What are shell form and exec form?

Question: What are shell form and exec form of commands?
I have gone through several documents to get a clear idea of shell form and exec form. But all looked confusing to me. Can anyone help to figure out what are the difference between these two form?
PS: Although I came across these terms while I was going through the docker file instructions(ex: RUN, CMD, ENTRYPOINT), I want to know the difference between them in general, not in docker context.
Comment: It's entirely stupid for docker to provide two functionally and semantically different formats for visually synonymous syntaxes
Answer: The docker shell syntax (which is just a string as the RUN, ENTRYPOINT, and CMD) will run that string as the parameter to /bin/sh -c. This gives you a shell to expand variables, sub commands, piping output, chaining commands together, and other shell conveniences.
RUN ls * | grep $trigger_filename || echo file missing && exit 1

The exec syntax simply runs the binary you provide with the args you include, but without any features of the shell parsing. In docker, you indicate this with a json formatted array.
RUN ["/bin/app", "arg1", "arg2"]

The advantage of the exec syntax is removing the shell from the launched process, which may inhibit signal processing. The reformatting of the command with /bin/sh -c in the shell syntax may also break concatenation of your entrypoint and cmd together.
The entrypoint documentation does a good job covering the various scenarios and explaining this in more detail.
Comment: great answer, but it introduced a lot of new terms. I would have been so nice if this would have been explained a bit simpler.
Answer: These following explanation are from the Kubernetes In Action book(chapter 7).
Firstly, They have both two different forms:

shell form—For example, ENTRYPOINT node app.js

exec form—For example, ENTRYPOINT ["node","app.js"]

Actually The difference is whether the specified command is invoked inside a shell or not. I want to explain main difference between them with an example, too.

ENTRYPOINT ["node", "app.js"]

This runs the node process directly (not inside a shell), as you can see by listing the processes running inside the container:
$ docker exec 4675d ps x
PID TTY      STAT   TIME    COMMAND
1    ?        Ssl    0:00   node app.js
12   ?        Rs     0:00   ps x

ENTRYPOINT node app.js

If you'd used the shell form (ENTRYPOINT node app.js), these would have been the container's processes:
$ docker exec -it e4bad ps x
PID TTY      STAT   TIME    COMMAND
1    ?        Ss     0:00   /bin/sh -c node app.js
7    ?        Sl     0:00   node app.js
13   ?        Rs+    0:00   ps x

As  you  can  see,  in  that  case,  the  main  process  (PID 1)  would  be  the  shell  process instead  of  the  node  process.  The  node  process  (PID 7)  would  be  started  from  that shell. The shell process is unnecessary, which is why you should always use the exec form of the ENTRYPOINT instruction.
Comment: I wouldn't say shell is unnecessary. It is required if, for example, you want to use env variables.
Answer: Expanding on the top rated answer in this thread,
These are the recommended forms to use for each instruction:

RUN: shell form
ENTRYPOINT: exec form
CMD: exec form

Shell features, variable substitution, signal trapping and forwarding, command and entrypoint concatenation are explained with examples in the below.
Variable substitution
In the shell form, Dockerfile instructions will inherit environment variables from the shell, such as $HOME and $PATH:

FROM alpine:latest

# Shell: echoes "/root" as set by the shell
RUN echo $HOME
# Exec: echoes "$HOME" because nothing is set
RUN ["echo", "$HOME"]

However, both forms behave the same when it comes to environment
variables set by the ENV instruction in the Dockerfile:

FROM alpine:latest
ENV VERSION=1.0.0

# Shell: echoes "1.0.0" because Docker does the substitution
RUN echo $VERSION

# Exec: echoes "1.0.0" because Docker does the substitution
RUN ["echo", "$VERSION"]

Shell features

The main thing you lose with the exec form is all the useful shell
features: sub commands, piping output, chaining commands, I/O
redirection, and more. These kinds of commands are only possible with
the shell form:
FROM ubuntu:latest

