Bio.codonalign.codonseq module (cal_dn_ds) for SARS-COV-2

Question: I have calculated the dN,dS ratio for a SARS-COV-2 data set ('NC_045512.2' (Wuhan strain) and 'LC666924.1'), and results in a zero value (for most of the genes).
Is it possible and what is the interpretation, for example negative selection?
Answer: Yes that is the expected result, because there are no amino acid mutations in the data sets you are using. Thus the numerator is 0 and anything divided by zero is always zero, even if every codon had a synonymous mutation.
The most precise interpretation is simply there are no amino acid mutations. It doesn't matter how you reword that, all divergence is resulting from synonymous mutations.
The only thing to watch out for is a rounding error, i.e. a single amino acid change is dropping off detection because dN/dS is incorrectly rounded.

A post was raised (now deleted) about what does that say about selection. dN/dS theory states that if it is significantly >1 thats positive selection .. etc. However, a truer representation of the data is there is no amino acid mutation, rather than their is a significant excess of synonymous to non-synonymous mutations. A zero value makes things tricky, and is exemplified by two hypothetical data sets one where every codon had one synoymous mutation (strong negative selection) compared against one that had a single synonymous mutation (little mutation) and both data sets had zero amino acid mutations - both data sets would have a dN/dS of zero but that is not a reflection of negative selection.

To answer the point below a single mutation is not a great basis draw statistical significance and the dN/dS ratio is not a good test if either the numerator or denominator are zero.
Most data is under negative selection in strict accordance with dN/dS.
Neutral selection is extremely rare.
Summary Sometimes the statistical analysis of a data set does not say very much ... and sometimes we have to accept that as an answer.
Answer: So if that had a little mutation, Does that mean it's a neutral selection?
And if the sequences (codons and amino) are exactly the same? We can say something about the interpretation?
See examples below-
ORF8
Seq1:
MKFLVFLGIITTVAAFHQECSLQSCTQHQPYVVDDPCPIHFYSKWYIRVGARKSAPLIELCVDEAGSKSPIQYIDIGNYTVSCLPFTINCQEPKLGSLVVRCSFYEDFLEYHDVRVVLDFI
Seq2:
MKFLVFLGIITTVAAFHQECSLQSCTQHQPYVVDDPCPIHFYSKWYIRVGARKSAPLIELCVDEAGSKSPIQYIDIGNYTVSCLPFTINCQEPKLGSLVVRCSFYEDFLEYHDVRVVL--I
ORF10
Seq1
MGYINVFAFPFTIYSLLLCRMNSRNYIAQVDVVNFNLT
Seq2
MGYINVFAFPFTIYSLLLCRMNSRNYIAQVDVVNFNLT
E
(The same)
Seq1
MYSFVSEETGTLIVNSVLLFLAFVVFLLVTLAILTALRLCAYCCNIVNVSLVKPSFYVYSRVKNLNSSRVPDLLV
Seq2
MYSFVSEETGTLIVNSVLLFLAFVVFLLVTLAILTALRLCAYCCNIVNVSLVKPSFYVYSRVKNLNSSRVPDLLV
Comment: I've answered above
Comment: @user18071336 If you have a new _question_ do not ask a question as an _answer_, post a new question, otherwise you will get downvoted and get banned by the system.


Bitcoin Number Formatting

Question: I want to avoid any precision errors when doing math on bitcoin values.
1) Is 'decimal' the best option to use for bitcoin currency in C#?
2) When converting from string to number, are there any precision errors I need to be aware of?
Thanks
Comment: From what I understand decimal is the preferred format for any high precision value
Comment: Please, do not include information about a language used in a question title unless it wouldn't make sense without it. Tags serve this purpose.
Comment: @OndrejJanacek why not include the language? It makes Google results easier to scan
Answer:
Bitcoin amounts can range from 1 Satoshi (0.00000001 BTC) to nearly
  2,100,000,000,000,000 (21,000,000 BTC). To avoid rounding errors, you
  must make sure your PHP implementation supports the full range of
  Bitcoin values without losing precision. Most PHP implementations use
  IEEE 64-bit double-precision floating point numbers with 53 bits of
  precision, which is enough to correctly represent the full range of
  bitcoin values.

Even-though this is related to PHP, it is still relevant. As suggested, you should use Decimal value type.

The last block that will generate coins will be block #6,929,999 which
  should be generated at or near the year 2140. The total number of
  coins in circulation will then remain static at 20,999,999.9769 BTC.
  Even if the allowed precision is expanded from the current 8 decimals,
  the total BTC in circulation will always be slightly below 21 million
  (assuming everything else stays the same). For example, with 16
  decimals of precision, the end total would be 20,999,999.999999999496
  BTC.

An example of a String being converted to Decimal and keeping precision:
var maxBtc = "20999999.999999999496";
var maxBtcDecimal = Decimal.Parse(maxBtc, NumberStyles.AllowDecimalPoint);

Converting back:
var maxBtcString = Convert.ToString(maxBtcDecimal);

Simple math:
var oneBtc = new decimal(1.000000000000);
var newBtcValue = maxBtcDecimal - oneBtc;

Comment: Using CultureInfo.InvariantCulture might save you some trouble too
Answer: Decimal is the best option available.
Take a look at this working C# bitcoin library that uses Decimal for bitcoin values: https://github.com/GeorgeKimionis/BitcoinLib
You need to be aware that in C# Decimal is not fixed-floating so you need to configure your O/RM or your DB to keep exactly 8 decimal points.
Answer: From MSDN

Compared to floating-point types, the decimal type has more precision and a smaller range, which makes it appropriate for financial and monetary calculations.

If you are doing mathematical operations on Bitcoin amounts, you should use Decimal.
Decimal.Parse()

should be used to convert from string to Decimal. See also this other Stackoverflow question

Bitcoin Number Formatting


Live webcam feed

Question: Are there any websites where I can setup up a live webcam feed that can be password protected so that only I can view it?.
Answer: I've used http://www.ustream.tv before.
When creating your "show", there is an option in the advanced tab for requiring passwords.
Answer: Most standalone IP cameras provide such website by themselves. If you have a webcam that works only through the computer, I doubt such thing will be possible without having some service running on your machine.

Live webcam feed


Is Gravity on a bell curve?

Question: Is there a point where gravity decreases the farther away from an object that is not related to distance?
Comment: Could you perhaps rephrase the question? It is difficult to understand precisely what you are asking.
Comment: Hi Jen. Can you clarify what you are asking? It has been suggested that at very large distances the gravitational force might depart from the Newtonian law - [MOND is an example of this](https://en.wikipedia.org/wiki/Modified_Newtonian_dynamics). However the departure from Newtonian behaviour is small.
Comment: I was actually looking for exactly what you asked about, don't know why this was closed.
Answer: Variables "on a bell curve", if I am interpreting you correctly, are random variables with probability distributions, that is, they are non-deterministic. Repeated measurements (or experiments) of random variables yield distinct results, with probability obeying a certain cumulative distribution function (CDF). One such distribution is the famous bell curve (shown are the chances of falling in certain intervals).
I guess your question can be rephrased as "Is Gravity non-deterministic?" -- that is, would we expect different results from repeated measurements of Gravity at the same distance from an attractive object?
The answer would be no, because the force of gravity is theoretically consistent across measurements. In contrast, Quantum Mechanics ellucidates phenomena at very small scales that indeed effectively do not yield the same results for repeated measurements.
Keep in mind that gravity measurement instruments, however, do measure "on a bell curve", because of error. The source of error is usually noise: a plethora a small interference effects (ranging from radio waves, vibrations, to thermal fluctuation of electronics).
If you get a chronometer and measure the height $h$ a ball released at time $t=0$ has fallen at time $t=1s$, you might expect from the effects of gravity alone the ball has fallen $g/2$ meters, giving a measurement of your local gravity $g$. However, in practice you won't obtain consistent results (that's an easy experiment to try yourself! you can do it by using smartphone video recoding and dropping objects against a measurement tape; you should get $g/2 \approx 4.9$).
Comment: @ACuriousMind he nailed it.
Comment: Please don't answer unclear questions with wild guesses as to what they might mean.

Is Gravity on a bell curve?


What was the purpose of Flynn Rider's real name in Tangled?

Question: Revealing that Flynn's real name is Eugene seemed a little bit out of the blue. I understand that his past as Eugene was very different than how he presents himself as Flynn Rider, but the whole name change that late into the movie felt out of place and added nothing to the story (at least for me). It has been a while since I've seen the film so my memory is hazy, but this has been something that has nagged at me since the first time I saw it!
Answer: Because "Flynn" is a persona he developed, a thief. Reverting back to his birth name indicates his dramatic change of heart -- due to falling in love with Rapunzel.
As described by Conny Eisfeld in her book How Fairy Tales Live Happily Ever After: (Analyzing) The Art of Adapting Fairy Tales:

In the end, Rapunzel does achieve a transformation of the formerly insincere Flynn towards his more humane Alter Ego Eugene as well.
Answer: His true name and backstory (i.e. being an orphan) were revealed about halfway through the movie. He revealed his name because he thought they were going to drown in the cave filling up with water (which made Rapunzel reciprocate with the info about her hair, giving her the idea that saved their lives). He shared his backstory because he trusted her after that, showing that he's started to change. It's also because he's starting to like her (as Rapunzel mentions right afterwards to Mother Gothel: "I think he likes me").
At the end of the movie, he mentions that he's going by Eugene again. This, along with the fact that he's stopped being a thief, shows that his transformation is complete. (And we see this is true in events that happen after the movie.)
Also, the first episode (transcript) of the animated series gave me the impression that he adopted more than just the name (well, that and Varian seems like an idiot):

Varian: I've read every single book about you!
Eugene: Oh well, um, you see, that's not actually me. I just took the name from the book.
Varian: Hey, hey! Remember the time you dueled that evil knight, blindfolded?
Eugene: No, no, not me.


What all do I need to buy when installing new transmission and torque converter

