Swinging Chokes

Question: Choke input filters were common on large old 50Hz power supplies .The size of the choke combined with a lack of understanding about distortion factor and cheaper caps favoured the cap input filter which is popular today.Swinging chokes were manufactured for these old power supplies .The swinging choke used at least 1 step in the laminations to give at least 2 different air gaps .     Partial saturation  gave big inductance at low current and small inductance at high current.This is precisely whats wanted .If the load was fixed a normal choke would perform fine.The choke filter is back with SMPS because the choke is not huge anymore .Why has nobody done a swinging choke for say a full bridge SMPS ?  Would say angle grinding the ferrite core on a SMPS choke have a similiar effect? Could the losses be acceptably low because most of the ferrite is not saturated?  Could the new distributed gap ferrite powder coils from WURTH that show a gradual inductance fall with current be relevent?
Comment: I suggest that the *cost* of the choke had a lot more to do with it than any alleged 'lack of understanding about distortion factor'.
Comment: We speak English here, not whatever dialect of gibberish this is.  Closing this mess.  "Civilised partial saturation" did make me laugh, though.
Comment: Do you have a link to what you are saying about this device/method on old power supplies?
Answer: Based on this description I think swinging choke was a somewhat primitive way of doing voltage regulation, or rather load regulation straight from a bridge (or center-tapped full wave) rectifier + filter.

If the rise produced by the swinging choke just offsets the losses produced by increased current through the rectifier, the power transformer, and possibly a further smoothing choke, the output voltage of this kind of filter will be almost perfectly constant as the load current is changed.

In an SMPS you do that voltage/load regulation by different (electronic feedback) means, typically by controlling the duty cycle, so I don't know what sense it would make to try and use that swinging choke method.
In general with SMPS designs one avoids saturating the output inductor (choke) because that will give you at the very least worse ripple, efficiency loss in the inductor, ultimately as heat and even possible destruction of the switching element. Finally some SMPS control schemes assume the current raises linearly thorough the inductor.
Having said all that, there is some research on driving SMPS output inductor into saturation. I wasn't aware of it until a few moments ago... The main motivation for this research was to use a smaller inductor thus minimize board space, rather than gain some sort voltage regulation from it (in that respect you get the opposite). Basically their argument is that footprint reduction gained by driving the inductor into saturating is worthwhile in the cases where:

the peak-to-average-power ratio is high so most of the time the converter's inductor won't be saturating, and
the increased ripple at high loads is tolerable because (for instance) one also has LDOs doing additional filtering thereafter for the most sensitive circuitry.

They also say that the latter issue can be addressed by "hysteretic converters". I don't know much about those.

Regarding your inductor examples from the comments below: an inductor doesn't become a dead short when it saturates, but rather becomes an air-core inductor... which does have lower inductance but it's not necessarily negligible. For the inductors in the aforementioned paper, the drop was to about 1/3 inductance at saturation. This of course can cause havoc if you haven't planned for it when choosing the switching element, but if you did, then it will of course survive.
And regarding inductor design for "partial saturation": I'm a neophyte at magnetics, so I can't say how to design one that has a gradual slope increase rather than an inflection point, but certainly it is possible considering the examples at http://elm-chan.org/works/lchk/report.html If you intend[ed] to ask how to build/choose such inductors, you should probably ask that as a separate question...
Comment: Fixed frequency peak current mode control is probably the most popular method used in SMPS . Sure there is always a feedback loop to get voltage regulation.Many designers prefer continious mode operation .A swinging choke would insrease the dymamic range of the SMPS .Keeping to one mode simplifies the control loop .Intuitively saturation is a lossey process and if it is total and sudden the switch could blow .I wonder if its possible to build such a choke maybe with a angled gap ?
Comment: Imagine a sloping gap choke it could work because only part af the core saturates.
Comment: Imagine 2 or more chokes is series .One low inductance choke never saturates so the switch wont go bang .The higher inductance choke{s] only saturate at low frequency where losses wont be too bad .A variable f scheme is better for all this but fixed f peak current mode is well documented and understood by everybody else .

Swinging Chokes


Linear regression using math or machine learning? Why even use machine learning for this?

Question: I have studied statistical math and is now taking a course in machine learning. The first example the teacher talked about is how to find a linear trend line using machine learning. Why would anybody do that? In my statistical courses we calculated linear trend-lines on datasets using far less computer power than a machine learning approach would use according to my understanding. Is linear regression using machine learning only a nice example to learn machine learning basics, or are there any real world reasons for why anyone would use machine learning to find such a simple trend line?
Comment: What exactly do you mean by "find a linear trend line using machine learning"?
Answer: Linear Regression is Linear Regression regardless of how you calculate/estimate the parameters.
The question becomes significant in case of a large multi-variate dataset where it is not easy/fast/possible to compute the parameters using algebraic equations (aka fitting simple line). In such cases Machine Learning techniques such as Stochastic Gradient Descent (SGD) can be helpful.
Answer: Linear regression is the working horse in many disciplines where causal models are estimated. When you look at economics, for instance, you will find that linear regresion is widely used. The reason for this is that you can identify marginal effects (the slope of some line) very easily. However, most applications use multivariate linear regression (many $x$). Theses models/regressions are often quite elaborate, combining theoretical reasoning with statistics (called econometrics in this case). See Wooldridge for a good introduction. Have a look at "fixed effects" or "systems of equations" for instance.
When it come to predictive modeling, linear regression is also mostly used in multivariate settings, e.g. in combination with principle components (as the $x$) or as polinomial regression(s). It can be very powerful (in some settings) when it comes to prediction. Further expansion of linear regression models cover "generalised additive models" (GAM) or "shrinkage" to be used in high dimensional problems (e.g. lasso, ridge). See ISL for a very good overview.
Even if you fit only a linear trend line (single variable case), linear regression can be very helpful in many cases because you can easily calculate things like confidence bands or p-values to get a quick idea of how well your univariate line fits some data.
Answer: Your teacher is getting fancy with the terminology. What's going on is that you're doing the usual linear regression, which happens to be a simple, easy-to-visualize example of a wide range of models in so-called supervised learning. You are not, however, doing any kind of fancy algorithm or model just because the class is called "machine learning".
Comment: Something I could believe you're doing is using a gradient descent algorithm to optimize the parameters in the regression equation, showing that they equal the usual OLS calculation.


Another way to say 'also'

Question: I use the word 'also' a lot when writing paragraphs.  When I find myself using 'also' twice in the same paragraph, it feels a bit awkward.  Is there another word or phrase I should be using?
Answer: Likewise: moreover; in addition; also; too but is you are making a list, the word 'item' replaces 'also' too.  The terms moreover, additionally, secondly, withal, what is more, furthermore may be more appropriate for your purpose
Answer: Plus may also be an alternative.
This is a nice house, plus there is a big private garden.

Another way to say 'also'


Best Practice Magento 2 / Composer / Custom Module

Question: Can you tell me what are the best practice when you create a custom module for a project. I would say to put the custom module related to the project in app/code/MyNamespace/MyModule and all Generic Module should be in vendor.
Or should I put all in vendor folder and call my modules with composer ?
Thanks
Answer: I would suggest using app/code approach if your main goal to create the module is for customization. Rather than storing it directly in the vendor folder.
Magento puts all core modules in the vendor folder allowing you to create your customization in app/code without the risk of being overwritten during Magento update/upgrade.


Commerce product fields as optional attributes

Question: I'm trying to create some kind of product attributes by adding fields in manage fields in Store | Product types. Is there any solution to give product creator ability to select which fields he want to use when adding product. Creating product types containing all possible situations would be strange.
Example:
I create one customizable product, but I want to give it 4 various attributes. For another creating product I could select checkboxes for different attributes.
Answer: You probably want to group products that a similar into the same product types and setup different product types, instead of having a single multipurpose product type that can be turned into anything. The product creator can decide which fields to use by choosing which product type to use. A distinction that will come very naturally for non technical people.
Comment: Not exactly. If I would like to create product types with all specified parameters then I will get something about 150 various product types combinations. All I need is one product type with additional fields ability. I can buy product A with specified width and length and then add various elements to it depending on this length and width - price will be dependent from this selected additional features.


I am seeking for a partner to finish a fictional story. Where can I find somebody to work with me?

Question: I have written a fictional novel of about 40,000 words with a very bad translation to English. I need someone to expand it with 30,000 more words to reach 70,000 and become a partner with me for publishing it. Where I can find a person?
Answer: You are looking for a ghostwriter. In your search engine of choice, search for "ghostwriter wanted" or "where to find a ghostwriter" or variations thereof to find where ghostwriters are commonly found. You will have to pay that person, of course – no one will write your book for you for a share in the potential profits.
Answer: Finding a writing partner is hard, and finding a co-author is even more difficult.
You find writers in writers' communities. Most large cities have many writer's meetups and public writing groups.  For instance, near me in Denver, CO, there are dozens of public groups where writers come together in person to share their work and share feedback. There are many times many groups that meet online -- via remote meeting places like zoom or over email.
Join as many communities in your genre and near your skill level and meet as many writers as you can.  You'll find some that you click with and some that click with you.  That pool of writers is your best chance for finding a co-author short of hiring a ghostwriter -- as has been recommended -- or hiring an editor to help you develop your story into something publishable.


I got upset [ with / from ] the phone call

Question: I've quite seen a lot of both cases but I couldn't tell what's the difference here. Please help.
Comment: I'd use "from". Using "with" sounds a bit like the phone call is being treated as an individual: *I got upset with the doctor.* But even using "from" the sentence is not very idiomatic. The more common phrasing is, *I was upset by the the phone call.* or *The phone call was upsetting.*
Answer: There are a few prepositions that can be used after upset:

They're all still very upset about losing the case.
He was upset over a disagreement with his boss.
I am still upset by what you said.

Macmillan Dictionary lists by, over and about as the prepositions used with upset. But there may be some other ones:

He was upset at missing all the excitement.
I think she may be a bit upset with you.
(from Online Oxford Collocation Dictionary)

From after upset is definitely not the most common choice. Click here for details. It doesn't mean that upset and from can't be found together: But as their life improved financially, she continued to get upset from time to time. But it's about the phrase from time to time.
All in all, about, by and over should be interchangeable (I was upset by/over/about the phone call). If you want to mention a person after upset, with or at may be the best choice:

I don't know what I've done to make you upset at me. (source)
Husbands, if your wife is upset with you, go to her and understand why she is upset. (source)
Comment: Thank you. Frankly, I was wondering "to get turned on [ with / from ]", but I was afraid of getting my post deleted, so I changed it. Could you be nice and explain what's the difference between "with" and "from" here?
Comment: @dolco Please post another question about it because you are asking about a totally different verb. You'll be able to get better answers like that.


Letter of Recommendation for PhD application

Question: I am applying for Ph.D. in the United States. During my undergrad, I had worked with a postdoc in the research lab I was working. Presently, the postdoc student has joined an esteemed university as an assistant professor, but has not yet started any research there. Can I approach him for a Letter of Recommendation for my Ph.D. application? How would that affect my application?
Answer: It would probably depend more on how well they know your work and can predict your future success than their actual career position at the moment. If you did good work with them it should work out. So, yes, ask them. Especially so if this was your only research experience.
You likely need three letters. If this is the one you think "weakest" then you are in good shape. It is good that they have moved beyond postdoc, which will add a bit to their credibility.
Answer:
Can I approach him for a Letter of Recommendation for my Ph.D. application?

Yes. It seems a good idea. I would suggest that you at least reach out to him. Generally, a letter from an assistant professor at an esteemed university, who worked with you in the past, is a good idea.

How would that affect my application?

That depends on how the postdoc writes the letter of recommendation for you.
Specifically, it depends on how the postdoc thinks of your past performance in that research lab, and how he perceives your ability to learn and do research independently as well as in a team environment.
Do you feel that he really appreciates your work and contribution with him in the past ? If yes, that is a very good starting point.


Questions that ask about polling in totalitarian/authoritarian countries

Question: Related to Qs like this. I'm pretty sure I can find some piece of propaganda that says that [almost] everyone in China adores Xi Jinping as their president, and likewise for North Korea or even Eritrea. Are questions like "is this true?" on-topic here, given how difficult it would be answer them with a real poll? (I somewhat haphazardly came up with that list, but it turns out I hit 3 of the top 5 "most censored countries", according to CPJ.)
Comment: How is that any different from YouGov polls or the BBC?
Answer: The question itself is answerable - as in, there is a theoretical possibility of  independently-sourced data existing that proves or disproves official press releases. And even if such data doesn't exist - explanation of why existing data isn't enough to be a proof either way can also be a good answer.


If I download Steam on Ubuntu, does that mean I can play any game I get on Steam ON Ubuntu?

Question: This question may or may not be very stupid, as I am kind of ignorant when it comes to computers. My friend has convinced me to switch to Linux, and I'm trying to figure out how I can game on it.
Comment: Also note that some indie bundles, e.g. https://www.humblebundle.com/, provide Linux and Mac versions of many games.
Comment: An additional note @Zommuter, the Steam keys for most Humble Bundles will mean you can then download the Linux version from Steam. YMMV with what games have their Linux version uploaded to Steam.
Comment: www.lgdb.org and desura are good sources to check into for gaming on Linux.
Answer: There is currently a subset of Steam's entire collection available on Linux (viewable on the Featured Linux Games page), however Valve is making a concerted push toward Linux as the OS of choice for gaming, meaning that more will follow.
There are two reasons for this push to Linux,

They believe Microsoft's Windows 8 is a catastrophe
They (and a few third party companies) are currently working on a Steam-based console called the Steam Machine, which will come pre-installed with Steam OS, a Linux variant (although it won't be locked down to that OS, you'll be able to install anything on it as you please).

As such, whilst it may not look like there are much games on Linux yet, you can expect more to come.
Answer: Steam has a limited number of games available on its Linux platform. You can visit the Steam Linux store to see which games are available.
Comment: It now also makes the entirety of its library available on linux via wine/proton, albeit with a "may or may not work" non-guarantee. That said, a surprising number of them do work quite well.


How to force stop all the processing in the background (and map that command to a keyboard shortcut)

Question: My Mac has been having a lot of issues lately. Most of them have to do with lagginess and the spinning beach ball appearing quite often, and staying there for a long time. If my Mac is so slow, there must be some processing going on in the background that's using up all of the resources. Is there a way to "kill" all that processing going on in the background? If so, how do I map the command to a key combination? (Because when my Mac is hanging up, I can't open up the Activity Monitor. Yes, the lag is that bad! Even when I manage to open it up, it says I don't have permission to use it.)
Comment: Um, I don't think it's wise nor advisable to *kill **all** the background processes* on your computer. Some of them are essential for ordinary computer function, like `launchd` or `kernel_task`. It's hard to differentiate between non-essential processes and essential ones, so if you have a problematic process I recommend just killing it specifically.
Comment: Unfortunately you're basing your question on an assumption that may have nothing to do with why you're suffering the lag you are. That is, the root cause of this may have nothing to do with a background process. Can you edit your question to provide full details of your setup (Mac model, HDD v SSD, RAM, free space on your drive, macOS version). Also, how long has this been happening and does it coincide with any other event such as new software or hardware or macOS update?
Comment: What is the storage and hardware (Mac book and HDD or iMac and SSD and major version of os.)? You might need to triage a bit, but let's see what specific are before trying an answer. Everything asked almost two years ago still needs clarification.
Comment: Excellent. The proper thing to do is to put an answer here so everyone knows the solution. This seems like it could help others and in time the votes should show that. Without an answer and without clarification in the question, it's likely to get auto deleted and/or more down votes. Your call of course to share the solution.
Answer: Force killing background processes isn't wise nor advisable. Some processes are very important to the OS's function, like kernel_task, WindowServer, CoreServicesUIAgent, etc. It's hard to distinguish between essential and non-essential processes if you try to "insta-kill" lag via a key combination.
I fixed the issue by moving the mouse around a lot while I watch YouTube videos in Safari. I don't know why, but it doesn't freeze when I do that.
I also got a new computer, so that solves the problem too.


How to get rid of the moisture in coffee?

Question: As pointed out here, my coffee powder seems to have caught moist. Since it is in a significant quantity and a very nice powder, I don't want to waste it. Is there any solution to this problem? The obvious one that came to my mind was heating it up on a low flame, but I don't know the pros and cons of it. Can someone help me with this?
Comment: By coffee powder do you mean an instant coffee or perhaps a finely ground coffee?  Heating probably makes sense, but an open flame would invite combustion.  So I'd use other heat sources if available.
Comment: A finely ground coffee it is @hardmath. Which heating mechanism would you recommend?
Comment: If it got moist, it's probably already too late. You can warm it to dehydrate it, but it's likely the flavor won't be the same. It's why the recommendation not to freeze coffee. Humidity in the container condenses, and if the container is opened while it's still cold, humidity in the air condenses on it. The moisture makes the coffee rapidly go stale. Worst case, mold can start to grow, which will give it a bad taste long before it's visible. Warming it to dehydrate it will also speed oxidation. But you've got nothing to lose. Try it and see if it's still drinkable.  If so, use it up quickly.
Comment: @fixer1234 I tried heating it up, you were right, there is a change in taste, but fortunately it isn't that big. I am happy that my coffee is saved :)
Answer: I'll take it as given that the problem you have comes from moisture in your finely ground coffee.  Indeed studies show finely ground coffee, other variables being held constant, has a greater hygroscopic tendancy (absorbing moisture from the surroundings during storage) and a higher angle of repose α:

Angle of repose is useful in order to acquire information regarding solid flowability. According to Shittu & Lawal (2007), during powder reconstitution, water molecules that hydrate the product's surface tend to reduce cohesivity between particles, allowing a rapid water penetration; thus, powders that possess high angles of repose, have higher difficulty to incorporate water. All factors tested (roast level, grind size and storage time), and the interactions between them, significantly influenced the angle of repose (α).

I'll report the experiment that I did with removing moisture from used espresso coffee grounds by repeated microwaving.  This is no guarantee that it will resolve the problem reported by the OP, where in an earlier Question South Indian filter not brewing properly it was said:

I don't know why, but suddenly it is taking longer to finish the brew and sometimes (mostly from the second time) the water doesn't even go down. It just stays in the upper part of the instrument.

This method of brewing is unfamiliar to me, and the description "to brew without using the middle small instrument which looks like the one used in a french press" sounds like it is akin to a pour over (the tag drip-brew was used there and here).
The possibility of drying coffee grounds was dismissed in this previous Answer:

I wouldn't attempt to dry wet grounds - the quality would likely suffer and for brewing they will be made wet again, which would make the drying step moot.

However there is perhaps something about the method of brewing at issue here that avoids these objections.  So to proceed with the experiment:

On the left is a frozen portafilter basket with used espresso grounds, which presents something of a maximally moist batch of coffee grounds.  I emptied the basket into a spare microwaveable dish (a creme brulee crock).
Setting my 1200W microwave to 30 seconds, I ran it and checked to see how hot or warm the dish and its contents became.  In the first run the contents became noticeably steamy, but then heating declined (water is specifically absorbing of the microwave radiation).  After a dozen runs the used grounds seemed to be contributing nothing to the warming of the dish (an empty crock by itself gets warmed but not hot in 30 seconds).
To the touch the grounds now feel dry, and as a test I put the dish in the freezer for 30 minutes.  This produced no clumping or grounds sticking to the dish.  So I'm going to say this was a quick and effective technique to dry the grounds per se, without resort to expensive desiccant supplies or DIY vaccum freeze drying equipment.
Finally we invoke the platitude that an ounce of prevention is worth a pound of cure:  storing the fresh coffee ground in packaging that prevents moisture absorbtion is easier than trying to fix a problem later on.
Comment: Thanks for the detailed answer, sorry I had missed it completely and hence the delay in accepting. I tried your method and it worked for me too.
Answer: If you're looking to get rid of the moisture in your coffee, then you can try one or more of the following methods.
The first option is to pour your coffee into a glass jar and store it in a cool, dry place. This will help to reduce the amount of moisture that's present.
Another method is to put ground coffee into an airtight container and store it in a sealed bag or container away from light. The high levels of carbon dioxide that are produced during storage will cause the water molecules within the grounds to break down, leading to decreased absorption of water by the beans.
Finally, you could also try using an air drier.
Comment: Welcome, and thanks for weighing in. The points in the answer don't seem correct and I'm wondering if there's some documentation you could link to. For example, storing it in an air-tight container in a cool, dry place will prevent it from absorbing moisture from the air during storage but would lock in the existing moisture rather than dry it out. Freshly-roasted coffee releases some free carbon dioxide (the reason for the valve on the package), but that wouldn't be a factor with repackaging older coffee. Also the CO2 doesn't breakdown water molecules or decrease absorption of water (cont'd)
Comment: vapor to reduce staling. Internally trapped CO2 needs time to be displaced by liquid water at the start of brewing, the purpose of the blooming stage. A dessicant (air drier) will absorb and hold free moisture so it isn't available to be absorbed by the coffee, but most forms that would be suitable for use with coffee don't aggressively attract water in a way that would adequately dry out moist coffee. But if you could find the right one, use a lot of it in relation to the coffee and a lot of mixing, and then separate the coffee for use, you might have hit on a solution.


