How to choose significance level for a large data set?

Question: I am working with a data set having N around 200,000. In regressions, I am seeing very small significance values << 0.001 associated with very small effect sizes, e.g. r=0.028.  What I'd like to know is, is there a principled way of deciding an appropriate significance threshold in relation to the sample size? Are there any other important considerations about interpreting effect size with such a large sample?
Comment: This is an issue of practical vs. statistical significance. If the slope is truly different from 0, even by a miniscule amount e.g. .00000000000001), a large enough sample will yield a very tiny $p$-value, despite the result having no practical significance. You'd do better interpreting the point estimate rather than the $p$-value when you have such a large sample size.
Comment: Adding to Macro's comment above, in this situation I look for "practical" or "clinical" significance in the findings. For what you are doing, is the effect large enough for you to care?
Comment: What @Macro and I are both saying is that you need to decide whether the clinical effect (point estimates, slopes) is important. Your threshold is on the basis of deciding "yes, this is an important clinical effect" rather than "a significant p-value" because most (all?) of your p-values are significant.
Comment: The point estimate is the observed regression slope estimate.
Comment: @Macro sorry can you clarify what you mean by point estimate here?
Comment: @Michelle yes some IV's generate predictions up to r=.15, and multiple regression coefficients up to r=.25. The motivation for my question is to understand these small effects in relation to  sample size and significance level. The intervention leading to these effects is very simple, so even a small effect is clinically interesting.
Comment: @Michelle ok then I guess I decide that it is an important clinical effect. Amen.
Answer: In The insignificance of significance testing, Johnson (1999) noted that p-values are arbitrary, in that you can make them as small as you wish by gathering enough data, assuming the null hypothesis is false, which it almost always is. In the real world, there are unlikely to be semi-partial correlations that are exactly zero, which is the null hypothesis in testing significance of a regression coefficient. P-value significance cutoffs are even more arbitrary. The value of .05 as the cutoff between significance and nonsignificance is used by convention, not on principle. So the answer to your first question is no, there is no principled way to decide on an appropriate significance threshold.
So what can you do, given your large data set? It depends on your reason(s) for exploring the statistical significance of your regression coefficients. Are you trying to model a complex multi-factorial system and develop a useful theory that reasonably fits or predicts reality? Then maybe you could think about developing a more elaborate model and taking a modeling perspective on it, as described in Rodgers (2010), The Epistemology of Mathematical And Statistical Modeling. One advantage of having a lot of data is being able to explore very rich models, ones with multiple levels and interesting interactions (assuming you have the variables to do so).
If, on the other hand, you want to make some judgement as to whether to treat a particular coefficient as statistically significant or not, you might want to take Good's (1982) suggestion as summarized in Woolley (2003): Calculate the q-value as $p\cdot\sqrt{(n/100)}$ which standardizes p-values to a sample size of 100. A p-value of exactly .001 converts to a p-value of .045 -- statistically significant still.
So if it's significant using some arbitrary threshold or another, what of it? If this is an observational study you have a lot more work to justify that it's actually meaningful in the way you think and not just a spurious relationship that shows up because you have misspecified your model. Note that a small effect is not so clinically interesting if it represents pre-existing differences across people selecting into different levels of treatment rather than a treatment effect.
You do need to consider whether the relationship you're seeing is practically significant, as commenters have noted. Converting the figures you quote from $r$ to $r^2$ for variance explained ($r$ is correlation, square it to get variance explained) gives just 3 and 6% variance explained, respectively, which doesn't seem like much.
Comment: (+1) This is an important fact that many practitioners do not think carefully about: "p-values are arbitrary, in that you can make them as small as you wish by gathering enough data, assuming the null hypothesis is false, which it almost always is."
Comment: @rolando2 thanks for the edit, always getting confused between large/small p-values! I think if it's off to right of distribution it's large, but p-value is small.
Comment: Thank you! The points in your penultimate paragraph are well taken. I am reading the Woolley article and noticed that your q-value formula is off. It should be p* not p/ - I tried to change it here but edits must be >6 characters.
Comment: @ted.strauss I'm glad it's helpful. Sometimes I feel discouraged by the limitations of the tools like p-values that we have to work with. Thanks for noting the mistake in the formula, I've fixed it.
Comment: Thanks for the wonderful answer. But I am not able to access the paper Woolley 2003 using the link provided above.
Answer: I guess an easy way to check would be randomly sampling a similarly large number from what you know is one distribution twice and comparing the two results. If you do that several times and observe similar p-values, it would suggest that there's no real effect. If on the other hand you don't, then there probably is.
Comment: I think you're suggesting doing simulations under the null hypothesis of no true difference with a large sample size and looking at the $p$-values. I can tell you without doing the simulations that $<.001$ proportion of the resulting $p$-values will be as small as the one the original poster observed. This is true for any sample size. This is the definition of a $p$-value.
Comment: In relation to the last comment by @Macro, here is a sketch of the proof that, under the null hypothesis $H_0$, the $p$-value has $U[0,1]$ distribution. Given a test statistic $T=T(X)$, if we observe $t=t(x)$, the $p$-value is defined as $p(t)=\mathbb{P}(T\geq t\mid H_0)$. Suppose that under $H_0$ the distribution function of $T$ is $G_0$, with $G_0$ continuous and nondecreasing, so that it has inverse $G_0^{-1}$. Then, we have $p(t)=1-G_0(t)$, and, for $u\in[0,1]$
Comment: (continuation of Zen's comment): $$
  \mathbb{P}(p(T)\leq u) = \mathbb{P}(1-G_0(T)\leq u) = \mathbb{P}(G_0(T)\geq 1-u) = \mathbb{P}(T\geq G_0^{-1}(1-u)) = 1-G_0(G_0^{-1}(1-u))=u \, .
$$
Hence, we conclude that $p(T)\mid H_0\sim U[0,1]$.
Comment: In fact, the $p$-values that will come out of the process you described will have a ${\rm Uniform}(0,1)$ distribution.


My Twitter replies now showing on my Tweets page

Question: My Twitter replies are now showing on my "Tweets" Page. Before, my replies to my followers showed under "Tweets & Replies" only.  Something changed, but I do not like it.  Do you know what changed and why?
Comment: Twitter goes through redesigns all the time. So do most web applications that are around for any length of time. As for "why" they've done this particular change, only they can answer.
Answer: Twitter re-designed their layout to remove @ replies from being included in character counts. This is so, in theory, a user can reply to an unlimited number of users, and still have room to write the full number of characters, rather than being limited to what's left after the @ replies.
I assume they did this to improve the usability of their product, as when discussions start involving many people it gets more and more difficult to carry on conversations.
So as for the particular UI change you mention, what they've done is separate the 'reply' function from the 'tweet' function, so instead of 'Tweets that are and aren't replies', there are now just tweets.


Use the TCS3200 color sensor without the included LEDs

Question: just a quick question. I want to know if it is possible to use the TCS3200 color sensor without the 4 LEDs included on the breakout board. I want to get the sky colors. Is that possible?
Answer: The photodiodes in the device itself have filters so it should theoretically be possible to use it without auxiliary light sources. Note, however, that the green and blue sensors have two sensitivity peaks and so using it outdoors without an infrared filter is not advised.
Comment: So how could I use the sensor without LEDs? I want to operate it using solar power and can't waste any energy. Can I just bridge them? Will I damage anything by doing that? Also is there any DIY infrared filter that I could build use with materials normal people have at home?


Recommended proximity of HVAC vent to return air

Question: I have an upstairs room with an HVAC vent in the ceiling above the door. The return air is in the hallway just outside of the same door. This room also happens to be the hottest room in the house (by 5-10 degrees in the afternoon). I'm wondering if the duct location is incorrect? My theory is that the cold air is immediately sucked out of the room and never displaces the warm air in the room. Would moving the duct to the other side of the room make a difference in this case?
Comment: @msemack, I'd have to disagree with covering the return.  Assuming the home only has one return upstairs, how would you get the hot air out with the return covered?  And if it's the only return for that HVAC unit, then you just severed the flow of air, possibly resulting in a large block of ice forming on the coils.
Comment: Try covering the return with one of those magnetic vent covers and see if the problem persists.
Comment: If there is only one return upstairs, then it is probably a badly designed HVAC system.  There should be multiple returns, one in any room that will have the door shut for an extended period of time (e.g. a bedroom).  But yes, choking return air completely is a bad idea, and I wouldn't reccomend leaving the return covered permanently, just for a day or 2 as a test.
Comment: There are three returns (one upstairs and two downstairs). Covering the return sounds sketchy. Definitely going to try those covers.
Comment: @msemack, I guess I've been dealing with older and city homes too much, most HVAC installs I've seen have one return per floor.  And if the floor has a dedicated HVAC unit, then that means only one return.  I can see the benefits of having more returns, since I can't sleep with my bedroom door closed.
Answer: I'm not a HVAC engineer, but your reasoning and theory sound good and well thought out to me.
I strongly believe (until I'm proven wrong) that moving the vent to the other side of the room would make a (noticeable) difference to the room's overall temperature during the warmer months.
Does the same duct-work heat your home during the winter months?
If yes, you will also want to take that into account when repositioning the vent.
Answer: Make sure you're adjusting the vents in the other room so that the coolest rooms receive the least air from the HVAC.  Then, as a quick and easy test, try installing a vent deflector that attaches with magnets to push the cool air across the ceiling and into the room, rather than blowing straight down and out the door.


Why doesn't Tor browser block HTTP by default?

Question: Unencrypted HTTP protocol does not protect data from being modified or intercepted. Without a secure connection, the user could be tracked and monitored, deanonymizing them. However, the Tor browser does not enable by default HTTPS connections after installation. It's only advised to make sure that the user is using an HTTPS connection in the Tor Project manual. Some users may not realize this and this could potentially expose them. The HTTPS Everywhere addon already comes pre-intsalled and it contains an option to block unencrypted requests. So why isn't this enabled by default or why isn't the Tor browser blocking HTTP connections without using the addon?
Answer: It's not enabled by default because it would block a significant fraction of the Internet for users. Blocking HTTP-only traffic will likely come in the future once Tor Browser is using a version of Firefox with HTTPS-only mode, and once the developers feel they can do it while minimizing the usability impact (for example providing documentation to explain why it was blocked, allowing the user to bypass the block, etc).
https://gitlab.torproject.org/tpo/applications/tor-browser/-/issues/40294
https://gitlab.torproject.org/tpo/applications/tor-browser/-/issues/19850#note_2723899
Edit: The Tor Browser now uses HTTPS-only mode on desktop by default: https://blog.torproject.org/new-release-tor-browser-115/

Starting in Tor Browser 11.5, HTTPS-Only Mode is enabled by default for desktop, and HTTPS-Everywhere will no longer be bundled with Tor Browser.
Why now? Research by Mozilla indicates that the fraction of insecure pages visited by the average users is very low – limiting the disruption caused to the user experience. Additionally, this change will help protect our users from SSL stripping attacks by malicious exit relays, and strongly reduces the incentive to spin up exit relays for Man-in-the-Middle attacks in the first place.
Comment: Steve, this is a great answer, but the latest statistics show that almost 90% of the web is HTTPS, so very few websites have HTTP right?
Comment: @Swangie Breaking even 10% of the web is still a large fraction. I personally would enable an HTTPS-only mode for myself, but my browsing is biased towards English-focused websites run by big tech companies, so I don't know how making this change as a default would affect other people in the world. I'm not sure what the current Mozilla and Tor Project plans are, but my guess is that they want to be careful about this.
Comment: I understand now, thank you for explaining!
Comment: @Swangie The browsers are like a swiss-knife tools nowdays - like using WebRTC and other features, see my answer for details, the question is **not** that simple...
Answer: 10% out of 1 billion of web sites is not chicken feet's 100.000 millions users say "go **** (away) Tor for good". Never mind this is up to me to keep my data, passwords etc. protected and as bad it is Google making you jump every time its turn on music, now Internet Community have to deal with overzealous developers who are believing they have to help us to be protected as if we don't know how to do so if we needed. Yes our website uses HTTP and NO we don't have nothing to protect. No passwords, no pay system nothing that need even basic inscription in which case while Tor crowed thinks they doing us a favor, 100.000 millions of Internet users removing Tor from their devices.
Comment: HTTPS isn't just about hiding sensitive data. It's also about preventing someone from modifying the webpage contents, for example inserting malicious javascript into an HTTP webpage. HTTPS should always be preferred over HTTP, even if the website doesn't transmit sensitive information.
Answer: The answer is - actually - inside the Tor network design. It is safe to use plaintext protocols, including HTTP, when you're using a hidden service, because the encryption part is already done by Tor. The only two reasons to use HTTPS via Tor are:

Utilizing HTTP/2.0 multi-pipe architecture. By design HTTP/2.0 can not work inside a simple plaintext HTTP
Using client certificates as an authentication token by exporting the environment variables via standard HTTP or email services. It's quite a handy tool, especially when properly integrated with PKI infrastructure

So it's totally not up to the tool - like Tor Browser - to think for/instead-of the user that is using it.


Martial Law vs Zacama, Primal Calamity

Question: It's my turn I have priority I control a Martial Law ... I detain my opponents Zacama, Primal Calamity ... My spell goes into the stack then I pass priority to my opponent. He uses Zacama's ability to destroy target enchantment in this case my Martial Law. His spell goes into the stack over mine he then passes priority back to me I have nothing else to do and the spells resolves. If both spell resolves this means my enchantments gets destroyed and his Zacama is detained? Or my enchantment survives because he can't active his activated abilities? Sorry still trying to understand the stack! I know his spell resolves first does that means he destroys my enchantment and is not detained?
Comment: I want to point out that there are no spells involved here. You have Martial Law's triggered ability, and Zacama's activated ability.
Answer: Your enchantment will be destroyed, then their creature will be detained.
That happens because, as you guessed, their creature only becomes detained after Martial Law's trigger resolves. Since it's been placed on the stack, and your opponent had priority before it resolved, they can use Zacama's abilities normally. That goes into the stack, and resolves before your triggered ability. Your enchantment will be destroyed, and then its trigger will resolve normally and detain their creature until your next turn.
Comment: Now that's a different situation. Arrest is a permanent spell, and only becomes a permanent *after* it resolves. If your opponent activates Zacama's ability in response to you casting Arrest, they'll be able to target any artifact or enchantment that's already on the battlefield, but not Arrest, since it hasn't resolved yet. Logically, they won't be able to activate Zacama's ability *after* Arrest resolves.
Comment: @Chris, you seem to be confusing a "stack" with a "queue."  The first thing into a stack, is the last thing to leave a stack.  The last element to enter a stack, is the first thing to leave a stack.  Where as, in a Queue, the first thing to enter a queue, is the first thing to leave a queue.
Comment: It doesn't matter, because the *Detain* keyword prevents the creature's abilities from being activated. When they're already on the stack, they've already been activated, so whether the creature is detained or not is not relevant.
Comment: I see. Doesn't matter if my "detain target creature" is on top of the stack resolving first? The same thing will happen?
Comment: A quick example. I have an Arrest (Same thing as detain but it's an aura spell). I cast Arrest at the beginning of my turn targeting zacama. My opponent has priority he uses zacamas ability destroy target enchantment. When both spell resolves my enchantment gets destroyed? And his zacama is never Arrested? Sorry I just want to make sure been playing magic wrong for sooo long!

Martial Law vs Zacama, Primal Calamity


Why is "(his) song" in Psalms 42:9 written in the feminine form?

Question: In Psalms 42:9, (his) song is written with a ה yet apparently recited with a ו. Is there a significance to it being written in the feminine form?
Comment: The word "שירה" in this context is associated by some Ugaritists with the Ugaritic word "ḏrt", meaning "dream" ([cf. p. 360](http://cnqzu.com/library/To%20Organize/Books/Brill%20Ebooks/Brill._Handbook_of_Oriental_Studies/Brill.%20Handbook%20of%20Oriental%20Studies/A_Dictionary_of_the_Ugaritic_Language_in_the_Alphabetic_Tradition__Handbook_of_Oriental_Studies_.pdf)). If so, the "ה" is not a suffix, and the possessive "his" is distributed from "חסדו" but not realized at all in the word "שירה". Check out [JBL 73 p. 237](http://www.jstor.org/stable/3262018), if you're into that.
Answer: The Meaning of the Term
The word is written in the feminine form because the antecedent would not be the Lord (masculine), but the word for 'prayer' (תפלה) mentioned in the verse which is feminine. So the term 'her song' would be literally the 'song of prayer' (or better, 'praiseful prayer') that provides comfort in the darkness of night. According to the commentary of the 19th Century Hebraists Keil and Delitzsch,

. . . the suffix of שִׁירֹה is the suffix of the object: a hymn in praise of Him, prayer (viz., praiseful prayer, Hab. 3:1) to the God of his life (cf. Sir. 23:4), i.e., who is his life, and will not suffer him to come under the dominion of death.

The Significance of the Term
This meaning of this term appears consistent with observations from Rashi and the Masoretes, who provide insight into the significance of this term. For example, the margin notes found in both the Masoretic Text in the Aleppo Codex and the Leningrad Codex connect this word with the word in 1 Ki 5:12; that is, in the margin of the Leningrad Codex there is a note to continue to view the written term as "שירה," but when reciting aloud to use the term "שירו." (The literal meaning of "שירו" would be "his song" when aligned with 1 Ki 5:12.) The Masoretes made the note that these two passages are the only two terms in Scripture that are to be understood with the same meaning in this way.
However, as already noted in another posting, Rashi made a correct observation from Midrash Aggadah that this term has a double-entendre based on the reference to 'and Israel dwelt' (וּשרָא) found in the Aramaic of 2 Sam 17:26 in the Targum Jonathan to the Prophets.  The Aggadah provides for the idea that Torah study occurs in day, and comfort occurs at night through praiseful prayer. Rashi appears to have consulted the Babylonian Talmud, which makes the exact same observation of the idea of 'dwelling' based on the Targum Aramaic of 1 Ki 5:12. The precise idea is that the study of Torah provides grace from heaven during the day whose "presence" (or praiseful prayer) will fill the night.

b. Chagigah, Folio 12B
"And how do we know that it is called heaven? 'Look down from heaven and see, even from your holy and glorious habitation' (Is. 63:15).
" 'dwelling:' is where there are platoons of ministering angels, singing by night and silent by day for the sake of Israel's glory: 'By day the Lord commands his loving kindness and in the night his song is with me' (Ps. 42:9)."

In summary, both the Talmud and Rashi juxtapose the idea of 'dwelling' (Targum Aramaic of 2 Sam 17:26 = שרָא) with the 'praiseful prayer' in Hebrew (שירה = feminine suffix) based on the homonym between both words in Aramaic and Hebrew, respectively. The study of Torah in the day leads to the comforting divine presence at night through 'praiseful prayer.' Finally, the literal idea of 'his song' (שירו = masculine suffix according to the Masoretic connection to 1 Ki 5:12) is therefore not contradicted, but is instead amplified and complemented.
Answer: This is a less common orthography, but does appear elsewhere. For example, in Genesis 49:11:

אֹֽסְרִ֤י לַגֶּ֨פֶן֙ עִירֹ֔ה וְלַשֹּֽׂרֵקָ֖ה בְּנִ֣י אֲתֹנ֑וֹ כִּבֵּ֤ס בַּיַּ֨יִן֙ לְבֻשׁ֔וֹ וּבְדַם־עֲנָבִ֖ים סוּתֹֽה׃

Contrast the bolded words with the italicized words. עִירׂה, for instance, is the masculine third person possessive of עַיִר (mule).
Compare the Aramaic suffix -הּ. For example, in the Aramaic translation (Onkelos) of the verse has לְקַרְתֵּיהּ (admittedly translating the word עִיר rather than עַיִר ).
Hebrew also has the suffix in certain cases (e.g. אָחִיהוּ  in Micah 7:2 rather than the usual אָחִיו). However, Hebrew (unlike Aramaic) elides ה in most cases. The orthography of שִירׂה (whether "song" or "dwelling") is a remnant of the earlier pronunciation *שירהו which was later pronounced ׂשִׁירו.
Comment: What is the reconstructed pronunciation you reference at the end? "Shirho"?
Comment: @WAF shirihu > shirehu > shiro
Comment: So there was some point T at which it was written and pronounced with 3 syllables, then at T+1 it was written with two and pronounced with two but they were a different two? How did that happen? Or am I collapsing epochs?
Comment: @WAF I would put it this way: There was *demonstrably* a time T when forms such as  אחיו and אחיהו existed side by side, because the Bible has both of the two forms. Since there is no earlier form of Hebrew attested, there is no *demonstrable* proof that at time T-1 there was only the form אחיהו and not אחיו, but comparative evidence (for which I quoted Aramaic, but really there's much more) shows that אחיהו was likely the older form and אחיו the innovation, and not the other way around, which is consistent with the general tendency of Hebrew to drop the ה in certain places...
Comment: @WAF ... Orthography is a different issue than the pronunciation, but in early Hebrew epigraphy, spellings such as שירה for 3rd person masculine possession were the rule and not the exception, and based on these inscriptions we can tell that the spelling שירו only became the rule later on. The earlier spelling ending in ה is not surprising considering the history of the pronunciation I mentioned above.
Answer: The Chabad translation, following Rashi, translates שירה as "his resting place".

By day, may the Lord command His kindness, and at night, may His
  resting place be with me, a prayer to the God of my life.

Rashi comments on שירה עמי:

may His resting place be with me: Heb. שירה. May His resting place be
  in our midst. שּׁירה is an expression of camping, as we translate (II
  Sam. 17:26): "And Israel encamped," וּשְּׁרָא. I learned this from the
  Great Masorah, which associates this [word] with (I Kings 5:12): "And
  his songs (שירו) were a thousand and five," in the "aleph-beth" of two
  words with different meanings (homonyms). This taught [me] that this
  is not an expression of song, but the Midrash Aggadah does interpret
  it as an expression of song, interpreting in this manner: Israel says
  to the Holy One, blessed be He: "We remember what You did for us in
  Egypt. You commanded us one commandment by day on the eve of the
  Passover, and we observed it, and at night, You redeemed us and we
  sang Hallel before You. But now we keep many commandments, yet You do
  not redeem us. Because of this, I will say to God, my Rock, 'Why have
  You forgotten me?...'"
Comment: So... What does this have to do with the kri/ksiv asked about in the question?


Can I extend SER service cable to accommodate a new breaker box?

Question: I'm planning on replacing a 100A stab-lok (house burner) sub panel with a QO Mains box  but I may need about 6 more inches of SER to get connected comfortably. The original box is already about 12 in from ceiling (I know, too high, but it's neigh impossible to run a new service feed). Can the SER conductors be extended, inside the box, with a butt connector and shrink tubing? Or other thoughts?
This is a sub panel in the basement fed off 100A breaker at main box in garage. It's not my first box conversion, but the first time I've worried about service cable length.
Thanks in advance..
Comment: What gauge are the existing SER conductors?
Comment: Thanks for reading, it's labled '#2' aluminum. It's a fused 100A feed from a breaker box.
Comment: Does this breaker panel serve an entire dwelling unit (apartment or ADU) by its lonesome?  What make and model is the upstream breaker box?
Answer: It is acceptable to splice additional wire to a feeder, as long as that feeder is not an unfused conductor (service entry). Keep in mind that improperly installed splice can become a real nightmare. It might be better to try and raise the new panel up if there are no obstructions rather than try extend the feeder.
Also if an AHJ gets involved they may want to see if the panel has the proper clearances to legally install the splice. That would be wire bending area and proper fill.
Good luck.
Comment: @Chuck - I would use an insulated tap connector. They are made by Polaris, Ilsco, Burndy, or any connector manufacturer. You can get them in many configurations depending on your need and space requirements.
Comment: Thanks RME, just trying to keep my options open and it is a fused feeder from the main box (100A circuit). No plans on AHJ nosing around, either, but would you have a recommendation on splice hardware for #2 Alu? The splice will be inside the new box, too. Thanks again for the input


Are International driving permits country-specific, or can I apply just once?

Question: In India we need to provide visa details and air tickets to get an International Driving Permit (IDP). If I am traveling to multiple countries, do I have to apply multiple times or is a single document enough for all the countries which accept IDP?
Comment: In general, they are not country specific, but I do not know whether that is also true in India.  But a little searching online did not reveal any evidence that the application requires visa details or air tickets.  Where are you applying for the IDP?
Comment: Which countries do you plan to visit? I know that France and Italy require different IDP.
Comment: Indonesia and Thailand
Answer: There are 3 slightly different versions of the International Driving Permit: the 1926 Convention, the 1949 Geneva Convention, and the 1968 Vienna Convention.  See https://en.wikipedia.org/wiki/International_Driving_Permit for details.  You might find you need to apply for 2 permits. Which one(s) you need is dependant on which convention your destination countries have ratified.
Answer: You do not need to apply multiple times.
The original question was if you need an international driving license per trip. This should not be necessary. As noted, there are international conventions for international driving licenses.
Nothing in those conventions says that a license would be limited for a single trip or country. The license is valid until its expiry date.
However, the overall picture is a bit more complicated:

There are different types of conventions and IDLs

Not all countries accept all types
Most countries only issue one type
Example: Germany does issue IDLs according to the Vienna convention, but Japan requires one according to the Geneva convention: A German in Japan cannot use their IDL, but has to follow a different procedure

IDLs are not always required between all countries

Example: EU driving licenses are always valid in all EU countries and some more

IDLs may be required in theory, but not in practice

Example: Europeans in the US theoretically need an IDL (at least in some states), but in practice nobody will ever ask for it.

Usually any travel guide (or your national automobile club) will know what the rules are for that country.


Switched from the Ethereum Wallet's test network to main network and need to remove the previous data

Question: I was on the Ethereum Wallet's test network and finally worked out all the code, but now that I have switched over to the main network I've had to download a lot of the preexisting blocks and has my Mac's storage nearly full. Is there a way I can clear out the previous data from the test network to free up space? Also, I thought about uninstalling and then installing it again, but I've already sent some ether to the "my account" in the wallet, would I lose that account or can I have it recovered?
Thanks for any and all help!
Comment: As a side note - in terms of development and testing you don't have to run a local node. By using MyEtherWallet (MEW) and MetaMask for example in the browser you can deploy contracts to a specific test network (and the main network) directly.  MetaMask also has a button to press to get test ether from a faucet on the test network.
Answer: The chain data are stored by default here: <code>~/Library/Ethereum</code>
You can delete the corresponding folder, the one matching the testnet.
Concerning your ether, it is on blockchain. You just have to synchronize again and will see your ether.
(Reading your last answer, you should learn about how blockchain works. Everything is stored on the chain, so everyone on the network has the same information. You delete the information on your side? Does not matter, just synchronize (download from other nodes) and you will see your ether again!)


Why does Windows Phone close applications suddenly?

Question: My Lumia 435 Dual SIM enjoys 1 GB of RAM but often when I open an application - not necessarily a heavy one e.g. messaging apps, etc. - it suddenly closes the application, or within the application, it suddenly freezes and closes the application. I suspect this might be a RAM usage issue, but it is unacceptable as a single modest app does not seem to probably overload the RAM. I used to have an Android phone with similar hardware specs (Comparison of the two phones) but it didn't close the applications like this. Instead it got slow at times and prompted me to wait and had everything in control, but Windows Phone seems to be very hasty and impatient when handling apps. So, what might be the cause for such unexpected app exits?
Comment: @maxvernon as a matter of fact, I tried this too even when no other apps are running I still have the problem.
Comment: You can close open apps by holding down the "Back" button, then tapping the "X" button on the top right of each app.  This may help your issue.
Answer: Normally I would ask whether enough space is free on your phone;
You should if possible try formatting and install apps to SD card if possible; If that doesn't work you probably need to take it to the Service Centre


Resizing an SVG using GIMP

Question: I exported an image from this site https://watabou.itch.io/medieval-fantasy-city-generator and am trying to make it really big, but can't figure out how. The tutorial vid I found uses an iOS or modified UI and I can't follow it. How do I resize this image, these paths, or whatever?
Comment: Hi. Welcome to GDSE. GIMP isn't an SVG editor, by any stretch of the imagination.  Use Inkscape instead. It's also free and Open Source
Answer:
Use Inkscape which is meant to edit SVG graphics
With Gimp (if the SVG is only the beginning for a final raster image). Several solutions (they assume that you have ticked the "Import paths` option in the SVG open dialog):

If you do File>Open and select an SVG file, you can change the resolution, and this changes the size of the imported image. So you can scale up by just increasing the resolution.
Once the image is loaded, Image>Scale image with scale everything, including the imported paths.
You can also scale just one path, using the Scale tool in Tranform: path mode (third icon in the Transform: line in the Tool options).
Comment: I'll second the suggestion to use Inkscape for your edit requirements. If you discover that your image is not a true SVG, and is raster instead, you can use the Trace Bitmap feature of Inkscape to convert it for your purposes.

Resizing an SVG using GIMP


What is the word for someone who dabbles in different art forms but can't master any?

Question: What is the word for someone who jumps from one artistic media to another but they never master anything. I remember a professor using it once and I just can't figure it out. (For example, Rob tried painting for 2 years, now he's into photography, but wait, he just started writing.) At the end of it all, he just dabbled here and there but isn't mastering any of them. I know the word has a a negative connotation. I'm not even sure if it even has to be an artistic related word, I just remember my art professor using it with that example.
Answer: Could the word have been dilettante? It doesn't necessarily imply several different media, but it means a person whose interest in (usually the arts) is only superficial.
Answer: Jack of all trades, master of none.

"Jack of all trades, master of none" is a figure of speech used in reference to a person who has dabbled in many skills, rather than gaining expertise by focusing on one.
. . . When abbreviated as simply "jack of all trades", it is an ambiguous statement; the user's intention is then dependent on context. However when "master of none" is added this is unflattering and sometimes added in jest.


Parenthesize what I have highlighted

Question: I want to highlight a piece of equation, click a button and have that part taken into parentheses.
Comment: Take a look at `NotebookApply`.
Answer: I have this palette open all the time:

CreatePalette@Row@
  {
  Button["(\[SelectionPlaceholder])",
              FrontEndExecute[
              FrontEndToken[SelectedNotebook[], "SelectionParenthesize"]]],
  Button["[\[SelectionPlaceholder]]",
         FrontEndExecute[
         FrontEndToken[SelectedNotebook[], "SelectionBracket"]]],
  Button["{\[SelectionPlaceholder]}",
         FrontEndExecute[
         FrontEndToken[SelectedNotebook[], "SelectionBrace"]]],
  Button["\"\[SelectionPlaceholder]\"",
         With[{e = NotebookRead@SelectedNotebook[]},
              NotebookWrite[SelectedNotebook[], RowBox@{"\"", e, "\""}];
              SelectionMove[SelectedNotebook[], All, Expression, 2]]]
  }

By the way, in some text editors (e.g. Sublime Text, Texmate), when you make a selection and press a (, [, { or ", you automatically get the selection wrapped with the corresponding character. I really wish that the Mathematica editor worked like that.
UPDATE: I have simplified the code and modified the last button (wrap selection in quotes) so that the modified string is selected. This is how the other three buttons behave. I borrowed some of @halirutan answer's code in order to make this work (thanks!).
Comment: Is it possible to merge this with writing assistant, or make it come up every time I open mathematica?
Comment: After you run the code, select "Install Palette" from the "Palette" menu. Then, it will be very easy to open it when you need it. In regards to merging palettes: I don't know. I guess that you need to look for the writing assistant source code and modify it, but I think it is not worth the trouble. What would be great is to set a keyboard shortcut to these actions.
Comment: +1 nice tool. How would you increase the size of these buttons?
Answer: Please start playing with NotebookRead and NotebookWrite and look what expressions are returned when you select different things. You could use a simple button like this
Button["Print Selection", Print[NotebookRead[SelectedNotebook[]]]]

Now, you want to change you selection by putting parenthesis around it. A first very simple version looks like this:
Button["Parenthesize",
 With[{e = NotebookRead[SelectedNotebook[]]},
  NotebookWrite[SelectedNotebook[], RowBox[{"(", e, ")"}]]
  ]]

Answer: Cross posted in community: Put parentheses around selection
Limitations and problems with .tr files made me create live templates: Live code templates
Once installed you can set package's stylesheet or add templates menu to all notebooks by:
SetOptions[$FrontEnd, NotebookEventActions -> {
     {"MenuCommand", "InsertNewGraphic"} :> Block[{$ContextPath}
        , Needs["DevTools`"]    ; DevTools`OpenNotebookMenu["CodeTemplates"]
        ]
      , ParentList
      }
    ]

and you are ready to go, with a caret just after the symbol (or when you select something) you can hit Ctrl+1 followed by ( and wrapped it is.

Parenthesize what I have highlighted


Can your Stack Overflow Careers profile be used as an official resume?

Question: Like the title says, can your Stack Overflow Careers profile be used as an official resume? Is it professional?
Comment: Personally as someone who handles hiring software devs I would no accept it. Just comes across as lazy. (not mean, just being honest) IE not professional
Comment: True software engineering "lazy" solution to this problem would be to design a solution that reads your SO profile page and uses the information found there to generate a nicely formatted resume. Then, whenever you update your SO career profile you just rerun your SO-to-resume compiler.
Answer:
can your Stack Overflow Careers profile be used as an official resume?

Yes you can. You can choose to use anything you like as your resume.

Is it professional?

Not in my mind.
Look around and see what kind of information resumes are intended to provide.
Remember that readers of resumes generally want straightforward simplicity. They don't want to puzzle through unfamiliar formats.
Then ask yourself if your Stack Overflow Career profile presents the experience that you would want a potential boss to go through, and if it puts you in your best light.
Answer: I'm not sure the word "official" can reasonably be applied to a resume. There's no central authority regulating what a resume should look like.
The question isn't whether it's "official", it's whether potential employers will accept it. My suspicion is that most won't. Remember that recruiters and employers process large numbers of resumes (perhaps dozens or hundreds for each job). Providing a resume in the format they expect makes their job easier -- and you really want to make their job easier. Failing to do so makes it very easy for them to move on to the next candidate.
My own resume includes the URL of a web page that includes a link to my SO profile. A direct link to your profile might also be reasonable.
Answer: I would say no. Most of recruiters / HR personnal would still expect to see your CV in a traditional printable format. However, it is worth including a link in it to your SO Careers page. That's what I did; it seems that recruiters find it fascinating and it helps me stand out of the crowd. (This is just a feeling though, with no facts to back it up. The length and breadth of my professional experience and the tone of my CV seems to stand out of the crowd by itself - for better or worse -, so it is hard to gauge the effect of the SO Careers link in isolation.)
Comment: +1: The SO Careers profile actually contains a resume which has a link from which you can create a pdf. I would say that could serve as an official resume with a proper cover letter attached, but a standard SO profile is not even nearly informative enough to even pretend to be a resume. Personally my SO careers resume is the most complete resume I have on file anywhere, but I still do not use it by itself. I typically have a tailored resume to the position I'm applying for and then provide a link to the careers resume either at the end or during an interview.
Comment: I always think more of a candidate that submits this format, as it says lots to me about them besides their skill in coding.  I rarely get it as the first format, though.
Answer: Keep in mind that a certain amount of the resume generation and application process is showing that you care enough and are clued in enough about the position to spend time preparing the material for the reader.
Providing it in a way that the reader can receive and comprehend it is the first step.  I know of very few application options where you can just paste a web link into the application and you can't easily print out the Careers page and hand it off.
If what you are doing is printing the SO Careers page or just saving it as HTML and pasting into the job opportunity application page - be prepared for the formatting to be pretty odd looking, and likely to communicate "I didn't really bother to try hard to make this readable".
OTOH, if you've spent a lot of time carefully crafting your experience and job description stuff on Careers, there's no reason you can't reformat all of that into a pretty decent resume - they ask all the normal resume type information and more.  Just make sure you go with a standard resume format as you cut/copy/paste the resume together.
I generally go the other way - I use my resume to build my Stack Overflow Careers page... not the other way around.
Answer: If you go to your Careers profile you will see the "create PDF" button. The resulting PDF is actually pretty nice CV, provided your profile is up-to-date and full with relevant data. If you are concerned that the potential employer will think that you are too lazy to create your own CV, but still want to show off your SE profile, just put a link to your profile at the CV header.


Is Ibuprofen Safe To Use As A Catch-All First Aid Solution

Question: I've heard it said that when in doubt use (or administer) Ibuprofen.  The idea being that it's a safe, general-purpose medical tool.  Assuming you follow the instructions on the bottle, is this a viable strategy?  Or are there situations or scenarios where it would be better to err on the side of doing nothing?  Are there situations or scenarios where you would definitely want to not use Ibuprofen, again assuming you at least follow the instructions.
Comment: This is much too broad. There are countless problems one can elaborate on (headache? shoulder pain? stomach ache? flu? nosebleed? chest pain? fracture? snake bite? rash? minor aches and pains? major aches and pains? fever?) Are you asking about all of these and more? Literally, there are innumerable scenarios for which you're asking a blanket answer to cover. If you want an actual answer, you need to focus your question to something answerable.
Comment: It's intentionally broad. I see the question is up for being closed, but I don't think this is good for the site. Some questions about health are very broad because health is an extremely broad subject, as you pointed out. When you're not an expert, yet are faced with pressing needs, you would like to have a rule of thumb. I believe that it's unrealistic to have a health site that excludes discussions related to broad and imprecise rules of thumb. The subject of health is immense and health issues are serious, if not occasionally life-critical. As such, there's just no way around it.
Answer: For every individual situation, one must weigh the risks vs. the benefits. If the potential or actual benefits outweigh the potential or actual risks, and the situation calls for ibuprophen, you take the medication.
If the potential benefits don't outweigh the potential risks, you don't take the medication.
The risks vary from individual to individual and from situation to situation.
There is no blanket answer to your question.
A Review of Quantitative Risk–Benefit Methodologies for Assessing Drug Safety and Efficacy—Report of the ISPOR Risk–Benefit Management Working Group, J. Guo et al, Value in Health, Volume 13, Issue 5, APR 2010
Comment: _There is no blanket answer to your question._ That's a fair answer to my question.  Can you provide one concrete case where Ibuprofen must not be administered, assuming you're already following the directions on the label?


Covariant Derivative of Kronecker Delta

Question: I am reading Carroll's book on GR right now, and I ran into a little trouble in his chapter 3 on curvature. He is establishing the properties of the covariant derivative, and claims that the fact that the covariant derivative commutes with contraction, i.e $$\nabla_\mu T^\lambda {}_{\lambda \rho} = (\nabla T)_\mu {}^\lambda {}_{\lambda \rho},$$ implies that the covariant derivative of the Kronecker delta is zero: $$\nabla_\mu \delta^\lambda_\sigma = 0.$$ I do not see why this is the case. I would greatly appreciate it if someone could point out what I am missing. Thanks!
Comment: The Kronecker delta is a constant tensor field, so it differentiates to 0...
Answer: Note that $\delta^i{}_j=\delta^i{}_k\delta^k{}_j$. Then
$$\nabla_l\delta^i{}_j=\nabla_l(\delta^i{}_k\delta^k{}_j)=C(k,m)[\nabla_l(\delta^i{}_k\delta^m{}_j)]=C(k,m)[\delta^i{}_k\nabla_l\delta^m{}_j+\delta^m{}_j\nabla_l\delta^i{}_k]=2\nabla_l\delta^i{}_j$$
where $C(k,m)$[...] is defined as the contraction operator which contracts the $k$ and $m$ indices. Thus $\nabla_l\delta^i{}_j=0$.
Comment: Thinking about this again, this seems to be the only answer that actually uses the fact that the operation commutes with contraction, so I think it should be taken as the answer.
Answer: The partial derivatives $\partial_\lambda \delta^\mu_\nu$ are clearly zero because the components of the Kronecker delta are constant functions of spacetime coordinates (one or zero).
One may always go to a locally Minkowski frame where the Christoffel symbols vanish and there, the covariant derivative is equal to the partial one and vanishes, too. Because the Kronecker delta is a tensor, its covariant derivative must be the same in all other frames, too.
Alternatively, one may explicitly write the Christoffel symbol terms, too:
$$ \nabla_\lambda \delta^\mu_\nu = \partial_\lambda\delta^\mu_\nu - \Gamma_{\lambda\kappa}^\mu \delta^\kappa_\nu - \Gamma_{\lambda\nu}^{\kappa} \delta_{\kappa}^\mu = 0 + \Gamma^\mu_{\lambda\nu}-\Gamma^\mu_{\lambda\nu} = 0.$$
The cancellation between the two connection terms is the same cancellation that also allows to ignore contracted pairs of indices in the tensor. I don't think it's helpful to "derive" the second statement from the first one, however, because the first one doesn't explicitly use the Kronecker delta at all so the claim that the first fact "implies" the other must be taken with a grain of salt.
Well, if I had to say what was meant, it was that
$$ T^\lambda{}_{\lambda\rho} = T^\lambda{}_{\kappa\rho} \delta^\kappa_\lambda $$
and the $\nabla_\mu$ derivative of this sum of products may be written using the Leibniz rule as
$$\nabla_\mu T^\lambda{}_{\lambda\rho} = (\nabla T)_{\mu}{}^\lambda{}_{\kappa\rho} \delta^\kappa_\lambda + T^\lambda{}_{\kappa\rho}  \nabla_\mu \delta^\kappa_\lambda $$
The assumption is the equation without the last $\nabla\delta$ term, so this last term has to vanish for any tensor $T^{\lambda}_{\kappa\rho}$, which implies that the whole $\nabla_\mu \delta^\kappa_\lambda$ object is zero, too.
Comment: yes, I agree with you that this is probably what the author had in mind. Thanks.
Comment: I've added an explicit calculation.
Comment: While this is correct, it does not answer OP's question about using contractions to prove this.
Comment: I reiterate my first comment. (Unless one uses the contraction rule + Leibnitz rule to prove the covariant derivative rule for $(1,1)$ tensors, as is usual, of course. But that's not stated in this answer.)
Comment: I don't need to use all the assumptions. I've still proven the implication. ;-)
Comment: Could I also argue that because the covariant derivative is defined such that when operating on a scalar, the operation reduces to partial differentiation, and the kronecker delta with contacted indices is a scalar, and therefore the identity holds? (obviously the off-diagonal elements are zero)
Comment: I've added the  derivation that I am confident that the author of the book actually wanted the reader to make.
Comment: @nickodel - you can't because in this way, you would only prove that $\nabla_\mu \delta^\mu_\mu = \nabla_\mu D = 0$, with the contracted indices, a scalar equation, but not for the individual pieces (not the tensor equation).
Comment: @nickodel No, that doesn't work, because "contraction of a tensor $=0$" does not imply "tensor $=0$." A relevant example is any Ricci-flat but Riemann-curved spacetime.
Comment: O.K, I see why this doesn't work. thanks
Answer: You can write the Kronecker delta tensor as a product of the metric tensor
$$\nabla_a(\delta^a_b) = \nabla_a (g_{bc} g^{ac}) = \nabla_a (g_{bc} g^{ac}) = g_{bc} \nabla_a g^{ac} +  g^{ac}\nabla_a g_{bc} $$
As you may recall, the covariant derivative of the metric tensor is $0$ in general relativity.
Version without using the metricity of the connection :
$\nabla_a (\delta_b^a T^b) = \nabla_a T^a$, but also $\nabla_a (\delta_b^a T^b) =   \delta_b^a \nabla_a T^b + T^b \nabla_a \delta_b^a$, so contracting the delta with the connection, this gives us
$$\nabla_a T^a = \nabla_a T^a + T^b \nabla_a \delta_b^a$$
Which will only be true for all $T$ if $\nabla_a \delta_b^a = 0$.
Comment: Yea this makes sense, however, in Carroll's book, he claims that the covariant derivative of the kronecker delta is zero BEFORE introducing the property of metric compatibility. He seems to be claiming this holds true even if the covariant derivative is not metric compatible.
Comment: Why is $\nabla_ag^{ac}=0$? The defining characteristic of the Levi-Civita connection is that $\nabla_a g_{bc}=0$ (lower indices).
Comment: Try it this way then maybe : $\nabla_a (\delta_b^a T^b) = \nabla_a ( T^a) $ but also $\nabla_a (\delta_b^a T^b) =   \delta_b^a \nabla_a (T^b) + T^b \nabla_a (\delta_b^a )$, meaning that $\nabla_a ( T^a) = \nabla_a (T^a) + T^b \nabla_a (\delta_b^a )$, hence $\nabla_a (\delta_b^a ) = 0$
Comment: I just realized I kind of blew this however, because the "a" indices do not need to be contracted. It holds for each component in the kronecker delta individually. I think your proof still holds however if you just turn one of the a's into a c or something. I edited the original question as well.
Comment: Also, looking closer, where do you use the "commutation with contraction property" in this proof? This seems only to use the Leibniz rule.
Comment: @nickodel He uses it implicitly in $\nabla_a (\delta_b^a T^b) =   \delta_b^a \nabla_a T^b + T^b \nabla_a \delta_b^a$.
Answer: Kronecker delta is the (1,1) tensor satisfying
$$\delta^{a}\vphantom{\delta}_{b}v^{b}=v^{a}$$
for an arbitrary vector $v$. By Leibniz rule of affine connection, we get
$$\delta^{a}\vphantom{\delta}_{b}\nabla_{c}v^{b}+v^{b}\nabla_{c}\delta^{a}\vphantom{\delta}_{b}=\nabla_{c}v^{a}$$. Giving arguments vector $u$ and linear form $\omega$ to the above,
$$\omega_{a}u^{c}\left(\delta^{a}\vphantom{\delta}_{b}\nabla_{c}v^{b}+v^{b}\nabla_{c}\delta^{a}\vphantom{\delta}_{b}\right)=\omega_{b}u^{c}\nabla_{c}v^{b}+\omega_{a}u^{c}v^{b}\nabla_{c}\delta^{a}\vphantom{\delta}_{b}=\omega_{a}u^{c}\nabla_{c}v^{a}$$,
we get
$$\omega_{a}u^{c}v^{b}\nabla_{c}\delta^{a}\vphantom{\delta}_{b}=0$$.
Because the above holds for arbitrary $u$, $v$, and $\omega$, we conclude that
$$\nabla_{c}\delta^{a}\vphantom{\delta}_{b}=0$$.
Answer: I do not know whether this has been mentioned in the other comments/answers but I write this short answer anyway. $\delta{^\mu}_\nu=g^{\mu\rho}g_{\rho\nu}$. Now from the vanishing of the covariant derivative of the metric tensor and its inverse ($\nabla_\sigma g_{\mu\nu}=0$ and $\nabla_\sigma g^{\mu\nu}=0$), and the Leibniz rule for the covariant derivative, you can conclude that $\nabla_{\sigma}\delta{^\mu}_\nu=0$.

Covariant Derivative of Kronecker Delta


Create a new layer every time I make anything new in Illustrator as in photoshop

Question: As we add a new shape or insert an image in photoshop there is a new layer created every time but this is not happening in Illustrator.
The whole project of mine is created in 1 layer only but I don't want that.
I want each layer to get separated .
Hope you get my query
Answer: Layers are inherently different in Photoshop and Illustrator. Everything in Photoshop is a layer, but Illustrator's Layers panel is actually layers and objects. Everything is created on one layer by default but you can still open that layer and see each object as it's own "layer".
If you do want everything on it's own layer (although you probably don't need to), you can do so by selecting the top level layer in the Layers panel and choosing "Release to Layers (Sequence)" from the panel menu:
Comment: What does it matter if its one leyer up or down? Also worth noting illustrator makes much more objects than photoshop. I mean 100 layers in PS is problematic a 1000 even more so. 1000 in illustrator is a normal day in the office
Answer: In photoshop the command Ctrl+Shift+N does the trick for me. Just do this every time before you work on a new item.
Comment: As the question is about Illustrator, I fail to see how this answers the question? Please explain!


SMS conversation with MobileConnect

Question: Does anyone have experience handling MO (inbound) SMS messages in MobileConnect? Our use case is sending an outbound message to a contact from within Salesforce. If the contact replies how can we see/capture the response? Are we limited to the Text Response template with a Keyword? Does this work differently with a private short code instead of a shared short code? Any help/advice is appreciated.
Comment: Is "from within Salesforce" referring to Marketing Cloud or CRM/Force.com? What is the perceived limitation of Text Response?
Answer: Depending on your use case and what you want to have happen, is important to note the following regarding your solution.
To send an SMS from Salesforce, you need to initiate the SMS using:

APEX Call to create the SMS sende via the MC API
Salesforce Entry Event in Journey Builder, and send the SMS via Journey Builder (note: The contact needs to exists in MobileConnect and opt'ed in to a keyword on the BU here)

When receiving a text-response or whatever flow you have, again, you have a couple of options - but the main thing to consider comes down to your contact model (does the same mobile number exist more than once?).
Overall what you need to ensure is that:

The subscriber within mobile connect has an attribute with the SFID stored
And, depending on use case, that your SubscriberKey is equal to the SFID

What this enables is that:

When you receive a text, you could use AMPscript to pull the the SFID variable, and the use that variable to create whatever you want to inside Salesforce Core (using CreateSalesforceObject)
If you use the SFID as SubscriberKey, you could also just add a row to a data extension which would allow you to inject people into a journey, which, would allow for the journey to control bevahior and record creation inside Salesforce Core.
Comment: I received a requeriment to send a SMS to a customer to confirm a visit on store. If he/she reply the SMS with "1" I can confirm the visit and change the Status of Event in SalesCloud. I understood your propose but where can I use AMPscript do use CreateSalesforceObject? Is there any kind of trigger on "Received text message response"?

SMS conversation with MobileConnect


Why did Mad-eye Moody (disguised Barty Crouch, Jr) wait until the very end?

Question: If Mad-eye Moody's only purpose was to get Harry to Lord Voldemort then why did he have to wait until the very end of the Tri-wizard tournament? Being a teacher he had Harry at his mercy anytime so should he take the pain of getting Harry into the tournament, risk helping him with the tasks, and so on? He could have easily done it any time during the entire year with any other object as the port key.  Why was the Triwizard cup chosen?  Is there anything that I'm missing?
Comment: An unusual choice of "accepted" answer.
Answer: It was Voldemort's plan. Who was Barty Crouch Jr. to decide to do something different from what Lord Voldemort decided?
As for why Voldemort wanted to wait - he had detailed plans to orchestrate. And enough patience/intelligence to follow them at appropriate pace.
Part of those plans was making sure that he didn't announce his resurrection to the Ministry right away, as abducting Harry via Portkey from Hogwarts would - instead, had he disappeared from inside the Maze, nobody would have known what happened, or blamed Moody/Barty.
Answer: There are three critical components to consider.
One: portkeys are not supposed to be used to transport oneself onto or out of the grounds of Hogwarts without prior knowledge of the ministry and Dumbledor.  It is possible to break this rule (as we see Dumbledore do himself in Order), but as the only example of a wizard doing this without ministry permission is Dumbledore himself, Crouch probably wasn't capable of it.  The cup was an "allowed" portkey and was supposed to transport the winner out of the maze and back to the stands to be celebrated.  Crouch Jr. altered it a little before placing it by adding the portus to the graveyard.  This is simpler than layers of spells probably needed for circumventing portkeys that have not been "registered" so to speak.
Two:  While Crouch could have killed Harry and then escaped, Voldemort wanted to kill Harry himself and he needed Harry's blood.  It hurt Voldemort's pride that he had been defeated by a baby and he felt he needed to prove there wasn't really anything special about, "the boy who lived."  He talks about this need in "The Death Eaters" when he says:

"You know of course, they have called this boy my downfall. . . but no
  matter, I can touch him now! [Harry feels terrible pain in the next
  paragraph while V touches him] I miscalculated my friends, I admit
  it."

He goes on for quite some time re-hashing stuff we really already knew from the first three books.  He talks about the Sorcerer's Stone and being thwarted again by Harry and his dissappointment in the lack of a search for himself by the Deatheaters standing there, but goes on and begins to speak about Bertha jorkins and how the plan to capture adn kill Harry evolved,

"But how to get at Harry Potter?  For he has been better proteced than
  I think even he knows, protected in ways devised by Dumbledore . . .
as long as he is in his relation's care.  Not even I can touch him
  there. . . Then, of course, there was the Quidditch World Cup. . . I
  thought his protection might be weaker there, away from his relations
  and Dumbledore, but I was nt yet strong enough to attempt kidnap in
  the midst of a horde of Ministry wizards. and then he would return to
  Hogwarts . . ."
"So how could I take him?  Why by using Bertha Jorkins's information
  of course.  Use my one faithful Death Eater, stationed at Hogwarts, to
  ensure that the boy's name was entered into the Goblet of Fire. . . "

Voldemort goes on to have Wormtail release Harry so they can have a "duel" in the next chapter.
Additionally, Harry neede to be portered to Voldemort at an expected time and a particular place.  There was a complicated bit of spell work and a potion involved here so just having Harry show up when ever crouch could happen to get him to touch the proper pen or whatever wouldn't have worked well.
Just before having Harry released for the Duel Voldemort says:

"You see, I think, how foolish it was to suppose that this boy could ever have been stronger than me, but I want there to be no mistake in anyone's mind.  Harry Potter escaped by lucky chance and now I'm going to prove my power by killing him here and now. .  ."  Emphasis mine.

Sure, Voldemort could have had Pettigrew call his Deatheaters to guard the graveyard and wait and capture him and then had pettigrew start in on the potion etc. etc. but then, I don't think Voldemort trusted the other Deatheaters to let Pettigrew go through with it, he certainly didn't want all of them seeing him in his weakened state and doing it the way he did meant he could put on a show and monologue for awhile - something all Villians truly enjoy.
Answer: Another point is that Voldemort wanted a show.  He wanted to make a grand event of Harry's kidnap, right under Dumbledore's nose.
He does not just want Harry, he wants him a glorious way which will have the wizarding world talking in whispers about it for years.  Kidnapping a young teenager in the middle of the night is a feeble way to go about things for the great Voldemort.
Answer: If everything had gone according to plan, big V would have been able to use the Portkey to get himself and his death-eaters into Hogwarts (undermining Dumbledore's ability to protect anyone). No doubt parading the lifeless body of "the boy who lived". This would have offered the maximum amount of worldwide exposure - as the event was attended by wizards from all over the world. It would have also given him the opportunity to kill the heads of three major eurpoean schools, the Minsiter for Magic and I can only assume other influential figures in the magic community. Taking all this into consideration the Port Key AND the Tournament could be considered a dream scenario for a large-and-in-charge return.
Personally, I can't be sure if this level of thought went into this area of the story. After all the plan was destined to fail purely because it was Book 4 in a series of 7, but this is what I plugged the plot hole with so I could sleep at night!
Edit: This is supported by the fact that the Portkey was configured to return to Hogwarts at all. I don't think this is the default behaviour for them.
Comment: I don't think this plan would be in keeping with Voldemort's character.  Remember, Dumbledore is the wizard he fears most.  **Also the fact that the cup has a return portus is actually incorrect.**  It does not return Harry to the center of the maze.  It takes Harry to the beinning of the maze where it was **initially designed to take the winner who first touched it.**  I seem to recall something about V wanting Harry's death to look like a mistake made during the tournament.  He had more strength building to do  and gather of the DE's to do before he starteda direct and full-out war.
Answer: Barty Crouch Jr said it himself, in that he couldn't do ANYTHING to risk Dumbledore suspecting him. Let's face it, you have to be pretty damn conniving to get something past Dumbledore.
Anyway, it's just a story. If he did it your way, the book would be about 100 pages long.
It's all about the journey :)
Comment: Pshhhh.  They don't even get to Hogwarts until page 171...


Search value in big SOQL

Question: I'm pretty new on apex. I'm writting an apex class to load a csv file and I need to process the data before to insert on a custom object, each record contains account's name but the field has to be the account's id, so I have a big SOQL with id and names of accounts and I need to search on a big list the name to get the id. If I use a for loop I get the cpu time error so I tried to use map to store the data, but  I want the Id and the method get() needs de id to return de value. Is there a way to get the id using the name? or use the name as key in the map and the id as value.
Thanks
Comment: without posting code to show what you tried, you are asking community to do your work for you which is not part of this forum's mission. Keep your code to a minimum and clearly indicate where you are stuck
Comment: not sure what you're doing, but if you use upsert then you can use an externalId to either insert/update your related data or to insert/update the account record itself. just define a text field on the account as external Id and make sure it has the right cross-reference value - here it sounds like you're using the name (I don't recommend this, but if the shoe fits...).
Answer: You can create a map from the name to the ID like this (where names is the set of names from your CSV; if the number of Accounts is small you won't need that where term):
Map<String, Id> m = new Map<String, Id>();
for (Account a : [select Id, Name from Account where Name in :names]) {
    m.put(a.Name, a.Id);
}

and then when you do a get using a name from the CSV the ID will be returned.
Note that this arrangement relies on all Accounts having unique names.
Comment: Yes, the names are uniques. This really work for me. Thanks

Search value in big SOQL


Apple Computers Not Connecting to the Internet

Question: So, it started right after Christmas when someone in our family got a brand new MacBook Air. She started having problems connecting to the internet right away, and then the rest of the macbooks (about 4 or so) had trouble connecting too. Up in the top bar at the top of the screen, the wifi icon shows that it is connected to the internet. But the wifi will turn off and on, and we figured out it had to do with the macs connecting to an ipv6 network. Every time it connects to an ipv6 network, it can't display any webpages. But anytime it connects to an ipv4 network, you can access anything that requires internet. Does anybody know about this?
Comment: What version of OS X do each of them run?
Comment: One of them runs El Capitan, the two run Yosemite, and the other is running Mavericks.
Comment: Is the one running El Capitan running the latest update?
Comment: Do you know when the newest update came out? I think the computer hasn't been updated since the computer was set up on Christmas day. Was there a version of El Capitan that had internet troubles?
Answer: From my understanding, if you have both IPv4 and IPv6 connectivity, the Mac operating system will try both and determine which is fastest. The problem is if the IPv6 DNS returns an IPv6 address that can not be reached, then the computer waits until it times out. This happens even it the IPv4 network reaches the web site. The only reasonable solution is to configure IPv6 as Link-local only.

Under System Preferences select Network.
Select the type of connection. (Ethernet, Wi-Fi, etc.)
Select Advanced...
Select the TCP/IP tab.
Select Link-local only as shown below.
Click on OK.
Click on Apply.

Link-local only means the IPv6 addressing will work for your Local Area Network (LAN), but is disabled on the Wide Area Network (WAN).
BTW, Microsoft has a fix for this, but only for Windows users. Download "Perfer IPv4 over IPv6 in prefix policies" from this site. There is way to make a similar change to the prefix policies used by the underlying Unix on a Mac. Unfortunately, from my understanding, OS X will ignore the change.
Comment: Thank you so much David Anderson! I will try this right away! Thank you so much!


What, precisely, happens when you apply the Chain Spell metamagic feat to the Chain Lightning Spell?

Question: The Chain Spell feat (Complete Arcane) causes a spell that normally has a single target to arc to multiple secondary targets based on your caster level. The spell chain lightning has a single initial target, then arcs to multiple secondary targets based on your caster level. If a wizard with a caster level of 20 memorizes a chained chain lightning how is the spell resolved (assuming thousands of available targets within range)? Does the feat go off first and then multiple secondary strokes move from there? Does the spell itself resolve first? Does it just double the number of secondary targets? Something else?
Answer: I don't think you can
Chain Spell says a spell that specifies a single target, and chain lightning specifies more than a single target. They don't seem to work together.
The most reasonable interpretation, assuming you wanted it to work, is just to have two separate chains: the chain lightning one, and the Chain Spell one. Strictly speaking, though both specify that no target can be struck more than once, those are separate rules so someone hit by the original chain could also be hit by the Chain Spell chain, except for the first target. That doesn't seem altogether unreasonable to me, balance-wise, but it does seem counter to the probable intent. Actually, combining them at all is probably counter to the intent and the actual wording.
Answer: I also think you can't but for a somewhat different reason than KRyan:
I would say the Chain Lightning spell is the result of someone incorporating the Chain Spell feat into the Lightning spell.
Since the feat doesn't stack you can't apply it again.
And yes, I realize the spell came first.  I'm trying to make a reasonable interpretation of the situation.
Comment: Do you mean lorewise or rulewise? I am pretty sure that the Chain Lightning spell existed before the feat, and inspired it, and not the other way around. Now if this is meant to be a way to explain in-game why this doesn't work, that is completely reasonable, just make sure it is apparent from the answer.
Comment: This kind of interpretation doesn't fly when dealing with 3.X rules; additionally, the "root" spell (Lightning Bolt) is an area of effect, not a targeted spell, and wouldn't be able to be modified with Chain Spell to begin with.


creating mp3 device playing sound in specific time

Question: I need help with creating device that will be able to play sound (can be recorded or from mp3/wav...) at certain time, for example at 8:00PM, 8:15PM; 8:30PM ...until 5:00AM. Device must be powered from battery and must be working for more than 2-3 months. Sound is about max 10 seconds and it should not be loud but also not quiet.
I found that for directly recording can be useful ISD1820 but then I need to set relay and clock.
Then I found VS1003, and I think that this chip can be able to do that without setting relay and clock.
If anyone can help me or know something better I would really appreciate that.
Comment: This type of vague question is closed.
Comment: Is the same sound to be played each time?  In other words, is 10 seconds of sound storage enough?  What kind of quality?  Voice?  HiFi?  Something else?
Comment: low bitrate mp3 or wav, ISD1820 is capable of 10 second record by default
Answer: Instead of using a VS1003 and a micrcontroller, you could do that with just a VS1005G using the internal flash. The VS1005G has internal real time clock, and the player software and the short MP3 file(s) could all fit in the internal 1 megabyte flash. You can also add SD card or external (nand) flash to play longer files. When you are waiting for the RTC alarm, the VS1005 chip just uses a few microamperes.
Answer: The VS1003 or similar module + a RTC Module + a microcontroller like a MSP430 Launchpad or Arduino plus a transistor or two is all you need.
The microcontroller and RTC can work with low voltages, and will be asleep most of the time. Heck, a microcontroller acting as a RTC would work as well.
Answer: As a quick and simple solution, I would personally go for a Raspberry PI with a Real Time Clock module for accurate time keeping: if you want the drift to be maximum 1min at the end of 3 months, that's 7 parts per million which is quite low for standard crystal oscillators. You can also get rid of the RTC module and use a NTP (network time protocol) time keeping instead if your PI is going to be connected to a network at all times.
However, despite the fact that it enables you to use NTP to essentially get your system running forever once plugged in mains, if battery operation is a hard requirement (quite power hungry, it definitely won't run off a reasonable battery for 3 months) you can stick with a RTC with any simple-to-use microcontroller + SD card and MP3 decoder modules (e.g. Arduino + shields).
Comment: An RPi isn't really a battery powered solution.
Comment: Updated my post to account for that, thanks for noting it.
Comment: If the battery is not recharged for 3 months, yes since the battery would need to be quite big.


Is there a thumb-rule for designing neural-networks?

Question: I know that a neural-network architecture is mostly based on the problem itself and the types of input/output, but still - there's always a "square one" when starting to build one. So my question is - given a input dataset of MxN (M  is the number of records, N is the number of features) and a C possible output classes - is there a thumb-rule to how many layers/units should we start with?
Comment: Possible answers to this question is very problem specific. There may be some useful rules for image object recognition, but these rules may not work on a different dataset.
Answer: This question has been answered in detail on CrossValidated: How to choose the number of hidden layers and nodes in a feedforward neural network?
However, let me add my own two cents:
There is no magic rule for choosing the best neural network architecture, but if you can find an architecture someone has used to solve a similar problem this is often an excellent starting point.
The best places to look are official or unofficial examples using popular neural network libraries  such as Keras, PyTorch, or Tensorflow, and architectures described in academic literature. keras/examples on github is a great resource.
These architectures were likely chosen after lots of trial and error, so most of the work will have been done for you.
Comment: One caveat to the CrossValidated answer is that it's now 7+ years old, and points to a 15+ year old FAQ for an "excellent summary" of configuring your hidden layers. To say that there's been a lot of work on NN configuration in the past 7-15 years is a bit of an understatement. There's an increasing number of applications which fall outside the "*one hidden layer is sufficient*" regime. -- That said, for a host of problems a deep learning approach may be overkill. Starting with a single hidden layer and only going deep if needed is a solid strategy.
Comment: Good points, R.M. - The second answer there is much more recent, however.
Comment: @Imran I think you never quite answer OP question. The choice of hidden nodes and architecture is a very deep question that's still not very well understood. Witness ResNet and wide ResNet with cross layer connections.
Comment: Thanks for your comment, @horaceT. My attempted answer was meant to mean "There is no rule of thumb, but there are heuristics that can be applied". I am aware of Res Nets. Please let me know how else I can improve my answer.
Answer: I read a paper exploring the idea of using neural networks to design other neural networks, by exploring which configuration of nodes and layers was the most efficient.
Here's the page where you can download a PDF.
Answer: Following @Imran's answer, I found this paper in one of in the comments of the CrossValidated post he linked to. Besides an attempt to find the right architecture using Genetic Models (instead of using a rule-of-thumb), section 2.1 gives some theoretical bounds to how many hidden units should be in a one/two-hidden-layers system.
EDIT: I've tested this theorem, and found out that using Genetic Models is just as good as selecting a random architecture.


Are E1 A1 C2 and A1 C2 E2 the same chords?

Question: Are E1 A1 C2 and A1 C2 E2 chords the same and/or are in same tonality? I think that they have same sound quality by using same notes, but these are different chords as they have different intervals between notes.
Answer: I bet they sound quite muddy all the way down there! Usually sound better higher.
E, A and C are the notes which make up the chord known as A minor. Thus A, C and E also make A minor.
The difference is in the voicing. The first is known as 2nd inversion, the other, root position.
They will sound similar, as they have exactly the same note names, but the mix is slightly different. It isn't the difference in intervals between notes that make them different chords - they're the same chords! If you played A2, E4 and C6, that chord is still A minor, but different again. There are many different voicings, but all will contain A, C and E. On some instruments, same name notes in different octaves can be doubled, tripled. Guitar, for example - open E has no less than 3 E notes, but only one G#.
Answer: Both of your examples are A minor chords, but in different voicings. Since a triad is made of three notes, there are three possible ways to arrange those notes (or voices) in a single chord. The technical name for these different chord voicings are Chord Inversions.

Regardless of how you arrange the voices in the Am triad, the chord remains Am, and therefore has the same tonality, or relationship to root and tonic. However, tonality is not the same things as "sound quality." In fact, Voicing is the intentional arrangement of notes in a chord in order to vary its sound. Playing chord accompaniment in the same position can become predictable and boring. Using inversions gives the ear fresh twists, or different personalities, of the same chord.
Chord Inversions also enable the composer to emphasize different voices in the chord. For example, sometimes the melody is found at the top of the chord; at other times the role and direction of the bass player is defined by the bottom note of the chord.
Using inversions will also increase efficiency while playing chord changes (allowing your hands to stay in the same spot on your instrument) and help give you smoother voice-leading between chords in a progression.
Here are some good threads on the subject:
1. One
2. Two


Token doesn't show in MetaMask

Question: I bought some ICON (ICX) tokens on Binance, then transferred them to MetaMask. I still see the transaction on Etherscan.  Initially, the tokens showed in MetaMask (tokens held went from 8 to 9), but the # of tokens was an odd number.  I checked MetaMask the next day and the number of tokens is back to 8 with no sign of the ICX coins.  If click on Add Token and I copy in the contract address, the token name says "Like ETH", precision says 0.  Where are those tokens?  Thanks.
Comment: Have you checked https://etherscan.io/ using your account address, and see if the tokens appear?
Answer: I have seen this problem many times with Metamask , go to Tokens tab and try to Add Token  and check again , it should show the balance of icx tokens in metamask :
Contract address : 0xb5a5f22694352c15b00323844ad545abb2b11028
Symbol : ICX
Decimal of Precision : 18

Token doesn't show in MetaMask


Create new item workflow with the reference to the third list

Question: (I don't even know if this is possible)
I need to create a new item in the list, but the trick is I have three lists:
List1 - Dates, List2 - items, List3 - PlantsNumbers. So the desired scenario is: when a new item is created in List1 -> New items should be created in the List2 and there should be as many items as I have in List3.
Example: I have 5 plants in the List3: A001, A002, A003, A004, A005. When I create a new item in List1, I need a workflow to create 5 new items in List2 with A001 -A005 as title. Lists 2 and 3 are connected by look up column - plant Number.
We have SP 2013.
Answer: Count number of items in List3, and add a loop to create new item in List2, using List3 Datasource with incrementing ID at the end untill you reach the last ID.
Comment: Great idea! But is there a way to do it with Designer 2010 workflows without loops? We don't have 2013 workflows in production.
Comment: Couldn't update it in the comment, so posted as answer. Hope it helps.
Comment: Moved everything in Pilot to test this solution with loop and stuck with problem: List1 and List3 are not connected in any way, and i can't do a lookup there, so when try to build a dictionary to use in count i have no clue what to put into that Find the List Item part of the workflow lookup.
Comment: I thought you were using 2010 designer?
Comment: Yes, we have 2010 in production, but 2013 in Pilot environment, so i tried this in pilot - moved all my lists there.
Comment: Oh ok. The answer posted before was for 2010, if you want to give a try.
For 2013, you will have to build dictionary, call web service to List3 and find the count of items to use it for loop.
Probably the below article, will help you in the steps
http://weblogs.asp.net/ricardoperes/looping-through-list-items-in-sharepoint-2013
Answer: Create additional columns in List1 nd List2 lets say - list1ID and list2ID.
 Create a workflow in List1 with Start Option - Item is created (WF1)

Create varID and set varID = 1 (or any whichever is your first item in List3)
Steps ->  Create item in List2, with fields - Title (from List3 for ID=varID)  and list2ID = varID and remaining fields as required.

Create a workflow in List2 with Start Option - Item is created (WF2)

Steps ->  Calculate list2ID +1 and save to calc variable Update Item in List1 : field is list1ID to value calc

Create a workflow in List1 with Start Option - Item is changed (WF3)

Steps -> If(List3(Title) for ID=list1ID) is not empty Create item in List2, Title is List3 Title where ID = list1ID, other fields as
  required and list2ID = list1ID

So, when a new item is created in List1, WF1 will create the first item in List2.
WF2 will update the item in List1.
WF3 will create the next item in List2. This process continues untill there is no item left in List3


Does Wurtz reaction follow an ionic mechanism or a free radical mechanism?

Question:
In a Wurtz reaction, is the intermediate formed a carbanion or a free radical?
And if we can assume both mechanisms to be true, how can we decide the reactivity of a tertiary halide?
Comment: I think your second question is fine as is. But, in the context of your first question, I just want to verify for myself that you do mean overall _reactivity_ of a tertiary halide via the Wurtz reaction, irrespective of reaction pathway, and that you are not asking whether the reactivity will be dominated by carbanion-forming v.s. free-radical forming _pathways_.  Wow, ancient question ;) I hope we can lead you to an acceptable answer!
Answer: I think both mechanisms are valid. As far as I know, both are supported by some experimental evidence. Byproducts, like alkanes (other than the expected one) and alkenes, can be explained by the free radical mechanism. On the other hand, the formation of Organometallic compounds can be verified by the ionic mechanism.
The essential thing to note is that the mechanism involves a $\mathrm{S_N2}$ step. And because of that sterically hindered alkyl halides, like tertiary alkyl halides, instead of giving a substitution product yield an elimination product and you get an alkene.
Answer: A mechanism is only a hypothesis which can explain a particular reaction. Wurtz reaction can be explained by both ionic and free radical mechanism.
Answer: Well I personally think it is better explained by free radical mechanism, as using this mechanism, you can easily analyse all the products formed, whether it be symmetrical compound formed from same alkanes, or an unsymmetrical compound.


Md5 padding bits

Question: What is the condition if the message size in md5 increses from 448 as the 64 bits are the length and we have to make the block of 512. So what will be the bits if it increases from 448
Comment: Message size is always padded to congruent to 448, modulo 512. The remaining 64 bit are the size of the message. At the end we will have  exact multiple of 512.
Comment: [Computing the padding of MD5](https://crypto.stackexchange.com/questions/29685/computing-the-padding-of-md5)
Answer: The padding will always be applied. So if the final block contains 448 bits or over then an additional block will be needed.
The first block is padded as usual, but instead of ending at bit 448, it will now continue up to the end of the block, bit 512. Then the padding will continue in the final block. So zero valued bits are added up to bit 448, after which the length is appended and the final hash value can be calculated.
It is easy to see that a message length of 448 to 511 bits will always result in a padding of 448 zero valued bits in the final block. This is however of little use because the encoded length does change, and internal state variables will differ as well.

Let's assume bytes, and look at the situation where 55 bytes / 440 bits are input:
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMPLLLLLLLL

and the situation where 56 bytes / 448 bits are input:
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMP0000000
00000000000000000000000000000000000000000000000000000000LLLLLLLL

the situation for 63 bytes / 504 bits:
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMP
00000000000000000000000000000000000000000000000000000000LLLLLLLL

and finally a situation where 64 bytes / 512 bits are input:
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
P0000000000000000000000000000000000000000000000000000000LLLLLLLL

where M is a byte of the message, P is the byte containing the first padding bit set to 1 (value 80 hex), 0 is of course a byte with just zero bits (value 00 hex) and L is the length encoding.

OT, but the LLLLLLLL is the encoding of the message size in bits, where each L is one byte. This length encoding is in big endian format. Let's define them as hexadecimals and we get the following table for the previous paddings:
440 : 00000000000001B8
448 : 00000000000001C0
504 : 00000000000001F8
512 : 0000000000000200

Md5 padding bits


When and where should I keep these saplings?

Question: These roselle seeds were germinated in a 15 inch (please don't bang your keyboards in anger) soil from the ground with cocopeat, compost, vermiculite and perlite mixed with it. Didn't knew the dangers of soil back then. The third and fourth leaves came out yellowish which I suspect was due to soil compaction. So I have repotted these in 3 inch plastic pots with fresh potting soil. Where should I keep this (in shade, in some sun or in full sun?) and for how much time? I live in Delhi, India and the weather's quite sunny with temperatures touching 40 degrees. Three of the second seedlings' leaves have been plucked off by a neighbour's toddler.
Answer: Keep them out of hot direct sunlight until they are bigger and  more robust - a little early morning or evening sun should do no harm. When they are bigger, you will likely need to pot them up into something larger, and exposure to sunlight should be reasonably gradual (not in midday sun for the first week or so) to give them time to acclimatise.
Comment: In that case, yes - dappled early sunlight rather than direct sunlight might be okay, if there's any of that available, but the uv levels are probably fairly high where you are compared with the UK at this time of year.
Comment: The leaf edge of one the less leaf one is getting softer on the edge in just 1 hour of morning sunlight. Should I keep it in shade?
Comment: I don't have dappled sunlight but a sort of balcony with a cement roof where no direct sunlight comes.
Answer: Delhi has a pretty humid climate. So in addition to giving it filtered sunlight (placing it under a decently dense canopy of a tree), also check the water levels. Don't underwater, but also don't over water the tree.
To add on to what @Bamboo said, you'll have to play it by ear. If the leaves are wilting and the soil has decent moisture, it probably needs more sun. If the leaves are turning brown/brittle or you are seeing sun scorch on the leaves (black/red burn spots) on the middle of the leaf, then it needs less sun.
But again, regardless of where you place it, make sure the water levels are right for the plant. Both underwatering and overwatering will kill the tree.
Comment: Leaf softness is more tolerable than leaf turning brittle. But yes. that's exactly the type of correction you should make. Get a feel for how robust the plant is and understand how to recognize/react to plant's conditions. That's the best advice for long term development. Once you identify the plant's condition, the treatment plan will be pretty easy to find.
Comment: The leaf edge of one the less leaf one is getting softer on the edge in just 1 hour of morning sunlight. Should I keep it in shade?


How to solve a deallocated connection in iPhone SDK 3.1.3? - Streams - CFSockets

Question: Debugging my implementation I found a memory leak issue. I know where is the issue, I tried to solve it but sadly without success. I will try to explain you, maybe someone of you can help with this.
First I have two classes involved in the issue, the publish class (where publishing the service and socket configuration is done) and the connection (where the socket binding and the streams configuration is done).
The main issue is in the connection via native socket.
In the 'publish' class  the "server" accepts a connection with a callback. The callback has the native-socket information. Then, a connection with native-socket information is created. Next, the socket binding and the streams configuration is done. When those actions are successful the instance of the connection is saved in a mutable array. Thus, the connection is established.
static void AcceptCallback(CFSocketRef socket, CFSocketCallBackType type, CFDataRef address, const void *data, void *info) {
  Publish *rePoint = (Publish *)info;

  if ( type != kCFSocketAcceptCallBack) {
   return;
  }
  CFSocketNativeHandle nativeSocketHandle = *((CFSocketNativeHandle *)data);
  NSLog(@"The AcceptCallback was called, a connection request arrived to the server");
  [rePoint handleNewNativeSocket:nativeSocketHandle];
}
- (void)handleNewNativeSocket:(CFSocketNativeHandle)nativeSocketHandle{
 Connection *connection = [[[Connection alloc] initWithNativeSocketHandle:nativeSocketHandle] autorelease]; // Create the connection
 if (connection == nil) {
  close(nativeSocketHandle);
  return;
 }
 NSLog(@"The connection from the server was created now try to connect");
 if ( ! [connection connect]) {
  [connection close];
  return;
 }

 [clients addObject:connection];  //save the connection trying to avoid the deallocation
}

The next step is receive the information from the client, thus a read-stream callback is triggered with the information of the established connection. But when the callback-handler tries to use this connection the error occurs, it says that such connection is deallocated. The issue here is that I don't know where/when the connection is deallocated and how to know it. I am using the debugger, but after some trials, I don't see more info.
void myReadStreamCallBack (CFReadStreamRef stream, CFStreamEventType eventType, void *info) {
 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
  Connection *handlerEv = [[(Connection *)info retain] autorelease];   // The error -[Connection retain]: message sent to deallocated instance 0x1f5ef0 (Where 0x1f5ef0 is the reference to the  established connection)
  [handlerEv readStreamHandleEvent:stream andEvent:eventType];
 [pool drain];

}

void myWriteStreamCallBack (CFWriteStreamRef stream, CFStreamEventType eventType, void *info){
 NSAutoreleasePool *p = [[NSAutoreleasePool alloc] init];
   Connection *handlerEv = [[(Connection *)info retain] autorelease];  //Sometimes the error also happens here, I tried without the pool, but it doesn't help neither.
                  [handlerEv writeStreamHandleEvent:eventType];
 [p drain];

}

Something strange is that when I run the debugger(with breakpoints) everything goes well, the connection is not deallocated and the callbacks work fine and the server is able to receive the message. I will appreciate any hint!
Answer: I remove the autorelease from this line:
Connection *handlerEv = [[(Connection *)info retain] autorelease];

Now, it seems to work, but I will try more things, because I am not sure when is released and if I will have "side-effects"
Please any hint is very helpful!


Combining and ranking standard deviations

Question:
I am trying to take three independent indicators and combine them into a single composite measure.
For discussion, let's say that this is a composite measure for 'economic performance', and that the measure contains three independent indicators:  worklessness, qualifications and unemployment.  Let's also assume that there is a complete data set, with scores for each of the 50 local areas.
To compare and contrast those 50 local areas, we believe that the most robust way is to work out the standard deviation for each indicator (i.e. working out the standard deviation [s.d.] for each of the three indicators, for each of the 50 local areas).
The problem that we face, however, is when we come to combine the indicators together into a single composite measure.  I understand from reading elsewhere (including on stats.stackexchange.com) that standard deviations cannot simply be added together; and that the correct method is to square each of the standard deviations individually to obtain the variance; add the variances together, and then divide this by the number of variances (i.e. divide by three in this case) and then taking the square root of this number.
If it was okay to add standard deviations together, there would be no problems, as we would simply be able to add standard deviations together, rank the resulting value, and quintile them.
However, if we follow (4.) above to combine standard deviations, the majority of the results now fall within one standard deviation of the mean.  The smallest level of granularity is now 1 s.d., making it impossible to rank / quintile them, except assume that anything within 1 s.d. is in the mid quintile.
Is there any way I can justify simply adding together standard deviations, so that they can actually be ranked and quintiled, instead of following the 'proper' method?
Comment: This mixes together various different problems, most prominently combining measures on different scales. Why you think it's worth collecting quantitative data and then degrading to ranks and quintiles is not clear.
Answer: The solution, it turns out, is to normalise the variables first (i.e. by calculating standard scores -- in this case, z-scores / z-values) which can be added together -- and that solves the problem in (4.) above.
Sets of data, each containing 50 observations of 3 variables - to classify the spread of the 50 observations into equal groups, so:

work out z-scores for each variable;
sum z-scores;
rank; and
quintile.
Comment: Regardless of whether this did what you wanted in one study, it is not the only solution here. For example, if the original measures were weakly correlated, you might end with a measure difficult to interpret.