Question: I'm installing a rebuilt automatic transmission in my 1992 Chevy Silverado 1500 extended cab two wheel drive. What all should I buy at the parts store besides transmission fluid , pan gasket and new filter? Also changing out the torque converter.
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Answer: If this is a newly rebuilt transmission which comes with a warranty, you won't need to replace the pan gasket and filter. These should be brand new and already be installed. Obviously you'll need the fluid. Your best bet with fluid is to use DEXRON VI, which is a fully synthetic fluid used in GM transmissions. It is fully backwards compatible and replaces DEXRON III. Use DEXRON VI unless you are specifically told not to by the transmission refurbisher.
If this is newly rebuilt but has miles on it since the rebuild, you'll want to replace the input and output seals to ensure those are fresh. Lube the seals with transmission fluid so they aren't dry or the installation of torque converter and slip yoke might damage them. You'd also want to replace the filter and gasket as you originally suggested (not absolutely needed, but I'd do it just to be on the safe side ... you never know). Consider getting a new seal for the dipstick tube, as replacing this before you put the transmission in is a lot easier then when it's in the vehicle.
As far as things to look out for ...

As GdD stated, the exhaust is a big thing. Look out for rusted nuts/bolts at the exhaust joints. These can not only stall your progress, if they are rusted enough, you might have to replace exhaust parts to get it back on the road. If you hit these fasteners with PB Blaster several different times (on different days) prior to doing the work, it will help tremendously.
Check your u-joints before pulling the driveshaft. Any movement other than allowing it to go around is bad. Tape the caps on the u-joint when you pull it down so they won't fall off. This will save you a LOT of headaches. EDIT: What I mean by "movement" is, while the driveshaft is still attached, grab ahold of it and shake it in several different directions to see if it will move. I'm mainly talking about vertically and horizontally perpendicular to the driveshaft. Do this at both ends of the driveshaft (transmission and differential).
Check the yoke's slip joint surface where it enters the transmission to ensure it is smooth. If there's a valley dug into it, it won't seal very good and you can lose transmission fluid out the back end.
Transmission lines can be a PITB. Tube wrenches can come in handy to help you separate them. Be careful not to cross thread them during reinstallation or you'll never get them to seal.
Ensure you put transmission fluid in the torque converter (TC) prior to installation. If you put it in the transmission dry, you will destroy it on startup. A quart should give you enough without it all pouring out as you're installing it into the transmission.
When installing the TC into the transmission, you should feel three separate "thunks" as you turn the TC to fully engage the transmission. If you do not feel three distinct thunks, you probably do not have it fully engaged. If it isn't fully engaged, you will destroy the transmission pump on startup which is located at the front of the transmission. When the TC is fully engaged, it should be well behind the mounting face of the transmission bell housing.
Before installing the transmission, you need to clean the cooler lines. Purge them of all old fluid and flush them out. Most transmission rebuilders require this with their transmissions or you void the warranty.
As GdD stated, check the transmission mount. There should only be one of them at the tail of the transmission. If it is cracked in any way (which is common) you'll want to replace it.
Comment: This is a great reply - might want to specify what you mean by "Any movement other than allowing it to go around is bad". It took me a couple tries to understand it and I believe that's only because I know what you're talking about.
Comment: Rear engine seal.
Comment: @Jupiter - Possibly. Though, it's one of those things ... *if it ain't broke, don't fix it.* If the rear-main isn't leaking and you replace it and don't do a good job of it, you could be introducing a leak which wasn't there in the first place.
Comment: @iDriveSidewayz - Edit has been inserted. Let me know if this is clearer or if I need to update further.
Comment: @Paulster2 I respectfully disagree. This is a 1992. The seal is old and inexpensive. It is expected to install correctly. It could start leaking at any time. If done now the tranny will not have to be removed to replace it in the future.
Comment: @Jupiter - Actually, you may be right. The rear main seal for the SBC (assuming that is what is in this vehicle) is a one piece design, which is in a housing. Remove the housing and replace is not too hard and can be easily accomplished on the bench. I think I'd still be judicious about it, though. If it's been done in the past (since manufacture), it might be something to weigh the options on. Rear mains are still a fickle beast. If not put in exactly square, they'll leak, then you've created a problem which wasn't there in the first place.
Comment: Yes they can be fickle. Once replaced one on a viscous coupler without stops. I knew it was just a slight bit out of square and let it go. That was an embarrassing comeback. If time is on a dead line it might be a good idea to buy 2 seals just in case, especially if someone has little experience. Lucky for me all I had to do is drop the driveshaft and 4 bolts later had access.
Answer: Much of this depends on the condition of certain items and whether you can re-use them. Basically, if you have to take it off to replace the transmission make sure you have what you need to put it and everything else back on.  I'd look closely at these before you start:

Transmission mounts: if they are worn or cracked then you'll want to replace them
Badly rusted bolts
Driveshaft hardware: as your driveshaft has to come off it's a great time to replace worn bushings, mounts, etc.
Exhaust gaskets/parts: if you have to take off your exhaust to drop the transmission
Answer: Do the rear main seal on the engine while you're in there.  100% do this.  Also inspect flywheel for cracks, missing teeth and warpage.


My Save Button is not working

Question: I have one custom object called (FeedbackFrom__c) in that I having 10 fields, each fields having different VF Pages at page no 11, I am having one save button if I click that automatically 10 fields needs to save in the object how I can achieve this?
Answer: You can use Wizard - Creating a Wizard
We need to create 10 VF page with one single controller.
Define each field as input field in VF pages under apex:form tag.
We need buttons prev, next, cancel on each page to navigate between the prev/next VF page or to cancel the whole operation. And Save button will going to be on last page.
Each button action we have to define in our controller which will return the page reference of the VF pages.
Define a variable of type 'FeedbackFrom__c'(Let say fbFrom) in controller and getter for it.
use that variable reference in VF page to save values in fields {!fbFrom.FieldName__c}
On Save button insert the fbForm (FeedbackFrom__c).
Comment: While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference.  Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/66201)
Comment: @Eric yeah, you are right!

My Save Button is not working


Reading an image inside a temporary file on raspberry pi 2

Question: I've been looking all night to find a solution or at least understant where the problem is comming from so here i am.
I'm runnning a Flask server linked to my Apache with wsgi.
I am recovering a picture from a user webcam as base 64 string (recovered from URI) and writing it on a temporary file.
I am doing the same for a profile picture (like Facebook) of the user on another temporary file.
<code>    # Decode base64 to image data
    imgdataCam = stringBase64Cam.decode('base64')
    imgdataPro = stringBase64Pro.decode('base64')

    # Create temporary files
    tempFile1 = tempfile.NamedTemporaryFile()
    tempFile2 = tempfile.NamedTemporaryFile()

    # Write images data in files
    tmpImg1=open(tempFile1.name,'wb')
    tmpImg1.write(imgdataCam)
    tmpImg1.close()
    tmpImg2=open(tempFile2.name,'wb')
    tmpImg2.write(imgdataPro)
    tmpImg2.close()
</code>
Later, i'm trying to read those files (temporary files still not closed so they still exist) as
<code>    img1 = cv2.imread(tempFile1.name)
</code>
But it looks like nothing appens, i made some prints everywhere and it looks like "cv2.imread()" is stoping my program without any error message.
I also tried to read those images with PIL like that:
<code>    pilImg1 = Image.open(tempFile1.name).convert('RGB')
    ocvImg1 = np.array(pilImg1)
    img1 = ocvImg1[:, :, ::-1].copy()
</code>
With PIL i'm able to read the file but i get the same problem as imread with
<code>    greyImg = cv2.cvtColor(img1, cv2.COLOR_BGR2GRAY)
</code>
Later on my program.
Everything is running very well on my laptop but once i uploaded it on my raspberry pi, i get thoses problems.
Could someone help me understanding where it is coming from please ?
It is also working well when i'm running my flask serveur with "python init.py" on this raspberry.
Answer: I Finally managed to find where the problem was comming from.
I was not able to read the file on my raspberry as it was using wsgi and apache and had no permissions to access those files. I fixed my isues by adding the following line to my apache vHost configuration file (/etc/apache2/sites-available/myapplication.conf):
<code>WSGIDaemonProcess fbApp user=www-data group=www-data threads=2
</code>
I still don't understand why Opencv didn't return any errors. Hope it'll help someone with the same problem.


How did Krishna go from being a mischievous kid to playing a major role in the Mahabharata war?

Question: How did Lord Krishna get involved in the Mahabharata war? What I mean is, Lord Krishna was born and grew up in Vrindavana and was playing with Gopis throughout his childhood, so how did he actually get involved in big battles like the Kurukshetra war? What was the turn of events?
Comment: Why are people voting to close as unclear?  It seems perfectly clear what he's asking: how did Krishna go from a mischievous kid who played with Gopis, to someone who's involved in big battles like the Mahabharata?
Comment: War, not battles.
Answer: Krishna wasn't actually born in Vrindavana.  As described in this chapter of the Srimad Bhagavatam, Krishna was born in Mathura to Vasudeva and Devaki, who had been imprisoned by Devaki's cousin Kamsa because he had heard a prophecy that the eighth son of Devaki would kill him.  To protect Krishna, Vasudeva smuggled him out of Kamsa's prison and gave him to Nandagopa and Yashoda.  It's after that time that Krishna grew up in Vrindavana and the surrounding areas stealing butter, performing miracles, playing with Gopis, etc.  Then he went back to Mathura, killing his evil uncle Kamsa and freeing his biological parents from prison.  Kamsa's father Ugrasena was restored as king (as Kamsa had deposed him earlier), Vasudeva was made crown prince, and ever since then Krishna lived as a prince in Mathura.  (And except for one or two occasions he never saw Nandagopa and Yashoda again, as I discuss in this answer.)
It's only after returning to Mathura that Krishna started getting involved in the events of the Mahabharata.  First of all, Vasudeva's sister was Kunti, mother of (some of) the Pandavas, so Krishna sent his advisor Akrura to Hastinapura to find out how his cousins the Pandavas were being treated by Dhritarashta, as described in this chapter of the Srimad Bhagavatam.  And then Krishna and Balarama saw the Pandavas for the first time in the Swayamvara of Draupadi (recognizing them in spite of their disguises), and afterwards he talked to them, as described in the Adi Parva of the Mahabharata:

Then Vasudeva approaching that foremost of virtuous men--the son of Kunti--and touching the feet of that prince of the Ajamida race, said, 'I am Krishna.'  And the son of Rohini (Valadeva) also approaching Yudhishthira, did the same. And the Pandavas, beholding Krishna and Valadeva, began to express great delight. And, O thou foremost of the Bharata race, those heroes of the Yadu race thereafter touched also the feet of Kunti, their father's sister. And Ajatasatru, that foremost of the Kuru race, beholding Krishna, enquired after his well-being and asked, 'How, O Vasudeva, hast thou been able to trace us, as we are living in disguise?' And Vasudeva, smilingly answered, 'O king, fire, even if it is covered, can be known. Who else among men than the Pandavas could exhibit such might?'

