How does Jigglypuff not fall asleep from its own song?

Question: Jigglypuff's song is seen to be extremely effective in putting people and Pokemon to sleep, but how does it not fall asleep from its own singing?
Shouldn't it at least fall asleep after it's done?
Comment: I think people don't usually fall asleep when they sing lullabies.
Comment: Same reason you can't tickle yourself?
Comment: -_-  greaat.....now I will be singing this for at least two days at random intervals   After not hearing this since being a sophomore in highschool...in 1999.     Also, likely immune for same reason that rattlesnakes don't die from their own venom being inside their own bodies......
Answer: At first: As kuwaly mentioned, normally no one falls asleep while singing a lullaby. That's most likely the reason, but there are other possible points:

Like in the game, Pokémon using Sing aren't affected by the attack. This was most likely done to make this move usable, and was copied in the anime so the viewers aren't confused.
Some of the Pokédex-entries suggest, that you need to look in the eyes of Jigglypuff to be affected. As a Jigglypuff can't look itself in the eyes, it can't fall asleep. You can read the entries on Bulbapedia.

I also think I remember other Jigglypuffs falling asleep, too, but I'm not sure. That would mean, that Jigglypuffs aren't immune to the singing, but just aren't affected by their own attack.
Answer: This can be answered well with typical concepts of biology. While no species (to the best of my knowledge) is known that can send other individuals to sleep by singing, practically every species produces some kind of natural products that are fatal or unpleasant to others.
Consider, for example, tetrodotoxin known as the poisonous ingredient of pufferfish or fugu. Tetrodotoxin acts by inhibiting nervous sodium channels and thereby inhibits nerve signal transfer. This should affect all higher vertebrates that rely on nervous signaling. It is not produced by the fish itself but by numerous bacterial symbiontic species. They are not the only species to use this toxin as a defence mechanism; among others, so does the rough-skinned newt.
Naturally, it is interesting that all species harbouring these bacteria seem immune to tetrodotoxin. However, even more interesting is the fact that the common garter snake, a natural predator of the rough-skinned newt, has also developped some immunity. This could be traced back to a modification of said sodium channels that render them immune against tetrodotoxin.
A similar mechanism could and should be acting with respect to jigglypuff's song. Potentially, one could assume that singing was either a method of self-defence (a sleeping predator cannot attack jigglypuff) or an attack method (a sleeping victim cannot run away). In any case, if jigglypuff were able to sing itself to sleep, that would be evolutionarily very unfavourable since it would present an easy target. Therefore, evolution probably selected those jigglypuffs who were able to withstand their own singing (and possibly also those, who enjoyed other jigglypuffs' singing). This gave them an advantage in survival.
The exact mechanism by which jigglypuffs' singing does not sing themselves to sleep would have to be researched by pokémon researchers in the pokéworld. However, I present the hypothesis that their nervous system reacts to the stimuli in a different way than other animals, humans and pokémon, possibly due to a different, yet to be discovered signalling molecule mutation.
Answer: What I think is that Jigglypuff can't hear itself when it sings. To whoever said you needed to look into its eyes, the Neon City episode in the anime had people falling asleep when they weren't looking into Jigglypuff's eyes. Maybe all Jigglypuff have different songs and ears, so the user of the song can't hear itself sing.
Answer: Status Condition Moves, like:
Hypnosis and Sing
For example, are primarily used to put Other Pokemon to sleep. They have no effect on the Pokemon performing the move(s). Therefore, whenever Jigglypuff is singing, Humans or Pokemon fall asleep. Her singing is primarily a "Status Condition" Move and that's it. If it was meant to be listened to, Humans and Pokemon would be wearing earplugs, so they don't fall asleep. It's even funnier when she stops singing, realizes that everyone's asleep, gets mad and draws on their faces with her microphone/marker.
Comment: Magic Coat and Magic Bounce - a move and an ability which reflect most status moves - would render this opinion moot.  Besides, the anime isn't entirely based on the games.
Answer: Actually, Jigglypuff does fall asleep from her own lullaby in this clip.
Comment: This answer would be better if the episode number is known since YouTube videos can be taken down at any time.
Answer: Perhaps when Jigglypuff sings, the direction and application of it's voice are ONLY directed towards everywhere but itself. I don't think it can't hear itself sing, because in every 1st gen episode it was in, it got mad that everyone fell asleep during its song. If it didn't think it could sing, or couldn't hear it, why would it be so mad? Also, in every 1st gen episode it appears in, it has a microphone that doubles as a marker. You can hear the reverberation of its voice in the Neon City episode, where it used loudspeakers, as well as in every other instance of it singing without loudspeakers. (except that one episode where it was quietly singing to itself as it walked down a road, and even then, if it couldn't hear itself sing, why would it continue singing?) In conclusion, if every time it deliberately sung for an audience, (and not for itself) it put a (hypothetical) sleep frequency in the music that was directed and amplified outward from itself, it would never hear that frequency, thus not falling asleep, but is able to hear its own song.
Comment: Thanks for chiming in and welcome to anime stackexchange! Your answer seems to contradict itself, particularly the first statement about the voice only directing outwards but then you argue that it can definitely hear its own voice. I would recommend forming a single sentence that holds the *main idea* of your reply at the end of your answer, preferably separated by a blank line.
Answer: Actually the reason jigglypuff is not sleeping hint hint hint hint is that it sing to everyone around herself and when she is singing is because that she knows not to sleep when she is singing so she can know what to say next.
Comment: O.O   Recursive statement hurts head.


Uninstall GRUB2

Question: I have a HP 650 laptop with windows 8. I installed Ubuntu 13.04 and removed it afterwards. I can get into windows 8 through secure boot, but if I disable secure boot, to run from CD or anything else, it goes straight to a grub screen which asks for commands. I really need to get rid of this bootloader.
Comment: Can you boot into windows through GRUB2?
Answer: Take a look at this answer from Rod Smith on my question earlier this month. It explains how GRUB should be removed properly. I faced the same problem where I couldn't get rid of GRUB after removing Ubuntu.
Though, if you are wanting to dual boot with GRUB and Windows 8, you should use the boot repair tool and run the recommended scan/fix.
Also note that you may gets some bogus GRUB entries for Windows recovery options that may actually boot to windows itself while the main Windows 8 entry will only give an error, so you may have to try each and see which one is for Windows.
You can then remove the bogus entries once in Ubuntu through a text editor (ie: Vim, gedit) or using a graphical frontend like grub-customizer.

Uninstall GRUB2


Is gamma still important to take into account?