# Shell: run a speed test
RUN apt-get update \
 && apt-get install -y wget \
 && wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip \
 && rm -rf /var/lib/apt/lists/*

# Shell: output the default shell location
CMD which $(echo $0)

RUN instruction can make use of shell form for all the other features mentioned above and to reduce overall size of the image. Every Dockerfile directive will generate an intermediate container, committed into an intermediate image. Chaining multiple RUN instructions can help reduce the overall image size.
Signal trapping & forwarding

Most shells do not forward process signals to child processes, which
means the SIGINT generated by pressing CTRL-C may not stop a child
process:
# Note: Alpine's `/bin/sh` is really BusyBox `ash`, and when
#   `/bin/sh -c` is run it replace itself with the command rather
#   than spawning a new process, unlike Ubuntu's `bash`, meaning
#   Alpine doesn't exhibit the forwarding problem

FROM ubuntu:latest

# Shell: `bash` doesn't forward CTRL-C SIGINT to `top`. so it will not stop.
ENTRYPOINT top -b

# Exec: `top` traps CTRL-C SIGINT and stops
ENTRYPOINT ["top", "-b"]

This is the main reason to use the exec form for both ENTRYPOINT and
SHELL.

Docker docs has more examples on this.. Signal trapping is also needed for docker stop command to work and for any cleanup task that needs to be done before stopping the container.
CMD as ENTRYPOINT parameters
Below concatenation will only work in exec form. It will not work in shell form.
FROM alpine:latest

# Exec: default container command
ENTRYPOINT ["sleep"]

# Exec: passed as parameter to the sleep command. At the end 'sleep 2s' will be run on the container.
CMD ["2s"]

However if you need to use some shell features in the exec form for CMD then below can be done.
CMD ["sh", "-c", "echo ${SLEEP_DURATION}"]

This does variable substitution to echo contents of SLEEP_DURATION environmental variable in the container while retaining the feature of exec form.

Source:
Above quoted examples are from this blog: source
Official docs now has lot more info on these differences - docker docs for entrypoint and docker docs for CMD

What are shell form and exec form?


Does supinated-grip press carry less risk of shoulder impingement than the press?

Question: Does supinated-grip press carry less risk
of shoulder impingement than the press?
The elbows seem to travel more in front of the body
when compared to the press - and so the shoulders seem to be
less internally rotated than during the regular press.
Does the underhand-grip variation of the press carry less of the risk of
tearing the rotator cuff relative to the press?
Answer: No. Neither variation carries any risk of shoulder impingement. Shoulder impingement is associated with end-range rotation, and is classified into internal or external shoulder impingement, depending on to which extreme the humerus is rotated at the time. Both variations of the overhead press leave the humerus in the middle of its range of rotation.

The elbows seem to travel more in front of the body when compared to the press

That's because the bar requires more forearm supination than you would otherwise be capable of, and the only way you can complete the movement is by pointing your elbows forward more to compensate, so that your hands don't twist off the barbell.
You can test this by trying to perform the movement without an barbell, just empty hands grasping an imaginary bar. Try it with your elbows forward, attempting to keep your palms aligned so that they're both facing directly backwards. Now try the same with your elbows out to the side. You'll find that as you raise your arms, your palms rotate to face each other. They couldn't do that if they were actually grasping a bar, so you wouldn't be able to complete that movement.

and so the shoulders seem to be less internally rotated than during the regular press.

The shoulders are not at all internally rotated during the regular press, so I suspect you're mistaking what internal rotation is. If you hold your arms in the position they'd be in in the middle of a press, then while trying to keep your upper arms in the same position, move your hands towards each other until they touch. That's internal rotation. External rotation would be again holding the same upper arm position, but trying to move your hands as far away from each other as you can.
Upright rows are an example of internal rotation in a similar upper arm position.

Does the underhand-grip variation of the press carry less of the risk of tearing the rotator cuff relative to the press?

No. It just makes it more awkward and forces your elbows to a forward position, which if desired is something you could always voluntarily do in the conventional press.
Comment: Could I ask you a question? I've seen that in the regular execution of the press, there is a general tendency to rotate the elbows out during the execution. Is there a physical reason (force pushing into pronation etc)?  I'm referring at the picture on the right (https://barbend.com/wp-content/uploads/2019/07/Overhead-Press-Elbow-Flare-1024x683.jpg)
Comment: @Kinka-Byo it's a necessity in order to remain in balance. If you draw a straight line that passes through the shoulder and the hand on the same side, the elbow needs to remain under this line to avoid the load coming out of balance and requiring the relatively weak rotator cuff muscles to hold it up. As you reach the top of the lift, those lines become more lateral, and so the elbows need to move out to remain under them. Elbows too close together loads the internal rotators, and tends to result in the elbows collapsing in more and the bar falling towards the lifter's head.


How could Expelliarmus beat Avada Kedavra?

Question: I want to be very careful about how I ask this question – I am not asking How did Voldemort die?    [CLOSED] Below the text is the relevant passages from Harry Potter and the Deathly Hallows if anyone wants to review them (I'm sorry for the amount of text).
How did Expelliarmus beat Avada Kedavra and kill Voldemort?
I feel the reason Harry's Expelliarmus overpowered Voldemort's Avada Kedavra curse has to do with who was master of the Elder Wand and how the Elder Wand works. I've always had trouble understanding fully how the Elder Wand works, though. How much did the fact that Voldemort never truly won or mastered the Elder Wand factor into how Expelliarmus reacted to Avada Kedavra and caused Avada Kedavra to rebound and kill Voldemort?
An answer based in book canon would be especially welcome, but any canon source really is fine.

Harry heard the high voice shriek as he, too, yelled his best hope to the heavens, pointing Draco's wand:
'Avada Kedavra!'
'Expelliarmus!'
The bang was like a cannon-blast and the golden flames that erupted between them, at the dead centre of the circle they had been treading, marked the point where the spells collided Harry saw Voldemort's green jet meet his own spell, saw the Elder Wand fly high, dark against the sunrise, spinning across the enchanted ceiling like the head of Nagini, spinning through the air towards the master it would not kill, who had come to take full possession of it at last.
Deathly Hallows - pages 595 - 596 - Bloomsbury - chapter 36, The Flaw in the Plan

and:

Harry, with the unerring skill of the Seeker, caught the wand in his free hand as Voldemort fell backwards, arms splayed, the slit pupils of the scarlet eyes rolling upwards. Tom Riddle hit the floor with a mundane finality, his body feeble and shrunken, the white hands empty, the snake-like face vacant and unknowing. Voldemort was dead, killed by his own rebounding curse, and Harry stood with two wands in his hand, staring down at his enemy's shell.
Deathly Hallows - page 596 - Bloomsbury - chapter 36, The Flaw in the Plan

And somehow I feel the following is important because Voldemort disdained the idea of learning from other people or things that he didn't see an immediate use for; for example, he dismissed the importance of House-elves because he found them beneath his notice and this came back to haunt him when Kreacher escaped the Horcrux cave alive and with the Slytherin locket Horcrux:

'A person can still use a wand that hasn't chosen them, though?' asked Harry.
'Oh yes, if you are any wizard at all you will be able to channel your magic through almost any instrument. The best results, however, must always come where there is the strongest affinity between wizard and wand. These connections are complex. An initial attraction, and then a mutual quest for experience, the wand learning from the wizard, the wizard from the wand.'
Deathly Hallows - page 399 - Bloomsbury - chapter 24, The Wandmaker

Can you help me put the pieces together?
Answer: There are two factors that led to Voldemort's defeat.  One is, as you've noted, his failure to master the Elder Wand.  But the other is the failure of all of his spells after he cast Avada Kedavra on Harry.
Because Harry died to save his friends, he and they received the same kind of magical protection that Harry bore after his mother died to save him.  The details, including citations from the book, can be found here.
Answer: That would be the primary and main factor, in my opinion.
The Elder Wand recognized Harry through Harry's Magic in Expelliarmus and chosen not to kill Its rightful master who was at last taking possession of It - Harry had previously decided not to do so for the time being and focus on the Horcrux Cup, leaving the deed for a later, more appropriate time. So, in essence, he was lending the Elder Wand to Voldemort, in order to take It back by force - the only thing It respects - later, thus a disarming charm was the perfect and appropriate magical tool for it. Had Harry rushed into Hogwarts to try to prevent Voldemort of taking the Elder Wand, and failed, Voldemort would have become Its rightful master - by theft, as did Grindelwald.
Instead, he did the opposite.
Hence it's a wand prone to killing, It backfires the killing curse to Its master's foe.
Although I too find it difficult to understand, since the Elder Wand seems to respect only raw magical might.
Perhaps, then, a secondary factor was the fact that Voldemort chose Harry's blood to rebuild his body, believing it would, not only make way for he to touch Harry, but also to be shielded by Lilly's sacrificial protection. But by doing that he rendered Harry the only foe capable of killing him - at least magically. And he also acted as a Horcrux of sorts for Harry, for while he lived, Harry could not die, binding him to earth through his blood and Lilly's protection.
That's why, I believe, Harry survived a second time the Avada Kedavra curse, while the Horcrux that lived in Harry's scar died. So, essentially, that connection of blood was keeping Voldemort's new body alive, with Lilly's protection also playing a role in empowering him; all in all, depending on an act of will on the part of Harry - who had previously accepted and even welcomed death, contrary to Voldemort - to decide whether or not and when to sever that connection. Voldemort's rebuilt body was full of raw magic might but, unlike his previous original body, did not stand such might on his own.
Thus the Elder Wand recognized Harry as the source of Voldemort's power, while Voldemort being nothing more than a protection for Harry, one that he could dispose of at the time of his choosing.
One might ask, as I did to myself, so how come Wormtail could have been killed by Voldemort indirectly through the cursed silver hand? Well, my thesis is that Harry's blood was taken by force, and by force Harry willfully severed that connection. For when he cast the Disarming Charm he seemed to be aware of what was going to happen, although he chose not to defeat his foe with a Killing Curse, even knowing that his foe would use one.
While Wormtail willfully sacrificed his flesh, and willfully accepted the silver hand as reward. Thus, Wormtail was, willfully blinded, trusting and agreeing his life and himself to whatever Voldemort's will might have been.
Magic, deep Magic most importantly, seems to function as contracts and pacts. Voldemort seems either to be ignorant of it, or to ignore and despise that - believing, perhaps by his experiences in the Orphanage or his accomplishes as a Dark wizard (flying for instance), that he was so powerful, that he was too special and above the rules. Indeed, he seems to believe he was a demi-god.
Answer:
How much did the fact that Voldemort never truly won or mastered the Elder Wand factor into how Expelliarmus reacted to Avada Kedavra and
  caused Avada Kedavra to rebound and kill Voldemort?

A 100%.
I say so based on the following statement: there were no other factors/reasons that would make Harry's spell victorious.
Now then, been a while I don't read a thing about Harry Potter, but I think there were indeed no other factors. Therefore, the Elder Wand's mastery was the only factor on play - thus, a 100%. This is the only reason Harry's spell won.
Comment: @Slytherincess re-read the description right when V dies. IIRC, it says something like "the wand would not kill its master," which I think indicates it is primarily, if not entirely, the wand's allegiance that caused it.
Comment: I appreciate your answering. Thing is, you're not telling me *why* the Elder Wand is the only factor that made Harry's spell victorious. I'm hesitant to accept this as a 100% certainty, for if I'm reading you correctly, you're telling me you haven't read a thing about Harry Potter in quite a long while. I'd like a really comprehensive answer explaining how the Elder Wand and the two spells meshed together to cause Voldemort's death. But, again, thank you for taking the time to answer :)
Comment: @Slytherincess: Can you think of any other factor? I can't - I don't remember ever any mention of a possible factor during the series - thus, the point stands (so far) that the Elder Wand's mastery is the only factor. If I think of one, I'll make sure to add it to the answer :)
Answer: It is likely to be the only factor.
Voldemort was a highly skilled duelist and an amazingly powerful wizard (remember several Death Eaters ambushed Kingsley and were unable to kill him whereas Voldemort fought him and several others at the same time).
Harry was not particularly good at magic (he was good at DADA for his age but he was not in Voldemort's league).
Therefore Harry vs. Voldemort should have Voldemort winning in magical power and dueling skill.
If Expelliarmus could normally beat Avada Kedavra then people would be using it all of the time.
Therefore it is unlikely that Expelliarmus has anything special that beats Avada Kedavra.
Wands are basically sentient and are not just tools to be used (I would guess that Voldemort would not appreciate how deep this connection went, he is a bully who is used to getting his own way by dominance). This was a very powerful wand and would be able to resist more than others the force of will from a user that was not its master, especially when ordered to kill its master.
This was really the only wild card in the situation and logically the only thing that could tip the scales in Harry's favour.
Answer: In hoping that you will not pull out some destructive cannon (again :-) ) I can think of the following:
Wands channel magic and wands give allegiance to wizards and thus prefer the magic they like to channel. If the Elder wand favors Harry over Voldemort it would also rather channel Harry's magic than Voldemorts.
There seems to be a continous connection between wand and spell. The first time Harry and Voldemort duel on the graveyard in HP4 their spells colliding in mid air causes this entire shining sphere and regurgitating spells thing to happen which is later explained by the two wands being twins by their cores. I think it's Dumbledore saying it in HP4 and under torture Olivander tells Voldemort in HP7 about the twin cores and that Olivander assumes this "problem" could be solved by using another's wand. (please don't make me find quotes) So colliding spells activate an effect of two wands sharing the same core -> connection between wand and spell even after the spell has been cast.
We know nothing can counter, undo or block Avada Kedavra (Moody,HP4). This leaves room for deflecting/redirecting.
Therefore I would guess that when Avada Kedavra and Expilliarmus meet in flight at the end of HP7 the Elder wand recognises Harry and Harry's magic, decides it would much rather be channeling Harry's magic and doesn't want to kill Harry anyways. So it stops pushing the AK curse towards Harry and actually want's to pull in some of Harry's magic. In effect I would guess AK hitches a ride with the Expelliarmus heading towards Voldemort.
That effect would be very similar to the graveyard event in HP4 where Harry wills magic back into Voldemort's wand (at least the movies show bright lights along the connetion between the wands and I think the book includes mentioning of those as well). This time, however, the magic does not just go back into Voldemorts wand (which apparently chose not to kill its master but rather take the hit itself), but is channeled back out the other way, since this time the Elder wand prefers that direction of channeling magic in accordance with the direction Harry and the wand he uses channel magic.
So I don't think the actual spells have that much to do with why Voldemorts curse rebounded. Had Voldemort used for example taranta legra he would have started dancing, but he ended up casting AK.
Answer: "The Disarming Charm lies at the heart of a good dueling technique. It allows the duelist to rebound an opponent's spell in the hope that the rebounded spell will strike the opponent and leave him or her vulnerable to further attack."
—Miranda Goshawk
This was found on a wiki, and I believe it is quoting from Pottermore, which is run by J.K. Rowling.
Now I'm not saying that is is the only reason that Voldemort's own curse, Avada Kedavra, was rebounded rebounded by Harry. If it was the only reason I would be surprised because the books say that Avada Kedavra can't be blocked.
The fact that the Elder Wand, the most powerful wand, was in a duel against it's true owner had a lot to do with it. When Harry used Expelliarmus the wand was given a chance to return to it's true owner and the spell that Voldemort had already casted ended up hitting him instead of Harry.
The reason Harry's spell hit Voldemort so accurately when he is no where near as good a duelist as Voldemort, as most mentioned, is because they are connected and Harry's wand is attuned to Voldemort as noted when, at the beginning of book 7, Harry's wand manages to find and attack Voldemort without much interference on Harry's part.
Another reason that could account for the loss is that Voldemort doesn't try to understand the nature of wands and instead tries to force the wand to obey him when it is well known that the wand chooses the wizard and Ollivander explains that a wand that isn't loyal to its master can affect the spells being cast by said wand. This is demonstrated when Ron gives Harry the extra wand he had collected and Harry's spells get messed up because it doesn't belong to him.
At the end of the book Harry talks about how Voldemort's defeat was not because of one thing but because of multiple things that all began to pile up against him.
1.) the wand belongs to Harry not Voldemort and this wand is the elder wand
2.) the bit of Voldemort's soul inside Harry which has inadvertently protected Voldemort is gone (I am don't know if this contributed to Voldemort's death but does stop him from surviving a fatal curse)
3.) Harry was willing to give up his life to cast the same protection over everyone that his mom gave him (I am unsure if this protection extended to Harry as well seeing as it doesn't say, and if it did then if Harry's mom had survived she would have been protected as well and I couldn't understand that seeing as that protection needs sacrifice)
4.) the curses they chose to cast
Most of the other answers on here explain the Elder Wand and it's part it the duel but some overlook the nature of the spell that Harry cast. I think that the spell played its role as well. I also mentioned two and three in the list above because, while I don't think it changed anything others do.
Answer: Voldemort was casting Avada Kedavra from the Elder wand. The Elder wand flew into Harry's hand thus Harry was now casting avada kedavra at Voldemort. Voldemort died from that Avada Kedavra. Harry didn't kill Voldemort as much as he killed himself and Expelliarmus had little to do with it except by shielding Harry until the Elder wand flew to him. There was no backfiring. Just a spell casted by Voldemort but used by Harry. Hope that explains it :)
Answer: Voldemort's wand cracked when he cast the "Avada Kevadra" spell, so this actually killed Voldemort. Harry's "Expelliarmus" spell only protected Harry and made such a powerful energy it cracked Voldemort's wand. Watch the movie when it closes in on Voldemort and look at the wand.
Answer: This is how I see it:

If you defeat another wizard, their wand 'shifts' allegence to you.
In the Half blood prince, Draco Malfoy 'defeats' Dumbledore by disarming him (Dumbledore let this happen).
Snape then kills Dumbledore.

So, Voldemort thinks Snape is the master of the elder wand so killing him should (in his mind) win the allegence of the wand. However, Draco is actually master of the wand, even though he's never taken possession of it.
(Quick note, Voldemort didn't kill Snape Nagini did, therefore he wouldn't have gained the allegiance of the wand, anyway)
In the Deathly Hallows, Harry defeats/disarms Draco in Malfoy Manor. At that point the elder wand shifts its allegiance to Harry so any magic cast with it against Harry is not going to work very well and certainly may not kill him.
Comment: There's no evidence to back up your "Quick note" other than your own opinion, as far as I'm aware. This also just seems to be (pointlessly) echoing the existing answers without adding anything new.
Comment: I'm not questioning the fact that Nagini killed Snape (that happens in the book too), I'm questioning your assertion that "he wouldn't have gained the allegiance of the wand" because of it. If you have any canon evidence, or even a well-reasoned argument, to support such a claim I'd be interested in it.
Comment: Quick note - from the film, Voldemort says (Nagini, Kill) then we hear the unmistakable sound of an animal attack.
Comment: To gain the allegence of the wand, Voldermort would have had to kill/defeat snape himself. Instead, he delegated the task to the snake, so theoreticall, the snake would have gained the wand... But, having to arms/hands would have struggled to use it . . .
Comment: The Elder Wand knew that Harry had disarmed Draco Malfoy (in this case disarmed means physically taking wands out of his hand) despite not being anywhere remotely near to that (it was still in Dumbledore's tomb), so I don't accept that it wouldn't know Nagini was acting on Voldemort's orders, especially considering there was a fragment of Voldemort's soul in the snake.
Answer: It only works in Harry's case, because Harry and Voldemort share a connection between each other. When they use opposite spells on each other and when both the spells collide, priori incantetum gets casted, as in Harry Potter and the Goblet of Fire.
Comment: Given the length of and the depth of information in the question your answer seems short. You could be more specific about which bit of Goblet of Fire you are talking about.
Comment: Yes, a book reference or quote would be very useful here.
Answer: Harry didn't kill Voldemort. Voldemort died by his own spell as Voldemort was now weak, both Voldemort's and Harry's spell crashed and Voldemort died by his own spell.
Answer: Basically for me you're talking about the spells.
My opinion is:

Firstly: you have to take into account the ownership of the wand
Secondly: Expelliarmus is a defensive spell and Avada Kedavra is offensive
Thirdly: Voldemort is weakened by way of Nagini having been killed

The final Horcrux, Harry, at this point being disconnected from the Horcrux weakness

Finally: There is the subject of Voldemort having just performed a very powerful spell whilst being very tired; you don't go for a knock-out blow if you're against the ropes.

So, this brings me to my point: Harry uses a defensive spell and defends himself against a magically tiring spell, from his own wand - which, by the way, Grindelwald actually owned as he cast a stunning spell from it as he was leaving Gregorovitch's, since you merely have to disarm, disable or kill the owner to get ownership of the Elder Wand :). So harry casts Expelliarmus and defeats Voldemort, and the curse rebounds, off of a defensive spell, killing Voldemort and also disarming him at the same time.
Answer: I'm sorry I don't have a source in front of me to provide citations.
Expelliarmus beat Avada Kedavra in DH because it always beats Avada Kedavra. Remember the graveyard in GoF? Harry survived the killing curse then by using Expelliarmus.
Everyone assumes there is no defense against Avada Kedavra. But when Professor Moody/Barty Crouch Jr. tells the class about Avada Kedavra, he says there is no known defense against it. Just because no one knows how to defend against it, doesn't mean that a defense exists.
In both of the duels that close GoF and DH, there is a lot of wandlore: twin cores, a priori incantatem, the Elder Wand's master, etc. It's subtle, but to me it's clear: Expelliarmus will always beat Avada Kedavra. And that's the answer to your question. It had nothing to do with wands.
Comment: @kaine Good point. But how do you explain that Harry survived the Killing Curse both times he countered it with *Expelliarmus*? Coincidence?
Comment: *citation needed* Sorry but there is a canon answer to this question that has already been accepted.  This answer is a fan theory... which contradicts WOG.
Comment: Yes. He survived because that was best for the story. He used expelliamus because that is his signature spell (he uses it so much compared to others it is explicitly pointed out in the last book). When there is a WOG answer, nothing else really matters.
Answer: It is simple. Since the elder wand did not belong to Voldemort, and Draco's wand belonged to Harry, Harry's spell overpowered Voldemort's. Because a wand works better with the person who rightfully owns it.
Comment: Is this just your opinion?


What happen if there's no one mining bitcoin?

Question: I read that miner are in a way contributed to the transaction progress of bitcoin. So, that means if there's no one mining anymore, the bitcoin can no longer be transacted?
Answer: Effectively, yes, this is true.
Answer: If no-one mines a Bitcoin like crypto-currency it will stop to work, this mean that transaction can be created and shared on the network but that they are not confirmed anymore and that there will not be any new money supply.  This don't mean that the crypto-currency is 'dead', Bitcoin like crypto-currency will not die until someone owns it's block chain.
Note that this is what happened to an alt-coin called 'junkcoin'.
People had to mine blocks themselves to get their coins on exchanges.
Answer: This is true, that's exactly what would happen.
However the rewards for mining would increase proportionally so if there was any value in bitcoins at all then someone would be motivated to start mining to gather the rewards. That's why this won't happen, if 90% of people stopped mining then the rewards for mining would be 10 times higher.
Plus there are enough businesses involved financially in bitcoin now that I would expect them to invest in some mining capacity to keep the network going.


Where do I declare global JavaScript variables in a web page?

Question: Where do I need to place a snippet of JavaScript code that initializes a variable that must be visible to all code executed with the page?  (For example, event handlers on elements will need to access this variable).
Answer: The only way to not have a global variable is to use the var keyword in the scope of a function. Anything else is a global variable.
(function() {
  var local = 5;
})();

It doesn't matter if the function is a literal or function definition, it has to be some type of function.
Global variable examples:
1:
var global = 5;

The above is not in a function scope, therefore global even if var is used.

2.
(function() {
   global = 5;
})();

In the above, no var was used, so it becomes an implied global.

3.
function foo(){}

foo was not defined inside of another function or assigned to a object key so its globally accessible.

4.
(function() {
   var local = global = 5;
})();

When doing multiple assignments with var, only the first variable becomes local... so global is a global variable and equates to 5.
5.
window.foo = 5;

Prefixing window. is an explicit way of defining a global variable in the context of a browser.
6.
this.x = 5;

By default in browsers, this points to the DOMWindow unless you're in a method that's attached to an object which is not window. It's the same as #5. Note that if you use a method like XMLHttpRequest, the context is of the window.
7.
with ( window ) { name = 'john'; }

If you use the with statement and you dont reference an object that already has a property, a global variable is defined. It's best to avoid using the with keyword in general.
Conclusion:
Personally, I would keep my code in an anonymous function scope, and only explicitly declare globals when I need to.
(function() {

   var governor = 'Schwarzenegger',
       state = 'California';

   window.president = 'Obama';
})();

In the above, I define governor and state variables and they are local to my function. I want to explicitly define president as a global variable. This way, I'm not confused about which variables I defined as globals or not, because I explicitly prefix them with window..
Comment: Upvoted for the useful examples provided to help me understand the various scenarios.
Answer: You can do it out of any function, or in a function without using the 'var' keyword. Assign it before any other scripts (very top of the page, likely) so the scripts can read the value.
You can also place it in an included JS file, but putting it right on the page is usually more usable as you can see the global values easily, and they can be modified for each page by the server-side code. Also try to prevent assigning global variables in the body, it may make confussions and will be harder to read.

this is a good practice in order to not polluting the global scope. If you need several public var in this way you could just write
YOUR_APP_NS.yourvar1 = ....
YOUR_APP_NS.yourvar2 = ....
YOUR_APP_NS.yourvarN = ....

but the global var is still 1
Answer: Declare the variable outwith of any of your functions, that way it becomes a global variable.
Here's an example of a global variable. The first function uses the global but the second function uses a local variable with the same name which masks the global.
var globalVar = 1;

function testFunc1 () {
    globalVar = 2; //Updates the global variable
}

function testFunc2 () {
    var globalVar = 5; // This variable masks the global and only updates within the scope of this function
    globalVar = 3;
}

Also, you mentioned that the snippet must initialise the global before any other reference. For this I would suggest you place your script block or reference to your javascript file before any other javascript references in your  element as possible. If you have other javascript files which are going to rely on the global variable then you may wish to ensure they do not load until the rest of the page has loaded first using the defer attribute. See the following:

Another option is to dynamically add your dependant scripts after your initial script has loaded. You can do this using something like jQuery as follows:
$(window).load( function() {
    $.getScript('dependant.js');
});

Answer:


Difference between a path integral, a Feynman path integral, a Wiener path integral?

Question: I am having trouble finding any clear information on path integrals. I am trying to find the difference between a normal path integral, a Feynman path integral and a Wiener path integral and the conditions on each to make a well-defined and calculable integral. Please can someone explain.
Comment: A normal path integral specifies a particular path in space, whereas the other two types integrate over many possible paths at once. There is not yet any rigorous mathematical framework for the Feynman path integral. The Wiener integral assigns a measure to the space of continuous functions and Lebesgue-integrates across that space using that measure.
Comment: @probably_someone Thanks for your comment. By 'path integral' I actually mean 'functional integral' rather then 'line integral'. For Feynman I am aware there is no such rigorous framework but I am yet to find any (even non-mathematically rigorous) definition of what path integrals count as Feynman path integrals.
Answer:
A (Feynman) path integral is what physicists call any of the functional integrals that pop up in the functional integral (or path integral) approach to quantum mechanics and quantum field theory. I will not exclude the possibility that some might use the qualifer "Feynman" to done some specific integral, but for most physicists a "path integral" and a "Feynman path integral" are the same. Note that you shouldn't confuse this with the Feynman parameter trick, where the integrals appearing might be called "Feynman integrals" by some. The path integral is, in general, not known to be mathematically well-defined, in particular only very rarely in spacetime dimensions greater than 3. For scalar fields (and also some fermionic fields) with polynomial interactions in two dimensions it is known - see the work by Glimm and Jaffe - how to set up a well-defined path integral using the Wightman/Osterwalder-Schrader axioms.
A Wiener integral is either the integral with respect to the Wiener measure on the classical Wiener space of continuous paths, or the more general notion of the Paley-Wiener integral. It is mathematically well-defined. The relation to path integrals comes about because the quantum mechanical version of the path integral (that of "0+1 dimensional QFT" if you like) is a (conditional) Wiener integral, and therefore mathematically well-defined.

If you are interested in a detailed exploration of the rigorous mathematics of the path integrals that appear in physics, "Quantum physics - A functional integral point of view" by Glimm and Jaffe is an excellent, if somewhat dense, resource.
Comment: Hi thanks for your answer. From what I have seen (Feynman) path integrals (and actually sticking with the 1d case here) are usually given by: $\int \mathscr{D}[x(\tau)] \exp(-\int L[x(\tau)] )$. Surely a more general form  is $\int \mathscr{D}[x(\tau)] F[x(\tau)]$ where $F[x(\tau)]$ is an arbitrary functional. Is there any restriction on $F[x(\tau)]$ such that this is well-defined?
Comment: @Quantumspaghettification The measure "$\mathscr{D}[x(t)]$" is ill-defined on its own, it's just an abuse of notation physicists use because it suggests the correct formal properties. The "actual" measure includes the "free part" from the $\exp(-\int L)$, so what we are really doing is integrating $\exp(-\int L_\text{interaction})$ against that ("Gaußian") measure. If you want to know what the Wiener measure actually looks like from a rigorous standpoint, I really cannot do better than chapter 3 of Glimm and Jaffe.
Comment: Great thanks, I have just read the relivent sections and now understand the concepts of the Wiener measure and Gaußian measure. You say "we are  really doing is integrating $\exp\left(−\int L_{\text{interaction}}\right)$ against that ("Gaußian") measure". In line with my question above could we integrate $F[x(\tau)]$ against the Gaußian measure or does it have to take this exponential form?


dashboard filtered by the current logged in user only

Question: is it possible to create dashboard filtered by the current logged in user only ? For example when a user logs in, he should see records created only by him and not everyone else's... Please let me know
Answer: Steve,
depending on the edition you are using, if you have dynamic dashboards enabled, you can configure the running user for the dashboard as either a specific user or the current logged-in user.
refer the below links on how to setup dynamic dashboard and configure the running user for the dashboard.
Configure Dashboard Running User
Dynamic Dashboard Overview
Comment: Using dynamic dashboard and enabling "Run as specified user" will only show records which the current logged in user have access to. But i would want a scenario where even when user have access to view all data in report, when he logs in it should filter the report for records he has created.
Answer: You can use the Relative Value nomenclature "$USER" in your dynamic filter.  Create a dynamic filter for the field "Owner" and add a value for "Me" with the value "$USER".


How do I bulk delete contacts?

Question: Is there a way to bulk delete contacts? I don't see a way out of the box of civicrm to select contacts individually form a report or search result, the way that views bulk operations does in drupal (with the checkboxes in front of contacts.
Answer: Yuri. You can do this from ANY search option. Delete Contacts or Delete Permanently are options under ACTIONS. You can verify this on the demo site. If you do not see same options on your system I would start by looking at the Permissions
Comment: Okay ...if found it: I was using the search block in the left column, which apparently has a simple search result without checkboxes. Using the search from the administration menu did show a result  with checkboxex. Thank you.
Comment: as mentioned in the question, I want to select the contacts from a list by ticking checkboxes. Using search, first there needs to be search criteria, and in my experience most of the time search criteria cannot be applied, because contacts need to be selected individually for operations.
Comment: I'm not sure I follow. If you peform a search, even with no criteria, then all your contacts are displayed. you can then check the box next to the people you need, as @petednz points out, and click Actions > Delete contacts. If you have a lot of contacts then you'd want to perform a search to target the ones to delete, then tick the boxes next to a selection of them.
Comment: That's the point: even as administrator, I don't see any checkboxes before the contacts when I perform a search.

How do I bulk delete contacts?


How to prove that $ \delta \frac{dq_i}{dt} = \frac{d \delta q_i}{dt} $?

Question: During the proof of least action principle my prof used the equation $ \delta \frac{dx}{dt} = \frac{d \delta x}{dt} $. We were not proved this equality. I was curious to know why this is true so I tried but I couldnt go any further neither did I find anything on the internet. Any help would be appreciated
Comment: Essentially a duplicate of https://physics.stackexchange.com/q/93176/2451
Comment: Possible duplicates: https://physics.stackexchange.com/q/321248/2451 and links therein.
Answer: You need to understand the definition of $\delta$. First let $q(t)$ be given. A variation of $q(t)$ is by definition a one-parameter family of curves $\tilde{q}(t;\epsilon)$ with the property that $$\tilde{q}(t;0)=q(t)\tag{1}.$$
In that case the first variation $\delta q(t)$ is defined by the equation $$\delta q(t)=\dfrac{\partial}{\partial \epsilon}\bigg|_{\epsilon=0}\tilde{q}(t;\epsilon)\tag{2}.$$
In other words: if you Taylor expand $\tilde{q}(t;\epsilon)$ to first order in $\epsilon$ you get
$$\tilde{q}(t;\epsilon)=q(t)+\epsilon \delta q(t)\tag{3}.$$
Now differentiating (3) with respect to $t$ you get the variation of $\frac{dq}{dt}$. Expanding the left-hand side you will have $$\widetilde{\frac{dq}{dt}}=\frac{dq}{dt}+\epsilon \delta \left(\frac{dq}{dt}\right)\tag{4}$$
while expanding the right-hand side you will have
$$\dfrac{\partial}{\partial t}\left(q(t)+\epsilon \delta q(t)\right)=\frac{dq}{dt}+\epsilon \dfrac{d}{dt}\delta q(t)\tag{5}.$$
Equating (4) and (5) as (3) allows you to do gives $$\delta\left(\frac{dq}{dt}\right)=\frac{d}{dt}\delta q(t)\tag{6}.$$
Answer: We consider a change
$$q(t) \rightarrow q'(t) = q(t) + \delta q(t),$$
where $\delta q(t)$ is some arbitrary function (maybe subject to some constraints, e.g. we might require that it vanishes at the boundaries of integration).
The time derivative of our new function is now
$$\frac{d q'}{d t} = \frac{d q}{d t} + \frac{d }{d t}\delta q.$$
Thus the change  in the time derivative is $\frac{d}{d t} \delta q$.
But the change in the time derivative is also precisely what is meant by the notation $\delta \left(\frac{d q}{d t}\right)$. In other words,
$$\delta \left(\frac{d q}{d t}\right) \equiv \frac{ d q'}{d t} - \frac{ d q}{ d t} = \frac{d}{dt} \delta q.$$


Woman is burned and killed by kingdom that kidnapped her, goes back to before she is taken

Question: I am looking for a comic webtoon, manhwa or manhua. For simplicity sake I am calling it a webtoon. It starts with the main character being burned and killed by a certain kingdom. They kidnapped her when she was a small child and she is reincarnated before she is taken. She is hiding under a bed and her mother finds her. Her mother dies through certain circumstances and the kingdom ends up kidnapping her again after her mom dies. After she's kidnapped, she is found in a dungeon by a guy who was spying on the kingdom and ends up saving her from the kingdom. She was tortured and abused because the kingdom wanted to steal her powers that she has that were similar to her mother's. She is reunited with her father and two siblings. She has blonde hair and her father and siblings have black hair.
Answer: This is Everything's Coming Up Roses, a Korean webtoon. It is licensed by Tapas.

Abducted from her mother at a young age and tortured for her incredible power, Evanna knew nothing but agony her whole life. That is until one day, she is rescued and returned to the father she never knew, the Duke of Vicente. But as Evanna's very existence brings back painful memories for the Duke, he must learn how to love her, while Evanna must come to trust her father and heal her trauma. But with Evanna's power highly coveted, can these two overcome their thorny pasts for a rosier future?

The story opens with the MC being dragged out onto an altar, where she is sacrificed to demons (or something similar). The palisades around the area make it look a bit like she's going to be burned, but I don't think that's what's happening.

She then reincarnates to when she was a young child, still living with her mother. The scene with her mother finding her is just her trying to coax her from coming out from underneath the bed, where she is hiding in terror. Soldiers burst in and kidnap her again, presumably killing her mother.
She has her magical power drained again in the castle, and is discovered by someone in the dungeon. Presumably he is a spy, as mentioned in the question. She escapes with the help of a woman who introduces herself as a friend of her mother, and leads her to her father. He has black hair, as mentioned in the question.

Found by searching mangaupdates for the tags Child Abuse and Reincarnation.
Comment: If accepted, it would be a dupe of https://scifi.stackexchange.com/questions/267133/manhwa-about-a-girl-who-gets-used-for-her-power-in-some-war/267141?r=SearchResults&s=2%7C62.5321#267141


Multiple comparisons for parameter significance in a sparse high dimensional regression model

Question: I have a regularized linear regression model with a large number of parameters (~100,000) that has been optimized using a sparse fitting algorithm (coordinate descent with early stopping).  The model parameters and prediction accuracy were cross-validated using repeated random subsampling.  I want to assess the statistical significance of individual parameters using the t-ratio (mean coefficient divided by standard deviation of the resampled estimates).  Is correction for multiple comparisons appropriate in this case and if so is it appropriate to select only the non-zero weights for significance testing?  Correction for multiple comparisons of individual regression parameters does not seem to be a common practice (e.g., correcting for testing significance of multiple main effects in ANOVA).
Answer: In the context of model selection, hypothesis tests can be used either for the (a) selection of the model, or (b) the verification of selected predictors.
Case (a) includes forward/backward/step-wise procedures, which are very common. These procedures however, do not try to account for the massive amount of hypotheses being tested along the way, so they do not really provide the type I error rate you might expect. A "model growth" approach that does try to control for the massive amount of hypotheses being tested, can be found (for instance) in  Benjamini, Gavrilov- A simple forward selection procedure based on false discovery rate control.
In case (b), you have already selected a subset of predictors and then wish to verify if they are indeed significant. Note however, that these procedures, answer different questions; It is possible that you will get a smaller prediction error by omitting a significant predictor. It is also possible that adding a non significant predictor will improve your generalization error (if you have multicollinearity for instance). For these reasons, if you are only interested in prediction (and not in "explanation"), there is indeed no need for hypothesis testing.  To the best of my knowledge (I might easily be wrong), properly controlling the type I error, after variable screening using cross-validation is an open question.
Concluding- if you decided you do need hypothesis testing for the purpose of interpretation, consider doing it from the start and not after a cross-validation screening. Otherwise, there are many heuristics, but no guarantee on the type I error rate.
Answer: I am not an expert in this area. But as far as I know, as mentioned in the previous answer, statistical inference in regularized models like LASSO is very much an open question. Relatively few papers deal with the inference part of regularized regression models (most are concerned with predictive properties). The paper P-Values for High-Dimensional Regression by Meinshausen  et al. may be of interest to you.


2010 MacBook Pro 8 gb ram

Question: When my 2012 mbp went down with a bad ram stick, I installed Windows 8.1 on a bootcamp partition on my wife's 2010 mbp.  I got my laptop working, not longer needed to borrow hers and attempted to remove the bootcamp partition. It is gone but when ever she reboots, she has to remember to hold the option key or she automatically boots to a black screen.  I assume something didn't get properly uninstalled and its attempting to load Windows bios but it doesn't exist. Is there a way to fix this?  There is no time machine or back up pre bootcamp installation to restore to.
Comment: Have you tried booting into the recovery partition?  Have you looked at any of these other [similar posts](http://apple.stackexchange.com/search?q=boot+black+screen+camp)?
Comment: Please don't use boring system specs as catch-line!
Comment: Go to System Preferences, Startup Disk. Choose your Macintosh HD partition and click reboot... it should reboot and start OS X without the option key pressed. After that, it should remember which partition you selected, too.
Answer: I would Recommend installing windows 10 only and getting rid of the mac partition completely. There are tons of online tutorials on how to do it. BUT if you want to use the partition and have that be the default when you hit the option key to choose your startup disk, HOLD CONTROL before you select it that you'll notice that upward-pointing arrow—the one that points to the selected disk—will change into a circular arrow instead, indicating that the chosen disk will not only be used to start your Mac this time, but that it will also become the default boot disk.

2010 MacBook Pro 8 gb ram


What time of day is it?

Question: What time of day is it?

It is morning.
It is in the morning./In the morning.
Morning.

Are they right? Which one is more commonly used?
Answer: 1 and 3 are both correct. 2 is not.
1 is a complete, grammatically correct sentence.
3 is not a complete sentence, but in common speech and informal writing we often do not use complete sentences when the meaning is clear. This is especially true for questions. If someone asks, say, "What color shirt is Bob wearing today?", most people would answer simply "Red" (or whatever color, of course). It's not a complete sentence, but we know that you mean "Bob is wearing a red shirt today".
2 is not correct because there is nothing that is "in" the morning. If you asked, "When is the staff meeting?", then it would make sense for me to say, "The staff meeting is in the morning", or simply "In the morning." But if you ask what time of day it is, there is nothing "in" this time. It just is.
Answer:
What time of day is it?

To respond to this question with an answer of "morning" as time of day, the complete sentence "It is morning" is proper in both written and spoken English.  In spoken English, a word is commonly used, where "Morning" would be a common response.
Use of "in the morning" in any form as a response to the question of "What time of day is it?" would be incorrect.  "In the morning" is a prepositional phrase answering the question "when" not "what".

What time of day is it?


Difference between Past Simple and Past Continuous in a sentence

Question: I was running a test and made a mistake in the sentence "They lived in Germany when they were young." I used Past Continuous instead of Past Simple, that is "They were living in Germany when they were young.". I am wondering if Past Continuous can be used here. If it can be used, what is the difference between the sentences? I was guided by this source: https://dictionary.cambridge.org/grammar/british-grammar/past-continuous-or-past-simple which says that I can use Past Continuous to show an event as ongoing at a time in the past.
Answer: Think of Past Continuous as a line (ongoing event) which is interrupted or which intersects with "a time in the past" (to make it even less ambiguous I would even say "at a point/moment in the past").

In the link you gave, Past Continuous is used in this way as you can see from the examples (in bold you have the point in time that cuts the line of the ongoing event):

I was listening to the radio when [main event] Helen phoned.
At 4 pm last Tuesday, I was working in the office.

"When they were young" is not a point in time, but a period of time. To express simultaneity of two ongoing processes you can use Past Continuous, it is true (I was reading, while she was hovering), but the clause "when we were young" indicates a period of time so far in the past, that the most obvious intention of the speaker would be to show that whatever the main clause states is no longer the case, rather than emphasising simultaneity.
However, with more recent past periods, I don't see why the Past Continuous could not be used in this way:

While we were at John's, Maddie was going on about her failures as if it was the first time somebody had ever listened to her.

or

While we were in France, we were living (staying) in this nice cosy studio by the Seine.

Note that in both last examples, were refers to shorter temporary states or circumstances than in when we were young. When live means having one's home somewhere, rather than temporarily staying somewhere for some time, it is less used in the Past Continuous.
Having said all that, I will not claim that the sentence "They were living in Germany when they were young" is incorrect. It is simply less common.
Comment: Your answer helped me understand the tenses more deeply, thank you very much!
Answer: Both are correct.  The past continuous suggests a temporary state and could be used, for example, if they were not born in Germany but were only passing through.
In other context, if it was not considered to be temporary, then "lived" is more usual.

As a girl, Mary was very familiar with walls. She was living in Germany when she was young. Her father was a Major in the US army and they were posted to West Berlin prior to reunification.
Comment: I find this usage awkward. IMHO your sentence would be much better as "She lived in Germany when she was young." or "She was living in Germany when the wall came down."
Comment: I agree, its rather awkward, but not grammatically incorrect.
Comment: It seems like I've got it! Past Simple tells you that something happened in a certain period of time. Past Continuous tells that something was going on for a certain period of time. Thus, Past Continuous emphasizes that the action was continuing during a given period of time, and not just happened sometime in this period. Therefore, I can say "They were living in Germany when they were young." to emphasize, for example, that they survived all the horrors of the war in their childhood. Continued in the next comment...
Comment: But if I just want to say that as a child they lived in Germany, and there is no point in emphasizing the duration of this action, then I use Past Simple. I also realized that it is difficult to explain Past Continuous and Past Simple without using them in the explanation...
Answer:
They lived in Germany when they were young. They were living in
Germany when they were young.

They lived in Germany when they were young. (this refers to a period of time - their youth)
They were living in Germany when the 2018 Münster attack occurred. (This refers to a moment in time - the attack)
Answer: I looked at the link you used to guide your decision to write "They were living in Germany when they were young." Past continuous is for emotional involvement and past simple is for a simple informative statement. More below.
The Examples from Cambridge Dictionary
You are correct that a writer can choose either the past simple or past continuous. However, a look at the examples they provided indicates that the past continuous is used when the writer wishes to emphasize emotional investment in the moment. The event may otherwise be finished or completed but it is important to appreciate the difficult situation in which the doctors worked, for example. You will agree that one's emotions are grabbed more in the first than in the second of those examples from the Cambridge Dictionary:

Doctors were treating patients in temporary beds and they were trying
to do their best in a difficult situation.

Doctors treated patients in temporary beds and they tried to do their
best in a difficult situation.

Life in Germany
Likewise, "They were living in Germany when they were young" should in some way be significant emotionally. If I could see the people you are introducing, I would have a better idea. Maybe they are old enough to have
experienced the horrible after effects of the Second World War. Extreme poverty, near-starvation, and trauma were widespread. Possibly they are the children of holocaust survivors and grew up with traumatized parents on top of everything else. You are being very polite but you want us to excuse them if they come across as a bit eccentric.
Or maybe they were born in the 1980s and grew up in good homes in a stable economy, but you want to explain that "They lived in Germany when they were young." That's just a simple statement, a simple bit of information to clarify that they did not grow up here. There is no emotionally disturbing past that we need to know about in order to understand these people.
Concluding Comments
I consider myself a native English speaker, though I learned it in elementary school, and I never gave any thought to the simple and continuous past. It's one of those things one "just knows" when speaking and that marks a non-native speaker. But seeing those examples clarified to me how and why we use the different forms. I hope this helps.
Comment: Thanks, your explanation helped me a lot!


Electric light bulb burns out

Question: Why electric light bulb more often burns out when we switch from OFF to ON our wall switch, but not during regular work? What happens to it so it burns?
Comment: Why, just why is this close-voted as off-topic? It's a perfectly good question about how electrical device failure develops.
Comment: I agree with @sharptooth; this seems reasonably on-topic.
Answer: The sudden change in temperature from cold to hot is quite a violent thermal-mechanical shock to a light bulb. Of course you get the same when you turn it off too but then you'll only notice it has failed when you come to switch it back on.
Also, the cold-resistance of the filament is quite low so, when power is initially applied there is a very high current surge that settles down in a few tens of milliseconds to normal running current. Wiki says this: -

The actual resistance of the filament is temperature dependent. The
  cold resistance of tungsten-filament lamps is about 1/15 the
  hot-filament resistance when the lamp is operating. For example, a
  100-watt, 120-volt lamp has a resistance of 144 ohms when lit, but the
  cold resistance is much lower (about 9.5 ohms).
Comment: @Zola one of the least temperature dependent materials would be Constantan or Manganin, but they have melting points at around 900-1200°C, at that temperatures they would glow red but nowhere near any usable light emission. Another thing is that the temperature coefficient changes with temperature and is mostly constant in a region of far less degree than 900°C or even 2700K (basically somewhere where a resistor is used as a resistor, so up to 200°C maybe).
Comment: Cooling down of the filament is much less violent than heating it up.
Comment: It's worth noting that some incandescent light applications. Eg theatre lights have a standby mode that keeps them warm but not emitting visible light.
Comment: Wow, the resistance fact is so obvious, but I never thought of it, until you pointed out.
Comment: So it acts as PTC thermistor? Why people didn't made it from some material whose resistance doesn't change with temperature?
Comment: Perhaps there is no such material that also reaches such a high temperature without melting. And the higher the temperature, the more efficiently it emits visible light. (at least below 6500K, and practical wires work at around 3000K, give or take 2-300K)
Comment: @PlasmaHH I totally agree; the current surge is non-existant and assuming the surrounding parts of the filament have become fairly hot, these will hold onto heat making the temperature fall less rapid.
Answer: The failure mechanism for incandescent bulbs needs to be looked at a microscopic scale. Over time, tungsten evaporates from the filament and condenses on the glass bulb. This creates the dark discoloration you see on well-used bulbs. As this occurs, you get local erosion of the filament, which ultimately creates a positive feedback cycle. Where a filament gets thinner, its local resistance goes up, so it gets hotter than the other parts of the filament. This increased resistance causes a local hotspot to occur, which increases the evaporation rate, which increases the temperature, etc. At some point the filament fails. If the failure occurs simply because the filament gets too weak, the bulb fails during normal operation. More often the shock of turn-on is too much for the local thin point, since it is (having gotten thinner) physically weaker than the rest of the filament, and the bulb fails on turn-on.
Comment: Never bothered to find out why bulbs get black spot. I thought it was a consequence of the flash pop off the bulb dying, not a slow progressive failure
Comment: @Passerby - Nah. It's just that you don't look closely at the bulb until after it burns out.
Comment: In halogen bulbs the evaporated tungsten will redeposit back onto the filament, and therefore they don't get black spots. Source: https://en.wikipedia.org/wiki/Halogen_lamp#Halogen_cycle

Electric light bulb burns out


Code to do Monte Carlo using SPSS?

Question: Is SPSS command code available for doing Monte Carlo research?
Thanks.
Comment: please be more specific.
Answer: Statistics does not have a built-in Monte Carlo system, but all the ingredients are present.  There are many random number generators, and you can use an INPUT PROGRAM to generate random datasets.  There is a custom dialog box interface for generating random datasets.  The package is called makedata.zip.  It is in the Utilities Collection on the SPSS Community website (www.ibm.com/developerworks/spssdevcentral) and requires the Python Essentials also available from that site.
HTH,
Jon Peck

Code to do Monte Carlo using SPSS?


The mean curvature of a hypersurface

Question: It is well known to geometric analyst that the scalar curvature of a Riemannian manifold can be decomposed to two parts: one part has a divergence structure and the other part consists of lower order terms. My question is for the mean curvature of a hypersurface in a Euclidean space, dose it have a similar structure? Has any author considered a decomposition of this kind? Any reference will be useful to me. Thanks in advance.
Comment: I just comment that for a graph in a Euclidean space the mean curvature has a divergence structure.
Comment: The formula for graphical mean curvature is naturally in a divergence form.  A hypersurfsce is locally graphical, so that gives what you want.  Any book on minimal surfaces will give you the formula, the one I have in front of me is colding minicozzi  eqn 1.6 on p 2. The 0 could replaced by mean curvature you're interested in nonminimal surfaces.
Comment: Thanks, Otis. Actually if we assume f is the immersion, I want to get a formula of the mean curvature which has two parts: one part consists of second derivatives of f and has a divergence structure and the other part consists of at most first derivatives of f
Comment: Yong, you might want to take a look at the formula Otis has referred you to and then let us know whether it meets your needs or not. If not, you should perhaps present the formulas you do have and explain why they aren't what you want.
Comment: Thanks Deane. I have looked at the formula Otis told me. But I still do not know how it can satisfy my need. Actually I want to define some Mass for hypersurfaces, which is similar to the famous ADM mass. To do this I need a proper decomposition for the mean curvature.
Comment: Actually I can make my question more clear. We know for a graph the mean curvature has a divergence form. Hence I am curious about whether we can give a decomposition of the mean curvature to two parts, such that one part has a divergence structure and the other part is zero, in the case of graphs.
Answer: I was unable to post an image without a big song and dance. If you go to MY STUFF and open the Michigan Math J. 1991, page 256 has the formula when the hypersurface is given as the level set of a smooth function. It is just a rotated version of the graph formula, as it must be. Meanwhile, the mean curvature is just a dimension constant times the divergence of the (oriented) unit normal, where it does not matter whther you take the divergence on the manifold or extend the unit normal field off the manifold and use the ambient divergence. All the same. I do not see how   you are going to separate out first and second order derivatives.
Wait, I can try to typeset:
$$   n H = \frac{1}{|\nabla F|} \; \sum_{i=1}^{n+1}   \sum_{j=1}^{n+1} \left( \delta_{ij} - \frac{F_i F_j}{|\nabla F|^2} \right) F_{ij}   $$
That actually looks correct. Good for me. Level set of the function $F$ and $H$ is the mean curvature with one of the choices of unit normal field.
Comment: Thanks a lot, Will. I will try to study your paper. If it works for me, I will tell you. Thanks again.
Comment: Could you tell me the name of your paper ? I can't open your link, thanks.
Comment: @lanse7pty  it was  http://zakuski.utsa.edu/~jagy/papers/Michigan_1991.pdf

The mean curvature of a hypersurface


Increase starting speed of acpmdc motor

Question: I am using a 12V,600 rpm PMDC motor. When I start the motor, it takes a little bit of time to reach its max speed due its inertia. My requirement for a specific task is that the motor should reach the max speed as early as possible. I am using 11.1V,30C ,8000 mAh Li-Po battery. Is there any way to achieve it without changing the motor. Can I use capacitor bank to supply the transient currents for overcoming inertia quickly. Please don't downvote.
Comment: You want to maximize the acceleration. Acceleration is proportional to the torque, which is proportional to the current. So you want to maximize the current. To do so you will need a current controlling loop, providing as much voltage as needed to maintain the maximum allowed current. this is not a simple solution.
Comment: You could also reduce the inertia by reducing the mass the motor has to drive.
Comment: "My requirement for a specific task is that the motor should reach the max speed as early as possible." - How quickly does it _need_ to reach maximum speed?
Comment: Start by specifying What you need Rpm(t), what you have and then it can be determined if it possible without compromising the rated input power or Amp-seconds or thermal rise.  A 10kuF cap will help a 10 Ohm motor for a few hundred milliseconds and any useful cap will be 10x bigger and more expensive than the battery.
Comment: How are you controlling the motor? Which motor do you have, and how long is the 'little bit of time"?
Comment: How much time? Data sheet and part number for the motor?
Answer: If the battery is not delivering as much initial current as the motor can tolerate, a capacitor will help. A different battery might also help. If the motor only needs to overcome its own inertia, changing the motor will only help if you can find a motor with a higher ratio of torque to inertia. With a speed of 600 RPM, I suspect the motor includes a speed reduction gear. A gear that is more efficient would help.
To get the maximum rate of acceleration from a given motor, the only answer is the one given by Eugene Sh. "...you will need a controller that has a current controlling loop, providing as much voltage as needed to maintain the maximum allowed current."
Comment: You could initially go to a much higher current than specified as running/load current. All motors of this type will have a stall rating maximum current which can be tolerated for at least a short while. You could for example use a capacitor, diode and FET switch to bump to double the voltage for a very short time. Size the capacitor to give the motor a good bump to overcome initial inertia.

Increase starting speed of acpmdc motor


How do I escape the git commit window from OS X terminal?

Question: I am just learning git and the terminal and I wanted to make a test commit but I cannot seem to be able to escape the text editor window to save the commit
Answer: It looks like you're inside the vi editor. Typing :wq and pressing enter should do it, i.e. save the commit message and exit.
: enters the command mode, w is for "write" (save) and q is for "quit".
You may need to hit escape before :wq to exit the insert mode (vi is a mode based editor).
If you want to exit without saving hit escape, :q! and enter.
git opens your default editor so you can edit the commit message. You can change the default editor, even to graphical text editors (such as Sublime Text). See here for example.
Answer:
Press Escape
Press shift+Z shift+Z (capital Z twice).

It works a bit faster.
Comment: OMG that's horrible vs code did not give any clue how to get out of it. thanks for saving my life.


Bipolar transistor. Unknown graphs

Question: I read a course about power transistors and I encountered these graphs

The chapter is talking about safe operation of BJT. Can anyone tell me what those graphs are ? (And how to read them).
Comment: You can find that information easily on the Internet: https://en.wikipedia.org/wiki/Safe_operating_area and https://www.apexanalog.com/resources/techseminar/soa_section.pdf  I found those just be searching for "Safe Operating Area". What the "FB" in **FB**SOA and "RB" in **RB**SOA mean, you will have to ask the one who showed you these graphs. It is more common to just use "SOA".
Comment: I found this too but what about second graph ? I really don't understand it.
Comment: What is there not to understand, the SOA area changes for different Veb. The same rule still applies, that the pount of operation has to stay **within** the SOA area.
Answer: The thermal timeconstant for silicon of size 1 micron (about the junction depth for fast low-voltage bipolars) is 11.4 nanoseconds.
The thermal timeconstant for silicon of size 10 microns (about the junction depth for high-voltage bipolars) is 1.14 microSeconds.
Pulses longer than 1.14 microSeconds will cause serious heating problems, because the thermal mass will not absorb the energy, and the heat generated in the collector will flow a few microns into the emitter-base region and cause thermal runaway, a positive-feedback behavior.
The default silicon wafer thickness is 300 microns; these wafers are often thinned (the back side is ground down) to 100 microns to fit into very thin packages. The thermal time constant of 100 microns is yet another 100X slower, to 114 microSeconds.
The metal plate (flag) under the silicon have about the same thermal properties as silicon, and that gets you to about 1 millisecond of survival time.
Answer: Forward(Reverse) Safe Operating Area.  The first one relates to power dissipation, so the diagonal (contour) lines will be ambient temperatures; stay in the lower left area.  The second is for reverse breakdown, and the contours are E-B voltage.  Read the rest of the chapter for details, these appear to be example charts rather than specs.
Answer: The first graph is what a forward bias SOA (Safe Operating Area) graph looks like in general. Below is a real graph from the TIP31 datasheet:

The limits are defined by maximum Vceo, maximum Ic, thermal limit, bonding wire limit and secondary breakdown.
The second is reverse bias SOA (base is reverse biased). Here is an actual graph from an MJ10021 datasheet:

You can see that the allowable instantaneous power at turn-off is dramatically lower for high Vce. More info here. In particular, pay attention to temperature derating effects.
In both cases, you must remain below and to the the left of the contour lines under all conditions or the transistor may be damaged.

Bipolar transistor. Unknown graphs


matching paint color over different wall coverings

Question: I removed wallpaper from one wall due to moisture but am leaving it up on the other three walls since the removal damaged the wall and the wallpaper is still adhering well. I am now trying to find paint and I like the color on drywall but not over wallpaper.I used kilz but it did not change the fact the color over wallpaper was so much lighter. How do I get paint to match over both?
Comment: Did you put Kilz on all of the walls, or just the wall where you removed the wallpaper? Different walls may also appear to have different colors due to the way the light hits them, best to look at night where you can control the light.
Answer: You need to hit all the walls with Kilz until they are consistent.  The purpose of primer is to make dissimilar underlying surfaces similar so the paint goes on equally.
That is not the job of paint.  You can do it with many coats, but why? Primer is cheaper than paint.  Also, the paint chips that you picked your colors from are exemplars of your paint over white, not whatever colors you are covering up.
If you're saying "primer isn't getting the job done", what you're really saying is "I'm not willing to use enough coats of primer to get the job done, and I somehow want that to work out anyway."
Answer: The only proper way to get a quality paint job is to remove the wallpaper first.


Core-Lightning Derviation Path

Question: What derivation path does Core-Lightning use to end up at the Node Public Key (and private key), given a mnemonic seed?
Answer: The node public key is not derived using BIP32. It's derived from the hsm_secret using an HKDF. The hsmtool utility can help you derive keys from your hsm_secret.
I described in this issue how every key managed by Core-Lightning is derived. It was a while ago but i don't think it's changed since.

Core-Lightning Derviation Path


Safety of opening .txt files via URL

Question: If I'm given a URL that points to a <code>.txt</code> file, is it always safe to open it? Can it possibly contain virus or malicious content?
Answer: A file named .txt, can still have a "dangerous" content type. E.g. Apache allow you to set "Content-Type: text/html" on .txt files (or to what ever on what ever). A file with content-type "text/html" will be rendered as a html page in the browser.
Comment: This is a good answer and is a typical audit test. Load a simple script tag into a text document with an alert, load it to your host and open it via the browser. Since the type is text/html, in many browsers the JS will execute and may be malicious in nature. (That said, the mime type could be anything, but this is an example of why one has to be careful of how they redisplay uploaded files).
Comment: For this matter, so can *any document on the entire Internet*.
Answer: It is not safe. It can be malicious.
The last four characters of the URL being ".txt" has no actual significance to the type of file that is sent to your browser, and in most cases won't affect how it handles the file. The important part is the Content-Type header of the HTTP response. http://foo.com/bar.txt could easily be a web page, or a flash video, or an mp3 file, or a java applet, or any of a hundred other things. I am sure you have been to plenty of web pages that don't end in ".html" (like the one you're reading this on right now).

Safety of opening .txt files via URL


What was Sartre's thought on good and evil?

Question: If existentialism according to Sartre hold everyone responsible. Why Sartre said "men are condemned to be free"?
Comment: What is the relation between the title and the post? And generally, we discourage one liners as they do not provide enough to go on for meaningful answers.
Comment: He said men are condemned to be free, because with freedom comes responsibility, particularly the responsibility of self-determination and the choice to become the Authentic Self. Thus, the individual cannot hide behind folkways and mores and must take responsibility for all choices in an ever broader process of accepting more responsibility for the Self.
Answer: Sartre (late in life interview with Benny Levy), Alasdair MacIntyre and György Lukacs were all concerned with developing an ethics towards the end of their career.  MacIntyre is still alive, I think.
I  guess you could say the problem of ethics became acute because of Stalin. [and the later Kchruchev speech to disgrace the Stalin legacy]. But Sartre as far as I remember would not join the French Communist Party. This Party was extremely doctrinaire and would not even approve the 68 revolution because it was not pure enough.
What is important and the book you need to find is an earlier book by a Frenchman, Francis Jeanson, "Sartre and the Problem of Morality" , which had to answer the the question left from Being and Nothingness and Sartre's speech at Club Maintenant, Existentialism is a Humanism.  This goes to the title of your question.
The book by Jeanson Here: https://www.amazon.com/Problem-Morality-Phenomenology-Existential-Philosophy/dp/0253166039this
Where is the right and wrong here? The good and bad?  Marx himself thought there was a good and bad. He had that figured out at 16yo.
There is a member here from Russia who is a Sartre expert so he can give a much better answer than I can, if he sees your question.
Francis Jeanson was a real person. However,  I have often wondered if Sartre ghost wrote the book. I'm probably wrong.


Can I use a transformer to drop a DC voltage?

Question: Can I use a transformer to drop down the voltage from a generator? Or should I just use a regulator? The generator outputs about 9.3 V and I need about 5 V, and I want to conserve power.
Comment: dropping voltage won't "conserve power". total power output won't change, except you'll waste some in the conversion.
Comment: I want to waste the least amount of power in the conversion. Since I'm dropping the voltage can I get more current with a regulator?
Answer: I am guessing its DC. So a Transformer won't work.
A Regulator will have to be used. Using a 7805 voltage regulator will do the trick.
If you want to conserve power, I think you can also just use a switching regulator -  Buck converter.
Answer: Use a voltage regulator.
A switching voltage regulator will be the most efficient. Texas Instruments has a decent selection, just input the parameters you need.
A linear regulator would work too, but will not be as efficient as a buck topology.
A transformer will not work at all. Transformers are for alternating currents, not direct currents (AC vs. DC).
Answer: The simplest way will be using a linear voltage regulator. I personally used LP2950 from Texas Instrument to drop from 9V to 5V.
Goodluck.


Keywords - column or separate table

Question: I am building a website on  MySQL with php, and I have 400+ products in a table. I have three columns with comma separated values, each has 1-3 values separated by commas in each row.
I was wondering if my db would be faster if I make separate tables for those three columns?
Comment: Normalize your tables. Now that they are tiny. It's going to be harder when they have 400M rows.
Comment: But is it really better @ypercube? is it faster than csv?
Answer: It may or may not be faster, depending on your data distribution and the queries you execute.  What it will be is better.
Normalisation isn't a goal in itself.  It's a series of processes one applies to remove potential errors while changing data.  The output is a schema which is resilient to changing data.  Without normalisation you leave yourself open to inconsistent data.  It really doesn't matter how fast your site runs; if it's wrong it's wrong and it's no less wrong by being wrong quickly.
Separated values could potentially be faster if your current queries retrieve too much information because it is all bundled up together in CSV columns.  It will definitely be faster if, down the line, you discover you have to join to another table on one value currently embedded in a CSV.  At that point your performance will fall off a cliff.
Answer: No, your db weren't probably faster because of multiple causes:

400 record is much fewer which were needed for optimization on the table structure. Probable your whole db will be in the ram (block cache), thus it will be enough fast even if only linear queries will be run.
Multiple tables are needed mostly if there is a need for optimization or consistence. In your place it is clearly not the situation.

On the long-term I suggest a little bit of digging into SQL, table structures, normalization and normal forms, first because it gives very good results, second because it is probably unavoidable on the todays IT industry.

Keywords - column or separate table


What is a word or a phrase for "finding balance"?

Question: I want a stoic and blissful name for my blog, and unfortunately "finding balance" is not available. Can you suggest something along the lines of that? I basically want this to be about how my life is a balancing act between trying and wanting to be different things at once.
Comment: Balancing act..
Answer: How about something like, "Locating Stasis", or "Achieving Equilibrium".
Answer: What about "Spirit Level"? That's all about balance, it's quite concrete -- but the first word could be a play on words to denote your inner well-being (or something like that).
Answer: 'Achieving Stability'
'Juggling Safely'
'Busily Composed'


Word to describe "when sensitive information is given to a trusted proxy in case of untimely death"

Question: What's a good word to describe the situation when sensitive information is given to a trusted proxy (such as a lawyer), to be released only when a certain event occurs, such as a person's untimely death?
Comment: Do you want to describe the *transaction* or the *information given*?  Title says the latter, while your text says the former.
Comment: @jae, I've clarified question and title.
Answer: I might call that a contingency confidence.
Comment: Nice. It doesn't exactly roll off the tongue, but I think it is precise.
Answer: The trusted information is held in escrow?
Answer: TV Tropes (warning: not productivity safe) has an entry for Dead Man Writing, and some of those examples cover what you're talking about.
Comment: No doubt from "dead man switch". I like it.
Comment: @dmckee: I thought it was a snowclone of "Dead Man Walking".
Comment: Actually, it all comes from the old Ashkenazi Jewish traditional text Sefer Chassidim which has a fable warning to never wear a dead man's shoes.
Answer: Edit: Answered before the question was clarified, and addressing the information so entrusted, rather than the process.

If the context is already established "insurance" is not a bad choice. But you can't use it without setting the stage because it has too many alternate meanings.
On a snarky note, there is "last will and testament", but again it won't work if you haven't set it up.
Comment: How about "escrow"?
Comment: @Fresh. Not bad. I think it has a bit of the same issue as "insurance"---too many mundane meaning to be clear without some elaboration---but certainly a relevant word. Money can be placed in escrow for sensitive transaction, real estate transaction generally include a escrow phase, etc...
Answer: This would actually be the "testament" part of last will and testament.  It comes, through three other forms, from the Latin for witness, which seems to dovetail pretty perfectly into the heart of the situation you're trying to describe. The act of putting that information in the hands of a chosen proxy would be described as giving testament.
The second google definition looks perfect.
From google:

tes·ta·ment
  ˈtestəmənt/
  noun
  noun: testament; plural noun: testaments
1.
      a person's will, especially the part relating to personal property.
2.
      something that serves as a sign or evidence of a specified fact, event, or quality.


Creating Shortcut that opens program at a specific desktop location

Question: Is there a way to create a desktop shortcut that opens a program at a specific location on the desktop? (assuming the program is either less than full screen or there are multiple monitors)
Answer: In general: no. It is up to each application to remember its own layout.
(Some applications could provide some kind of mechanisms -- as console mode shortcuts do -- to specify position, but that is unusual.)
Answer:
open a program at a specific location
  on the desktop

This can be achieved with window management. Apply rules to any program window and specify size, location, transparency, etc.
Eusing's Auto Window Manager is a nice freebie, Actual Window Manager offers even more sophistication but it ain't free (for me, Actual Window Manager is a "must have", even more so with a multi-monitor setup), both programs work with Windows 7.
Answer: The version of UltraMon that I used on XP made this possible - haven't tried it on 7 tho.
Answer: For applications that save their location in the registry this can be accomplished by changing those registry values before launching the application.
As an example the following batch file opens Notepad at a specific size and location relative to the primary monitor.
<code>@echo off
reg ADD "HKCU\Software\Microsoft\Notepad" /v iWindowPosDX /t REG_DWORD /d 800 /f
reg ADD "HKCU\Software\Microsoft\Notepad" /v iWindowPosDY /t REG_DWORD /d 400 /f
reg ADD "HKCU\Software\Microsoft\Notepad" /v iWindowPosX /t REG_DWORD /d 50 /f
reg ADD "HKCU\Software\Microsoft\Notepad" /v iWindowPosY /t REG_DWORD /d 100 /f
start Notepad
</code>


How to share cookies between domain and subdomain with nookies?

Question: I'm using nookies and I'm having a hard time sharing cookies between my app and website.
This is the code I use on my app.mydomain.com file:
<code>       //setCookies to main domain
        setCookie(null, 'jwt', loginResponse.jwt, {
          maxAge: 30 * 24 * 60 * 60,
          path: '/',
          domain: 'mydomain.com'
        });
</code>
I guess I'm doing something wrong since it's not working.
Answer: I just found out because my main domain had www before the domain, it didn't work but now it's working since I removed it.


How do you calculate your cost projection on amazon S3 for the next few years?

Question: Since cost of hosting is always going down at what rate are you estimating it to fall for your cost prediction?
Answer: I use this Amazon Calculator for Monthly Costs.
It's not infallible, but it's a pretty good guess.
Comment: My question was more about a way to find a conservative prediction on price cut for S3 hosting in the future.
Comment: @plehoux If you word your questions better, you get better answers.  You can't predict the future.   If you can, contact me off-site, and tell me the lottery numbers for next week, and I'll split the jackpot with you.
Answer: I think the best you could do as look at the trend in cost reductions over time. Here is one recent source:
<code>                 Old            New
First 1 TB      $0.150      $0.140 per GB
Next 49 TB      $0.150      $0.125 per GB
Next 50 TB      $0.140      $0.110 per GB
Next 400 TB     $0.130      $0.110 per GB
Next 500 TB     $0.105      $0.095 per GB
Next 4000 TB       $0.080 per GB  $0.080 per GB (no change)
Over 5000 TB    $0.055 per GB   $0.055 per GB (no change)
</code>
Notice for large data sets there was no change. So you need to look at your current data amount and go off of that.
Personally, I would be conservative and just assume it is not going to cost any less (it could actually start to cost more). If the differences in these projections is actually a significant amount of money your time might be better spent looking at non-cloud hosting solutions for a cost comparison.
Comment: +1 for assuming it's not going to cost less then what you're currently paying.


Fitting a binomial model to test the reaction of two groups to a treatment with a control site

Question: Background:
I am trying to fit the right model to check if birds of different age groups (adult\juvenile) reacted differently to an acoustic stimulus during migration (meaning that birds are staying at the site for very short periods – every individual is counted only once). The "reaction" of birds is represented by their presence. In the experiment birds were captured (and released shortly afterwards) at two sites: (1) experimental site– where playback was used alternately: one day on and one day off for 50 days (altogether providing 25 repeats of each) and (2) control site – no playback at all – accounting for the natural variation in the numbers. Altogether ~300 birds were captured at each site (not many per age category per day).
An example from the dataframe:
I thought about three options to model the effect of the experiment (and other factors) on the number of birds from each age group:

Poisson – problematic due to severe overdispersion. Therefore, this model was discarded and I suggest using binomial distribution (see next two models).
Theoretically would have been:
glm(formula = Age_count_Experimental ~ Playback * AgeGroup + Day + offset(log(Age_count_Control)), family = poisson(), data = DF)
Where Age_count_Experimental is the number of birds caught at the experiment site, playback is whether playback was played or not (0/1),
AgeGroup is Adult or Juvenile (so each Age_Count_Experimental has either the number of juveniles or the number of adults),
Day is the day of the experiment (continuous starting at 1, accounting for the natural directional change along the migratory season) and
Age_count_control is the number of birds in the control site at the same day (separated by age-group as in the experiment site), set as an offset to account for the natural changes in the number of birds from each group.

Binomial – ratio according to age
glm(formula = Age_prop ~ Playback * AgeGroup + Day,  family = "binomial", data = DF, weights = Age_total)
Here Age_prop is the daily number of birds (juvenile or adult) at the experiment site divided by the total number of birds from the same age group at both sites.
Weights (Age_total) are the total number of birds form the same age group.

Binomial – ratio of juveniles from all birds at each site (experimental \ control).
glm(Experimental_AgeProportion ~ Playback * Control_AgeProportion + Day , family="binomial", data=DF, weights = Experimental_Total)
Here Experiental_AgeProportion is the daily number of juveniles caught at the experiment site, divided by the total number of birds at the experiment site (juveniles+adults).
To account for the natural variability as observed in the control site, I used Control_AgeProportion which is the same proportion (juv/juv+ad) but at the control site.
Weights (Experimental_Total) are the total number of birds (juv+ad) from the experiment site.

My questions:

Model #3 has an interaction that is not trivial. It is there to test whether the ratio of juveniles at the study site differed from the "natural" ratio (as presented by the data from the control site) during the treatment days (with playback) but not during the control days (no playback). Do I get it right?  Am I using this control site data correctly?
Models #2 and #3 clearly provide very different results (estimates, p-values) regarding the impact of the treatment on the reaction according to age group. I think model #3 is more useful in this case because the ratio checked in this model is more appropriate (especially given the current, small, sample size). Am I right? How and based on what can I justify the use of one model over the other?
Are there missing parts in these models and the way I fit them using R? Are there things I should check regarding these models (such as checking overdispersion in model #1)?
Answer: I would use a GLMM for this with age category as a random factor (as you're trying to analyse differences between groups while also trying to predict an effect from other continuous variables), look for documentation associated witht he lme4 package.
As a previous poster said, stack overflow is a more appropriate for programming questions than this kind of broad question.


How to add a text in the column 'Ship To Name' in sales->order incase of virtual product

Question: I have a virtual product. I know that doesn't have shipping details and hence in sales->order grid, Ship To Name column is blank but in those cases, I want to add a custom text.
How can we achieve that in magento 184.108.40.206?
Answer: Look into the file app/design/adminhtml/default/default/template/widget/grid.phtmlFollow the lines of code added to add your custom message for the column 'Ship To Name' incase of virtual product.
Hope this will help the needy one!If someone gets something better, please post!
Comment: this solves you problem but it's a bad way of coding it. You are editing a template that is used by all the grids. Not a good idea.
Comment: @Marius Can you suggest something please
Comment: I'm searching now.
Answer: you can rewrite the class and change the column configuration to include a default value.
By default the grid column looks like this
$this->addColumn('shipping_name', array(
    'header' => Mage::helper('sales')->__('Ship to Name'),
    'index' => 'shipping_name',
));

you can make it look like this
$this->addColumn('shipping_name', array(
    'header' => Mage::helper('sales')->__('Ship to Name'),
    'index' => 'shipping_name',
    'default' => Mage::helper('sales')->__('Your default text here')
));

[EDIT]
An alternative would be to rewrite the grid class and implement the method _afterLoadCollection.
This is called after the collection that needs to be displayed is loaded. So you will only be affecting the items to be displayed.
you can make the method like this
protected function _afterLoadCollection()
{
    foreach ($this->getCollection() as $item) {
        if (empty(trim($item->getShippingName()))) {
            $item->setShippingName(Mage::helper('sales')->__('Your default text here'))
        }
    }
    return parent::_afterLoadCollection();
}

this way you change only your grid and do not affect all the grids.
Comment: I agree to your way too but this is not helping in my case. I checked, Shipping name coming as 2 spaces for virtual  product thereby default not working there. Any suggestion/idea about the issue
Comment: @AnuragKhandelwal See my edit.


How to convert dates into events?

Question: I have a sharepoint site that features a variety of inputs, including a column for dates. It was created as a date list, but I cannot figure out how to get these dates to populate into a calendar. It seems I need to turn them into events, but i was unable to find a workflow for that. Any help is appreciated. Thank you
Answer: Just Create a calendar view
on the time interval select the beggining date and the end date
then you can select what you want to see on each inidividual tile

How to convert dates into events?