And ever since then Krishna's association with the Pandavas grew.  Arjuna married Krishna's younger sister Subhadra, for instance.  (She's the mother of Arjuna's son Abhimanyu.)  Later Krishna and Arjuna helped Agni fight off Indra so he could burn down the Khandava forest as I discuss in this answer.  And shortly thereafter,  since Krishna was an incarnation of Vishnu, Yudishthira made him the chief guest of his Rajasuya Yagna.  Krishna continued to help the Pandavas, for instance saving Draupadi from being disrobed as described in this chapter of the Sabha Parva of the Mahabharata.  And then after the Pandavas came back from exile, Krishna went as a peace envoy to the Kauravss on behalf of the Pandavas.  And last but not least, Krishna of course served as charioteer of Arjuna in the Kurukshetra war.
So to sum up, the reason that Krishna's life changed so dramatically from his days as a cowherd was because he reclaimed his status as a prince once he went back to Mathura and killed Kamsa.  And the reason he became so intricately involved in the events of the Mahabharata is that the Pandavas were his cousins.
Comment: Revisiting this thread and few things don't seem right. (1) *`... and ever since then Krishna lived as a prince in Mathura.`* Missing Dwaraka where he stayed big part of life even before Mahabharata. (2) *`And the reason he became so intricately involved in the events of the Mahabharata is that the Pandavas were his cousins`* Though unintended, this is undermining the stature of Krishna. The correct statement should be: "Krishna was involved to re-establish the Dharma which was in favor of Pandavas"
Comment: Very clear and detailed answer, thank you Keshav.
Comment: @a20 Thanks!  If you find this interesting, you might also be interested in another answer of mine on a similar subject, namely how Krishna went from someone that people thought was an ordinary human to someone who was known to be an incarnation of Vishnu: http://hinduism.stackexchange.com/a/3427/36
Answer: Lord Krishna was involved officially in the Mahabharata when Arjuna and Duryodhana went to Lord Krishna's palace to seek his help.
Lord Krishna told that he would help both of them and gave his options

Those want him to be on their side, but he wouldn't use any of his weapons.
And those who want to have his huge narayani sena to be on their side.

Lord Krishna gave his first choice to arjuna as he came first and he sat at lord's feet.
Arjuna chose Lord Krishna to be on his side, in-spite of his assertion that he wouldn't use any weapons and whereas duryodhana got the narayani sena.


Displaying positions in expression tree