Question: Do different monitors (including mobile screens) still use significantly different gamma functions when displaying colour images? Is there a standardised way to represent colour that can then be translated according to the gamma of the monitor, or are they all sufficiently similar to preclude the need for this nowadays?
Comment: I'd say this post is on topic. It seems to relate heavily to GPU Gems 3: Chapter 24. The Importance of Being Linear
http://http.developer.nvidia.com/GPUGems3/gpugems3_ch24.html
Comment: Whether something is on topic elsewhere is not relevant to this decision. We just need to know whether it's on topic *here*.
Comment: Being welcome elsewhere is *never* a proper reason alone to declare something off-topic *here*.
Comment: @robobenklein nowhere in this stack's scope states this stack is for 3D graphics specifically.
Comment: I'm deliberately posting borderline questions to measure where the border is. Please raise as many uncertainties as possible on Meta.
Comment: Such discussions are important to have - that's what this private beta is all about. So I've raised it on [meta](http://meta.computergraphics.stackexchange.com/questions/35/are-questions-about-gamma-on-topic)
Comment: This doesn't sound like Computer Graphics as our scope intended it to be, this site is specifically oriented towards 3d, rendering, simulation, and the process of viewing them. This sounds like it belongs on graphic design.
Comment: @robobenklein this would most likely get rejected from graphics design, and its borderline. Besides gamma is about viewing your art
Comment: Ah actually i lied... This question would be welcome to GD.SE because a similar is there. IF i can get to it first, if im away its most likely gets modded to oblivion.
Comment: @AlanWolfe i used to own that book, somebody at work stole it from my hand reference.
Answer: Yes, while many screens and OS operations are using a gamma of 2.2 your hardware and computation result still need to be corrected. There are also special mediums such as broadcast TV's that have a different gamma. Sensor equipment like cameras are mostly linear so they need to be adjusted accordingly. Besides this the user can set their system to whatever gamma they like.
In computer graphics primary reason to account for gamma is that your computation is most likely done in linear space* or summing light contributions becomes unnecessarily complicated. In any case gamma is really a simplification of things, you'd be much much better of doing profile to profile conversions if its possible to invest the computational time to do so.
Mathematical explanation
This may be a simpler to understand. Your monitor has a display error of $g(x)$ which is no problem if your data is conforming to $g(x)$, however if you want to calculate:
$$ a+b+c+d $$
and $a$, $b$, $c$, $d$, have the error of $g(x)$ you would actually need to calculate.
$$ g(g^{-1}(a)+g^{-1}(b)+g^{-1}(c)+g^{-1}(d)) $$
You would need to do this for each sub element over and over again. Therefore instead of running the transform each time you transform all once to linear and then once back.
And finally a artistic reason
It may just look better with a different gamma. Many games have a gamma adjustment for this reason.
* Worst case is that you think your computations as linear but do not compensate for the monitors nonlinear output charachteristics.
Comment: No, but [hopefully we will in the future](http://meta.computergraphics.stackexchange.com/q/18/6). Feel free to add you answer as an example for its necessity, though.
Comment: Do we have latex yet?
Comment: If you want to show how your answer *would* look if we had MathJax, to help make the case, you can use [mathurl.com](http://mathurl.com).
Answer: The de facto standard color space for digital images these days is sRGB.  sRGB is a good default assumption if working with a display whose exact color space is not known (i.e. most random displays someone might run your app on), or images whose color space encoding is not known (i.e. most random image files you might encounter).
The sRGB standard defines the CIE chromaticity of the pure red, green, and blue primaries and the white point—in other words, it defines what those primaries and white should perceptually look like relative to pure wavelengths.
sRGB also defines a gamma curve that's used for encoding the RGB values.  The gamma curve is the part that graphics programmers are usually concerned with, as we have to convert colors back and forth between sRGB and linear to do lighting math physically-correctly.  All modern GPUs have sRGB support built in: they can automatically apply the gamma transformations in hardware when sampling a texture, or writing a pixel value to a render target.
As far as monitors are concerned, with a high-quality one it should be possible to calibrate its settings (or it may come pre-calibrated) so that its output matches sRGB as faithfully as possible.  In case the monitor itself can't do it, a limited amount of color correction can also be done on the GPU during scan-out; there are some small hardware lookup tables that the RGB values are mapped through before being sent out over the wire.
You might also come across Rec. 709, which is the standard color space for HDTVs; it's very similar to sRGB, using the same primaries and white point, but a slightly different gamma curve.  Some high-end monitors use the Adobe RGB color space, which is somewhat wider-gamut than sRGB; photographers tend to like those because they more faithfully represent what photos will look like when printed.  The next generation of HDR TVs coming out (hopefully) in the next few years will use Rec. 2020, which has a huge gamut and requires 10 or 12 bits per component rather than 8.
So to come back to your question whether you need to worry about different monitors having different gamma: not much.  For gaming and general PC graphics you can pretty much assume sRGB, and figure that if the user really cares about color accuracy, they'll have a good, calibrated monitor.  If you're producing software for photographers or print media, or for next-gen HDR video standards, then you might have to start worrying about wide-gamut color spaces.
Comment: Wider gamut monitors will also start to be commonplace in near future. For example I do not calibrate to sRGB on my art worstation, but the profile to profile converter makes images still look the same as on my dev machine.


Gradient tool in Photoshop not even blend?

Question: When you make a gradient in PS, for example a black to white gradient going across the screen, it seems that it is not an even blend from black to white. There is too much black, too much white, and not enough in between. Here is an example picture. The histogram display in the curves window shows what I mean. If it was an even blend, the histogram wouldn't show this curve shape. Am I correct in this? Is there a way to get an even blend?
Comment: by even you mean numerically linear? Or visually linear? Both of which are different things.
Comment: Or do you mean the dither?
Answer: I know this is old, but...
By default, gradients are "contrasted" in Photoshop when drawing Gradients - the colors in the ends are given more presence than the midtones, to improve the visual effect (more contrasted like I said). If you want them to be evenly represented, you must go into the gradient editor and lower the "Smoothness" parameter to zero. Then draw the Gradient again, and the histogram will be "flat".
Answer: That depends a lot on the recipe you used for black and your other settings in your profile.
When you say black, that could mean many different black (#000000 or K100 or C75-M65-Y25-K80)
I'm more of a print person so I don't really do any color management in RGB and I find it easier to evaluate the results of how the colors will look like in CMYK. But if this can help to understand what's going on, I made some samples to show you different type of black to show how they react when used in a gradient.
In your graphic, your black is not really black. It's a mix of colors that looks like black. You have other colors that are distributed from the start to end of your gradient, and they multiply each others. So they will saturate the mid-tone of your gradient.
In RGB there is no true black; the "real" black is #000000. But this black is still a mix of all the red-green-blue at 100%, and a very rich black in CMYK.
I made a gradient in RGB mode using only K100 and here is the histogram. The nice curve is there.

And here are the different black, all in CMYK mode. You will notice how some fill the mid part more than others. You can also see how the RGB black is really "thick"!

And here is the channels screenshot to show how the other colors in the different black are mixed with the true black. You can see which color is saturating the middle part of the gradient.

Bottom line: If you want a nice smooth and well balanced black gradient, you should try to remove the other color saturating it in the middle, use the real black at 100% and find what you prefer. It's probably easier using the CMYK color values even if you're in RGB mode.

Extra note on gradient with black for printing:
If you use a black with gradient for printing, be careful to add some of the other color too, otherwise you will see some "steps" between each shade of black as if the gradient was very low resolution! Same will happen if you do a light gray gradient when printing in Pantone or one color only. In that case, you shouldn't even make a long gradient; if you have a gray at 30% black to 0% on a 10" sheet for example, the gradient will be visibly split into 30 slices of gray of 0.3" each! Horrible result!
It's also good to add on your gradient some noise (2.0) and then gaussian blur (0.5) to get a nice smooth gradient and hide the "steps".
Answer: It's more even than it may seem at first. I took a copy of your image and cropped it to the gradient. Then I copied that gradient to a new layer, inverted it, and rotated it 180º. Then I masked half of it to reveal a side-by-side comparison with your original. The difference is almost completely unnoticeable.

A few different things are factoring in to make a "regular" gradient look a little skewed. The human eye is better at distinguishing lighter values. Our daylight vision is far better than our low light vision, for example. Many monitors have built-in color enhancements that warm or cool the picture, which would affect gradients as well. There may also be icc profiles applied to the image which cause it to display in a way that is different to its literal values.
Comment: The dark haze on the bright end of the original is caused by the drop shadow of the gradient dialog in the original image. Notice that you can't see it in the inverted one because we can't detect such subtle changes in the dark end of the brightness spectrum.


Compile Tor Browser on Raspberry Pi 2

Question: I have seen a ticket opened about this on tor bug tracker, but no progress for over a year on the Tor Browser being available on arm processors. I have setup firefox with a proxy to use Tor but that is not safe because the browser itself leaks to much info. So I am asking for help if this is the right place to ask how to compile the Tor Browser on RasPi 2 on Debian/Ubuntu. Just some simple instructions for me to follow so I can compile from source, or is there an easier way?
Comment: If you use Firefox (Iceweasel) make sure you go to about:config and change the network.proxy.socks_remote_dns from false to true, by default your DNS queries are leaked over clearnet. I just wanted to leave this as a comment but I don't have the reputation for it as I don't actually have much of a solution to your question other than pointing you to https://www.torproject.org/docs/debian.html.en#source
Answer: Speaking from experience, this is not currently possible.
During the compiling process, the make script will download some binaries that are only built for X86 and not for ARM and therefore the compilation wil fail every time.
The Tor developers plan on releasing a version for Tor Browser for ARM in the future, but there is no ETA.
Your best option at the current time is to download the Tor application and apply it to Firefox/Iceweasel.
Comment: Do you have a ticket-link for that? The link from Andrew is not valid (closed/moved) anymore.
Answer: Tor Browser does not work on ARM as of this time.
https://trac.torproject.org/projects/tor/ticket/12631
TOR ticket tracker for porting to ARM hasn't had much traction at all.
I wouldn't expect this project to be ported to arm anytime soon.
Note: tor is available on raspberry pi. This is for running a relay. This is different from the tor browser.
Answer: On all raspberry pi's, I have found that downloading the source and then running the following commands
cd your/source/directory
sudo ./configure && sudo make

If all goes well, this will install TOR from source.
Note: You may need some external libraries in order for this to work. I needed libevent and libopenssh
Then just run tor from the command line like so
tor

Compile Tor Browser on Raspberry Pi 2


Adding segment to Bezier curve

Question: When I attempt to add a second segment to a Bezier curve, it creates it very small and folded back on itself, almost like a circle. I create it by selecting the end point of the first curve and then Ctrl + LMB. I've tried this is 2.77 and 2.78c and get the same results so it's obviously something I'm doing wrong. Trying to find the new end point is difficult and when I do hit on it and drag it away, it generally wanders off the flat plane. Thanks.
Comment: Try changing the handle type of the newly created segment to *Vector* from the toolshelf. Also check if the new curve is closed from the *Properties Window* in the *Object Data* tab
Answer: Maybe you want to use the Extrude operation.  Select the last control point on the curve and hit e.  You can then move your mouse around to choose where the new control point will go.
Comment: `E` for [Extend](https://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/Intro_to_Bezier_Curves#Extending_Your_Curve) (not extrude)
Comment: Thanks! This helped me solve my issue
Answer: I was finally successful in adding a second bezier curve, but not the way described in a Blender course I'm taking. If I do it the instructor's way, I get a curve folded back on itself with very little chance of straightening it out.
I'm using Blender v2.78c but I tried it on 2.77 and got the same results.
Here is how I have found I can do it.
At the end of the first bezier curve align the control handle so that one end points generally in the direction that you want to add the next curve. Select (RMD) the END of the control handle which points in that direction (NOT the end point of the curve), hold down CTRL and left click (LMB). The new curve will be added.
Answer: Years in the future from the original answer but I hope this helps others. Version 2.79 you can make local (L) that let's you scale, rotate, move you can adjust any modifiers apply and in theory it should be still link to the external file.

Adding segment to Bezier curve


What's the benefit of the average human body temperature?

Question: Why would the body choose a resting temperature of 36.1c to 37.2c? It seems a very inefficient mechanism of survival considering the typical ambient temperatures on Earth. If there is a benefit to needing to continuously do extra work, what is it?
Comment: what have you searched so far to answer this?
Answer:
What's the benefit of the average human body temperature?

It's a balance between preventing infection and not requiring excessive food intake. It is has also been claimed that this is the temperature at which the most essential enzymes are most reactive, without becoming damaged by excess temperature.
References:

"Mammalian Endothermy Optimally Restricts Fungi and Metabolic Costs", by Aviv Bergman and Arturo Casadevall, DOI: https://doi.org/10.1128/mBio.00212-10
"Fungal virulence, vertebrate endothermy, and dinosaur extinction: is there a connection?" (.PDF), by Arturo Casadevall, DOI: https://doi.org/10.1016/j.fgb.2004.11.008

"The number of fungal species that can thrive and therefore infect an animal declines by 6 percent for every 1° C rise in temperature. This means that tens of thousands of fungal species infect reptiles, amphibians and other cold-blooded animals, but only a few hundred harm mammals.".

It is useful to refer to ectotherms (an organism in which internal physiological sources of heat are of negligible importance in controlling body temperature, which permits them to operate at very economical metabolic rates) as poikilotherms when applicable.

"Poikilothermic animals include types of vertebrate animals, specifically some fish, amphibians, and reptiles, as well as a large number of invertebrate animals. The naked mole-rat is the only mammal that is currently thought to be poikilothermic.".
"Poikilotherm animals must be able to function over a wider range of temperatures than homeotherms. The speed of most chemical reactions vary with temperature, and in order to function poikilotherms may have four to ten enzyme systems that operate at different temperatures for an important chemical reaction. As a result, poikilotherms often have larger, more complex genomes than homeotherms in the same ecological niche. Frogs are a notable example of this effect, though their complex development is also an important factor in their large genome.
Because their metabolism is variable and generally below that of homeothermic animals, sustained high-energy activities like powered flight in large animals or maintaining a large brain is generally beyond poikilotherm animals. The metabolism of poikilotherms favors strategies such as sit-and-wait hunting over chasing prey for larger animals with high movement cost. As they do not use their metabolisms to heat or cool themselves, total energy requirement over time is low. For the same body weight, poikilotherms need only 5 to 10% of the energy of homeotherms.".

This update speaks to the theories on enzymes (solitary from metabolism), offered in other answers.
Articles and theories that are not discredited:

Enzyme assays by Hans Bisswanger:
That article is mostly concerned with the temperature used to conduct assays of enzymes.

"The essential requirements for enzyme assays are described and frequently occurring errors and pitfalls as well as their avoidance are discussed. The main factors, which must be considered for assaying enzymes, are temperature, pH, ionic strength and the proper concentrations of the essential components like substrates and enzymes. Standardization of these parameters would be desirable, but the diversity of the features of different enzymes prevents unification of assay conditions. Nevertheless, many enzymes, especially those from mammalian sources, possess a pH optimum near the physiological pH of 7.5, and the body temperature of about 37 °C can serve as assay temperature, although because of experimental reasons frequently 25 °C is preferred. But in many cases the particular features of the individual enzyme dictate special assay conditions, which can deviate considerably from recommended conditions.".
...
"Enzymes display their highest activity at their respective optimum conditions, deviations from the optimum cause a reduction of the activity, depending on the degree of the deviation. Moderate deviations produce only small activity decreases which can be tolerated (Figure 1), and so the physiological conditions prevailing in the cell may be taken as standards for at least of the mammalian enzymes. However, assay procedures are usually adapted directly to the features of the individual enzyme and not to obey general standards. Enzymes are sensitive substances present in small amounts and their activity in the cell can often be detected only at their optimum conditions.".

Royal Society of Chemistry - "Enzymes - Function and structure":

"As the temperature rises, reacting molecules have more and more kinetic energy. This increases the chances of a successful collision and so the rate increases. There is a certain temperature at which an enzyme's catalytic activity is at its greatest (see graph). This optimal temperature is usually around human body temperature (37.5 °C) for the enzymes in human cells.
Above this temperature the enzyme structure begins to break down (denature) since at higher temperatures intra- and intermolecular bonds are broken as the enzyme molecules gain even more kinetic energy.".

Note: Wikipedia: "Wilson's temperature syndrome":

"The American Thyroid Association (ATA) describes Wilson's syndrome as at odds with established knowledge of thyroid function. The ATA described the diagnostic criteria for Wilson's syndrome as imprecise and non-specific, and raised concern that the proposed treatments were potentially harmful. Florida State Medical Board members described Wilson's syndrome as a "phony syndrome" and a scam during disciplinary action against Wilson."
...
"The ATA stated in 2005 that a "thorough review of the biomedical literature has found no scientific evidence supporting the existence of 'Wilson's Temperature Syndrome'." The statement added that the mean temperature of normal persons in the AM on waking is 97.5 °F, not 98.5 °F, and that many of the symptoms described by Wilson are nonspecific and typical of depression, anxiety, and psychological and social stress. It also notes that a similar set of symptoms occurs in the alternative diagnoses of neurasthenia, chronic fatigue syndrome, fibromyalgia, multiple chemical sensitivity, chronic Epstein-Barr virus syndrome, and chronic candidiasis. Finally, the Association notes that chronic supplementation with triiodothyronine (T3) is particularly difficult and problematic, since various tissues set their own cellular levels of this hormone by making it individually from thyroxine, and supplementation of T3 may overwhelm this normal regulatory mechanism in some of these tissue.".

Reference: Wilson's Temperature Syndrome

"Metabolism Dependent on Enzymes"
"Enzyme Function Dependent On Temperature":

"... when an enzyme-dependent chemical reaction is monitored for how well it takes place at various temperatures, the lower the temperature, the slower the chemical reaction. As the temperature is increased, the reaction rate will go faster with each increase until it reaches its optimum reaction rate. If the temperature is increased too much, the rate of reaction will diminish due to denaturing or change in shape of the enzyme.".

The treatment suggested by Wilson is what was discredited, the fact that enzyme reactions proceed differently at different temperatures is still supported. Reference to his article was included due to the partial overlap with established knowledge.
Comment: I think you are the only one that answered the rather indirect question of why body temperatures are above ambient.
Comment: @BryanKrause I am expanding my answer.
Comment: @NonSecwitter I've made another update, I believe it explains that. Poikilotherms adapted to be conservative while homeotherms adapted to high energy activities and maintaining a larger brain. I think your 'DNA question' deserves its own space, but the short answer is that each developed its own [taxa](https://en.wikipedia.org/wiki/Taxon) in either environment.
Comment: Those are some interesting citations, but I think this answer misses the other advantages of an elevated body temperature.
Comment: Interesting. I was hypothesizing that perhaps our DNA developed in a warmer environment and we developed adaptations for cooler environments. Is there any possibility of that scenario?
Answer: First, let's learn about the vocabulary to describe how living beings deal with their internal temperature with this answer. Now that you have read this answer, you understand that humans are homeo-endo-therms.
There are pros and cons of homeothermy. Those pros and cons depend upon the species and esp. upon the type of environment experienced by the organism. Here is one pro and one con. In the specialized literature, you;d find a much more exhaustive list of pros and cons
Pro
The activity of most chemical reactions are affected by temperature. See this post, this post and this post for examples (this post might also be of interest). Enzyme activities are typically highly dependent upon the temperature.
Homeotherms have the advantage that their internal working is not too affected by the outside temperature allowing them to maintain a high metabolism and a high level of activity in a variety of environmental conditions.
Con
Depending upon the environment and the species, it may take a lot of energy (and other ressources) to maintain a constant temperature. For example, in mammals we see behaviours such as shivering, hair positioning (piloerection), vasoconstriction, sweating, change in body posture and other systems such as non-shivering heat production by brown adipose tissues.
Answer: Consider if cavemen would be efficient at defending and fighting each other and predators if they took 15 minutes to warm up from a cold nap before they can start to move.
Animals with wider temperature ranges have to maintain many enzyme genes for enzymes that work at different temperatures, and that's inefficient.
If an animal is warm, it processes food and grows a lot faster, so it makes sense for all growing animals to be warm day and night if they can. Older animals can build up fat and reserves and milk and offspring faster if they are resting warmly also. So a female human would benefit from being warm from age 0-37 to breed.
Bears can be dormant at 33'C and alaskan marmots can adjust to 3'C.
Humans that don't hybernate have to be active every day, and have to survive the nights, and grow fast, and build up fat reserves, and keep the immune system enzymes and antibodies at their most performant.
Answer: You perhaps need to consider that it's not just humans.  All mammals have body temperatures in a fairly narrow range - 97-103 °F/36-39.5 °C.  Birds likewise have a narrow temperature range, though a bit higher, around 105 °F/40.5 °C.
The advantages seem fairly obvious, at least if you've seen reptiles in cold weather torpor.  As another answer points out, the speed of chemical reactions varies with temperature.  Maintaining a constant temperature allows those reactions (which ultimately determine the speeed of everything the body does) to happen at a constant rate, so animals can be equally active in everything from polar ice to tropical jungle.


Poor adhesion on new layer - Monoprice mini select

Question: On my Monoprice Mini Select v2 there is poor adhesion when the print head goes to put down a new layer on the bed as seen in the photo. Does anyone have a fix for this?
Comment: What is your first layer print speed? It seems to me like you're printing too fast and the filament hasn't enough time to settle on the bed.
Comment: I print super slow for the whole print since it seems like I get better detail this way
Answer: You could try a higher bed temp, but also check to make sure bed is levelled all round as this can sometimes cause this to happen
Comment: I'm pretty sure the bed is leveled but I'll check it again. Would another surface like painters tape, or a glass bed upgrade help?
Comment: I find printing on glass bed with tape always gives a  better result but the build tech material is just as good it just needs regular cleaning after each print as oil from your fingers can get onto it and it rests on the top, looking at your image it seems to stick fine after that first bit, painters tape is OK but doesn't always work I use https://www.wanhaouk.com/products/wanhao-print-bed-tape
Answer: If you have already used alcohol to eliminate grease and fingerprints, sometimes scrubbing the print surface with a regular green scotchbrite pad can restore adhesion. It micro-scratches the surface and seriously increases the surface area of contact.
This all assumes you have properly calibrated the bed, reduced first layer print speed by at least 50%, increased first layer print thickness By >= 50%...
Answer: Things you need to check or do:

Use adhesion layers
Set lower speeds at first layer.
Increase bed temperature (try 5 degrees steps)
Clean the bed
Check if the bed is completely leveled up.
Increase the thickness of the first layer.


How do sefardim pronounce the tzerei?

Question: How do sefardim pronounce the tzerei?
Is it "eh" as in elephant or "ay" as in play?
Comment: Many languages, including (I believe) many varieties of Sephardic Hebrew, use a vowel that is intermediate between those two vowels.
Comment: −1. How you pronounce "'eh' as in elephant or 'ay' as in play" is unclear to the rest of us. This question would be *much* improved if you'd use the International Phonetic Alphabet or another means of transcribing different vowels so as to distinguish them (such as by noting their [formants](http://en.wikipedia.org/wiki/Formant)) irrespective of how individuals pronounce particular words.
Comment: Do you have a reason to suspect it's not pronounced "oo" as in "boom"?
Answer: A little phonetics background is needed to answer this question. Phoneticians usually transcribe sounds in languages using a set of symbols known as the International Phonetic Alphabet (IPA). Phonetic transcriptions in the IPA are written in between square brackets [], so for example the word "beds" is transcribed in IPA as [bɛdz].
As you can see from the previous example, the "eh" sound is written in IPA as [ɛ]. It's also useful to know that the "y" sound is written in IPA as [j], so for example the word "yes" is transcribed as [jɛs].
Now what about the vowel sound in the word "plays"? Well, if you think about it, the shape of your mouth changes as you pronounce the "ay" vowel in this word -- over time, it constricts more and becomes closer to the sound [j]. However, there are languages (e.g. French) which have a vowel sound similar to "ay" but more "pure", in that the shape of the mouth doesn't change over time -- this sound is written [e] in the IPA, and you can listen to a recording of it here. For example, the French word "été" is pronounced [ete] with a "pure" "ay" sound for both vowels. By contrast, the English word "plays" is pronounced as [plejz], where the vowel starts as an [e] vowel but shifts to a [j] over a short period of time. (This is what is known as a diphthong.)
Now, there are also languages that have a vowel that is intermediate between the vowels [ɛ] and [e]; this is sometimes written as [e̞]. For example, Modern Hebrew uses the vowel [e̞] for both tzere and segol. For more information on these three vowels, and to listen to recordings of them being pronounced, see the Wikipedia articles on [ɛ], [e], and [e̞].
Two other vowel sounds that we will need to know: The vowel in the English word "bit" is written as [ɪ] and the vowel sound in the English word "beet" is written as [i], so these two words are transcribed as [bɪt] and [bit], respectively. For more information and recordings, see the Wikipedia articles on [ɪ] and [i].
Now that we understand the phonetics behind these vowels, we can understand their realizations in Sephardic Hebrew. The following quote is from S. Morag, "Pronunciations of Hebrew", Encyclopaedia Judaica XII:

ṢERE AND SEGOL
All the communities which follow the Sephardi pronunciation have one realization for both ṣere and segol (see above). This realization is a front higher-mid or lower-mid vowel, [e] or [ε]. In some North African communities no distinction is made between the realizations of ṣere (and segol) and that of ḥireq. This applies also, to some extent, to the Iraqi community.

So according to Morag, both segol and tzeirei are pronounced identically in the Sephardic pronunciation, and depending on the variety of Sephardic Hebrew are both pronounced as [ɛ], [e], or [e̞]. My own speculation is that this depends on whether the local language of the area those Jews lived in used [ɛ], [e], or [e̞], and that there has been a shift to [e̞] among Sephardic Jews living in Israel due to the influence of Israeli Hebrew. Also, when Morag refers to some communities that merge tzere/segol and hiriq, I infer that the pronunciation of this merged vowel is [ɪ] or [i] – as you can hear in this recording of Adon Olam sung in Tunisian Hebrew.
In summary, the possible Sephardic pronunciations of tzere are  [ɛ], [e], [e̞], and [ɪ] or [i]. A caveat: These vowel sounds are not really discrete categories; rather, there is a continuum of vowel sounds stretching from [ɛ] to [i], and the separation into five categories is something of a convenient fiction.
Comment: +1, excellent exposition. It might be worth noting (or maybe not) that Hebrew's _tzere_ or _segol_ is frequently transcribed in IPA as [e] or [ɛ] irrespective of how it's pronounced (except when comparing Hebrew to other languages or various Hebrew speakers to one another).
Comment: What happens when a Yud follows a tzere? Is the yud simply silent and the same rules apply?
Comment: @Ramin Yes, I think the yud is silent in that case.
Comment: @Malper, in that case why is עָלַי pronounced "alay" and not "alah"?
Comment: @Ramin Because yud is only silent after tzere and hiriq.

How do sefardim pronounce the tzerei?


Tourist speeding fine in USA

Question: I got stop for speeding in United States (New York City) and I was issued a summons stating my offence. I was than told to mail it back to the court, stating if I plead guilty or not. I did so when I was in Las Vegas and mail it through the concierge at Monte Carlo. I came back to Singapore and after almost a year, I have yet receive my summons. I was told by my friends who were caught for speeding that they received their summons after 6 months. After reading some forums, I heard that if I fail to pay the fine, and return to the US, I might get arrested at the airport. I will have to pay the fine with interest. I have the intention of returning to the States, and I'm worried.
Comment: What is your question?
Answer: Simplest answer to all your questions:  If you're worried pay the fine and forget this ever happened.  NY state is not likely to pass along traffic violation information to Singapore.
So with that in mind: you could try and go to NYS Traffic Violations Page and pay your ticket, unless of course you decided to plead "Not guilty" or your violation required a mandatory court appearance.
For New York City this may be different but the back of your ticket should have information on how to plead and pay your ticket online.  Most forms are available from NYC.gov (though for some reason seems to be broken today).
If you mailed in your ticket with a guilty plea and you expect back documentation on what the amount of the fine should be, you shouldn't have anything to worry about, whenever this arrives.
Comment: Hi karlson, thanks for the reply. As I return the post in Las Vegas, I'm not sure if the mail manage to get to NYC. Thanks for the reassurance. I will checkout the link you provided. Thank you.
Comment: @Alexlim Standard first class mail for letters is 2-5 business days depending on source and destination.  Las Vegas to NYC would be at most 4.
Answer: Unfortunately if you didn't pay it on the web and mailed a check, there's no confirmation that you paid it. Just rest assured knowing that you paid it.
Besides, moving violations like speeding tickets aren't offenses people get arrested for by themselves. US border agents won't arrest you unless there is an outstanding warrant for your arrest, an unlikely scenario unless you committed a crime while speeding. However if you have an outstanding speeding ticket, you will be subject to additional screening upon re-entry to the US. Further information can be obtained here.Good luck and sleep a little better knowing you won't be arrested upon re-entry if they didn't receive your letter ;-)
Since you're expecting a summons, I'm guessing you pleaded not guilty? Wouldn't it be more expensive to show up for court in the US then just paying the ticket?
Comment: Hi Stephan, thanks for ur reply. I have pleaded guilty. I'm awaiting their respond on the amount for the fine. Apart from being arrested, I'm worried that the interest can double the fine or more if I return to US a few years later.
Comment: There is no such thing as interest on a fine.  Just administrative and other fees.

Tourist speeding fine in USA


Any setup to version control ALL ubuntu settings?

Question: Just now, I had to google for the third time in my life on how to disable that thing
in Ubuntu, where you hold the super key and a help window pops up.
Granted, there was a few months in between, but I shouldn't have to remember these things anyway.
And even if I had perfect memory, I still don't want to

Launch ccsm
Navigate to Ubuntu Unity plugin
Search where in these 4 tabs is the option that I want
to disable that I've disabled times before, and there's no
conceivable scenario where I'd want to use it.

Note here that I have nothing against this setting being enabled by default:
maybe it's actually helpful to a lot of new people.
I just want to have an option to disable it once and for all for all my systems.
My plan is to version control all these settings, and each time I make
a change in the GUI, I'll make a patch that does it automatically next time.
The question is where are these settings? I think they're stored in xml somewhere.
Here's the current state of my patch:
gsettings set org.gnome.desktop.wm.preferences button-layout ':minimize,maximize,close'
gsettings set org.gnome.desktop.wm.preferences theme 'New Wave'

I don't know if I can set all the settings with just gsettings, maybe there are
more tools that do this.
Answer: Those settings are all within your home folder, so backing up .config, .gnome and so on should do the trick. You can use unison to sync those across devices.
Comment: Could you please elaborate the `so on` part. That's the reason why I asked the question.


What exactly is AD&D?

Question: I am considering getting a new Dungeons & Dragon set, and I am considering getting AD&D, but what really is AD&D? Does it involve more combat compared to 4e? Does it add more classes compared to 4e? Is it more roleplay oriented?
Comment: "More" relative to *what*? Also, when you say "new" – do you just mean new *to you*? Because there hasn't been new material published for AD&D in almost twenty-five years. TSR, the company that published AD&D, went bankrupt in 1997 and sold the D&D property to Wizards of the Coast, who have not used the "Advanced" moniker for any of their D&D offerings.
Comment: @KRyan I'm guessing that they found both D&D and AD&D things and are wondering what makes AD&D advanced
Comment: @thatlonelyeladrin please explain more of the context here of how you're looking and where you're finding these things...
Comment: Hey ThatlonelyEladrin, I see that you visit the site occasionally; do you have an interest in clarifying what you meant when you asked this so it can be reopened?
Answer: Advanced Dungeons & Dragons is from 1979*. It's not related to Dungeons & Dragons from 2014 (a.k.a D&D 5th edition), except that it's an ancestor of it. Put another way: AD&D is the 1st edition relative to which D&D (2014) is counted as the 5th edition.
The reason it was called "Advanced" back in 1979 is because it was compared to the original game and a simpler version (called "Dungeons & Dragons" and "Basic Dungeons & Dragons", respectively). The "Advanced" was also tacked onto the front for (ultimately futile) legal reasons having to do with the split between the two creators of the original edition of D&D (now called "OD&D" for clarity, since the naming and numbering of D&D editions is confusing). Relative to those editions from the 70s, yes, AD&D has more options and rules.
How does it compare to current-day D&D? I would say it's roughly the same amount of complexity, actually. Characters are mechanically simpler with fewer moving parts, but the rest of the rules are less unified and therefore somewhat more complicated to learn. In play experience, it's about the same complexity.
Do you want it? Almost certainly not. If you were deliberately looking for an old edition of D&D, then you might be interested in AD&D, but if so you'd already know what AD&D was.
Why is AD&D still being sold then, if it's ancient? Because lots of people never stopped playing it, or stopped and then returned to that edition. Everyone has a favourite edition of the game (because they're all so different as to be effectively separate games), and WotC clued in a few years ago that they could make decent money by putting AD&D and other previous editions back into print.
* The precise year is debatable actually: the AD&D Monster Manual was 1977, the PHB was 1978, and the DMG was 1979. I'm using 1979 because that's when AD&D was "complete" enough to play as "AD&D", but a 1977 date would also be perfectly accurate.
Comment: @nitsua60 We have [How many editions of Dungeons & Dragons are there?](http://rpg.stackexchange.com/q/336) and [What are the big differences between the D&D editions?](http://rpg.stackexchange.com/q/13212) (plus [How can I learn about other editions of D&D?](http://rpg.stackexchange.com/q/36358)). Are you thinking of something not covered there?
Comment: do you think there's a place on rpgse for a CW question: "what are all these different editions" with an answer: some sort of chart that delineates official name, pub date, company, common name, and a signature feature or two? And links to these various edition-comparison questions?
Answer: AD&D was and is, exactly, Advanced Dungeons and Dragons: a successful attempt by the game's author to improve and expand upon the original Dungeons and Dragons (1973-1975 vintage) during the game's first decade.  AD&D's core books were published in 1977-1979.
A parallel revised (and less complex) version, Basic Dungeons and Dragons, was followed and superseded by the Basic, Expert, Companion, Master and Immortal sets.  (Often called BECMI)
All of the above were published by TSR. (Thanks to various corporate actions, Wizards of the Coast now has the rights to Dungeons and Dragons.)
I am considering getting a new Dungeons & Dragon set.
The newest Dungeons and Dragons set is Fifth Edition, published by Wizards of the Coast. (5e for short).
I am considering getting AD&D, but what really is AD&D?
It is a 20+ year old Dungeons and Dragons system that was published by a company that no longer exists ... in two editions.  I bought and played the original.  I bought "Advanced Dungeons and Dragons" in the late 1970's, and the Second Edition AD&D in the early 90's.
Does it involve more combat compared to 4e?
No. How much combat is emphasized depends on whose campaign you are in.
Does it add more classes?
No.
Is it more roleplay oriented?
Not by itself.  Depending upon the group you played with, role play was or is emphasized more or less.  Lots of room for role play, and lots of room for dungeon crawls that go from one fight to the next.
When all is said and done, the play experience between AD&D and D&D is similar.
When Wizards of the Coast published their first version of the game, they dropped the "Advanced" and fused the Basic and Advanced versions of AD&D into a single game again, Dungeons and Dragons.  That is now referred to as Third Edition Dungeons and Dragons.
Personal experience:
I've been playing Dungeons and Dragons since 1975, which is the year after it was first published.  Most of my experience as a dungeon master was in AD&D first edition.  I'd recommend 5e, even so.  It was good enough to bring me back.

What exactly is AD&D?


Can I work while upgrading?

Question: As the title says, I want to upgrade Ubuntu to 11.10 but I must keep working my whole day. I don't mind a couple of reboots, but I need to work my day. Can I still fully work while it upgrades or does it blocks the system?
Thanks.
Answer: I'd say no. The upgrader itself says you shouldn't do work while upgrading a system.
With that being said, I've done all sorts of things - normal word processing, compiling things (that was stupid) and web browsing (just to name a few), the only thing that has given me problems has been compiling things while doing an upgrade.
However, to be on the safe side, don't do it.
Answer: It's just like doing your regular updates. You can keep working but might have to restart a few times. Better still, just to remain safe, make a backup of all the work you have done and also all the work you'll be doing during the updates frequently.
Answer: When you upgrade & after backing up your current data, you'll see a status window showing the steps of the upgrade, labelled 'distribution upgrade' or something like that. In that window, Ubuntu will check off each step of progress as they are completed:
Preparing to upgrade
Getting new packages
Installing the upgrades
Cleaning up
Restarting the computer
It is near the "Restarting the Computer" phase that Ubuntu wil reboot into the 11.10 release & all unsaved data will be lost.
I would personally wait until you have a a spare hour or two to upgrade to prevent any possible loss of data or interruption from work.

Can I work while upgrading?


Got approved and rejected for pretty much the same edit (removing thanks)

Question: Should I or should I not edit questions like I attempted here?
Rejected
Approved
Comment: TL;DR: Editing hugely old posts in such minor ways - even if it's in a *correct* way - isn't really worth anyone's effort.
Comment: @J.Steen I disagree. There's a mountain of content on this site which could do with improvement. Google isn't only interested in results on the front page. If someone is willing to go to the effort of tidying up old content, why not let them do so? It improves the site as a whole, even if you think it's too unimportant for your time.
Comment: @Basic - Did you look at the edits? Do you honestly find [this one](http://stackoverflow.com/review/suggested-edits/6337952) to be anything but a waste of four people's time?
Comment: @MartinSmith No... And I agree I should've. My mistake. I believe my point is valid for users who have enough rep to make a change without filling up the approve edit queue. It's been a while since I've needed edits approved so I commented without thinking in enough detail. I agree that making others approve minor edits is a waste of resources [vote reversed]
Comment: @J.Steen SE disagree with you also, has [minor edits](http://meta.stackexchange.com/questions/149722/approve-as-too-minor) are to be approved if they improve, even so slightly, a question or answer.
Comment: @JonathanDrapeau My beef - or that of the post I was paraphrasing - isn't "too minor". It's "too minor" and "sodding ancient" and "reviewed". There's no need to make such minor edits to such old posts and put it into the review queue.
Comment: @MartinSmith I find this argument hard to follow. It's not like the suggested edit queue is constantly overflowing and we're struggling to find people to do reviews. We're in almost the exact *opposite* situation.
Comment: http://meta.stackoverflow.com/questions/267384/removing-someone-elses-thank-you
Comment: @MartinSmith It doesn't seem like much of a waste of time when the content of the edit is so clear and easy to review. What is it, one click? Also FYI: I didn't go out of my way to find something to edit; I was looking for a solution to a problem and saw that I could make an improvement when I stumbled upon these questions. The indefinite amount of people looking at the question in the future will be spared the  trouble of reading off topic content.
Answer: The official say on this is yes.
But I'll leave it to you to decide if you want to keep doing it or not, and to decide, have a look at the numerous discussions about minor edits.
Sometime those kinda of edits will pass and sometimes they won't, really depends on the people reviewing as many don't see these edits as good ones still.


Looking for a test tool for Flash-based web applications. Any ideas?

Question: I'm looking for a Selenium-like tool to test Flash-based web applications (specifically a guided interview with questions and form fields that the user navigates through to produce a document at the end). I would like to create automated scripts with set content to run through the tools for QA purposes.
Answer: There is flex-ui-selenium and flash selenium; both extensions to existing selenium RC adding flash communication capabilities to it.
Another quiet interesting tool with which some people around me have gone much farther is RIAtest. Its similar to the unit testing framework for flex called flex-unit but is used for GUI automation.
and finally I have remotely heard of flex monkey (yet anoter gui automation tool)
Comment: I've used all 3 with limited success.  Flex Monkey was by far the best in my own opinion, although depending on the application that you're testing, you may need to also purchase a flash builder license.
Answer: FlexMonkium is also an option. FlexMonkium: FlexMonkey Plugin for Selenium. It comes with a IDE in firefox for record and playback of Flash based sites. Prerequisite is you need to compile your flash application with the libraries provided for the objects to be recognised
Some links to check are http://www.gorillalogic.com/testing-tools/flexmonkium/flexmonkium-docs/flexmonkey-setup
A good tutorial collection is available in http://www.jamesward.com/2011/03/02/testing-flex-apps-with-flexmonkey-reloaded/


Is it possible to disable Copy & Paste in SSHD on Linux?

Question: Is it possible to disable Copy & Paste on Linux so that people using Putty or any other ssh client can't copy & paste from the server to their own machine?
Answer: You wouldn't be able to disable the functionality of another machine's rendering of the output your server sends to it.
The output on putty uses the rules setup in Putty for copying the data displayed on the screen. Meaning that the data displayed on the screen is the output from your server to the terminal and the source (Linux) no longer has control of that data.
You could change the installed options for each of the terminals connecting to your server assuming you have admin power over those machines as well.
As a suggestion for controlling things on the server side I would restrict the ability to display data that you wouldn't want copy/pasted or restrict access to the server at all from ssh for users. Meaning you could wrap a lot of functions in sudo or not allow access to databases or portions of the file system.
Answer: No; copy and paste happens on the client side and is invisible to you.


Commenting regular expressions

Question: Are there any common practises for commenting the regular expressions: inline comments referring different part of RegEx or general comment for all expression?
Comment: My rule of thumb for regular expressions is: if you need to comment the regular expression, it's too complicated.
Comment: There are but you need to be more specific. For example Bash supports inline comments and Python offers verbose regular expressions.
Comment: And always include this link: http://regexcrossword.com/
Comment: I don't necessarily agree that if you have to comment it, it's too complicated. A complicated regex can still save you tons of eye-glazing imperative code. Use a good descriptive variable name to assign the regex to. If it still isn't clear enough, use a brief comment to convey the original **intent** behind the regular expression.
Answer: This is somewhat a language specific answer, but no language is stated in the question.
The book "Dive Into Python" suggests implementing comments using Verbose Regular Expressions:

Python allows you to do this with something called verbose regular
  expressions. A verbose regular expression is different from a compact
  regular expression in two ways:

Whitespace is ignored. Spaces, tabs, and carriage returns are not
  matched as spaces, tabs, and carriage returns. They're not matched at
  all. (If you want to match a space in a verbose regular expression,
  you'll need to escape it by putting a backslash in front of it.)
Comments are ignored. A comment in a verbose regular expression is
  just like a comment in Python code: it starts with a # character and
  goes until the end of the line. In this case it's a comment within a
  multi-line string instead of within your source code, but it works the
  same way.

Example:
>>> pattern = """
^                   # beginning of string
M{0,4}              # thousands - 0 to 4 M's
(CM|CD|D?C{0,3})    # hundreds - 900 (CM), 400 (CD), 0-300 (0 to 3 C's),
                    #            or 500-800 (D, followed by 0 to 3 C's)
(XC|XL|L?X{0,3})    # tens - 90 (XC), 40 (XL), 0-30 (0 to 3 X's),
                    #        or 50-80 (L, followed by 0 to 3 X's)
(IX|IV|V?I{0,3})    # ones - 9 (IX), 4 (IV), 0-3 (0 to 3 I's),
                    #        or 5-8 (V, followed by 0 to 3 I's)
$                   # end of string
"""
>>> re.search(pattern, 'M', re.VERBOSE)                1

Source and further details here
This method has a slight disadvantage that the caller must know that the pattern is written in a verbose format and call it accordingly.
Comment: Rather than storing the pattern in a variable, you can use `re.compile` at the point where you define your pattern, and only store the resulting object.  That way, the pattern compilation flags (including `re.VERBOSE`) don't need to be separated from the pattern itself.
Comment: Really helpful answer, thanks! But how can I match a `#` if I'm using the verbose flag? By the way: the source links seems to be down.
Comment: Okay, so `#` can be matched literally when inside a character class: `[#]` (source: https://docs.python.org/3/library/re.html#re.X)
Comment: @JohnBartholomew In some cases you may not want to call `re.compile()` at the place you define the regex. To include the `VERBOSE` flag into the regex string you can put it in the inline form to the beginning of the regex: `(?x)`. See https://docs.python.org/3/library/re.html#re.X
Answer: In my view, a good practice is to concisely state in comments what the general idea of the regular expression is.  This saves other developers (or sometimes yourself) the hassle of copy-pasting the regex in a parser like RegExr, only to understand what it does.
Comment: RegExr will happen anyway, unless the dev is a regex savant.   But I agree with providing a general description; that's what I do with my regexes.
Comment: +1: Anything more detailed will end up being a crash course in regex as a comment.
Comment: Not only does it save the hassle of tedious examination of the regular expression to understand it, but it makes the intent of the original programmer clear, especially given the distinct possibility that the original programmer got the regular expression itself wrong the firs time 'round. Having said that, in a lot of cases assigning the regex to a good variable name can count a long way toward providing adequate documentation of intent.
Comment: This answer and the @zzzzBov comments make sense.
Answer: Typically, I will write a regex and not explain the individual pieces of the regex, but rather what it's purpose is. That is that what and why. This is a bit like asking "What should my comments look like?" to which one would say "Don't write what the code is doing, write why the code is doing what it does"
// Strip the leading "?" and remove the query parameters "offset=<integer>" & "count=<integer> so we have a pattern of the request"
var search = location.search.substring(1).replace(/offset=[0-9]+?&/g, "").replace(/count=[0-9]+?&/g, "");

Unless you are trying to teach someone about regexes via comments in code, I don't think explaining what each individual piece will do. When working with other programmers, you can safely assume that one would know something as global regular expressions.
Comment: you would be surprised...
Answer: I guess it really depends on how you're putting the regex together.  Generally speaking I think it would be a bad idea to put comments within the actual regex string itself (not possible in most scenarios, as far as I know).  If you really need to comment specific portions of a regular expression (are you trying to teach someone?), then break each chunk into separate strings on their own lines, and comment each line using the normal commenting process for your programming language.  Otherwise, pleinolijf's answer is pretty good.
example:
string myregex = "\s" // Match any whitespace once
+ "\n"  // Match one newline character
+ "[a-zA-Z]";  // Match any letter

Answer: I usually define a string constant whose name describes the overall purpose of the regular expression.
For example:
const string FloatingPointNumberPattern = @"[-+]?[0-9]*\.?[0-9]+";

You could add a comment above this constant to give it a description, but usually the constant name itself should be enough.
Comment: One extra thing I like about this answer is that if it gets used in more than one spot, the intent *has* to be carried around too - no forgetting to comment it.
Answer: In some scenarios, the developer(s) may be using regular expressions to match text outside of their typical domain. The original developers may have gone through a lot of iterations capturing various edge cases that might only have been discovered through that iterative process. Thus, subsequent developers may not be aware of a lot of the edge cases that the original developer(s) dealt with, even if they are aware of the general case.
In cases such as these, it may be worthwhile to document examples of the variations. The location of this documentation may vary depending on amount (e.g., not necessarily in the code).
One way to approach it is to assume that future developers will only have basic knowledge, like how regular expressions work, but not any knowledge that you either (1) had prior to development of the regular expressions that wouldn't necessarily be known to the future developers or (2) knowledge that you gained during development (e.g., edge cases that were discovered).
For example, if during development you say something like "Oh, I didn't know that X could take this form," then it's worth documenting that (and maybe the part of the regex that handles that variation).
Answer: Comments should add useful information that is not obvious from the code.

Make it easy to understand what the expression is supposed to do at a requirements level, either in the code itself or in a comment. What is the intent behind the expression, is it to validate email addresses or pick out Canadian phone numbers.
Make it easy to understand what the expression is actually doing, i.e. what the expression evaluates to. First try to make it clear by splitting up the expression, if you first check for all hyphens then remove all numbers then make that a two part expression with variables holding the intermediary values, it will make it much easier to read and the reader will be able to step through your logic one step at a time. (There is a famous answer to a question on SE where someone is trying to decipher some old code which involves bit manipulation '>>' and finding out if certain flags are set where the answer lays out not only what the code really does but how the question's authour should go about deconstructing this kind of code in the future which is exactly what I am trying to describe but I can't seem to find the question to link to)

There are few applications that need every last cycle, if you are pattern matching massive data sets then maybe there is a better way, maybe not, but for most things the extra execution time is not that big a deal.
And remember the next person to come across your code and fix a bug might be you in six months time and there is no way you are going to remember what it was supposed to do.
Answer: Extract the RegEx into a separate class into a with a meaningful name. Then I'd document the code with automated tests.
This will ensure

That the code actually works - also for corner cases
Ensures that a quick "bugfix" doesn't screw up a lot of corner cases
May document optimizations where backtracking is disabled

Naturally, your class may host several regex's.

Commenting regular expressions


Are the beaches in Rosarito Mexico clean enough for swimming?

Question: I know the Pacific is cold, and I'm OK with that, but I'm trying to find out if the beaches in Rosarito are clean enough for swimming. I love doing open water swimming and am comfortable in the ocean, I just have no idea if the water there is clean enough to do it on a regular basis. What are the water conditions like there?
Comment: http://www.semarnat.gob.mx/playas/playas_limpias/destinos/rosarito
Comment: I have been surfing just South of Rasarito in Popoltla and the K-38 area for 30+ years and have never seen a jellyfish
Answer: I'm quite familiar with Ensenada (considering purchasing a holiday residence there), which is 50 miles to the south of Rosarito. I assume you're asking because of the electricity generator and the transport docks in the northern part of Rosarito, so I'll scope this answer down to south of the fishing pier.
If you'll accept that, then the water quality is about as pristine as you'll find on the west coast with the possible exception of Cabo San Lucas at the tip.
What are the water conditions like there?
If 'water conditions' means clean, then it's fine.  If you mean surfing, I don't surf but never saw that many (for obvious reasons).  Those that were out surfing invariably wore wet suits.

The water temperature is not that great for me, but it's a matter of opinion.  Anyway... it's not the temperature of the water that will bother you so much as the jellyfish and sting rays.  Plus sharks come in to feed on the fish.  Also, the rocks are really sharp, both above and beneath the water and there's a danger of being pulled down and cutting yourself.
Summary: For me, western Baja is more about the climate, the nature, fishing, and health benefits than swimming. I would not associate that region with recreational swimming because you can do much better further north.
Adding because of commentary...
If you make an exploratory trip to the region for any length of time, I recommend packing a Delorme Communicator. I can't recommend this highly enough for travelling around Baha, especially on the Sea of Cortez side.
Comment: Very interesting reply. I didn't know they had a jellyfish problem there. Tell me more please
Comment: @JimBeam, did you walk along the shore after the tide went out?
Comment: no I did not. To be honest I have spent relatively little time in Rosarito. I'm trying to (at a distance) pick a good beach community that would also let me swim every day
Comment: @JimBeam, I think an exploratory trip is in order. Pick a spot equidistant between Rosarito and Ensenada and you'll find some communities that maintain jelly watches.
Comment: I have gone swimming in Ensenada and it is wonderful.


How did Joey not know Ross was the father immediately, if Ross was with Joey before he slept with Rachel

Question: Joey and Ross are together discussing the Europe story. Joey has Ross record himself to practice, and then Rachel comes in which is how they end up being videotaped, thus he's already wearing the red sweater. If Joey realizes the red sweater was the father's, and Ross was wearing the sweater, shouldn't he have known Ross was the father? I don't think they can pawn this off on Joey being dumb.
Comment: I think you've underestimated what can or can't be pawned off on Joey being dumb.  Remember, this is a grown man who somehow [doesn't understand sarcastic air quotes.](https://www.youtube.com/watch?v=bW8OkSJvhvE)
Comment: It's Joey. if it's not either Food or Pretty girl, nothing stays and bother him in his mind.. Simplish slow-witted guy who usually gets last glimpse on sarcasm(consider him being best friend of Chandler and still getting his sarcastic comments last)
Answer: I think:

Joey is aware of the history of Ross and Rachel, so (for Joey) the chances that the sweater is Ross', and thus Ross being the father, are slim to none. So that idea might have subconsciously flew over his head.
As far as we (audiences) are concerned, the episode with the red sweater was aired before the one with the videotape, so at that point, we didn't know and that's important.
You can blame it on Joey being slow-witted. I mean it's Joey. He has done worse than that. Also, the thing happened a month before the events of the red sweater, so it's Joey x 30.
Comment: "He has done worse than that." He, for example, forgot that his apartment used to have carpets before Monica took them up and buffed the floorboards.
Comment: @PaulD.Waite Yeah! That's Joey.
Answer: You're missing scene when Rachel told Ross about pregnancy. The one dubbed "Condoms only work like 97% of the time".
Joey reaction to the news from Ross show that he didn't suspected Ross to be father because he EXPECTED Ross to use condoms. And that Rachel/Ross child was effect of their secret agreement rather then accident.


Does adding an user to the apache group creates a security hole?

Question: Beginner question. I saw this mentioned on a website, considered a bad practice,but can't remember where and why. So, if I have an user which has access to files that Apache shouldn't have access, and I add this user to the Apache group, would that make a security hole. If yes, why (Apache shouldn't be able to access the sensitive files if for example the permission is 700) ?
Answer: Any permission setting can create a security issue in some environments, if the impact of the permissions are not understood.
Adding a user to a group, will generally not give any special privileges to that group. Files owned by the user will not normally be visible to members on that group, since you are probably not setting that group as the default group for that user.
If the user uses  sg or something to create files so that group has access to the file, then any members of that group will to the file.  If that person creates some file or directory and grants read-write privileges to that group, then potentially, a bug in the web server or code being served could be exploited to store arbitrary files in that directory, and serve that out.
In some kind of multi-tenant arrangement granting permissions to the apache group may allow a tenant to see data created and owned by another tenant.
In any case, just take some time and use the find command with the -gid option to filed files and directories on your system that belong to that group.  That will let you see what you are granting access to, when you add a user to a group.
Answer: you would generally run apache as a user with almost no privileges on the system.  Typically less than you would give normal users on the system.  The user running apache should have write access to almost nowhere, hopefully nowhere other than logging.  You presumably added a user to the apache group to give that user additional privileges.  are they privileges that the apache server process even needs in the first place?  Should these privileges be assigned to some other group with the user is part of instead of the apache group?


Unlocking SIM card Huawei Ascend Y530

Question: I recently bought Huawei Ascend Y530 which is SIM-locked in a swiss provider, swisscom that is. I checked through the web to find how can a sim-locked phone be used with any sim, but surprisingly I couldn't find something usefull.
There are a lot of entries, about companies that give you an unlocking code, by providing them, the device's IMEI. Unfortunately this doesn't come free of charge let alone the questionable reability.
I contacted Huawei to provide me with the code, but they couldn't.
The most relevant information I could find was from xda-developers forum, where someone can find a lot of information about rooting or unlocking bootloader but not on how to unlock the sim.
Another interesting question was Is there a free way of unlocking an Android phone from a particular network?. There, someone can unlock the phone just by giving the IMEI number. Rather sadly however, this app can only be used for a certain provider and a specific device.
I don't know if I factory-reset the phone will be unlocked or even rooting it.
Does anyone know how to unlock the phone, so as to use any sim card? Is there a way to get access to the SIM-unlocking code, just like it can happen with a lot of Samsung devices?
Answer: It's nothing to do with Huawei. You need to contact the carrier who you got the phone from.
Comment: Thank you very much for your answer! The thing is that the carrier will charge me a great ammount of money, much more than to buy a new unlocked one! I am looking for something similat to http://android.stackexchange.com/questions/2579/is-there-a-free-way-of-unlocking-an-android-phone-from-a-particular-network

Unlocking SIM card Huawei Ascend Y530


Is a circle the strongest 2D shape for containing internal pressure?

Question: I understand how a circle (or sphere if you want 3D) is the best shape for holding a vacuum inside a container, but what if you wanted to have a large positive pressure inside of the container instead of outside? Would a circle/sphere still be the best shape as far as material required to hold X amount of pressure?
Answer: Despite being difficult to manufacture, a sphere is the best shape for a  pressure vessel, but due to the manufacturing difficulties are more costly to make.
From the American Society of Mechanical Engineers website:

Theoretically, a spherical pressure vessel has approximately twice the strength of a cylindrical pressure vessel with the same wall thickness

Other sources agree with this, adding:

Spherical pressure vessels is preferred for storage of high pressure fluids. A sphere is a very strong structure. The even distribution of stresses on the sphere's surfaces, both internally and externally, generally means that there are no weak points.
Answer: Due to the fact that the pressure differential is the same everywhere around the surface of a sphere, it must be the strongest, therefore hold the greatest pressure, and withhold the greatest pressure, too. A circle won't hold pressure, as it is only 2 dimensional, and everything would escape!
Answer: It depends what you mean by 'best'
For a homogeneous material like steel a sphere will (in theory) be the lightest structure which will contain a given volume at a given pressure. However spheres do have certain disadvantages.
-They don't stack well, so if you are distributing industrial gases, for example,  they are difficult to store and transport and take up a lot of space compared to their useful volume.
- They are difficult to manufacture, especially in composites.
- Spheres are often not a convenient shape to handle, especially in applications like breathing apparatus and fire extinguishers where this is very important.
In practice the most useful shape for a pressure vessel is often a cylinder with hemispherical or ellipsoidal ends, often with one end concave to allow it to stand on its end. This is not quite as efficient in term of the minimum thickness of material required for the walls but this is often outweighed by the practical considerations already noted.
Most general engineering textbooks will have a section on algebraic formulae for calculating the stresses in various different types of pressure vessel.
It's also worth noting that composite pressure vessels are increasingly common. These are often made by winding a resin impregnated yarn around a former and as well as cylinders toroidal vessels can be made in this way, which come close to being as weight efficient as spheres but are generally more convenient. With composite materials it is also possible to orientate the yarn so as to have different strength in different directions, enhancing material efficiency, which is easier to do with a cylinder or torus than a sphere.
Scale matters as well so for very large scale bulk storage (eg LPG container ships) a lot of the problems with constructing spheres may become less relevant.
In terms of internal vs external pressure the most important difference is that external pressure will impose compressive forces on the vessel so some geometries may be subject to buckling in addition to simple stresses  but for common types of pressure vessel this won't make a huge difference in general design.
Answer: It's all about the fact that spherical shell would not experience bending if the load is evenly distributed over the surface (which is the case when pressure is the only load). The very idea of using shells is to create them of such shape that stresses due to bending would be low, and the load bearing capacity of the shell would be provided by the tensile forces (or by compression) arising in the shell (tensile/compression forces lead to much lower stresses than bending moments do). An interesting example devoted to load bearing capacity of shells is presented on the following webpage (it is devoted to so-called "shallow" shells, which have low curvature, i.e. they closely resemble plates, but can withstand much larger loads, exactly because compression in the material plays much bigger role than bending in this case):
http://members.ozemail.com.au/~comecau/quad_shell_shallow_shell.htm


Is there a color LCD display for an arduino?

Question: I currently have a Mega2560 with the LCD4884 Shield. The Shield is good for putting out text and simple pixel images. But I am wondering if there is something that has a full range of colours that would work with the Arduino? The screen size would only have to be a few inches in size.
Comment: I would personally think of this a shopping recommendation. To answer your question: https://www.google.com/#q=arduino+color+lcd
Answer: There are actually several shields that have color screens on them. Many of the shields are just regular mini TFT displays, however there are also touch screen ones.
Here is one from Adafruit that includes a MicroSD holder and a Joystick.
Here is one from Radio Shack that features a 2.8 inch screen with touch capabilities
As far as screen size, many of the screens are only about an 1 inch across, however the biggest I have ever been able to find are 2.8 in.
Comment: The 1.8" TFT from Adafruit with joystick & MicroSD is my favorite thing ever! Display + User Input. Majenko developed an epic library for it: https://github.com/cacycleworks/chipKIT_ST7735
Comment: [Here is one](http://www.ebay.com/itm/3-2-TFT-LCD-and-Shield-for-Arduino-DUE-TAIJIUINO-DUE-with-SD-Touch-control-/130940301269?ssPageName=ADME:L:OC:US:3160) from Elechouse in China on eBay, $30 3.2" TFT Color LCD with touch stylus and using the Adafruit GFX library.  Demo worked first try, instructions and software on the eBay page.
Comment: @Bob How responsive is it? Does it take a few moments to load new pictures? Resistive touchscreen?
Comment: @Anon you mean responsive to touch?  Interactive animation?  I don't recall any want for responsiveness but I only fired the demo up once.  I recall seeing a photo image and using the stylus in a simple "draw" program like in the eBay photos.  I could connect and load it again if you have anything specific you'd like me to look for.  I only got it working in the Arduino IDE, hadn't yet ported it to my favored AtmelStudio IDE.
Answer: There's also a 2.2" Adafruit TFT.
The nice things about the Adafruit displays are:
i) library support for both the display and the graphics core library. So it's easy to get it up and running.
The built in frame buffer reduces resource requirements on Arduino.
Answer: Another very cool screen is the official Arduino TFT LCD Screen. (Datasheet if you're curious.)
It's a 1.77" screen, with a resolution of 160x128. It has a micro-SD slot in it, which is easily accessible. It is a color screen, with up to 18 bit per pixel.
The extremely nice thing with this screen is that since it's officially supported, you don't need to do anything extra to support it. The official Arduino TFT library works perfectly with it. However, according to Jameco:

Library Update: There is a known issue with the TFT library supplied
  in IDE versions 1.0.5 and 1.5.4 Beta. You will need to replace the
  library. We have zipped up the updated TFT library for both versions
  available here. Just delete the existing library and copy in the
  replacement for the appropriate IDE version and restart the IDE. (IDE
  v1.0.5 or v1.5.4)

So beside that minor fix, everything should be easy and quick to work with. This page has some code samples which should make it easy to work with.


What's the right time to go back to the fountain to heal and buy?

Question: I'm sure everyone has had this issue at some point. Outleveling your lane enemy is usually the difference between life and death. So the question is when to hit the recall button. Interested in all lanes, all roles. For example, Support: hit recall when you have 620 gold to get that Philosopher's Stone.
Answer: The amount you return to fountain should always be minimized
You'll notice an experienced player returns to fountain much less often than a newer player. Less time at the fountain means more income.
We can break down the logic into periods of the game:
Laning
High level goals of laning phase:

Out farm your opponent
Control the tower
Get kills if possible.

Backing Tips:
Try to return after pushing your lane.
Make sure your opponent can't shove the lane and cause you to lose CS at the tower while you're returning
Try to return ONLY after you've saved enough to actually purchase something
What's the point to returning to heal, if you could have waited one more wave and purchased a big item to help?
Return if you need additional health or wards
This is tricky. Unless you feel like you're in absolute danger of dying to an attack or gank from the jungler then you do not need to go back.
Mid Game
High level goals of Mid game:

Push Towers
Control Objectives
Farm

Backing Tips:
Don't just back if you're low on health or mana
Even if you're low on health, if you're knowledgeable of the enemy and have map awareness, you can still farm and gain gold until you have enough for an item. This is especially true if you have life steal.
Playing a mage with low mana? Knowing blue is up in 15 seconds can save you a trip and valuable time.
Don't back when you know an objective is close
I know you're dying to finish your Infinity Edge, but what's it worth when you're back at base and your team just died at dragon?
If you find yourself in a position where you can get significantly stronger, ask your team to stall an objective while you purchase. Make sure you have vision of the objective before backing.
Late Game
High level goals of late game:

Objectives
Team pushing

Backing Tips:
Be sure to back with your team, or when you don't put them at risk
I've seen a lot of games lost from one poor initiation late game. If you're not with your team, you increase the chance of having your team killed without you. Back when you feel you're not going to place your team in a position when you're at base, and they're getting caught.
Know timers for objectives
If baron is up in 10 seconds and the enemy knows you're backing, you better believe they're going to start baron knowing they have an advantage. As I mentioned earlier, if you MUST back, let your team know to stall, and do NOT let the other team know you're backing.
That's just the tip of the iceberg, honestly. It all comes down to intuition. Best of luck
-- Taijii
Answer: I will start with general laning.  A guideline you really can't go wrong with is to buy when your laning opponent buys (or within a reasonable amount of time after).  It is essential to keep up with your opponent in items and consumables (wards and pots).  If you choose not to buy after your opponent does and he returns with items, you could end up in a sticky spot in terms of losing CS, being zoned, or even killed.
Supports should generally go back when their carries go back.  This is to prevent a pattern where only one of you is in lane at certain points.  If this happens, that one player will get completely zoned by a good opposing lane.  Supports should also go back when at risk of being bursted down (common sense) and during some situations such as no wards + no information on enemy jungler (meaning your carry cannot CS safely).
Answer:
So the question is when to hit the recall button.

Since an answer that covers every champion in every lane is beyond my sanity ability, here are some general things to consider before recalling:

Current gold.  Can you buy something essential to your build or that gives your lane an advantage?  If you're ignoring CS, can you afford GP items?
Relative experience.  If you're about to level up (especially lvl 6), it may be worth the risk to stay in lane and get a new ability.  If you have Catalyst, this level will also heal you.
Your opponents last recall/health.  Generally, it's safe to recall when your opponent does.  However, if they're low on health and have large sustain, it may be better to apply pressure instead.  Also be careful if they have teleport, since they can quickly re-appear in lane.
MIA's.  Low on health and the enemy team is MIA?  Good time to eat your blue pill.
Global objectives (baron, dragon, buffs).  Even at 1/3 health, some champions can help secure globals (smite) or protect their team while doing so (Janna's Monsoon).
Buffs and when they expire.  Low on mana but blue buff is available? Consider grabbing it instead of recalling.
Summoner Spells.  When playing with teleport, it's ideal to only recall when you can teleport back to lane.  Often it's better to use heal, clarity, etc before recalling.
Sustain (lifesteal, spellvamp, health and mana regen, etc).  If your opponent just recalled and you have the means to heal yourself, you can gain an experience advantage by staying in lane.
Other lanes performance.  Sitting at half heath after just killing your opponent?  Instead of recalling, check for other lanes you can gank.
Kill/Death ratio.  Play safer if first blood hasn't happened, or if you're behind in kills.  If you're ahead in kills, you can afford riskier play.

Rules are meant to be broken, and these are no exception.  Champions with great sustain can recall much less frequently, and champions with huge burst (LeBlanc) don't need much HP to be effective.  Sometimes it's better to save your heal/clarity than to use it and be forced to recall anyways.  Deciding when to safely leave lane is a very important aspect of this game, and ultimately relies on the player's best judgement.

tl;dr: Recall to shop important items and to protect yourself from dying.  Recall less if you have good sustain, are easily winning your lane, can help another lane, can take a global objective, or have newly acquired buffs (and enough hp to use them).
Answer: There's a lot of variables here. The basic goal is to wait until you can pick up a core item for your role without risking enemy champ free farming, lane partner dying or losing your tower.
If you are low enough to be killed you clearly don't have a choice - that aside, before leaving you should ask yourself -

Do I have enough for my core item(s)?
Will my lane opposition be able to free farm? (The AD carry in case of bottom lane)
Will I lose my tower or put my lane partner at risk?
Answer: depends, if i lane i go back when i kill their lane and push the creeps to their turret to deny them xp and possibly reset the lane. Or when you see they backed and are ahead of you in items, in which its not good to stay in lane as you dont want to put yourself behind. As in the jungle, i recall after i farm the jungle enough to but my gp5 or first item, possibly after the first or second gank to keep my lane presence on the map. but you are right to push their creeps and take their jungle to be ahead, deny your lane opponent xp and such.


Why Friday is Called "Jumua"

Question: Sunday is called as youmul ahad, and monday is youmul ithnain...
The rest of the days in a week except Friday are called with their number...
But what is the reason only Friday is called jumua?.
Comment: Hi, and welcome to the site. Although your question is more about Muslim countries than about Islam, "jumu'ah" is mentioned in several ahadith, and I think that makes this a good (but basic) on-topic question.
Answer: The linguistic meaning of "jumuah" is from the root word "jama3ah" (jeem, ayn, meem) which means to gather together. Yawm al-Jumu'ah is thus dubbed because the Muslims gather together for salaat al-jumu'ah (Friday prayers) in congregation -- this is not something you can do individually, but must be done in a group.
Speaking of day names, Saturday is "Yawm As-Sabt" and also does not follow the numbering convention.

Why Friday is Called "Jumua"


How do I change the default text editor in the Debian (squeeze) distro

Question: "Joe's own editor" does not come naturally to me. How do I change to using nano or vim?
I've tried
export EDITOR=nano

but it doesn't seem to be respected. I'd like visudo to respect this as well.
Comment: You're way should work but you have to manually export `EDITOR` each time you start the shell. Try this: `echo "export EDITOR=nano" >> ~/.bashrc`.
Comment: @BryanDunsmore No, not to `~/.bashrc`, to `~/.profile`. See [Alternative to .bashrc](http://unix.stackexchange.com/questions/3052/3085#3085)
Comment: Thanks Bryan, but it actually wasn't working at all. I'm not sure what the deal was b/c this works in other distros and environments for me.
Comment: It noticed this is the default also in Debian GNU/Linux buster (current stable). At least in the version provided by the OVH service provider.
Answer: To change the default editor at the system level:
sudo update-alternatives --config editor

and then follow the onscreen prompts.
Comment: If your editor isn't on the list, do this first (for geany) `update-alternatives --install /usr/bin/editor editor /usr/bin/geany 10`
Comment: This doesn't work for non-root users
Answer: The way to change the default editor for your account is to set the EDITOR environment variable. If that doesn't work for you, you've done something unusual. Check that you haven't also defined VISUAL, or if you have, give the two variables the same value (see VISUAL vs. EDITOR – what's the difference?). Add these lines to your ~/.profile (note: not to ~/.bashrc):
EDITOR=nano
VISUAL=$EDITOR
export EDITOR VISUAL

Under the Debian policy, all programs are supposed to support EDITOR and VISUAL to set the default editor.
Under Debian and derivatives, you can use the alternatives mechanism to set the system-wide default editor, as mentioned by Steve Robillard: run update-alternatives --config editor as root.
Comment: It is also changing an editor only for you, not for every user. There's a little possibility that someone may not be familiar with vim if you set it system-wide as default editor.
Comment: "Under the Debian policy, all programs are supposed to support EDITOR and VISUAL to set the default editor."  In a twist of irony, `editor` is not one of those commands. :/ https://stackoverflow.com/a/73307112/3196753
Comment: @tresf `editor` is the default to use when `EDITOR` and `VISUAL` are unset. There's a separate command which checks `EDITOR` and `VISUAL`, called `sensible-editor`. See the link for "Debian policy".
Answer: The solution mentioned above works, but it isn't scriptable. If you want to do this in a scriptable (non-interactive) fashion, you should use --set:
# update-alternatives --set editor /usr/bin/vim.basic

You can get a list of the choices with:
$ update-alternatives --list editor

Answer: I came across the very same issue, however setting it via update-alternatives did not quite do the trick on a Raspbian Buster (10.2).
Although I set vim.basic as my default editor (manually using update-alternatives --config editor), it had only a priority 30, while nano had a priority of 40.
root@rsyslog:~/scripts# update-alternatives --config editor
There are 4 choices for the alternative editor (providing /usr/bin/editor).

  Selection    Path                Priority   Status
------------------------------------------------------------
  0            /bin/nano            40        auto mode
  1            /bin/ed             -100       manual mode
  2            /bin/nano            40        manual mode
* 3            /usr/bin/vim.basic   30        manual mode
  4            /usr/bin/vim.tiny    15        manual mode

Press <enter> to keep the current choice[*], or type selection number:

I started poking around in the usual profile- and dot-files and came accross the following one:
root@rsyslog:~/scripts# cat /root/.selected_editor
# Generated by /usr/bin/select-editor
SELECTED_EDITOR="/bin/nano"
root@rsyslog:~/scripts#

After setting vim.basic via /usr/bin/select-editor, the file contained vim.basic:
root@rsyslog:~/scripts# /usr/bin/select-editor

Select an editor.  To change later, run 'select-editor'.
  1. /bin/nano        <---- easiest
  2. /usr/bin/vim.basic
  3. /usr/bin/vim.tiny
  4. /bin/ed

Choose 1-4 [1]: 2
root@rsyslog:~/scripts# cat /root/.selected_editor
# Generated by /usr/bin/select-editor
SELECTED_EDITOR="/usr/bin/vim.basic"
root@rsyslog:~/scripts#

Upon now I could do crontab -e with VIM again :).