Convert JSON IPython notebook (.ipynb) to .py file

Question: How do you convert an IPython notebook file (json with .ipynb extension) into a regular .py module?
Comment: Possible duplicate of [How do I convert a IPython Notebook into a Python file via commandline?](https://stackoverflow.com/questions/17077494/how-do-i-convert-a-ipython-notebook-into-a-python-file-via-commandline)
Answer: From the notebook menu you can save the file directly as a python script. Go to the 'File' option of the menu, then select 'Download as' and there you would see a 'Python (.py)' option.

Another option would be to use nbconvert from the command line:
jupyter nbconvert --to script 'my-notebook.ipynb'

Have a look here.
Comment: @DaveGoldsmith Run `pip install jupyter`. Once it's installed, go to your project directory and run `jupyter notebook`. It should open a web browser automatically, otherwise open one and go to `http://localhost:8888/notebooks/` to start creating or working with notebooks.
Comment: Doesn't work with `ipython [8.7.0]`. Returns warnings: `Unrecognized alias: 'to', it will have no effect.` and `File 'nbconvert' doesn't exist`
Comment: An additional way to call nbconvert it is to do it automatically on save with the jupyter_notebook_confg.py file -- See http://stackoverflow.com/a/25765194/1653571
Comment: I don't seem to have ipython or jupyter installed, so I'm unaware of how to get to the notebook menu.
Comment: Is there a way in which I can get the output text also in a.py file
Comment: On newer versions of Jupyter, it appears that the wrapping quotes are not required, so to achieve the same result the command should be

`jupyter nbconvert --to script my-notebook.ipynb`
Answer: According to https://ipython.org/ipython-doc/3/notebook/nbconvert.html you are looking for the nbconvert command with the --to script option.
ipython nbconvert notebook.ipynb --to script

EDIT:
as per the comments, this is now updated to
jupyter nbconvert mynotebook.ipynb --to python

Comment: @Adam, I understand that. I wanted to document the correct executable.
Comment: Getting this notice now, FYI:
`[TerminalIPythonApp] WARNING | Subcommand 'ipython nbconvert' is deprecated and will be removed in future versions.
[TerminalIPythonApp] WARNING | You likely want to use 'jupyter nbconvert' in the future`
Comment: @Matt ipython has been renamed to jupyter. The message is telling you that the old executable name is deprecated. The convert command itself isn't.
Answer: In short: This command-line option converts mynotebook.ipynb to python code:
jupyter nbconvert mynotebook.ipynb --to python
note: this is different from above answer. ipython has been renamed to jupyter. the old executable name (ipython) is deprecated.

More details:
jupyter command-line has an nbconvert argument which helps convert notebook files (*.ipynb) to various other formats.
You could even convert it to any one of these formats using the same command but different --to option:

asciidoc
custom
html
latex. (Awesome if you want to paste code in conference/journal papers).
markdown
notebook
pdf
python
rst
script
slides. (Whooh! Convert to slides for easy presentation )

the same command jupyter nbconvert --to latex mynotebook.ipynb
For more see jupyter nbconvert --help. There are extensive options to this. You could even to execute the code first before converting, different log-level options etc.
Comment: This is not really different than @Kush's answer, just the command name has changed since his answer.
Answer: you can use this to do that :
pip install ipynb-py-convert

then run this on your terminal to convert .py file to .ipynb :
ipynb-py-convert Ex/abc.py Ex/abc.ipynb

to convert .ipynb files to .py :
ipynb-py-convert Ex/abc.ipynb Ex/abc.py

Answer: You can run a .py file in the same directory:
import json

files = ["my_first_file_name.ipynb", "my_second_file_name.ipynb"]

for file in files:
    code = json.load(open(file))
    py_file = open(f"{file}.py", "w+")

    for cell in code['cells']:
        if cell['cell_type'] == 'code':
            for line in cell['source']:
                py_file.write(line)
            py_file.write("\n")
        elif cell['cell_type'] == 'markdown':
            py_file.write("\n")
            for line in cell['source']:
                if line and line[0] == "#":
                    py_file.write(line)
            py_file.write("\n")

    py_file.close()

I rewrite this code from Syrtis Major's answer.
Comment: The best answer available. Does not need `jupyter nbconvert` and just uses the standard json format to get the notebooks. Absolutely Brilliant!
Answer: well first of all you need to install this package below:
sudo apt install ipython
jupyter nbconvert --to script [YOUR_NOTEBOOK].ipynb

two options are available either --to python or --to=python
for me this works fine:
jupyter nbconvert --to python while.ipynb

[NbConvertApp] Converting notebook while.ipynb to python
[NbConvertApp] Writing 758 bytes to while.py

pip3 install ipython

if it does not work for you try, by pip3.
pip3 install ipython

Answer: Tested on Ubuntu 20.04
Install required packages for PIP
$ pip install ipython
$ pip install nbconvert

To install required packages
$ sudo apt-get install texlive-xetex texlive-fonts-recommended texlive-plain-generic

METHOD 1
Use jupyter nbconvert command to convert to different format
Source file pro.ipynb

To convert to ascii
$ jupyter nbconvert --to asciidoc pro.ipynb

To convert to pdf
$ jupyter nbconvert --to pdf pro.ipynb

To convert to python
$ jupyter nbconvert --to python pro.ipynb

METHOD 2
Convert ipynb project through python code use savefig method of pyplot:
pro.ipynb
import matplotlib.pyplot as plt
%matplotlib inline
exp_vals=[1400,600,300,410,250]
exp_labels=['Home Rent','Food','Phone/Internet Bill','Car','Other Utilities']
plt.axis('equal')
plt.pie(exp_vals,labels=exp_labels,radius=2,autopct='%0.1f%%',shadow=True,explode=[0,0.5,0,0.3,0],startangle=20)
# plt.show()
plt.savefig('piechart.jpg',bbox_inches='tight',pad_inches=2,transparent=True,edgecolor='r')

piechart.png image that it generated:

   Hope this helps to convert your ~(`)/\/\/\_ [Python] code

Answer: You definitely can achieve that with nbconvert using the following command:
jupyter nbconvert --to python while.ipynb

However, having used it personally I would advise against it for several reasons:

It's one thing to be able to convert to simple Python code and another to have all the right abstractions, classes access and methods set up. If the whole point of you converting your notebook code to Python is getting to a state where your code and notebooks are maintainable for the long run, then nbconvert alone will not suffice. The only way to do that is by manually going through the codebase.
Notebooks inherently promote writing code which is not maintainable (https://docs.google.com/presentation/d/1n2RlMdmv1p25Xy5thJUhkKGvjtV-dkAIsUXP-AL4ffI/edit#slide=id.g3d7fe085e7_0_21). Using nbconvert on top might just prove to be a bandaid. Specific examples of where it promotes not-so-maintainable code are imports might be sprayed throughout, hard coded paths are not in one simple place to view, class abstractions might not be present, etc.
nbconvert still mixes execution code and library code.
Comments are still not present (probably were not in the notebook).
There is still a lack of unit tests etc.

So to summarize, there is not good way to out of the box convert python notebooks to maintainable, robust python modularized code, the only way is to manually do surgery.
Answer: You can use the following script to convert jupyter notebook to Python script, or view the code directly.
To do this, write the following contents into a file cat_ipynb, then chmod +x cat_ipynb.
#!/usr/bin/env python
import sys
import json

for file in sys.argv[1:]:
    print('# file: %s' % file)
    print('# vi: filetype=python')
    print('')
    code = json.load(open(file))

    for cell in code['cells']:
        if cell['cell_type'] == 'code':
            print('# -------- code --------')
            for line in cell['source']:
                print(line, end='')
            print('\n')
        elif cell['cell_type'] == 'markdown':
            print('# -------- markdown --------')
            for line in cell['source']:
                print("#", line, end='')
            print('\n')

Then you can use
cat_ipynb your_notebook.ipynb > output.py
Or show it with vi directly
cat_ipynb your_notebook.ipynb | view -
Answer: If this is a one-off, follow e.g. @kikocorreoso depending if you want to use command line or gui.
However, if you want some solution that will maintain a synchronized version of the .py and the .ipynb you really should consider using jupytext as also pointed out by @Wayne
Run conda install jupytext  or pip install jupytext
Then do:
jupytext --set-formats ipynb,py <file>.ipynb
To keep it synchronized to the .py file:
jupytext --set-formats ipynb,py <file>.ipynb --sync
This will make sure jupyter keeps the two files in sync when saving from now on...
Last note: If you are a gui person, after running the installation command for jupytext, everything else can be done from the gui as well File-->Jupytext-->pair Notebook with light Script:
Comment: the comma in `ipynb,py` haunts me
Answer:
Go to https://jupyter.org/
click on nbviewer
Enter the location of your file and render it.
Click on view as code (shown as < />)
Comment: Please elaborate steps 3 and 4.
Comment: @JJJ It is detailed at the link. For 3, I, for instance, had the jupyter notebook on a Git repository and just entered the link to the file on git. For 4, after opening your notebook, on top right, you find few icons. The icon with  on it is "view as code" icon. Hope this clarifies.
Answer: Jupytext allows for such a conversion on the command line, and importantly you can go back again from the script to a notebook (even an executed notebook). See here.
Answer: One way to do that would be to upload your script on Colab and download it in .py format from File -> Download .py
Answer: Convert the Ipynb dir files to .py
import os

for fname in os.listdir():
    if fname.endswith('ipynb'):
        os.system(f'jupyter nbconvert {fname} --to python')

Comment: This is just the same as the other solution but you're running the bash command from inside python.
Comment: right, I guess it's good to have different ways of doing it, sorry for being a bit of a dick.
Comment: I didnot get file
Comment: make sure you have jupyter notebook installed
Comment: $ pip install ipython
$ pip install nbconvert
Comment: @emilBeBri it's for converting multiple files in one attempt.
Answer: jupyter nbconvert [filename].ipynb --no-prompt --to python

The above code will generate [filename].py in the same directory
Answer: Copy all the (''.ipynb) files in the Desired folder then execute:
import os

desired_path = 'C:\\Users\\Docs\\Ipynb Covertor'

os.chdir(desired_path)

list_of_directory = os.listdir(desired_path)

for file in list_of_directory:
        os.system('ipython nbconvert --to script ' + str(file))

Answer: My version of Jupyter Notebook, 3.3.2, has this option on the File Menu:
Answer: Use VS Code

Step 1 : Open your .ipynb file in vs code.
Step 2 : Click on export Screenshot of where the option is.
Step 3 : Click on Python Script Screenshot of export types.
Now VS Code will open your file as a python script in a new tab with an untitled name.
Now press Ctrl + s to save it to wherever you want.
Comment: While I haven't verified if VS Code can handle the conversion, I believe that recommending the installation of a feature-rich IDE like VS Code for a straightforward conversion might be excessive. Unless the question explicitly mentions the use of VS Code, a more lightweight and focused tool could be a more suitable recommendation for the specific task at hand.
Comment: @tidakdiinginkan while that may be true, it is a helpful suggestions for those already running notebooks in VSCode. Thanks Sandupa, helped me out :)
Comment: @RogerKint a solution that caters to everyone wins over specific toolset solutions. Had the OP mentioned VSCode specifically, this solution would have made sense. good for you that this solves your specific case.