Question: Can one display the position of each character in an expression tree? For instance: g[h[i, h], l] should be displayed using TreeForm where each character is replaced by its position in the tree. I can mimic this with  TreeForm[0[10[11, 120[121, 122]], 2]]. However, I want the true representation of the positions (using the usual list notation for positions, i.e. {0} instead of 0, {1,0} instead of 10 etc. Is there a way to apply the Position function to each such character in the tree and display the positions in TreeForm?
Answer: Perhaps you can convert the heads to the desired strings using MapIndexed:
TreeForm @ MapIndexed[
    ToString @* Last,
    g[h[i,h],l],
    {-1},
    Heads->True
]

Comment: Thanks. This does the trick. Is it possible to just apply matters in one go, i.e. avoiding the need to use both  {-1} (i.e. the leaves) and Heads -> True (to apply it to internal nodes, i.e. non-leaves). In other words, is there a way to apply something directly to all nodes of the expression tree? Or is Mathematica set up to distinguish strictly between leaves and internal nodes? (As seems to be the case from its convention to drop the final zero in the leaf positions).

Displaying positions in expression tree


How could we search for life in TRAPPIST-1

Question: It is possible to search for life from here, how?
What methods could be used?
It is possible to look for organic matter?
Could we know if there is life according to the components of the planets atmosphere?
Answer: As far as I know, and aside from direct communication, there's only one way to "find life" on another planet. That method is to look for molecular oxygen in the atmosphere. Molecular oxygen hates existing by itself and loves to combine with other atoms and molecules through oxidation. The Earth's atmosphere is currently ~30% $\mathrm{O_2}$, but that's only because we have a huge amount of plant life (primarily algae) constantly producing it. If you removed all life from the Earth, the oxygen in the atmosphere would quickly oxidize out and you'd be left with an atmosphere primarily of nitrogen and a few smaller constituents.
What this means is that if we do see a substantial amount of oxygen on a planet, the best bet is that that oxygen was artificially produced by life. It's not ironclad evidence, but its a very strong indicator. We can search for oxygen through a few techniques that already exist. They're still being developed, but the technology is very quickly coming to fruition. Ultimately, you'd need to look at the spectrum of the planet's atmosphere. This can be achieved by either looking at the star's light as it passes through the planet's atmosphere, or else observing at numerous wavelengths and seeing how the transiting planet's radius changes (due to changing atmospheric opacity at different wavelengths).
Comment: You know that abiotic oxygen is a thing, right?
Comment: @AtmosphericPrisonEscape Yes, that's why I said its not ironclad evidence. Oxygen can exist without life so seeing oxygen is not 100% an indicator life produced it, it is just highly suggestive.
Comment: Well, I would debate the 'highly suggestive'. In fact I always am. We don't know if it is highly suggestive. Low number statistics.


get all image library lists via listdata.svc or web service, how?

Question: I want to retrive all image/picture lists a site has with javascript.
Can that be done via listdata.svc or via a soap webs service?
When looking at the response from listdata.svc i can't see what type each list is in the response, so to me it seems like listdata.svc cannot be used?
If so, which soap web service is it that i should use instead?
Answer: You'd want to look at the GetListCollection operation of the Lists web service.  In the response there'll be a ServerTemplate field. In MOSS 2007, I see picture Libraries having a ServerTemplate of 109.
Comment: Agreed on the approach. If you want to do it client side, look at SPServices to help you out. [link](http://spservices.codeplex.com)
Comment: That works too, depends on how he wants to implement the solution.
Answer: If you're in SharePoint 2010, and using JavaScript, just use the ECMA Script Client Object Model.
Intro: SharePoint 2010: Client Object Model for JavaScript (ECMAScript).
Some info about the ListCollection class: SP.ListCollection Class.
This depends on your javascript competency. It does use Object Oriented Javascript which just scares the bejesus out of me (I'm a Server Object Model in C# & .NET Framework-loving cat), but it's another option for you.


Release a BSD-licensed but closed-source program?

Question: The BSD/MIT license only mentions things about redistribution. But I don't see any restrictions on the initial release of a BSD-licensed program. Is it possible that I write a program, but only release its binary under the BSD-3-Clause license? If so, why are BSD/MIT licensed programs considered to be open-source/free?
Comment: Example: The MS-DOS v2 source release contains some binary program executables. I consider these "free software without sources" because of the usage conditions that Microsoft chose to release the repo under.
Comment: Google is doing such closed-source shenanigans which are made to look to be "open-source licensed" while in fact being closed source, e.g. https://github.com/google-ar/arcore-android-sdk/issues/1538
Comment: @ecm: In the case of MS-DOS v2, people have reverse-engineered the sourceless binaries to create compatible source code, on the grounds that the binaries were released under BSD conditions. For instance https://www.os2museum.com/wp/dos-2-11-from-scratch/
Comment: @john_e: I was actually thinking of the assembler and linker included in the release. I believe those tools have not yet been reverse-engineered.
Comment: @ecm Assembler and Linker code does not need to be reverse engineered. It is source code. It is very close to the hardware and nowadays only few people can read (and understand) it, but nevertheless it is source code and not a binary.
Comment: @Martin_in_AUT: No, I do not mean assembly language *sources*. I mean the very tool that is the assembler, that is MASM.EXE. Regardless of what language this was created from, the MS-DOS v2 source release contains only the binary executable as MASM.EXE, no sources whatsoever.
Comment: "Is it possible ... to only release its binary under the BSD-3-Clause license" -- Why do you want to do this?
Comment: @Brandin No I'm not going to do that. Just a conceptual question.
Answer:
Is it possible to release binary-only under a permissively-free licence?

Yes, absolutely.  We have other questions (1, 2) here about that, but to me they boil down to "it's a bit weird, you probably shouldn't do it, but you can".

If so, why are BSD/MIT licensed programs considered to be open-source/free?

They're not, necessarily.  Source code that you receive under BSD or MIT is considered to be free software.  Binaries would just be considered freeware, because although you're not paying for the binary, you aren't (in any meaningful sense) getting some of the four freedoms.
Answer: A binary-only distribution of software is very common for commercial software, but it is also possible to distribute binaries with a permissive license like BSD or MIT.
The advantage of this strategy might be in the ease of distribution and re-distribution. However, it might also be a double-edged sword, because the users don't know what's in it (possible malware, patent claims), so users will be hesitant to use it.
Permissive licenses commonly allow modifications, translations etc, and that includes reverse engineering and de-compiling. Therefore, for experienced programmers, there is a path to the source code related to the binary, unless code obfuscation techniques have been deployed (which again should trigger even more doubts among users).
So should a binary-only distribution be considered 'open-source/free'? Definitely not. It raises a lot of questions.
Answer: Open-source licenses are licenses suitable for releasing source code of computer software. Some of such licenses (like GPL) are copyleft, they require you to release the source code of your own software based on open source code, others (like BSD) don't have such requirement.
For instance, most compiler toolchains include some source code. One example is ARM/Cortex core library CMSIS (Cortex Software Interface), which was initially released under a BSD-like license and later switched to Apache. Yet a lot of ARM software is commercial and closed source. All the authors have to do is to mention that their software includes code from ARM Ltd. to fulfill the license terms.


How to turn off Latex/MathJax buffer symbol conversion in org-mode

Question: Whenever I write, say, \Rightarrow inside of $$, I immediately see the actual right-pointing arrow substituted in. Unfortunately, this does not travel well between GUI-based Emacs and Emacs started -nw in a terminal. Research tells me this is a latex-math-preview-* (or is it something with org-preview-latex-default-process?) feature, and this substitution is happening as Emacs (through imagemagick?) creates actual images to insert in-line when it sees Latex/MathJax blocks. My question is, How do I turn this feature completely off in the buffer? I'm on Emacs 26.3 and (elpa) org-mode latest.
Answer: I don't think you're seeing the image preview via imagemagick/dvisvgm, I think you might be seeing a unicode overlay maybe?
If it is, according to the manual you should be able to toggle it with C-c C-x \ looking at the variable org-pretty-entities in M-x customize-variables may help you.
Comment: You were right, i.e., not related to imagemagick or dvipng at all. `org-pretty-entities` was nilI, but I had `#+STARTUP: entitiespretty` in the header.


Can you successfully migrate ArcGIS 10.0 mxd to 10.1?

Question: I have upgraded from 10.0 to ArcGIS 10.1.  I am trying to open an 10.0 mxd file in 10.1 and it appears to have lost any additions I had made to the table plus its' x and y coordinates.  Can you successfully migrate ArcGIS 10.0 mxd to 10.1?
Comment: Could you be a little more specific about what got lost between the versions? I have also migrated to 10.1 recently, but haven't had any issues yet.
Comment: I'm unclear too.  Has your shapefile/feature class lost recent edits? There are no special steps to migrate a project, you just open it in ArcMap 10.1.  That doesn't mean you can't have problems, the ESRI Forums have indicated there can be many.  The usual suggestions are to use Save As to update the mxd to the newest version, update any file geodatabases to the newest as well. Sometimes during updates one has to try the boilerplate appoach of renaming of the ESRI application data folder to "fix" problem templates or registry entries.  You lose your customizations doing the latter.
Comment: You should be able to open a 10.0 mxd in 10.1 without any issues. You will not be able to open a 10.1 mxd in 10.0 though. Do you have the service pack and patches installed? I have lost data as you have described in both versions, but that was always due to the network connection dropping in the middle of an edit session, and not from simply opening a 10.0 mxd in 10.1.
Comment: This is a long shot, but is it possible you're experiencing one of these issues? http://support.esri.com/en/knowledgebase/techarticles/detail/41119?WT.mc_id=EmailCampaign16217
Comment: also, for troubleshooting, it'd be helpful to know if you tried opening these datasets in ArcCatalog or a new map document and experienced the same missing data
Answer: There should be no special steps. Although, you should keep in mind that if other people are working with the same mxd and do not have 10.1 they will not be able to open it. In that case, you should "save a copy as..." a 10.0 document.


Chi squared test assumptions not met

Question: I want to perform a univariate analysis to predict if a higher BMI is associated with an increased incidence of complications after surgery. I divided the BMI of patients in 4 categories (<18.5; 18.5-25; 25-30; >30) and complications in 2 categories (yes; no). I tried to use the chi squared test to perform this univariate analysis, but the assumptions were not fulfilled. The expected counts were not higher than 1 in all cells and they were smaller than 5 in more than 20% of the cells. Which test can I use to perform this univariate analysis in a 2x4 table if the assumptions of the chi squared test are not met?
Comment: The problem seems self-inflicted. A logit regression of (yes, no) for complications on BMI  data as they arrive avoids the unnecessary and arbitrary categorisation. You may need a more nuanced approach to the data on complications as well. There is much literature that BMI is a crude measure any way and that using thresholds like 25 can confuse as much as it clarifies.
Answer: I would do away with the BMI grouping altogether and, at least as a start, run logistic regression on the BMI values. Then you can test the coefficient on BMI to get your p-value for BMI's effect on rate of complications.
Grouping BMI puts you in the position of saying that 24.9 and 25.1 are as different as 18.5 and 30, which you probably do not believe.

Chi squared test assumptions not met


Optimal randomized algorithm for set cover

Question: This cstheory.SE post gives various randomized approximation algorithms for the set cover problem. Is there a randomized algorithm (which runs in $\mathrm{poly}(n)$ time) for the set cover problem which achieves an approximation ratio of $1$ (with high probability)? Is it possible to achieve such an algorithm, or is this still unknown?
Answer: Approximation ratio of 1 means that it outputs an exact solution (so it is not an approximation algorithm but rather an exact algorithm).  Set cover is known to be NP-hard, so there is no such polynomial-time randomized algorithm, unless RP = NP.
Comment: @Steven, good point, thank you.  I have revised my answer.


-2 in the gradient of the loss function

Question: I'm reading Humman-level control through deep reinforcement learning
, at the beginning of Page 7, it defines a loss function (I omit some parameters to make it cleaner)
$$
L(\theta)=\mathbf E\left[\left(r+\gamma \max_{a'}\hat Q(s', a';\theta^-)-Q(s, a;\theta)\right)^2\right]
$$
Then I differentiate it with respect to the weights, I get
$$
\nabla_\theta  L(\theta)=\mathbf E\left[-2\left(r+\gamma \max_{a'}Q(s', a'; \theta^-)-Q(s, a;\theta)\right)\nabla_\theta Q(s, a;\theta)\right]
$$
It is not consistent with the gradient in the paper. (my version has $-2$). What's wrong with my inference? Thanks in advance.
Comment: Perhaps the paper is only interested in finding the zeros of the gradient?  In that case it would be unconcerned about any constant nonzero multiple.
Comment: @SherwinChen It's quite common in statistics that we ignore the constant for differentiation. The paper is right. whuber is correct.
Comment: @whuber Thanks for commenting. And sorry that I'm not so sure about what you meant, could you be more specific? Why is the paper only interested in finding the zeros of the gradient? IMHO, $\nabla_\theta L(\theta)$ is going to be used to update $\theta$, and zero seems meaningless in that case.
Comment: @SmallChess Thanks, so that's just a convention?
Comment: I changed your title to something more descriptive, feel free to edit it
Answer: As already said by others in the comments, such constants are often ignored, as they don't influence the result of minimizing the loss. So squared loss is often defined as $\tfrac{1}{2} (x-y)^2$, so that $\tfrac{1}{2} $ cancels out with $2$ and you don't have to bother with it. I'd guess that's also the case in here. The sign is only for the optimization algorithm, since some of them specialize in minimizing, while other in maximizing. You minimize the loss, or maximize negative loss (i.e. utility).
Comment: @SherwinChen the sign is only for your optimization algorithm, since some of them specialize in minimizing things, while other in maximizing. You minimize the loss, or maximize negative loss (or utility).
Comment: I agree with you about the $2$ part, but what confuses me is the negative sign, I think it becomes important when doing gradient ascent/descent. so why should we ignore that?

-2 in the gradient of the loss function


Why did the SLS only reach a TLI speed of 17500 mph

Question: Why did the SLS only reach a TLI speed of 17500 mph when the Saturn V reached a TLI speed of 24500?  The SLS was considerably lighter and had 15% more thrust and should have been able to achieve a higher speed.
Comment: Because Apollo didn't take the most efficient route to the Moon. The Apollo missions burned harder on  LEO departure to get to the Moon in about 3 days,  whereas the Artemis missions are taking a Hohmann transfer course, which takes 5-6. Thrust isn't the issue here, it's [delta-V](https://en.wikipedia.org/wiki/Delta-v).
Comment: Also, your numbers are wrong.  You've listed orbital velocity for LEO instead of the TLI speed for SLS.
Comment: @notovny it's not even doing a Hohmann transfer to the moon, it's transferring to NRHO, a L2 halo orbit...specifically because it's easier to reach.
Comment: @ChristopherJamesHuff: Artemis I (which I assume is what the OP is talking about, since I don't know of another launch of SLS so far) was a distant retrograde orbit, not NRHO. Artemis II will be a free return trajectory.
Comment: @JörgWMittag that's right...I'd disregarded that because it's never going to be repeated, but the question does say "did" and "was", so seems to be about the first launch, not typical operations. The distant retrograde orbit was a similarly high, relatively accessible orbit, though, entered and departed via lunar powered flybys to reduce the propulsive delta-v needed.
Answer: An hour and twenty minutes after being inserted into low Earth orbit at 17,175 mph (27,640 km/h), the Artemis I SLS Interim Cryogenic Propulsion Stage (ICPS) performed the Trans-Lunar Injection (TLI) burn which accelerated the Orion spacecraft towards the Moon at a velocity of about 22,600 mph (36,371 km/h).
According to Apollo by the Numbers the velocity after the TLI burn performed by the Saturn S-IVB stage ranged from 24,129 mph (38,832 km/h) for Apollo 12, to 24,258 mph (39,039 km/h) for Apollo 15.
The Apollo and Artemis I missions used different trajectories to reach the Moon. The Saturn V TLI burns placed the Apollo spacecraft on a less efficient three-day trajectory, which was also a free-return trajectory that would have looped around the Moon and returned to Earth if a Lunar Orbit Insertion (LOI) burn was not performed by the Apollo spacecraft. This provided a safety margin in case a problem occurred during the trip to the Moon (as actually happened on Apollo 13).

Apollo 8, (NASA)
A slightly modified trajectory was used starting with Apollo 12 and all subsequent lunar missions. Besides the LOI burn a mid-course correction burn was also required to "cancel" the free-return trajectory. This method opened up a larger area of potential landing sites, while still allowing time to check out the spacecraft systems prior to committing to a non-return trajectory.
Artemis I was a non-crewed mission which used a very different trajectory than was used on the Apollo lunar missions, as well as being different from what will be used on the crewed Artemis II and Artemis III flights. Artemis I used a more efficient five-day trajectory to reach the Moon, and was not free-return. Two post TLI burns performed by the Orion spacecraft (not counting course corrections) placed Orion into a Distant Retrograde Orbit.

Artemis I (NASA)
Artemis II will be a crewed non-landing, non-orbiting mission and will use a free-return trajectory. However like Artemis I it will take more than three days for Artemis II to reach the Moon using a more efficient trajectory than Apollo. After separating from the ICPS the Orion spacecraft will make several burns on the way to the Moon as part of a Multi-Trans-Lunar Injection (MTLI) method.

Artemis II (NASA)
For Artemis III Orion will be placed into a Near-Rectilinear Halo Orbit (NRHO) where the the crew will transfer to the Starship HLS lunar lander.

Artemis III (NASA)
Additional Info:
The Artemis I 17,175 mph LEO number is from the NASA TV live broadcast commentary (timestamp 3:36:16) on November 16, 2022
The Artemis I 22,600 mph TLI number is based on the following sources:
NASA pre-launch document - 24,500 mph
NASA TV live broadcast commentary (timestamp 5:00:22) November 16, 2022 -  22,500 mph
CNN Interactive November 16, 2022 - 22,600
CollectSpace November 16, 2022 -  22,670
Apollo TLI (from Apollo by the Numbers)

Mission
mph
km/h

Apollo 8
24,208
38,959

Apollo 10
24,247
39,022

Apollo 11
24,236
39,004

Apollo 12
24,129
38,832

Apollo 13
24,231
38,996

Apollo 14
24,212
38,965

Apollo 15
24,258
39,039

Apollo 16
24,250
39,027

Apollo 17
24,242
39,014


What are the rules of thumb for margins in web design?

Question: My web designer tells me that in a web page, the empty margins or padding should always be multiples of a standard. For example 6 px, 12px, 18px. This should produce nicely balanced lay-outs. I would like to learn a little bit more about it:
Should one really not violate this at all?
Should the standard be the same horizontally and vertically?
Comment: I'm not proposing to close the question here, but [graphic design SE](http://graphicdesign.stackexchange.com/) is another good place to ask.
Comment: @zzzzBov "Absolute statements are always false" is an absolute statement. So are you wrong?
Comment: "empty margins or padding should **always** be multiples of a standard" (emphasis mine) - usage of the word "always" is a pretty good indicator of a false statement, because absolute statements are **always** false.
Comment: @toshiomagic [no idea](https://www.youtube.com/watch?v=xECUrlnXCqk).
Comment: The reason for the bounty from me is I think this question is very interesting, and needs to be answered correctly. My answer is just one from my point of view. I think that there is more appropriate ones, taking full act on the complexity (like @Coswyn).
Answer:
The best learning resource for this would be a good introduction on typography – probably the seminal classic by Bringhurst (see http://webtypography.net for a good roundup applied to the web), though e. g. Spiekermann's 'Stop Stealing Sheep…' is not bad for starters, either – and on design grids (see my answer here on UXexchange).
When designing grids you are mostly using a basic module (proportions ideally defined by working from the content outwards) that all content is fitted to (i.e. multiples of it).
Vertical and horizontal margins between blocks are in most cases different. Vertical whitespace is often oriented on the baseline grid (see e.g. Bringhurst, again). Using one is highly recommended to achieve at a unifying vertical rhythm.
The minimum amount of horizontal whitespace, i. e. primarily the separation between columns of body text (gutter), is governed by Gestalt psychology with font size, line spacing, and line width as main influencing factors. You should place text blocks far enough from another such that your recipients will be able to see them as distinct units of their own. A traditional rule of thumb would make the gutter at least 1.5 ems wide in order to appear significantly wider than any possible whitespace within a line of text. On the screen, good line spacing tends to be a little bit wider than in traditional print, though. Hence you will probably need a little bit more than that. Using the same value as your baseline grid is a good guess to start with in most cases.
BTW: design standards – unless significantly backed up by ergonomics or cognitive psychology – are never standards in the more rigid sense of the word. You may violate any 'standard' as long as you know why you are doing it.
Answer: Yes... and no. What your designer might refer to is proximity through grouping. The white spaces (in your case margins) separates different groups of elements from each other.
More on the topic: Grouping Elements for Clear Web Page Design
Answer: It's better to use relative values - "em"s or percents, because margin looks good only in specific width/height ratio.
Relative sizes are useful even in fixed layouts, because when you need it to shrink/widen a little, you have to change it only in one place.
So the answer is: Do not use pixels, use "em"s for margins as well as box sizes, and it IMHO should be between 0.5em to 2em - depending on visual experience.
And ratio between vertical and horizontal margin depends on overall "vertical&horizontal" rhythm (google).
Comment: To be clear: 1em = `font-size`, 2em = 2 * `font-size` etc. Therefore: if `h1` and `p` both have margin of 0.5em, and `h1` has 20px and `p` 12px `font-size`, then heading's margin is translated to 10px and the paragraph's to 6px.
Comment: But layout proportions do not scale in an optically linear manner as the perceived visual 'blackness' of the content varies when scaled (at least where type is concerned). Therefore, using relative units does not help that much in that respect, IMHO.
Answer: It can be helpful to have standard spacing within content sections. IE paragraphs, headings and lists should all have the same amount of spacing below them as that creates rhythm. The rule of thumb though is to maintain balance and consistency.
Answer: This site's layout is a good example of how a combination of adherence to multiple patterns yields balanced proportions and an overall consistent structure. The logo, for example, is spaced approximately 14px at the top and bottom within its header segment though it's indented 18px from the edge of the question header, making the top and bottom spacing approximately 30% smaller than the left side - other elements within the header are spaced similarly. On the other hand, the spacing of the text within the question header is approximately 9px on the bottom, 13px on the top, and 24px on the left side. That sets the top spacing to be approximately 50% smaller than the left side, and the discrepancy in the bottom is relative to the alignment of the text to the bottom of the main header in addition to it being header text (separated from the main content with a divider, though closer to that content which it more closely relates to than anything else that surrounds it).
Proportions vary and are an art in themselves. There is a math to it all, but bringing a complex structure together is, in practice, a generally intuitive process.
I'm sure there are multiple books and online resources that touch on this, and they are all likely helpful in their own ways, but my best advice is to be an avid observer of proportions in the things around you - in themselves and relative to their environments and other things in that environment - especially in nature. In time you will hone your intuition and begin to more naturally imitate those proportions and apply them in their appropriate settings.
Answer: Consider using a grid layout where your margins are also given by that grid.  I tend to use the 960 Grid System but there are many more that other swear by.
For me the benefit of this is largely from choosing something once that works and then not having to spend time thinking about it every time something needs to be laid out.
Comment: I think we differ here on the design side.  Giving endless options to make each page as good as it could be in isolation of the others is not something that I believe makes a good UX.  Consistency is far more valuable for me.  I will however agree that one shouldn't stick exactly to a chosen grid even at the detriment of the page.
Comment: You should IMHO not mistake the technical implementation of the grid (i.e. the main reason for using a CSS framework) with the underlying design. The default values in 960gs, Blueprint etc. are exactly that: defaults, i.e. tolerable guesses to start from. But they do not release you from making a design decision that might be better suited to your content. All those frameworks are quite well adaptable to different grid setups (see the countless grid generators for them on the web).
Comment: There is value in consistency of a grid framework.  The example of 960 is very valuable - people are used to that width and designers are used to working with it.

Consistency is part of usability.
Comment: ahem… where did I state that you should design 'pages' in isolation of each other? I had hoped that it was clear that my statement applied to designing a _system_ :-) But the design of a good grid system always should be guided by the content it shall be supporting.
Comment: @Chris In just one word: fail. (SCNR)
Answer: You should have consistency yes - but if the page is not user focused what good are multiple standard margins/padding anyways. I try and use multiples of 5 personally as it is faster to equate.


Nexus 5 error can't access to camera

Question: I have a Nexus 5 running android 6.0.1 and I'm using the google camera 3.2.045. After taking a picture and locking the phone just after, when i open my phone again i got a system message saying "can't access to camera" with 2 possibile options: ignore and report. So i closed the app, but every time I open it up again or I try to take a picture also with others app but i get the same message. What should I do?
Comment: Goto settings->apps, choose Google camera applicatiion. Inside `app info`, tap on `force stop`, and then choose storage section, `clear data` and `clear cache`. Open Google camera application and check. (Note: It will reset camera, your applied camera settings will lost)
Answer: This is some bug, I had this problem to, but later it was disappeared.
Answer: I have the same issue, now stranger then usually.
What works now for in like 70% of the time is going on
Options --> Apps --> Kamera --> Force Stop. Reboot device if that doesn't work and try again☺
Hope this helps you :)

Nexus 5 error can't access to camera


Get the artwork for an mp3 file

Question: Hi guys does anyone how you can access the artwork image for an mp3. I download the mp3 from a server and save it in documents, and when i play it from file I want to display the image for the mp3?
thanks
Comment: Are you sure that the mp3 file downloaded has an image embedded?  More info please
Answer: The album art is usually embedded in the ID3 tag. The id3lib library can be used to read it.
EDIT: There is also the id3v2 command-line utility. I haven't used it though.
Answer: It's probably going to be in the ID3 tag. 2.4 and 2.3 ("APIC") are the most common, but 2.2 ("PIC") is still floating around. There are various C libraries which may help.
There's MPMediaItemArtwork, but I think that only works for files in the iTunes/iPod/whatever library.

Get the artwork for an mp3 file


Who has the power to delete comments en masse

Question: Multiple comments on my question have been repeatedly deleted without anyone flagging them. They are from multiple users, are valid and not offensive, and yet are being deleted en masse. How could this be, and who has the power to do so?
Comment: how would you know whether anyone flagged them or not?
Comment: There are a number of comments from yourself on the question you linked to, could you tell us where the deleted comments were?
Answer:
My comments on my own question, when responding to a downvoter, were repeatedly deleted without anyone flagging them. How could this be, and who has the power to do so?

Moderators do. Moderators, unlike yourself, can also see when someone has flagged a comment. So for instance, I can determine that you've had 10 offensive comment flags on that question so far. Let's see if we can figure out why...

@Downvoter- speak up, don't be a puss.
@Downvoter/closevoter- Do us a favor and explain yourself
@Anonymous downvoter/closevoter- Care to speak up?

Guess what? <code>@Downvoter</code> doesn't notify anyone of anything. It's pure noise. And calling folks "puss" is a great way to convince them not to waste their time talking to you.
Comment: The second of those comments is quite reasonable.  The `@` is, as you say, pure noise.  And in the context of the others it seems delete-worthy, but not on its own.
Comment: Ha- guess that first one was probably ill-advised- but it's honest.
Answer: Moderator have the power to delete comments.
I'm just guessing here, but as comments should be used to ask for clarification (said clarification should be edited into the question (or answer) not posted as a comment), it's highly likely that one of the comments on your question were flagged and a moderator decided that they were just noise and not adding anything to the question at all.
Comment: It's a bit pointless though. Down-voters won't get any notification of your comments so unless they check back on the question they won't see the comment.
Comment: Right- it's just a very frustrating thing to get downvoted and not be able to a) recieve an explanation b) engage the downvoter.
Comment: Is it valid to ask for clarification/explanation from anonymous downvoters? That's what I was doing.
Answer: In Jeff's answer to Who has the power to delete a comment?

Without giving too much away, there are certain heuristics that make
  some types of comments a bit, shall we say, easier to flag away than
  others.

While your description of your comments don't seem to fall into the pattern I know about, its possible that your comments fell into the heuristics so it could have been a single non-moderator who was deleting your comments.
Comment: I've definitely been surprised how powerful some of my flags on comments have seemed to be in the past when a user was in the process of self-destructing.
Answer: Standard users can flag comments. After a certain amount of flags, the comments are deleted.
I have seen comments get posted, add my flag, and see the comment disappear, in ten or twelve seconds total.
Don't forget that hundreds or thousands of people may be browsing the site at once, and it is very common to get a dozen views within seconds.
Enough of your peers thought the comments were worth flagging for the comments to evaporate. Please pause a moment and consider what it means for your peers to be moderating your activities in this fashion. Please take that moment again every time you're about to post a comment. :)


what's difference between these two statements about passing variables in Python recursively

Question: I'm a new python learner. and there is a question confusing me a lot cause it really waste much time to think about.
There is a algorithm puzzle about binary tree, and a sum, you should find all root-to-leaf paths where each path's sum equals the given sum.
For example:
Given the below binary tree and sum = 22
An example picture here
I have written a python recursive method like blew and it runs correctly on online judgment.
#definition for a binary tree node.
class TreeNode(object):
    def __init__(self, x):
        self.val=x
        self.left=None
        self.right=None
class Solution(object):
    def pathSum(self, root, sum):
        """
        :type root: TreeNode
        :type sum: int
        :rtype: List[List[int]]
        """
        res=[]
        if not root:
            return res
        temp=[root.val]
        self.helper(root,sum,res,temp)
        return res
    def helper(self, root, sum, res, temp):
        if not root:
            return 0
        if root.left==None and root.right==None and sum==root.val:
            res.append(temp)
        if root.left!=None:
            self.helper(root.left,sum-root.val,res,temp+[root.left.val])
        if root.right!=None:
            self.helper(root.right,sum-root.val,res,temp+[root.right.val])

in the last four lines, I invoke the helper function recursively to find the  path sum by pass root left child and root right child.
However, if i rewrite the code like below, I mean only last four lines
if root.left!=None:
    temp+=[root.left.val]
    self.helper(root.left,sum-root.val,res,temp)
if root.right!=None:
    temp+=[root.right.val]
    self.helper(root.right,sum-root.val,res,temp)

it gives me wrong answer and can't pass the online judgment.
Dose anyone know what is the difference between this two kind of ways in pass the parameter to a function in python. or it's any declare and pass problem in my code.
In my view, I can't see any difference. Thanks everyone.help me !
Comment: Don't compare `None` for equality; use `root.left is None` and `root.left is not None` for `==` and `!+`, respectively.
Comment: for what reason? it is more python?
Answer: += alters a list in-place:
>>> def inplace(l):
...     l += ['spam']
...
>>> def new_list(l):
...     l = l + ['spam']
...
>>> a = ['foo']
>>> inplace(a)
>>> a
['foo', 'spam']
>>> a = ['foo']
>>> new_list(a)
>>> a
['foo']

Your original code passes in a new list each time:
self.helper(root.left,sum-root.val,res,temp+[root.left.val])

but your altered code shares temp across all recursive calls and extends it each time. This matters because by creating a new list you gave the recursive calls for the left branch a new, independent list from the right branch of your recursion. By extending the list with += you now give a larger list to the right branch after processing the left branch.
Answer: When you say temp += ... you are modifying temp. But you use it in both the left and right cases.
So you have:
temp = [0]
if root.left is not None:
    temp += [1]               # Now temp is [0, 1], probably okay
    ...
if root.right is not None:
    temp += [2]               # Now temp is [0, 1, 2], not [0, 2]!

Answer: The second version is incorrect because you would be updating the temp variable between the left leaf check and the right leaf check
if root.left!=None:
    temp+=[root.left.val] # temp updated here
    self.helper(root.left,sum-root.val,res,temp)
if root.right!=None:
    temp+=[root.right.val] # the updated value could be used here, which is wrong
    self.helper(root.right,sum-root.val,res,temp)


Can someone shed some light on how the effect in this bar photo was done?

Question: I am very intrigued by this photo. Can anyone shed some light into how this effect could be achieved?
Answer: I think that it's saturated a little bit, contrast increased and split tone was applied towards blue. Here's an example how you can split the tone using Lightroom 4.
In the first example, the Hue was 237 (blues) and Saturation value was 29

While in the second example, the Hue was also 237 and Saturation value was 100. As you can see this image is more blueish than the first one
Comment: not necessarily, split toning allows you to give the highlight parts of the image a specific tone and the shadow parts a specific tone, and you can control how much the tone will affect the hightlight/shadows by increase or decrease the saturation, please see my updated answer
Comment: from what i can gather on the internets, split toning convers an image into sepia like dual tone photo.. all colors are lost due to b&w conversion
Comment: you can split tone a colour image and use opacity to lower the effect


Signature of the body and declaration in a method implementation do not match. - on master page

Question: I just converted my .net 2.0 application to a .net 3.5 application

there was an error converting the website project
so i recreated the website project
added the website files again (which converted successfully) and got added to the project

No build errors
but on runtime I get this error:

Server Error in '/' Application.
Parser Error
Description: An error occurred during
  the parsing of a resource required to
  service this     request. Please
  review the following specific parse
  error details and modify your source
  file appropriately.
Parser Error Message: Signature of the
  body and declaration in a method
  implementation do not match.  Type:
  'MyMaster'.  Assembly:
  'CompName.ProjectName,
  Version=1.2.3631.30873,
  Culture=neutral, PublicKeyToken=null'.
Source Error:
Line 1:  <%@ Import namespace="System.Diagnostics"%>

Line 2:  <%@ Master Language="C#" AutoEventWireup="true" Inherits="MyMaster" Codebehind="MyMaster.master.cs"  %>
Line 3:  <%@ Register Src="Controls/MyControl.ascx" TagName="MyControl"     TagPrefix="mc"%>
Line 4:

Answer: The underlying error was an Ajax Problem
The new website project was pointing to the new Ajax DLL in the .net entity framework
(System.Extensions)
I had to goto the .proj file in notepad and edit the reference to point to the old .net AJAX DLL.


Deriving least squares parameters for linear regression between elements of a random vector

Question: This is a specific application of the usual least squares derivation for linear regression but I'm confusing myself.
Suppose $X = (X_1, ..., X_d)$ is a random vector.
Pick any $i, j < d$ and let $X_{-ij}$ be $X$ without the $i$ and $j$ components.
Then we want to regress on $X_{-ij}$ to find $X_i$ and $X_j$.
So I want to find $\beta_i$ and $\beta_i^0$ such that $X_{-ij}^T\beta_i + \beta_i^0$ minimizes the expected least square error.
i.e, I want to find $\text{argmin}_{\beta_i, \beta_i^0}\mathbb{E}[(X_i - X^T_{-ij}\beta_i - \beta_i^0)^2]$ and similar for $\beta_j, \beta_j^0$
$\beta_i, \beta_i^0$ will be in terms of variances and covariances of the $X_k$ once I'm done.
I've been unable to get the terms to behave however, and have unable to find a solid expression for the $\beta_i$. Would appreciate help with the derivation.
Answer: The $ \beta_{i} $ elements are the correlation coefficients between $ {X}_{i} $ to all other elements.


Could you recommend me game collection books of attacking players?

Question: I have found a lack of aggression in my style and I want to study aggressive players' games to develop my style.  Please recommend books that fulfill this purpose. I am an advanced player.
Comment: Not a book, but that [agadmator Chess Channel](https://www.youtube.com/c/AGADMATOR) on YouTube is good. It features a great many attacking games by the likes of Morphy, Tal, Fisher, and Nezhmetdinov. I've learned a lot from watching many of the videos. The ones about Tal and Nezhmetdinov are particularly good, since the person who runs the channel has an infectious love for those two players.
Answer: I am probably too weak to give advices (I am somewhere between 1700-1800 on chess.com), but since I am on a similar road maybe those books will help:

Attacking Chess: Aggressive Strategies and Inside Moves - Josh Waitzkin - I have read this book entirely. Actually it does not teach you a method, but various cases. It is a fun text to read, and it shows you about the mood and attitude you have to have. The examples are instructve but you have to take your time to absorb them

A Guide to Attacking Chess - Garry Lane - This teaches you elements and can constitute a method to attack. It is really instructive and a really good book

Looking for Trouble - Dan Heisman - This is not about attacking, but more about spotting mistakes. However this is important, since when you have advantage you have to push and when you are on defense you have to solidify. But any mistake can change that, and when a mistake is not spotted than everything changes.

How to Reasses Your Chess - Jeremy Silman - This is not a book about attack. It is about imbalances. But you can attack successfully if you have a reason (weaknesses, space, speed, etc). Otherwise attacking blindly is like trying to destroy a fortress by hitting your head into walls. No chance. Any alternative book about positional elements gives you reasons for attacks.

(Addition edited in by H.R.) A classic is Art of Attack in Chess - Vladimir Vukovic, with special view on attacking the king (uncastled, castled with no weaknesses, castled with weaknesses, with pawns, with officers...).
Comment: Another recommendation of a classic: "Art of Attack in Chess", Vukovic.
Comment: Are there any books of a particular player's collection? I think that way I can incorporate aggression into my style better.
Comment: @HaukeReddmann you should add it as an answer. I starting to inspect that and it looks very interesting, thank you
Comment: @rapaio: I have enough karma and simply edited into your answer, hope you don't mind, just revert if you don't like  :-)
Comment: @HaukeReddmann not at all, it was just an occasion to give a deserved vote as a thank you :)
Answer: Players to look for (short list, makes a good place to start):

Mikhail Tal (you can try looking up, say, 'attack like tal' on youtube. eg 1, 2)
Alex Shirov
Rashid Nezhmetdinov
Leonid Stein

(Interesting edit, considering it's just video links and the OP specifically requested books, and the links are not even about the named book, which was already mentioned later in this answer.)
Books:

Rocking The Ramparts - Larry Christiansen
Storming The Barricades - Larry Christiansen
The Modern Chess Sacrifice - Leonid Shamkovich
Attack With Mikhail Tal - Damsky
Attacking Manual (2 vols) - Jacob Aagaard

From the more recent pile:

Sacrifice and The Initiative in Chess - Ivan Sokolov

And if more distant historical players are more your thing, look for:

Alexander Alekhine
Harry Nelson Pillsbury
Rudolf Spielmann
Frank Marshall


What is the exact meaning of "I dig it"?

Question: I have received feedback for a song I composed and some peers used the expression "I dig it". I know it should be interpreted as positive but, to what extent?
Answer: From Oxford dictionary:

dig

informal with object

Like, appreciate, or understand.
    'I really dig heavy rock'

I think it's safe to say that their comment is high praise indeed.
Answer: "Dig" is slang and suggests first that the music/song is liked (liked a lot), and second that it is understood.
Answer: Used in this sense the verb dig means to admire or appreciate, and though it is now rather dated it was part of the pop music lingua franca of the 1950s and 60s.
OED sense 6c has examples from 1935 to 1969 - it is said to be of US origin.

6c. slang (orig. U.S.).  (a) To understand, appreciate, like, admire;
  (b) to look at or listen to; to experience. Cf. sense  1c.
1935   Hot News Sept. 20/2   If you listen enough, and dig him enough,
  you will realise that that..riff is the high-spot of the record.
1941   Life 15 Dec. 89   Dig me?
1943   M. Shulman Barefoot Boy 90   Awful fine slush pump, I mean
  awful fine. You ought to dig that.
1944   C. Calloway Hepsters Dict.   Dig v.—(1) Meet. (2) Look, see.
  (3) Comprehend, understand.
1944   M. Zolotow Never whistle in Dressing Room iii. 52   When they
  see a pretty girl they shout, 'Dig the chick.'
1947   R. de Toledano Frontiers of Jazz p. x,   I recognize it when I
  see it, the same as I dig good Jazz when I hear it.
1949   L. Feather Inside Be-bop iii. 28   Dizzy didn't dig the band's
  kind of music and the band didn't dig Dizzy.
1958   Punch 8 Jan. 92/1   The lines of communication get tangled. In
  other words the people don't quite 'dig' you.
1958   Listener 29 May 912/1   He wants to 'dig' the whole of life,
  and is convinced that experience comes only to the irresponsible.
1958   Punch 25 June 853/3   Does the beat generation really dig such
  crazy old-world catch-phrases?
1959   C. MacInnes Absolute Beginners 60   If you like the other
  number, I mean like the looks of them, really dig them sexually.
1959   C. MacInnes Absolute Beginners 62   Everything you learned, you
  hadn't learned until you'd really dug it: i.e., made it part of your
  own experience.
1960   N. Mitford Don't tell Alfred xviii. 192   Of course he's a
  man's man, you might not dig him like we do.
1969   New Yorker 29 Nov. 48/1,   I just don't dig any of these guys.
  I don't understand their scenes.

Note that the OED does refer to sense 1c, suggesting that there may be a connection. It has origins from as early as 1789

1c. fig. with allusion to the general sense; also spec. to study hard
  and closely at a subject (U.S.). Hence, to understand (cf. sense  6c
  (slang (orig. U.S.)).
1789   Trifler No. 43. 549   Youths who never digged for the rich ore
  of knowledge thro' the pages of the Rambler.
1801   R. Southey Thalaba I. iv. 220   'Tis a spring of living waters,
  Whose inexhaustible bounties all might drink But few dig deep enough.
1827   Harvard Reg. (1828) Dec. 303   Here the sunken eye and sallow
  countenance bespoke the man who dug sixteen hours' per diem'.
1869   L. M. Alcott Little Women II. xii. 177   Laurie 'dug' to some
  purpose that year.
1936   N.Y. World Telegram 6 Oct. 16/1   'You dig?' is a short cut for
  'You understand?'
1952   B. Ulanov Hist. Jazz in Amer. xxiv. 344   The man who really
  'digs' can more often than not describe the next development in jazz
  before the musicians have reached it.
1957   C. MacInnes City of Spades i. xi. 89   Twist now—you dig?
Answer: This particular use of 'dig' can mean either to like or understand something. It could also mean a combination of the two, as a general verb of approval for something.
The term was particularly popular during the 1960s-1970s and is today considered slightly old-fashioned. It seems to be mainly used today in connection with music, perhaps as a deliberate homage to the music and associated culture of that era.
Answer: That they 'dig' your song is a great compliment - shows that they can relate to it and also loved it! It's a cool way of praising!
Answer: It originates with the Irish language Tuigim meaning "I understand". https://inirish.bitesize.irish/339
Comment: Welcome to [ell.se]! That is not supported by the linked website, could you [edit] to provide more evidence please?
Comment: No. It's true I'm telling them. That's as much effort as I put in for free.


Use student visa to visit another country even after deciding not to pursue studies abroad

Question: I recently got a student visa to go study a Master's in Germany, however, I decided to take a job instead and never really enrolled in the university (so no student ID in case it matters). However, I want to visit a Schengen country as a tourist and am wondering if I can use my student visa to enter the country. Would I be allowed entry to the other Schengen country given that I decided not to pursue the Master's and never went to Germany in the first place?
Comment: If you never fully enrolled it's highly likely your visa is no longer valid. The university would typically be required to inform Immigration of your failure to enrol and the Student Visa would then be cancelled/curtailed. If they give a notice period after which the visa is cancelled, in general you would not be allowed to use the visa to travel in and out.
Comment: Do you mean to ask whether your student visa is legally valid even though you aren't a student, or does "allowed entry" mean "allowed by the border officer to clear passport control" without regard to the validity of the visa?
Comment: It might be a good idea to write a letter to the embassy and get an official answer. Technically, the chance that something will go wrong **during** the trip is quite low, but personally I do not like evaluating chances;)
Answer:
Would I be allowed entry to the other Schengen country given that I decided not to pursue the Master's and never went to Germany in the first place?

No, you would not. You wouldn't be allowed entry to Germany either. Your visa is for a specific purpose, which is not tourism.
Comment: Downwote for claiming "you wouldn't be allowed entry to Germany either". If German border control can't read thoughts/mind, there is no reason for declining entry to Germany until the travelling person claims different reason for the trip him-/herself
Comment: @AndreySapegin but.. the person *is* claiming a different reason. Quote: "*However, I want to visit a Schengen country as a tourist*".
Comment: Yes, but he is claiming it here and not in front of border control:)
Comment: @AndreySapegin Are you suggesting he should lie to the border control? Have you read Traveller's comment to the question?


Which is fastest? Data retrieval

Question: Is it quicker to make one trip to the database and bring back 3000+ plus rows, then manipulate them in .net & LINQ or quicker to make 6 calls bringing back a couple of 100 rows at a time?
Comment: This does not directly answer your question, but I asked a question about link ["How fast is Linq"](http://stackoverflow.com/questions/115851/how-fast-is-linq). Perhaps the answers will help you.
Answer: It will entirely depend on the speed of the database, the network bandwidth and latency, the speed of the .NET machine, the actual queries etc.
In other words, we can't give you a truthful general answer. I know which sounds easier to code :)
Unfortunately this is the kind of thing which you can't easily test usefully without having an exact replica of the production environment - most test environments are somewhat different to the production environment, which could seriously change the results.
Answer: Is this for one user, or will many users be querying the data? The single database call will scale better under load.
Answer: Speed is only one consideration among many.
How flexible is your code?  How easy is it to revise and extend when the requirements change?  How easy is it for another person to read and maintain your code?  How portable is your code?  what if you change to a diferent DBMS,  or a different progamming language? Are any of these considerations important in your case?
Having said that,  go for the single round trip if all other things are equal or unimportant.
You mentioned that the single round trip might result in reading data you don't need.  If all the data you need can be described in a single result table,  then it should be possible to devise a query that will get that result.  That result table might deliver some result data in more than one row, if the query denormalizes the data.  In that case, you might gain some speed by obtaining the data in several result tables, and composing the result yourself.
You haven't given enough information to know how much programming effort it will be to compose a single query or to compose the data returned by 6 queries.
As others have said, it depends.
Answer:
the problem I have here is that I need it all, i just need it displayed separately...

The answer to your question is 1 query for 3000 rows is better than 6 queries for 500 rows. (given that you are bringing all 3000 rows back regardless)
However, there's no way you're going (to want) to display 3000 rows at a time, is there? In all likelihood, irrespective of using Linq, you're going to want to run aggregating queries and get the database to do the work for you. You should hopefully be able to construct the SQL (or Linq query) to perform all required logic in one shot.
Without knowing what you're doing, it's hard to be more specific.
* If you absolutely, positively need to bring back all the rows, then investigate the ToLookup() method for your linq IQueryable< T >. It's very handy for grouping results in non-standard ways.
Oh, and I highly recommend LINQPad (free) for trying out queries with Linq. It has loads of examples, and it also shows you the sql and lambda forms so you can familiarize yourself with Linq<->lambda form<->Sql.
Answer: If you know which 6 SQL statements you're going to execute beforehand, you can bundle them into one call to the database, and return multiple result sets using ADO or ADO.NET.
http://support.microsoft.com/kb/311274
Answer: Well, the answer is always "it depends". Do you want to optimize on the database load or on the application load?
My general answer in this case would be to use as specific queries as possible at the database level, therefore using 6 calls.
Answer: Thx
I was kind of thinking "ball park", but it sounds as though its a choice thing...the difference is likely small.
I was thinking that getting all the data and manipulating in .net would be the best - I have nothing concrete to base this on (hence the question), I just tend to feel that calls to the DB are expensive and if I know i need all the data...get it in one hit?!?
Comment: Please make your comments through the comments button underneath specific replies. If your comment is to multiple people, edit your original post and stick your message at the bottom. The answers section is for.. well.. answers.
Answer: Part of the problem is that you have not provided sufficient information to give you a precise answer. Obviously, available resources need to be considered.
If you pull 3000 rows infrequently, it might work for you in the short term. However, if there are say 10,000 people that execute the same query (ignoring cache effects), this could become a problem for both the app and db.
Now in the case of something like pagination, it makes sense to pull in just what you need. But that would be a general rule to try to only pull what is necessary. It's much more elegant to use a scalpel instead of a broadsword. =)
Answer: If you are talking about a query that has already been run by SQL (so optimized by SQL Server), working with LINQ or a SqlDataReader might actually have the same performance.
The only difference will be "how hard will it be to maintain your code?"
LINQ doesn't query anything to the database until you ask for the result with ".ToList()" or ".ToArray()" or even ".Count()". LINQ is dynamically building your query so it is exactly the same as having a SqlDataReader but with runtime verification.
Answer: I always stick to the rule of "bring in what I need" and nothing more...the problem I have here is that I need it all, I just need it displayed separately.
So say...
I have a table with userid and typeid.  I want to display all records with a userid, and display on the page in grids say separated by typeid.
At the moment I call sproc that does "select field1, field2 from tab where userid=1",
then on the page set the datasource of a grid to from t in tab where typeid=2 select t;
Rather than calling a different sproc "select field1, field2 from tab where userid=1 and typeid=2" 6 times.
??
Answer: Rather than speculating, why don't you try both and measure the results?
Comment: Bryan thats a good idea - I am just pushed for time and hoping someone could help.
Answer: It depends
1) if your connector implementation precaches a lot of objects AND you have big rows (for example blobs, contry polygons etc.) you have a problem, you have to download a LOT of data. I've optimalized once a code that had this problem and it was just downloading some megs of garbage all the time via localhost, and my software runs now 10 times faster because i removed the precaching by an option
2) If your rows are small and you have a good chance that you need to read through all the 3000, you're better going on a big resultset
3) If you don't use prepared statements, all queries have to be parsed! Big resultset might be better.
Hope it helped

Which is fastest? Data retrieval


How to make twisted strips

Question:
How can I make the twisted red and white strips on the cylinder? I have taken the cylinder and loop cut but how to twist the cylinder and get that spiral selection.
Comment: Why bother with twisted selection. Use a texture.
Comment: @atek - I agree with Mzidare. Using a texture (a 2d image of diagonal red and white stripes) wrapped around the cylinder allows you to keep the cylinder geometry simple, which should produce smoother and faster renders.
Comment: i don't need texture to be added. We i got the answer below hope it help u also
Answer: Create a circle and go into edit mode. I adjusted the number of vertices to 16.
In the Properties Panel, add a Screw Modifier to the object. Set the axis to Z and raise the Screw property until the proportions are correct.Apply the modifier if you wish.
In face selection mode, Alt+rightclick on the face loops and assign them a new material.

How to make twisted strips


Image of a disconnected set is disconnected

Question: I'm aware that the image of a connected set is connected and the preimage of a disconnected set is disconnected. However, I'm struggling to find an example of a disconnected set such that the image of the disconnected set is also disconnected. Can the preimage of a connected set be disconnected?
Answer: HINT: I assume that you want $f$ to be continuous. Consider the function $f:\Bbb R\to\Bbb R:x\mapsto x^2$. What is the image of $\{-1,1\}$? What is the pre-image of $[1,2]$?
Comment: Image of $\{-1,1\}$ is connected, should we take $\{0,1\}$ instead?
Comment: @AkashGaur: Although the question shows no signs of having been edited, I'm reasonably sure that I gave that as an example of a disconnected set whose image is connected. Whether that was in response to a comment that has since been deleted or in response to an original version of the question that was changed too quickly to count as an edit I can no longer say after four years. It's even possible that I misread the question at the time.
Answer: If $f:X \to Y$ is continuous, then the contrapositive of $A$ connected $\implies f(A)$ connected is $f(A)$ disconnected $\implies A$ disconnected. Pre-image of a disconnected set is disconnected is incorrect, eg. let $f:\mathbb R \to \mathbb R$ be the constant zero function, then the pre-image of $\{0,1\}$ is connected.
For the other examples, take the image of $\{0,1\}$ under the identity function on $\mathbb R$ and the pre-image of $\{0\}$ under the constant zero function $f:\{0,1\} \to \mathbb R$ under the subspace topology of $\mathbb R$.


How to stop MacBook Air desktop being shown on another computer on network

Question: I have recently upgraded all computers to macOS Sierra V10.12.4 and found to my surprise that my MacBook Air's desktop files and folders are being mirrored on another, more public, computer on the network.  To avoid embarrassment I want to stop this.  I cannot find a way to do it - any help would be appreciated.
Answer: On the other computer that is public. Open iCloud preferences and turn of iCloud files. Consider signing out of iCloud entirely on that other computer.
For even more protection:

Turn off iCloud document sync on the source computer (or move the sensitive files to another folder that doesn't sync to iCloud). This eliminates the ability to access those files from iOS, though.
Store sensitive files in an encrypted DMG - they will still sync, but without a password to unlock the image - the files are not indexed or accessible.

In the future, Apple's new file system will allow file level encryption so that you can be less selective about sensitive files syncing but more selective about which are locked from inadvertent access (whether spotlight or just opening the file). This is probably 18 months off or more for total iOS / macOS adoption of APFS and file based encryption.
Comment: Assuming a user wants the best of both worlds, another option @patrix is to ensure they don't store any _sensitive_ files in their Desktop or Documents folders as these are the only ones automatically storing data in iCloud Drive. This way they can still have iCloud Drive activated but keep sensitive information in another location so they don't become available on other devices.
Comment: If somebody is concerned about exposing information, wouldn't it be better to turn off iCloud Drive etc on the computer where the sensitive information is coming from?
Comment: Yes @patrix - that would certainly follow. If you don't want or need iCloud to store those files online or access from iOS - turning it off at the source as well makes great sense.


question edited to change meaning

Question: The question Example of  function which is not computable was recently edited by the original poster to completely change the meaning. In particular, the accepted answer is no longer reflective of the question and is misleading as an answer to the current question. I'm not sure what our practice is for this sort of situation.
Comment: I think changing questions in a significant way should be **strongly** discouraged. It wastes peoples effort, leaves answers that are no longer relevant and leaves the answerer in bad light.
Comment: As far as I know, OP means original poster, not original poser. Do correct me if my edit was inappropriate (and wrong).
Comment: Note that I edited my answer correspondingly.
Comment: @Quinn: that does help. My concern was mostly that the first sentence of your answer no longer matches the question, through no fault of yours. I think similar things have come up before. Personally, I think the new question should have been posed as a new question, rather than an edit.
Comment: @doraemonpaul: I don't think a scolding is in order, because the person might not realize they can ask a second question. But I undid the edit and asked them to do so (I hope I did so without any negativity).
Comment: Yes, I agree. At the very least, the OP should make it clear when an edit changes the meaning of the question completely. In particular, the content of the original question should remain.
Comment: @anegligibleperson has alrady done the same thing. He change the question from $\dfrac{\partial^4y}{\partial x^4}=c^2\dfrac{\partial^4y}{\partial t^4}$ to $\dfrac{\partial^4y}{\partial x^4}=c^2\dfrac{\partial^2y}{\partial t^2}$ in http://math.stackexchange.com/questions/192436 when there are completely solved answer. Please feel free to scold him.
Answer: Depending on the situation, I think we should either:
1) Roll back the change, and ask OP to add a new question, linking to the old.
OR
2) Make the edits which ensure that the original question still remains. In this current case, that is easily done. In the general case, when it might not be possible to just make additions to the question, we request OP to create a new question and rollback any changes which change the meaning of the question substantially, pointing OP to this thread.
We should also encourage people who answer to not immediately change their answer and if they do so, they only add instead of taking away.
Comment: In the past, I have stumbled across the question after a new answer (to the new question) has been posted. In these situations, I have edited the question to note both the original and the new questions being asked. I agree with your analysis - this has seemed to work pretty well.
Comment: I suggest also considering adding text to the top of the answer to make it explicit that the question was changed and, possibly, indicate what the difference is so anybody can understand why the answer doesn't match.
Comment: This seems like pointless arguing that does nothing but clutter up the site.  If the user accepted an answer, it's over.  Learn to cope with the fact that your good intentions don't always get rewarded.
Answer: I think that an OP shouldn't modify her/his question after the answers, and according to the answers!
I can understand that an  OP wishes to improve her/his answer, but not to modify the question so to incorporate the answers!
I am new to this site, and today it happened to me that a question was edited after my answer, and some comments that said the same thing I said, and was modified  on the  base of the answer and the comments. This is the thread:
https://math.stackexchange.com/questions/4603615/one-one-function-between-sets-of-equal-cardinality/4603625#4603625
The OP asked how to prove  the statement in the title, and in my answer I said that he couldn't prove it, the statement was false, because it was false for infinite sets.
At this point the OP changed her/his question, and added 'for finite sets'to the statement.
So my answer became stupid and useless, moreover the question became a duplicate (the original original question  was not a duplicate), then the question was closed  and the thread deleted, I lost my upvotes.
What a mess!
Waste of time for people who participated to the discussion, and deletion of a question and of answers that could be useful to leave visible, because this confusion about finite/infinite sets and cardinality and onto/one-to-one function is frequent, in my experience (I am an economist and a moderator of a site of mathematics in my country).
The reason why I write this post, anyway, is not my upvotes, but the interest of the site to have a good functioning.
Comment: @ Martin Sleziak Thank you for editing, I sometimes don't see minor typos as the light of the computer makes me a little dyslexic, it is not sloppiness!

question edited to change meaning


Is it true that |r|=|s| (is equivalent to ) r=|s|?

Question: I'm actually doing an exercise where I have to draw graphs of functions.
I understand r=|s| but not |r|=|s|.
Are they the same?
Comment: $r=|s|$ means that $r\geq 0$. Is this true if $|r|=|s|$?
Answer: They are not the same. If $r=|s|$, then $r$ can never be negative, but $|r|=|s|$ is true if $r=-1$ and $s=1$ (or for that matter if $s=-1$). The statement that $|r|=|s|$ just says that $r=\pm s$, i.e., that $r=s$ or $r=-s$: in both cases $r$ and $s$ will have the same absolute value, regardless of their algebraic signs.
Answer: Let $r = 4$ and $s = -4$. Then, $r = |s|$ and $|r| = |s|$.
Then, switch it around. Let $r = -4$ and $s = 4$. Then, $|r| = |s|$ but $r \neq |s|$.
So they are not always the same.


"Bromobenzene" vs "bromophenyl"

Question: What is the difference between the keywords Bromophenyl and Bromobenzene used in organic chemistry.
Comment: Anywhere where you would use ethyl instead of ethan, you use phenyl instead of benzene. As benzene is $\ce{C6H6}$, while phynyl is $\ce{C6H5}-$. By other words, phenyl is benzene with 1 H removed, making it a single bond substituent.
Comment: Phenyl is an alkyl from benzene, the same as ethyl from ethan. I admit, more logical alkyl name of benzene would be benzyl, but it is already historically reserved for the phenyl-CH2-  alkyl. Bromo- is just a prefix for bromine substituent.
Comment: @Poutnik  do you mean we use "phenyl" when the ring joined as a alkyl group to the parent chain
Answer: Bromobenzene is a complete compound, bromophenyl is a description of a unit in a larger compound
Chemists abbreviate some groups to simplify the names of more complex compounds. So while bromobenzene is a complete name for a compound, bromophenyl signals that the unit occurs as part of a larger compound.
In this case–to abuse strict chemical terminology a little–there is a bromobenzene unit attached to to 2 carbon on an ethanol unit and attached at the 2-carbon on the bromobenzene unit so we say 2-bromophenyl not the more complicated "bromobenzene with the hydrogen at the two position replaced by an ethanol unit with the connection being made at the 2-position on the ethanol."

"Bromobenzene" vs "bromophenyl"