I was seeing some Javascript code and I stumbled upon something like this:   function() {     if(true) {         var a = 5;     }     alert(a); }   I was pretty sure this would output undefined but it didn't ? Can someone tell me why?
How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves?  I have seen  given on Wikipedia, but unfortunately it did not help.
Schengen area 90 days limit: Can I leave on the 91st day? Can anyone tell me if the 90 days is in fact 90 nights? Can you leave the Schengen area on the 91st day? Or are you only allowed 89 nights and you are required to leave on the 90th day? Is there a difference between foo(void) and foo() in C++ or C? What is the origin of BrEng ‘bird’ meaning “young woman”? Bird:         (Brit.) a girl or young woman, esp one's girlfriend ()      According to  bird:         "maiden, young girl," c.1300, confused with   (q.v.), but felt by later writers as a figurative use of  (n.1). Modern slang meaning "young woman" is from 1915, and probably arose independently of the older word.      also :         , bird was used for ‘girl’, but this was probably owing to confusion with another similar middle English word, burde, which also meant ‘young woman’. The usage crops up from time to time in later centuries, clearly as an independent metaphorical application, but there does not really seem to be an unbroken chain of occurrences leading up to the sudden explosion in the use of bird for ‘young woman’ in the 20th century.   (www.dictionarycentral.com)      Modern usage of bird meaning girl appears to be unrelated to the old Middle Ages meaning. Etymonline dates it back precisely to 1915.    What is the modern origin of bird meaning young woman?  In what context did they start to use it at the beginning of the 20th century? How to yield from parallel tasks in .NET 4.5 Renaming accessor/mutator methods in Eclipse? Is there any way to automatically rename accessor/mutator when a variable they get/set gets refactored -> renamed (Eclipse 3.4)? Proving a graph has no Hamiltonian cycle I have a virtual instance of redhat running that I can ssh to from any host on the corporate network.  My ssh session was dropped while running some scripts that may or not have caused me to disconnect.  The who command locally still lists the dropped connection. Reconnecting with ssh starts a whole new session.  Is there a way to connect to the original session?  If not can I kill it?  I have root and physical access.  I was not using screen in the original session. Should Stack Exchange introduce the ability to upload embedded sounds (maybe via HTML5/Flash, whichever the user has) as part of questions and answers to Stack Exchange?  It could require a certain amount of rep to stop new users from doing it frivolously.  My rationale behind this is the new language &amp; usage sites.  I often find myself thinking that it might be helpful, when discussing a regional dialect or something, for the person answering to just pronounce what they're trying to describe in words. Why can a discontinuous function not be differentiable? I don't really understand why a discontinuous function cannot be differentiable.  In Stewart's Calculus, the definition of a function $f$ being differentiable at $a$ is that $f'(a)$ exists. Earlier it gives the definition of the derivative as $f'(x)=\lim_{h\to0}\frac{f(x+h)-f(x)}{h}$. It also has a theorem that if $f$ is differentiable at $a$, then $f$ is continuous at $a$. There is also a definition that a functions $f$ is continuous at a number $a$ if $\lim_{x\to a}f(x)=f(a)$.  Take for example the very simple function:  $$ f(x)=\begin{cases} x+1 &amp; x\geq0, \\ x &amp; x&lt;0.  \end{cases} $$  It is discontinuous at $x=0$ (the limit $\lim_{x\to 0}f(x)$ does not exist and so does not equal $f(0)$), but if I find the derivative using the limit above, I get the left and right limits to equal $1$. So therefore, the derivative exists.  According to the book, the function shouldn't be differentiable at $x=0$ as it has a discontinuity (continuity is a necessary condition of differentiability). What am I doing/understanding wrong? How does 3-wire RTD or resistance measurement works in bridge of wheatstone? I cannot understand how 3-wire measurement will improve the resistance measurement.    They say that IF lead resistance \$ R_L \$ is the same, it will compensate. How can this happen?  If bridge is balanced (without \$ R_L \$):  \$ \frac {R_1}{R_2} = \frac {R_g}{R_3} \$  If \$ R_L \$ is added: \$ \frac {R1}{R2}= \frac {R_g+R_L}{R_3+R_L} \$  \$ \frac {R_g}{R_3} \$ is not same as \$ \frac {R_g+R_L}{R_3+R_L}\$; is this true only if \$ R_G=R_3 \$ in the beginning? So this means that \$R_L\$ does not get compensated? Wiener Process $dB^2=dt$ Why is $dB^2=dt$? Every online source I've come across lists this as an exercise or just states it, but why isn't this ever explicitly proved? I know that $dB=\sqrt{dt}Z$, but I don't know what squaring a Gaussian random variable means. I'm having problems with an exercise from Apostol's Introduction to Analytic Number Theory.     Given $x$ and $y$, let $m=ax+by$, $n=cx+dy$, where $ad-bc= \pm 1$. Prove that $(m,n)=(x,y)$.   I've tried to give a proof, but I suspect it's wrong (or at least not very good). I would be very thankful for any hints/help/advice!  My proof:     We observe that since $ad-bc= \pm 1$, $ad=bc \pm 1$, and $(ad,bc)=1$.   Now, $(a,b) \mid m$ and $(c,d) \mid n$ but      $$(a,b) = ((d,1)a,(c,1)b)=(ad,a,bc,b)=(ad,bc,a,b)=((ad,bc),a,b)=(1,a,b)=1.$$      Similarly, we determine $(c,d)=1$. So, $1=(a,b) \mid m$ and $1=(c,d) &gt; \mid n$. But $(x,y)$ also divide $m$ and $n$. Since $(x,y) \geq (a,b)=(c,d)=1$, this implies that $(x,y)=m,n$. Hence   $(m,n)=((x,y),(x,y))=(x,y)$. Looking for a book series about a girl and her friends captured and sold as slaves Show that the square of any prime number is the Factof of some integer Make locking posts more granular PWM complementary square output waveforms PWM channels in certain microcontrollers such as the SAM3X8E have two complementary square output waveforms, PWMH and PWML, per channel. What is the purpose of having two waves that are the inverses of each other? Enabling GPU rendering for Cycles? Is there any way in QGIS to apply service area buffers e.g if I have a point on a map I wish to show the service coverage of 1 mile, 2 mile, 3 mile, breaks using  the road network? Keying node in compositor. How can I associate the alpha channel so that it works with the Alpha Over Node? (As a follow-up to  question) I'm trying to overlay a a green-screen plate over a 3D background. I create the key with a Keying node and the overlay with an Alpha Over node. I can get a clean key by enabling Convert to Premultiplied.  Whereas if I leave the Convert to Premultiplied off, the key does not work.  The reason for this, as explained on :  The Alpha over node actually assumes associated alpha and performs the correct over operation, which is FG+(1-FG.a)BG.RGB. Unassociated alpha can do none of these things. [...] it is prudent to manually associate your alpha and control the merging to prevent data loss in the RGB channels. I still stand by the advice, however; always try to maintain a consistent state of alpha, and when you deviate, do so under scrutiny.  So the question is: what is the correct way to associate the Alpha Channel crated by the keying node, so that it works with the Alpha over node without resorting to the convert to premultiply option?   green screen element can be downloaded from the mango project I'm looking for an easy and robust way to strip all the comments from a listing. My approach (passing \@gobble to the commentstyle key) correctly removes all the one-line comments and block comments. However, the white space left behind by by block comments remains, creating useless gaps in my listing. See the screenshot below (the red rectangle is my emphasis). Any idea?    \documentclass{article}  \usepackage{xcolor} \usepackage[T1]{fontenc} \renewcommand{\ttdefault}{pcr} \usepackage{listings}  \makeatletter \lstset% {%   basicstyle   = \ttfamily,   morecomment  = [l]{//},   morecomment  = [s]{/*}{*/},   frame        = single,   commentstyle = \itshape\color[gray]{.5},   rulecolor    = \color{black},   breaklines, } \makeatother  \usepackage{filecontents} \begin{filecontents*}{sample.c} #include &lt;stdio.h&gt;  /*  block comment taking up white space */ main() {     float fahr, celsius;     float lower, upper, step;     lower   = 0;    /* lower limit of temperature scale */     upper   = 300;  /* upper limit */     step    = 20;   /* step size */     celsius = lower;     printf("\nCelsius\tFahr\n");     while (celsius &lt;= upper)        {         fahr = (9.0/5.0) * celsius+32.0;         printf("%3.0f\t%6.1f\n", celsius, fahr);         celsius = celsius + step;     } } \end{filecontents*}  \begin{document} \makeatletter \lstinputlisting[caption={with comments}]{sample.c} \lstinputlisting[caption={without comments},commentstyle={\@gobble}]{sample.c} \makeatother \end{document}