How do I roleplay a character with low wisdom?

Question: Each of the ability scores have their own quirks when it comes to negative numbers. 1 in strength is they can't wear clothes because they're so weak, 1 in con is their blood can't clot and they constantly break bones, 1 in intelligence makes you a vegetable. What would a 1 in wisdom be?
Comment: Where are you getting the low score definitions? Are they inventions of your own? If so, this seems like an idea generation topic and is too broad and primarily opinion based. To ask the question in a more answerable way for this site, you may want to state your goals for the character and leave it more open-ended (so that experts can provide [good subjective](https://stackoverflow.blog/2010/09/29/good-subjective-bad-subjective/) answers based on experience). For more information on how to ask a good question, visit our [Help Center](https://rpg.stackexchange.com/help).
Answer: Skills related to Wisdom include Perception and Insight, so you could play someone poor at those. Perhaps your character has poor vision, poor hearing, or is extremely gullible and easily deceived. Maybe this leads to poor animal handling abilities, as you don't notice when they are getting aggressive or afraid.
Answer: For the headline question: However you like - its your character
With respect to your first sentence ("Each of the ability scores ..."): this is just wrong. There is nothing special about having 1 in any ability score apart from the mechanical effects of having a -5 on skills/attacks related to that ability.


jQuery Validate Custom Rule Ignore a Checkbox

Question: With some help from other post the related to validating multiple checkboxes, I decided to go with this customer rul
$.validator.addMethod("checkBox", function(value, element) {
    return $("input[type=checkbox]:checked").length > 0;
}, "");

I then call this in the rules section:
field_name:{checkBox:true}

This works great for making sure at least one checkbox is checked in the field, which is really all I need. However, when I started to test I realized I have a checkbox that is set to show/hide a div.  This checkbox is being factored into the validation and in return is making the submitted data not valid.
I have tried using ignore:".class_name" but have been unsuccessful in getting the script to actually ignore this field.
Can anyone steer me in the right direction in getting a checkbox to be ignored in the custom validation?  Thanks in advance for the help!
Answer: How about changing the "return" line to
return $("input[type=checkbox]:checked:not(.class_name)").length > 0;

Comment: Sometimes the most simple things can be overlooked.  That worked beautifully, thanks for the response!


How do we define foot in Mandarin Chinese?

Question: As we known, foot is a stress-related unit. But in Mandarin, the existence of stress remains controversial, so I would like to know the formation of foot in Mandarin Chinese. Thanks.
Comment: Note that there is a Chinese language stackexchange here: http://chinese.stackexchange.com/
Answer: Duanmu (2007) The phonology of Standard Chinese has an extensive analysis of Mandarin foot structure. The only way to fully answer your question is to cut and paste everything into a post, but in a nutshell, feet are trochaic, and he posits simultaneous syllabic and moraic feet, with no sub-minimal feet, and stressed syllables are obligatorily heavy. It also seems that he has "stress" as an independent property which interacts with foot formation (that is, he posits principles dictating that certain things must have stress – not that they must be the head of a foot – and then foot structure must somehow be built to satisfy stress / foot related conditions).


Samsung Note 8 GT-N5110 restarts by itself

Question: My Note 8 (stock android 4.4.2) worked perfectly until one day it decided that it would restart by itself every time after I shut it down. To make a long story short, if I reset the device to the factory settings and leave the battery disconnected for a few days the table will work fine after reconnecting the battery. However, if I connect the device to the internet it updates untold thousands of applications and the problem reappears. I have repeated this process about four times and have concluded that there is an update that is causing the problem, but have no idea of how to identify the problem application(s). I have also decided that there are applications like Allshare Controlshare Service that will update themselves once they see the internet even if you tell the device not to update anything. They will also reinstall the update even if you roll it back to the factory default. I would appreciate any ideas on how to safely reconnect this tablet to the internet.
Comment: All I can say is that your device has been hit by malwares! You can't get rid of them by simply resetting your device, they're installee as system apps. What you need to do now is to flash the device with a clean firmware then everything should be back to the normal
Answer: Following esQmo's suggestion, I followed the general instructions given at
Install Original Factory Rom on Samsung Galaxy Tab 2 10.1 and reinstalled the stock firmware. Never did anything like that before, but to my surprise it worked and the tablet now is behaving itself.


MongoDB with redis

Question: Can anyone give example use cases of when you would benefit from using Redis and MongoDB in conjunction with each other?
Answer: Redis and MongoDB can be used together with good results. A company well-known for running MongoDB and Redis (along with MySQL and Sphinx) is Craiglist. See this presentation from Jeremy Zawodny.
MongoDB is interesting for persistent, document oriented, data indexed in various ways. Redis is more interesting for volatile data, or latency sensitive semi-persistent data.
Here are a few examples of concrete usage of Redis on top of MongoDB.

Pre-2.2 MongoDB does not have yet an expiration mechanism. Capped collections cannot really be used to implement a real TTL. Redis has a TTL-based expiration mechanism, making it convenient to store volatile data. For instance, user sessions are commonly stored in Redis, while user data will be stored and indexed in MongoDB. Note that MongoDB 2.2 has introduced a low accuracy expiration mechanism at the collection level (to be used for purging data for instance).
Redis provides a convenient set datatype and its associated operations (union, intersection, difference on multiple sets, etc ...). It is quite easy to implement a basic faceted search or tagging engine on top of this feature, which is an interesting addition to MongoDB more traditional indexing capabilities.
Redis supports efficient blocking pop operations on lists. This can be used to implement an ad-hoc distributed queuing system. It is more flexible than MongoDB tailable cursors IMO, since a backend application can listen to several queues with a timeout, transfer items to another queue atomically, etc ... If the application requires some queuing, it makes sense to store the queue in Redis, and keep the persistent functional data in MongoDB.
Redis also offers a pub/sub mechanism. In a distributed application, an event propagation system may be useful. This is again an excellent use case for Redis, while the persistent data are kept in MongoDB.

Because it is much easier to design a data model with MongoDB than with Redis (Redis is more low-level), it is interesting to benefit from the flexibility of MongoDB for main persistent data, and from the extra features provided by Redis (low latency, item expiration, queues, pub/sub, atomic blocks, etc ...). It is indeed a good combination.
Please note you should never run a Redis and MongoDB server on the same machine. MongoDB memory is designed to be swapped out, Redis is not. If MongoDB triggers some swapping activity, the performance of Redis will be catastrophic. They should be isolated on different nodes.
Comment: MongoDB 2.2 (just released) adds TTL support, which addresses your first point: http://docs.mongodb.org/manual/tutorial/expire-data/
Comment: Great points about some of the comparative strengths of each.

One of the points of Redis is tuning for in memory. There are other projects focused on low latency, such as AerospikeDB, which focus on clustering and reliability, and also on SSD storage, which can be used when the real time use case goes beyond what Redis can easily handle.
Comment: the video itself of Jeremy Zawodny's talk : https://www.youtube.com/watch?v=qFcB1Xw1WSk
Comment: Great points about some of the comparative strengths of each.
Answer: Obviously there are far more differences than this, but for an extremely high overview:
For use-cases:

Redis is often used as a caching layer or shared whiteboard for distributed computation.
MongoDB is often used as a swap-out replacement for traditional SQL databases.

Technically:

Redis is an in-memory db with disk persistence (the whole db needs to fit in RAM).
MongoDB is a disk-backed db which only needs enough RAM for the indexes.

There is some overlap, but it is extremely common to use both. Here's why:

MongoDB can store more data cheaper.
Redis is faster for the entire dataset.
MongoDB's culture is "store it all, figure out access patterns later"
Redis's culture is "carefully consider how you'll access data, then store"
Both have open source tools that depend on them, many of which are used together.

Redis can be used as a replacement for a traditional datastore, but it's most often used with another normal "long" data store, like Mongo, Postgresql, MySQL, etc.
Answer: Redis works excellently with MongoDB as a caching server. Here is what happens.
Anytime that mongoose issues a cache query, it will first go over to the cache server.
The cache server will check to see if that exact query has ever been issued before.
If it hasn't then the cache server will take the query, send it over to mongodb and Mongo will execute the query.
We will then take the result of that query, it then goes back to the cache server, the cache server will store the result of the query on itself.
It will say anytime I execute that query, I get this response and so its going to maintain a record between queries that are issued and responses that come back from those queries.
The cache server will take the response and send it back to mongoose, mongoose will give it to express and it eventually ends up inside the application.
Anytime that the same exact query is issued again, mongoose will send the same query to the cache server, but if the cache server sees that this query was issued before it will not send the query onto mongodb, instead its going to take the response to the query it got the last time and immediately send it back over to mongoose. There is no indices here, no full table scan, nothing.
We are doing a simple lookup to say has this query been executed? Yes? Okay, take the request and send it back immediately and don't send anything to mongo.
We have the mongoose server, the cache server (Redis) and Mongodb.
On the cache server there might be a datastore with key value type of data store where all the keys are some type of query issued before and the value the result of that query.
So maybe we are looking up a bunch of blogposts by _id.
So maybe the keys in here are the _id of the records we have looked up before.
So lets imagine that mongoose issues a new query where it tries to find a blogpost with _id of 123, the query flows into the cache server, the cache server will check to see if it has a result for any query that was looking for an _id of 123.
If it does not exist in the cache server, this query is taken and sent on to the mongodb instance. Mongodb will execute the query, get a response and send it back.
This result is sent back over to the cache server who takes that result and immediately sends it back to mongoose so we get as fast a response as possible.
Right after that, the cache server will also take the query issued, and add that on to its collection of queries that have been issued and take the result of the query and store it right up against the query.
So we can imagine that in the future we issue the same query again, it hits the cache server, it looks at all the keys it has and says oh I already found that blogpost, it doesn't reach out to mongo, it just takes the result of the query and sends it directly to mongoose.
We are not doing complex query logic, no indices, nothing like that. Its as fast as possible. Its a simple key value lookup.
Thats an overview of how the cache server (Redis) works with MongoDB.
Now there are other concerns. Are we caching data forever? How do we update records?
We don't want to always be storing data in the cache and be reading from the cache.
The cache server is not used for any write actions. The cache layer is only used for reading data. If we ever write data, writing will always go over to the mongodb instance and we need to ensure that anytime we write data we clear any data stored on the cache server that is related to the record we just updated in Mongo.

MongoDB with redis


How to determine the domain and range of a function?

Question: I know what domain and range are, at least I think I do, but recently I took a test in which they asked me to determine the domain and range of a function I remember only very faintly now. In the test, I answered what seemed logical to me, however, later on I found that the answer was completely wrong when I looked at a graph of the function. My question is: is there a way to determine the domain and range of a function without looking at its graph?
Comment: I would like to know how to do it generally, but if an example would help clarify the process I would say $\ln (|\frac {x}{1+x^2}|)$
Comment: have you got an example?
Answer: Unless explicitly stated, the domain of a function $f(x)$ is all possible values of $x$ for which $f(x)$ is defined. For example the function
$$f(x)=\frac{1}{x}$$
is defined for
$$\{x\in\mathbb{R}\,|\,x\neq 0\}$$
The range of a function can be determined by finding the absolute maxima or minima. In this case $f(x)$ has no absolute maxima or minima, so the range of $f(x)$ is the entire real number line $\mathbb{R}$. For another function
$$g(x)=x^2-4$$
note that the first derivative is
$$g^\prime(x)=2x$$
which equals $0$ at $x=0$. Thus this is a minimum or maximum. The second derivative at this point is
\begin{gather}
g^{\prime\prime}(x)=2\\
g^{\prime\prime}(0)=2
\end{gather}
Because the second derivative is positive, $x=0$ is a local minimum. Note that $g(x)$ at this point is equal to $g(0)=-4$. Because the limits
\begin{gather}
\lim_{x\to\infty}x^2-4=\infty\\
\lim_{x\to -\infty}x^2-4=\infty
\end{gather}
are both $>-4$, no value of $g(x)$ can be lower than $-4$. Thus it is an absolute maximum and the range of $g(x)$ is
$$\{x\in\mathbb{R}\,|\,-4\leq x\}$$
Comment: What would happen with ceiling and floor functions?
Comment: The same process would still apply, except you would have to have $x\in\mathbb{N}$. Visualizing the graph of the function helps immensely.


How do I get rid of a car that I own?

Question: I have a car in my garage that I don't want anymore. How can I make it so that it's not mine anymore?  Will destroying it do? Or just leaving it in the impound and letting them destroy it? The thing is that you can still claim the car back after it's been destroyed.  How do I permanently remove the possession of a car?
Answer: If your car is not insured you can simply destroy it and you will be rid of it.
For insured cars it is a bit trickier:

If your car is worth less than $50k you will be able to sell it to Los Santos Customs and get rid of it permanently that way.
If the car exceeds that worth, you can replace it with another car when you have a full garage. Just drive a car from the streets into that garage, and you will get a warning that the garage is full and if you wish to replace a car. After the loading screen you will be prompted to choose a car for replacement.

Be careful with pressing the "OK"-button so as not to accidentally lose the first car on the list, if it is not the one you want replaced.
Answer: You can actually sell vehicles to the Los Santos Customs, but only one every so often one every 45 mins
Answer: Pull the car that you want to remove out of your garage, then call your mechanic and ask him to bring you another vehicle from your garage.  This will then destroy the vehicle, I found this out the hard way lol.
Comment: Has this since been fixed?
Answer: You can do one of two things:

Blow the cars up
Drive it into the ocean

There is no way to sell cars (at least not yet) so the only way to get rid of them is to turn the cars into scrap metal.
Comment: None of this permanently removes the car. You will still be able to reclaim in via insurance.
Comment: You can sell cars at LS Customs. I don't know about cars you own though, haven't tried it.
Comment: Unless the car isnt insured

How do I get rid of a car that I own?


Misprint or misunderstanding?

Question: I tried to translate text:

Offer Declined - Candidate staying at his current job.
Recruiter - Why? This is a great offer. Did you accept a counter offer?
Candidate - NO counter offer. The hiring experience was terrible and lengthy - 6 weeks.
The environment is stale, the team was not welcoming, 4 rounds of interviews (2 phone and 2 in-person) the job description was not anywhere close to what I interviewed for and there is no flexibility or room to advance.
Recruiter - The current offer offers 10K more
Candidate - If you read through the reasons why I declined the offer you'll see that money is not that important.
Employers must realize and acknowledge that the hiring process is broken and flawed.
  Post jobs that make sense.
  Treat candidates like Talent, not job seekers.
  Cut your hiring process by 50% or 60%.
  Be welcoming, informative and supportive throughout the hiring process. Make us feel welcomed, wanted and appreciated. Not strangers asked why are you here?
No appreciation for our time and interest. No urgency
I said it before and will say it again. To all the EMPLOYERS, RECRUITERS and MANAGERS out there
  "Attracting talent is a talent. You must have the talent to attract talent" Mike Daly

Well, I clearly got everything except bold line.
He says that employers dont appreciate candidates time and interest in context of advice to employers?
and "no urgency" in the same time...
I believe that I miss something here, could you help me?
Comment: I'm gonna guess that it should sounds like:
`Make us feel welcomed, wanted and appreciated`.
`Not strangers asked:"why are you here?" with no appreciation for our time and interest.`
`No urgency. `
At least it will be pretty close to whole message of the text.
Answer: Seems to me that poor punctuation might be responsible, and the intention might have been "No appreciation for our time and interest, no urgency."
A desire for shared sense of urgency by both parties.
Comment: You have not adequately explained this answer, and it's not clear what the comma has to do with that interpretation of the passage. The words "no urgency" by themselves _might_ signify that one or both parties needs a greater sense of urgency, but they seem equally likely to signify this as a standalone sentence fragment (preceded by a full stop) and perhaps even more unlikely to signify this when following a comma. (A comma could signal causation: "My lack of urgency is due to your lack of appreciation.")

Misprint or misunderstanding?


What is the use of secant modulus?

Question:
Secant modulus is defined as the slope of a line connecting the origin and a specified point (like yield point) in stress-strain diagrams. Instead of elastic modulus, which is the slope of the tangent line at origin, the secant line connects the origin and yield point. But what is the purpose of this method? I know this is used to approximate the behaviour of materials at the nonlinear region, but why do we use secant modulus instead of tangent modulus near the yield point? Tangent near the yield point would probably approximate much better. The secant modulus method seems hugely inaccurate to me.
Comment: How do you plan on defining yield point in order to decide what the tangent modulus at it is? (Especially with materials with a gradual roll-off and no pronnounced knee.) Secant modulus provides you with an 'average' behaviour across a region of interest (provided you define your point appropriately).  On your diagram, assuming your structure is working in the zero to A region, doing linear elastic calcs using Es will in most cases get you a closer-to-true deflection than using tangent E at A, or tangent E at zero, or tangent E at elastic limit.  It's just a convenient pragmatic approximation.
Answer: In the linear region of the stress strain curve the tangent modulus is equal to the secant modulus. Stress= Etangent x strain = Esecant x strain.
However at point A you can see from the curve that stress = Esecant x strain, not E tangent x strain.
Answer: The modules of elasticity at yield point (or below) is called Young Modulus, while the material still behave in elastic region. In this case the Secant Modulus and Young Modulus is equivalent.
However while entering the elastic-plastic region and plastic region. As the material become incompressible, the study of the material properties requires more complex consideration such as the poison ratio changes in the region.
Methamatically, Secant Modulus is included in the theory during simplification of the stress-strain relationship of material in those regions.

What is the use of secant modulus?


Can I upload other peoples old tech reports to ResearchGate?

Question: I have a bunch of old tech reports I copied when a grad student written by other people.  I want to throw them out but would rather scan them into ResearchGate first.  For example, INRIA tech reports on various unification methods.  Is this OK or should only an author of a report scan it in?  I'm not claiming it as my own, I would tag it to the authors.   I just think they are a shame to throw away completely.
Comment: After reviewing the archive, 60 papers, mostly not INRIA, at least half still available online, no hidden gems alas, so much ado about nothing.
Comment: Who owns the copy right? For example, if they were published by the US government, they are in the public domain. Personally, I find old tech reports useful for my research.
Answer: No, it's not OK. You are not legally allowed to distribute these reports if you don't hold the copyright and haven't been granted the right to distribute by the copyright holder.
To add a non-legal reason: You don't know if the authors would like to see these reports on ResearchGate. They might be embarrassed by what they wrote in them, they might want to update them, they might want to publish them as a journal article, they might boycott ResearchGate, ... It would not be polite to upload them without their permission.
Comment: It seems quaint to force people to travel to a foreign library to read an obscure technical report, when this kind of archiving can effectively be crowd-sourced. Google and Microsoft did it head-on in size but got criticized.  I see what you say about reputation management for people who are still alive and actively polishing their brand.  The mice in my attic will be relieved to have their meals undisturbed, they quite like term rewriting systems for 2nd order unification.
Comment: Dead people also have a reputation and sometimes they have heirs who care about that reputation. I understand where you are coming from, but I don't see a way for you to distribute without permission. Of course, you can archive these for yourself.
Comment: @LarsEricson How did you phrase the request? If you said "Do you want to upload them?" he might have said "nah" because he was retired, but if you asked "May I upload them?" You might get a better answer.
Comment: P.S. I pulled the binders out of the attic and actually more than 50% of articles are still available online.  Vintage is 1970-1988.  It turned out not to be INRIA tech reports but rather a mix of different formats (journal, conference, tech report) from all over.  The ones that aren't available are from journals too old, conferences too old, or departments reorganized with no web presence or authors that didn't continue their careers.  So maybe no great loss.  I was expecting some hidden gems.


Getting a "General error mounting filesystems" after upgrade to 13.04

Question: When I turn on his computer, the GNU GRUB menu appears. When I choose the Ubuntu option,this shows up. What do I do?
<code>Scanning for Btrfs filesystems
General error mounting filesystems.
A maintenance shell will now be started.
CONTROL-D will terminate this shell and reboot the system.
root@Sai-Medical:~#
</code>
Comment: Does it appear straight after the GRUB menu? Do you have btrfs file system? Have you tried selecting rescue mode in GRUB?
Comment: Welcome to askubuntu!  It generally helps if you give a more descriptive title to your question.  In this case it found that the exact same question has been asked before - check the other one for answers.
Answer: Try to use Boot-Repair Tool.
Many cases of problems relating to the boot are a mal-function or bad-installation of Grub or something related to the MBR and partition table, noticing that Boot Repair Tool was created aiming to give an easy way to fix this common problem, recommended by Ubuntu team.
Obs.: If you don't get access to the internet during use of Boot-Repair you won't get the URL mentioned below that can give us important details about your problem in case the recommended repair doesn't work.
Get a CD including Boot-Repair
Since you are unable to start Ubuntu there are two options to get Boot Repair Tool:

Use this ISO to create a bootable Live-CD/USB of Boot-Repair Tool
Boot your pc from Linux Security Remix where Boot-Repair Tool will be included by default

Choose one of the options, start Boot-Repair and click the "Recommended repair" button. When repair is finished, note the URL (paste.ubuntu.com/XXXXX) that appeared on a paper, then reboot and check if you recovered access to your OSs.
If the repair did not succeed, indicate the URL to us as it will give us more information about the error.
For more details and info about advanced options please read this Ubuntu help page.


How many solutions are there for $3$ natural numbers adding to $24$?

Question: I attempted stars and bars and got $\binom{26}{2}$ but that is saying $1 + 1 + 22$ and $22 + 1 + 1$ are both distinct, which should not be the case.
Comment: If you insist on order not mattering, then what you are looking for are the [restricted partitions](https://en.wikipedia.org/wiki/Partition_(number_theory)#Restricted_part_size_or_number_of_parts) of $24$ into $3$ (*presumably nonempty*) parts.  Its not going to have a nice simple formula like the stars-and-bars case.
Comment: "*which should not be the case*"  Why wouldn't it be the case that those are distinct?  Walking east $22$ yards and then north $1$ yard gets you to a different place than walking east $1$ yard and then north $22$ yards doesn't it?
Answer: There is one solution with $x_1=x_2=x_3.$  For each even number $n$ from $0$ to $24$ except for $8$, there is one solution with $x_1=n$ and $x_2=x_3 \neq n$, for a total of $12$ such solutions.  If order matters, we multiply by $3$, yielding $36$ solutions.
That means that of the $\binom{26}{2}$ solutions (in which order matters), there are $37$ solutions that don't use three different numbers as $x_1, x_2, x_3$.  That means there are $\binom{26}{2}-37=325-37=288$ solutions using $3$ different numbers in which order matters.  Dividing by $6$, we get $48$ solutions with three distinct numbers in which order doesn't matter.
So I conclude there are $48+12+1=61$ distinct solutions (ignoring order).
Answer: There's a nice combinatorial argument due to Frame (American Mathematical Monthly 46 (1940) p.664) about counting triangles inscribed in a circle that leads to the surprising formula
$$p(n,3) = \left\{\frac{n^2}{12}\right\},$$
i.e., the number of 3 part partitions of $n$ is the nearest integer to $n^2/12$.  If by natural numbers you mean positive parts, then your answer is 48 by this formula.  If instead you mean to allow 0 as one or two of the three parts, then the easier formulas
$$p(n,2) = \left\lfloor \frac{n}{2} \right\rfloor$$
(integer floor) and $p(n,1) = 1$ give the $p(24,3) + p(24,2) + p(24,1) = 48 + 12 + 1 = 61$ count of the other answers.
Answer: It sounds like you want to find integer solutions to
$$
x_1+x_2+x_3 = 24 \\
0 \le x_1 \le x_2 \le x_3
$$
Perform a change of variables $y_1=x_1$, $y_2=x_2-x_1$, $y_3=x_3-x_2$, yielding
$$
3y_1+2y_2+y_3 = 24 \\
y_i \ge 0
$$
You can count the solutions recursively by conditioning on the value of $y_i$.
Another approach to count the solutions $(y_1,y_2,y_3)$ is to use a generating function.  Explicitly, you want the coefficient of $z^{24}$ in
$$(1+z^3+z^6+\dots)(1+z^2+z^4+\dots)(1+z+z^2+\dots)
=\frac{1}{(1-z^3)(1-z^2)(1-z)}.$$
The number of solutions turns out to be $61$.
Answer: I found the exact formula for $p_n(k)$, the number of partitions of $n$ into at most $k$ parts, here:
$$p_3(n)=[\frac{n^2}{12}+\frac{n}{2}+\frac{47}{12}]+[-\frac{1}{8},\frac{1}{8}]+[-\frac{1}{9}, -\frac{1}{9},\frac{2}{9}].$$
Now, $24\equiv 2\pmod 2$ and $24\equiv 3\pmod 3$. Now, according to the article, I think, we choose the last fractions in the formula:
$$p_3(24)=[\frac{n^2}{12}+\frac{n}{2}+\frac{47}{72}+\frac{1}{8}+\frac{2}{9}](24)=\frac{12^2}{12}+\frac{12}{2}+\frac{47}{72}+\frac{1}{8}+\frac{2}{9}=61.$$
We can olso compute this number by means of a recursive formula. Let $p(n,k)$ be the number of partitions of $n$ into exactly $k$ parts. Then we have the recursion:
$$p(n,k)=p(n-1,k-1)+p(n-k,k).$$
Hence, also by using $p(n,2)=\lfloor\frac{n}{2}\rfloor$,
$$\begin{array}
.p_3(24)&=p(24,1)+p(24,2)+p(24,3)\\
&=1+\lfloor\frac{24}{2}\rfloor+p(23,2)+p(21,3)\\
&=1+12+\lfloor\frac{23}{2}\rfloor+p(20,2)+p(18,3)\\
&=13+11+\lfloor\frac{20}{2}\rfloor+p(17,2)+p(15,3)\\
&=24+10+\lfloor\frac{17}{2}\rfloor+p(14,2)+p(12,3)\\
&=34+8+\lfloor\frac{14}{2}\rfloor+p(11,2)+p(9,3)\\
&=42+7+\lfloor\frac{11}{2}\rfloor+p(8,2)+p(6,3)\\
&=49+5+\lfloor\frac{8}{2}\rfloor+p(5,2)+p(3,3)\\
&=54+4+2+1\\
&=61.
\end{array}$$


How to set up TLS without a certificate authority on a site for internal use

Question: I wish to set up SSL/TLS for my site. How can I do this on my own without using a certificate authority.
The site will be accessed only via certain machines so I can easily install the public certificates on their browsers.
Comment: By "implement TLS", do you mean "put TLS into effect", or do you mean "write your own TLS handling"? In most circumstances, only the first of those options is a good idea.
Comment: yes i just want to put it into effect .. using the existing validated algorithms without having to rely on an external CA
Comment: Why bother? Let's Encrypt using DNS validation makes using real certificates for non-publicly accessible internal or firewalled sites a no-brainer. And it saves you the bother of having to install certificates on the clients.
Answer: If you can arrange for the correct certificates to be reliably recognized by clients, then all you need is to produce your own certificate "by yourself", traditionally as a self-signed certificate. Tutorials are easily found for that, e.g. with Linux tools or Windows IIS.
You might also want to run your own CA (e.g. with this software), and install the CA certificate in the client browsers -- this is extra initial complexity, but will make things simpler if you need to change some certificates later on (e.g. if the previously installed certificates expire).
Comment: thanks a ton for this .. this is what I was looking for .. I am midway trying to implement this on my local machine.. And at this point I can't seem to figure out how I can use this for a hosted site. I have a host provider where I have to use the cpanel to make any changes.. and I am not sure if I'll be able to do this .. I guess I'll know better once I try it out ..  I'll get back here once I do that ..
Answer: I'm by no means a security or TLS/SSL expert, but  I do know a few things:

Implementing your own version of security protocols, hashing/encryption algorithms, etc. is generally a bad idea in production code. It's fun to do as a learning project though.
It's tempting to use client-side encryption when looking for a TLS or SSL, but this goes against best practices.
There are tools that help you make self-signed certificates, but I believe most browsers will show a warning to the user for this, which may scare some, if not most, users away.

I haven't tried it myself, but you may want to check out StartSSL. I can't guarantee it will work, and it may not support TLS, but if you want a free option, it's really the only non-self-signed one I have seen.
If someone comes along and says I'm wrong about what I wrote here, please listen to them! If not, I hope I could help you out.
Good Luck!
Comment: The OP probably doesn't want to do something insane like write a TLS implementation, just use TLS with a self-signed cert, which isn't insane. Yes, StartSSL certificates work with TLS. I'm not sure if it's possible for a cert _not_ to.
Comment: @MattNordhoff: it's certainly possible for an X.509/PKIX cert to have Extended Key Usage (EKU) that doesn't include the SSL/TLS values (serverAuth, clientAuth) or AnyEKU; common examples are those for S/MIME email and for code-signing (Windows, MacOS, iOS, Java, android at least) and for PDF-signing. There are many other things that use X.509 that aren't as well known and visible. There are also PKIX certs that are used _with_ TLS that aren't _server_ or client certs, namely those for CAs and OCSP responders.
Comment: thanks .. I am not trying to create my own algorithms .. just trying to implement the already existing ones .. i know the browser will show warning but since i can control all the machines that will access the site .. i can simply install the public certificates on them.. :)
Comment: StartCom CA is closed since Jan. 1st, 2018, it doesn't issue any new certificate from StartCom name roots.
Comment: The title and text of the question were misleading. I have updated the title to "How to set up TLS without a certificate authority on a site for internal use"
Comment: @MaximMasiutin: because in 2016 StartCom/StartSSL was sold to WoSign, who were caught cheating and starting around the beginning of 2017 distrusted by nearly everybody. After wriggling for about a year they gave up. There are many Stack Qs on this from the time, just search.


What is the code point of a mathematical h when one uses unicode-math?

Question: It seems that the rest of the minuscules are at U+1d44e ..., but the h, which is called Planck's constant, is not used for h.  I got this impression from replacing all these glyphs and observing the expected result except in the case of h.
Comment: Welcome to TeX.SE! Apparently the Unicode Block *Mathematical Alphanumeric Symbols* does not have the small italic `h`, see https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols or https://www.unicode.org/charts/PDF/U1D400.pdf. It belongs to the *Letterlike Symbols* with codepoint U+210E. However I'm not sure how on-topic for this site this question is.
Answer: It's ℎ (U+210E), in a different block than you checked.  Here's a useful reference.
Note that ISO style says to typeset constants upright, which would be \symup{h} or \mathrm{h}.  There is also an upright ħ (U+0127) distinct from ℏ (U+210F).  However, this does not appear to be common practice in mathematical physics.


Is it reasonable for flight economy to correct banking tendencies with stick and rudder?

Question: An aircraft with side-by-side seating but only one person aboard should fly banked.  Banking decreases lift and more elevator is needed than in leveled flight which increases drag. Correcting the banking with ailerons and rudder also increase drag. Which is better for economy?
Answer: You might be better off correcting weight imbalance with more fuel in the opposite wing if possible.  Then fly with fuel selector on both as long as you can.  This should give you better economy than trimming aerodynamicly.
Notice this also true for weight too far forward or aft.  Good balance helps in the air.
Answer: Based on your question, you are correct:  It will take more fuel to fly at a constant angle of bank.
If your goal is to remain at a constant altitude for as long as possible it would be better to fly straight and level, properly trimmed with the ball centered, than to orbit in a circle at a constant angle of bank with the additional elevator trim required to maintain altitude.
Answer: You are really describing a banking tendency no?  If the airplane is banked, it will turn.  To make it fly with bank, without turning, you have to use opposite rudder, creating a sideslip, which you would never do.
So if you have a banking tendency, that is the airplane wants to roll in a certain direction all the time, is the banking tendency happening while the airplane is flying straight (ball centered) or is the banking tendency because the airplane is skidding (ball offset).
If you center the ball with rudder, so the tail is lined up behind the nose, and the airplane still wants to bank if you let go of the ailerons, you have either an unequal lift problem (something in the wings is not symmetrical) or a lateral weight distribution problem.
The options are to hold aileron input, with the ailerons displaced from neutral, to counteract the rolling tendency, or counteract the rolling tendency with lateral weight offset that results in the airplane flying level with ball centered with no aileron displacement.
From an efficiency standpoint, you want to avoid flying with controls displaced into the airstream, so it's more efficient to use weight offset to counteract a rolling tendency if offset is able to achieve wings level without displacing the ailerons.  On a lot of airplanes you can achieve this with lateral fuel differentials when it's possible to feed from one tank or the other.  You can create a deliberate fuel imbalance that counteracts the rolling tendency, then maintain this imbalance by switching back and forth as fuel is burned.  I do this in my plane because it is quite sensitive to lateral balance.
Comment: The original question was how to balance a single occupant's rolling moment in a light aircraft (i.e. lateral imbalance), if I understood correctly.
Comment: Yes, that was exactly my original question. Leveling the slight banking needs only a slight touch in stick that can be tolerated but the constant left rudder (without a rudder trim) is inconvenient for the pilot. So I wondered how uneconomical is it to fly slightly banked and control the direction only with stick.
Comment: Well the answer is buried in my blah blah blah. Don't use rudder to stop a rolling/turning tendency if the rudder application sends the skid ball off center.  Only use rudder to center the ball.  If it wants to bank with the ball centered, either hold the aileron in or shift fuel to make it go away.  Otherwise you are flying along cockeyed.
Comment: You did not answer my question. The ball will be centered with aileron and rudder. But the question is economy: is it significantly uneconomical to fly slightly banked, elevator trimmed, direction controlled with stick and.. of course.. the ball slightly on the left due to banking. Forget the fuel.
Answer: If I understand your question, it is that having a single occupant aboard offsets the CG from the longitudinal axis of the aircraft causing a slight roll of the aircraft until the CG again aligns itself along the longitudinal axis.
This is, at least technically correct.  However in most aircraft design features such as pendulum effect, preset trim tabs and dihedral angle of the wings largely diminish this to the point of being imperceptible to the pilot.  You won't even notice a difference flying solo as opposed to an even number of passengers aboard.
Whatever effects associated with this are nothing compared to the effects of overbwnking tendencies, left turning tendancies eg P-Factor, torque, spiral slipstream and propeller gyroscopic precession, thrust asymmetry from an inoperative engine(s), etc.  these maladies are usually corrected by means of trim on larger aircraft or dampened out by flight control computers.
So yes, to be sure, the asymmetric loading from a single pilot does try to roll the aircraft slightly, which has to be countered with a roll torque opposing it which has additional aerodynamic consequences associated with it.   It it's so minor and countered by inherent design features for positive static and dynamic stability that you won't even notice the difference in flight.
Comment: With single pilot the lateral weight imbalance induces slight banking, so slight that turning tendency is minimal and almost unnoticable. But if I correct the banking with ailerons, I also need slightly but constantly to use the left rudder which is inconvenient in a long flight without a rudder trim. So my question, is the extra effort to make her fly wings leveled reasonable for economical point of view or do I let her fly slightly banked which is more convenient for the pilot. (Of course the best option would be to balance the plane).
Comment: Yesterday I made an unofficial experiment with my ski plane. If the slight banking due to  solo flying was corrected with aileron and rudder, the ground speed seemed repeatedly to decrease 1-2 knots compared to letting the plane fly banked, half the ball on the left, keeping the altitude with stick -- and so apparently with better economy.
Comment: Interesting experiment, thanks for sharing!  I remember from multi engine training that it is similarly more efficient to fly with the ball just a little out of center, but I can't remember the justification well enough to repeat it.  I'm sure it has the same basis.


what is the best way to get professional feedback on my resume

Question: Are there standard resources online or otherwise for getting feedback on my resume?
Comment: If you go to a head hunter or placement service they will review your resume.  But you may not want to work with head hunter or placement agency.
Comment: Are companies calling you? That's all the feedback you need.
Comment: I haven't made it public yet
Answer: Getting feedback on your resume is pretty easy:

Contact the company/recruiter who may have rejected you.

"Hello, I know that you found a more suitable candidate for the position. I was hoping that you might send me some feedback on my resume, and any suggestions regarding how I presented myself in the interview. Thank you for your time, etc"

A lot of colleges, or hiring agencies will also provide resume proofing services, and even run mock interviews with you. Ask a fellow professional whom you get along with to take a look as well.
Last but not least Google is your friend :-P

Ted, if you've never applied with your resume before then I suggest asking someone who has a career in your field to take a look - hopefully someone who's been involved in hiring for their company. Barring that, anyone with recruiting experience will be able to give you pointers. Step #2 very much applies here.
The important thing is not to apply with a flawed resume and miss opportunities that interest you. It's easy enough to ask someone for advice. Best of luck!
Comment: Has anyone tried #1 when not given an interview and did it result in useful feedback?
Comment: @Brandin - I have done that before. The company actually sent me a couple of pretty good pointers. I think most people feel pretty good about being asked for their input/advice. Of course not everyone will bother to reply, but what can you do?
Comment: My personal experience corroborates this answer, I find that generally people are more than willing to offer you opinions and advice on your resume. It might even increase your chances in a future application to their firm since you've shown that you are able to be critical of your own work and accepting of other peoples' opinions.


TP-Link Archer T4U Plus driver

Question: I can't find a driver for this adapter model
Answer: TP-Link does not provide any official drivers for Linux-based operating systems. They do have a download page for the T4U, but the kernel support is limited to 2.6.18 to 4.11. Newer kernels are not at all supported.
That said, you may be able to get by with one of the open drivers. This will be 100% dependent on the chipset in your T4u, though.
If your network adapter is using the RTL8812AU chipset, then this driver from thelinuxguy should work for you.
If you have a European model, which may use the RTL8822A chipset, then you'll need to find something that works. Unfortunately I do not have any experience with that specific chipset, so do not know where you can find a driver.
Answer: https://gist.github.com/primaryobjects/f723b966d5f42094619f9c1048c7838b
For tp-link archer t4u plus v1.0 (European edition I suppose) this solution worked for me on Ubuntu.

TP-Link Archer T4U Plus driver


Subversion Repository on Linux Dev

Question: What's the best practice for setting up a subversion repository on a linux development machine.  External users need to be able to access a specific repository, but nothing else on the machine.  I know one answer is to set up a dedicated repository, but I'm looking for a single machine solution: location of repositories, accounts, backup procedures.
Answer: One of the popular access methods to Subversion is via Apache module. You can set put different rights at the directory level to control access. See Choosing a Server Configuration and httpd, the Apache HTTP Server. For authentication, I recommend using external authentication source like Microsoft AD via mod_auth_sspi.
If you need to mix and match rights, see my answer for How can I make only some folders show up for certain developers with SVN.
Answer: I work for an IT operations infrastructure automation company; we do this all the time.
Location of repository: We use "/srv/svn" by default to store all SVN repositories, unless a customer has a specific requirement, for example an existing repository might be stored on a ReadyNAS shared filesystem.
Accounts: All our customers use LDAP. Either OpenLDAP server running on a master host, but sometimes Active Directory because some customers have a Windows domain in their office, which we can configure as well. Developers get access to the "SCM" group (usually svn, git or devel), and the 'deploy' group. These groups only have permissions to log in and perform SCM related activities (ie, write commits to the repo based on group ownership), or do application deployments to production.
Backup procedures: We use svnadmin hotcopy unless the customer already has something in place (usually svnadmin dump, heh).
svnadmin hotcopy /srv/svn /srv/svn_backups/$(date +%Y%m%d)

For access to the repo, it's usually simple svn+ssh. Some customers already have an Apache setup, but not many. I recommend SSH. Developers push their public ssh keys out and all is well. There's little to no maintenance with LDAP user management (the only way to go).
Answer: I'd recommend looking at the chapter on server configuration in the subversion book. It makes suggestions about which configuration is more appropriate for your use.
For what it's worth, setting up a repository using the stand alone svn daemon is very straight forward. The annoying thing is managing user rights.
Answer: I have a blog posting that describes the steps necessary to set up and initiate a Linux-based Subversion server in order to maintain code repositories etc.
Basically the steps are:

Download the Subversion tarball.
Unzip and install Subversion.
Deal with any installation problems that arise when running ./configure, if any.
Create the Subversion repository using svnadmin create.
Edit the repository configuration file using your text editor of choice.
Ditto the password file.
Import your code, projects etc into the repository using svn import.
Start the server as a daemon eg svnserve -d. It is also possible to get it to do this automatically
upon reboot.
Start using it using standard Subversion commands to eg check out, check in, backup etc...

Subversion Repository on Linux Dev


Bounding entries of the inverse of a matrix with bounded entries

Question: Let $A$ be an $n$-by-$n$ matrix with integer entries whose absolute values are bounded by a constant $C$. It is well-known that the entries of the inverse $A^{-1}$ can grow exponentially on $n$. (See the replies to https://math.stackexchange.com/questions/1146929/estimations-for-the-size-of-the-biggest-entry-in-an-inverse-matrix .) Can they grow more rapidly than exponentially? Or are they bounded by $(C+O(1))^n$?
Comment: If it would be possibel to add a row and column to a Hadamard (e.g. Walsh matrices)$ such that determinant is 1 the entries could grow like $(\sqrt{n}C)^n$.
Answer: Christian Remling's answer to this question: Smallest non-zero eigenvalue of a (0,1) matrix indicates that the answer is that the entry can grow super-exponentially.


Accessing a serial port from a linux kernel module

Question: Hello Linux Kernel Driver Gurus!
I'm writing a v4l2 driver for a camera that uses a serial interface for configuration.  I'd like the driver to configure the camera, as it keeps the client code consistent across camera models.  The question is: what's the best way to access the camera's serial interface from the driver module?
From what I hear, accessing files from a kernel driver is a big no-no, but it can be done.  As such, I'm currently using the following code snippet, but it feels like a hack.
oldfs = get_fs();
set_fs(KERNEL_DS);

fd->f_pos=0;
fd->f_op->write(fd, data, data_len, &fd->f_pos);

set_fs(oldfs);

My question is really: what's the right way to do this?
Answer: I presume that since a serial port is involved, this must be some kind of embedded system.  After all, not many PCs even have serial ports.  I also assume that the serial port can be considered a permanent connection, at least from the user's perspective.  If that is all true, then you don't really want a TTY device.  You want to access the device as a private UART.
If you have a look at the Wolfson audio codecs (sound/soc/wm*.c) you will see an example of devices that primarily communicate over I2S but have an auxiliary I2C interface for configuration.  This is conceptually what you want, I believe.  The driver presents a unified interface to software, and issues commands to whatever hardware is appropriate.  Obviously this is much cleaner than having to expose hardware implementation details to userspace.
I couldn't find a good example of a UART driver in the kernel that works this way, but hopefully I've described what to look for.  From a practical rather than technical purity point of view, it might just be better to do file I/O from the kernel.
Comment: Thanks for this: the Wolfson Micro drivers are good examples. It's still unclear how best to use a UART (I really don't want to rewrite the UART driver!), but this is a great start. Thanks!
Answer: First I would advise you to find a way to do this from the userspace if possible: what you try to achieve here really is userspace code in kernel code.
But if you don't find a way to do it, this article shows you how to do userspace calls in kernelspace.
Since you want to access a serial port, you should have calls that tty oriented, for instance for open:
serial_fd = sys_open("/dev/ttyS0",  O_RDWR | O_NOCTTY | O_NONBLOCK))

Comment: I understand that this really should be in userspace, so I guess the question is: how can I have a v4l2 driver receiving ioctl's for controlling zoom that requires commands sent over a serial port?
Comment: Thanks for the great article! It explains a lot of things I didn't understand in about kernel and user spaces.


Can Quorum Nodes be accessed via https?

Question: I  have a Dapp which has SSL certificate. I am unable to access Quorum Nodes via https and http as the Dapp is https.
Can anyone please suggest me a method to solve this issue.
(Node access via web3)
Answer: HTTPS connections are not supported by GoQuorum at the moment.
You should be able to achieve the same using SSL termination or similar. Take a look at the following doc to see how this is done with nginx: https://docs.nginx.com/nginx/admin-guide/security-controls/terminating-ssl-http/
Answer: This might not be a good answer, but this question did pique my curiosity as I do have a fair amount of experience with SSL pinning and essentially bypassing it or figuring out what needs to be passed in headers and how tokens are handled (yes I'm very opportunistic) to look at apps (mainly I make automations). I've done this for years, even when you have SSL pinning and behavioural checks(like checking for rooted phone etc)- I'm good at getting around it.
This all said I'm new as hell to writing smart contracts. I literally just looked up Quorum (looks like its JPMorgan private blockchain based on a soft fork of ethereum) because I had no idea what that was. So my advice is going to be somewhat general.
I'm assuming this is something along the lines of an x509 certificate for authentication right? It might be worthwhile to try renewing the certificate and private key(things can be that simple, but yet frustrating).
I think nodes that are configured to use TLS for transport would not be able to  communicate with nodes that use unencrypted transport connection. When you have security features enabled, you have to use TLS to ensure that communication is encrypted. So I'm guessing you would need to reassess all your nodes/clusters. Restart everything. Also monitoring  - if its there(I am assuming it is) I think you'll need a different .pem file for that.. and frankly it should be possible to configure whatever http traffic to go through https.
I'm not sure if this is wholly feasible with Dapps, but turning on a packet sniffer for debugging might be helpful. Burp suite, mitm, even postman etc etc. There are even ones available for your phone (I personally really like HTTPCatcher for my iphone). Unfortunately if you have an android you will need to root the device in order to place self signed cert on root to sniff https traffic.
Again very interesting question, I'm just not fully grounded with dapps yet so these are mainly my musings.

Can Quorum Nodes be accessed via https?


storm inlet drain blocked

Question: Residential storm inlet overflowing and blocked in the car park.
Removed water but was unsure what to do next or how the mechanics of the inlet work. Any help would be greatly appreciated. Thanks
Comment: I would suspect that this leads directly to the city's storm water drainage system, that said system is blocked, and that it's the city's responsibility to take care of it. I'd notify the city and ask them to check on it next time it rains.
Comment: With the amount of mud that it looks like was in there it definitely needs a call to the city, usually there is a trap so the crud settles then the water flows out. If it is plugged down the pipe the city I lived in used large suction booms and pulled the leaves and mud back up then flushed it, sometimes an auger was necessary.
Comment: Once you've contacted the city and they've fixed it, please come back to write up what happened as an answer to your question. That's not only perfectly acceptable 'round here, it's actually expected.
Answer: I assume that is a pic taken standing over the storm drain looking down into it.  How interesting that someone put a sewer cleanout in there.  Don't mess with that cleanout unless you want the problem to get worse real quick, I am sure it has nothing to do with handling rainwater.
Do you know where this is supposed to exit?  Is it running underground to an outlet downhill somewhere?  If you don't know where it goes to you probably shouldn't mess with this one.
If you know where the outlet is you MIGHT be able to put a pump in there and run a garden hose with a pressure nozzle on it down into there with the water on full and the pump keeping the drain empty and if there's no sharp bends you might be able to clear the blockage out if it's just mud.  I would start with the exit end, though.  If you cannot find it that doesn't mean it's not there, more likely it's a victim of years of neglect and is buried.
Sometimes these things ended up running into a sewer line or sometimes into an underground "french drain"  To do this job right if you can't find the outflow you need a sewer endoscope and a sewer line locator the tooling alone is a couple grand.

storm inlet drain blocked


Is it possible to construct a finite state automata for a decimal adder?

Question: Suppose the strings are of the form x#y#z , where x,y,z are strings formed from the alphabet $\Sigma=(0,1,2,3,4,5,6,7,8,9)$ . The language is accepted if x+y=z is satisfied, for example : 56#65#121 is accepted, but 2#97#104 is not. Is it possible to find a finite automata for such a language ?  I cannot fathom how decimal addition could be carried out using a DFA .
Comment: Hint: consider the special case where $x=0$.  Can you use a finite automaton to recognize that subset of strings?
Comment: What are you referring to when you say "I am aware of binary addition"? Binary and decimal arithmetic are equivalent here; neither is possible with a FSA but both are possible with a PDA if the input is encoded very carefully. Only unary arithmetic is possible with a PDA using the input encoding you suggest.
Comment: Sorry, I actually had unary addition in mind. now edited.
Answer: Interestingly, the question in the body has a negative answer, but the question of the title has a positive answer, if you choose the appropriate representation for the data.
Let me explain this for a binary adder (I let you generalize the argument for a decimal adder). First represent the numbers $x$ and $y$ to be added in reverse binary, with a final $0$ and make sure they have the same length by adding further $0$'s at the end if needed.
For instance, $22 = 2 + 4 + 16$ would be represented by $011010$ and $13 = 1+4+8$ by $101100$. Their sum $35 = 1 + 2 + 32$ is represented by $110001$. Now, just read this data column by column
\begin{matrix}
22 \to &0&1&1&0&1&0\\
13 \to &1&0&1&1&0&0\\
35 \to &1&1&0&0&0&1
\end{matrix}
to get
$(0,1,1)(1,0,1)(1,1,0)(0,1,0)(1,0,0)(0,0,1)$. Taking all representations of the triples $x, y, z$ such that $x + y = z$, you get a regular language on the alphabet $\{0,1\}^3$, recognised by the following automaton

The trick behind this representation is that addition can be obtained by a sequential transducer.
Comment: Very nice. But using reverse binary is unnecessary since regular languages are closed under reversal. (As humans, we're just more comfortable having carries move forwards. But the DFA is perfectly happy with carries moving backwards, or more accurately carry  expectations moving forwards.)
Answer: Definitely, this language is neither a regular language that can be accepted by FA nor a context free language that can be processed by PDA. This fact can be proved easily by pumping lemma.
This language is only a context sensitive language and can be accepted by a LBA (linear bounded automaton) or standard turing machine.