I have been fiddling around with some piece of Javascript and I find console logs 1 for below code, However I was expecting 2, as it is 'a' which created b.  function b(){          c();     function c(){                     d();         function d(){              console.log(myVar);         }     } } function a(){     var myVar=2;      b(); } var myVar=1;  a();   But again I see b sits in lexical environment of window so it is getting the value from there. So how does scope chain work?Does it take value from caller/ creator or lexical scope?
What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?
Ok, I must be missing something obvious, but I'm having trouble adding a link to user/%/edit to the main menu.  In the Menu UI, I clicked "add link," set the title to "Account settings," and then was at a loss about what to put for the path.  I know how to generate a link to the account edit page using views, which is what I've always done before, but this time I actually need to add the link to the "Main Menu." Is there a quick way to reset a .blend files windows and settings to default How do you join on the same table, twice, in mysql? I have 2 tables. One (domains) has domain ids, and domain names (dom_id, dom_url).  the other contains actual data, 2 of which columns require a TO and FROM domain names. So I have 2 columns rev_dom_from and rev_dom_for, both of which store the domain name id, from the domains table.  Simple.  Now I need to actually display both domain names on the webpage. I know how to display one or the other, via the LEFT JOIN domains ON reviews.rev_dom_for = domains.dom_url query, and then you echo out the dom_url, which would echo out the domain name in the rev_dom_for column.  But how would I make it echo out the 2nd domain name, in the dom_rev_from column? Joel Spolsky asked what rhymes with orange. The official answer is, "Nothing," although a creative poet can get close by using half words, just the -nge part or resorting to place names and foreign words.  Does orange somehow violate the basic phonotactics of English? (And hence we wouldn't expect other English words to rhyme with it?) Limit at infinity of $x^{1/x}$ I encountered a problem: calculate $\lim\limits_{x\to\infty} x^{1/x}$  My solution is quite weird and I find no document explaining whether I am right or wrong!  My solution:  As $\lim\limits_{x\to\infty} 1/x = 0$  then $\lim\limits_{x\to\infty} x^{1/x} = \lim\limits_{x\to\infty} x^0  = 1$  My question is: Whether I am right or wrong, and could you please explain why? Did Sidious know the secret of cheating death? What sort of cheat sheets for a new DM lead to a better flowing 5e game of Dungeons and Dragons? The question is, what elements on a DM screen are essential? I'm new at playing and DMing, altough a lot of experience watching games, just got a group to play with now. Started with the starter set in 5E and the Lost Mine of Phandelver adventure, however I've noticed the game can come to a stop when checking the rules or how to do something, while getting the books and stuff like that. So I thought to make a DM screen with some cheat sheets, of the most usual things new players, and new DM's have doubts on, and how to make the game flow well without long rule-checking breaks. What are the essential things to have on that screen? So far this is what I found  but not sure if it has all I need or so much stuff that'll also make the game stop a lot while cheking it out. I want to boot Ubuntu into recovery mode but there is no grub menu entry allowing me to do so. I pressed e and now I am able to edit boot options. It looks like that:  setparams 'Ubuntu , with Linux 3.6.0-26-generic'  recordfail gfxmode $linux_gfx_mode insmod gzio insmod part_msdos insmod ext2 set root='(hd0,msdos5)' search --no-floppy --fs-uuid --set=root &lt;uuid&gt; linux /boot/vmlinuz-3.5.0-26-generic root=&lt;uuid&gt; ro ipv6.disable=1 quirt splash $vt_handoff initrd /boot/initrd.img-3.5.0-26-generic   The  documentation says:     Boot to the recovery mode even if it is not listed on the menu:         Remove existing kernel options from the linux line and add single      But this sentence doesn't make any sense, maybe the wiki page is broken somehow. How to modify the boot menu to boot directly into recovery mode?  Note: I don't have access to grub config or anything else, only the boot menu edit page is available. I am a Ph.D. dropout with a one year of career gap. I want to return to academia, but now  I have realized that it was perhaps the biggest mistake to take a gap after quitting my Ph.D. The purpose of taking a gap was to work on my communication skills and get a  new perspective on my work and my career in science. This could have been done within a period of 2-3 months but it became one year long because of my own recklessness. I allowed myself to distract from my goal and I started working on my hobby i.e. Painting. I lost myself there and completely lost track of my time. I was really enjoying everything about this new venture. I took it as a challenge to become better at my skills in painting. Eventually, I became the best in my group and got lots of appreciation. But then, I lost my interest while realizing that there was no further challenge and all there was left is to work and work while crafting your art which was never going to be perfect. It made me realize that what I actually love is to take the new challenges and work on myself. To be an artist was never a career option for me, all I wanted was to learn the skills. That's it!   While counting my achievement in science, I  realized that it was an irresponsible thing to take a gap in doing something that has nothing to do with science. Earlier I had a scholarship and a very competitive mind that has led me to get a Ph.D. position in one of the best labs in the country. Now I don't have the scholarship. I want to go back to my world of research where I was accelerating exponentially. I want to tackle the challenges of science with a new perspective and better skills. I want to be productive more than earlier and ready to take all the tough challenges.  But I feel embarrassed about my past mistake. Because of this, I come across as someone who is not sincere about her career. But I can't help it because the truth is that I did behave insincerely by losing track of my time.  I should have been conscious enough to realize the consequences. Now, what do I do? The past has gone and the vision of the present is crying for a better future. How do I make things better like before? Alternative definitions of wifebeater I was a li'l nonplussed to find out that the word  can mean other things besides "a man who beats up his wife". Its definition reads:        One who (usually as a repeated practice) beats one’s wife, or a husband prone to violence   A kind of sleeveless shirt, often but not exclusively worn as an undershirt.   (uncountable, UK, slang) Stella Artois, a brand of lager beer.       reckons that sense 2 is American and originates "apparently from the association of such a garment with men who commit domestic violence". It does not register the UK slang. I'm guessing that Stellas also have an unfortunate association with domestic violence.  Are these alternative senses popular in their respective countries or are they perhaps nonce words that have lingered on? Any idea how these disparaging associations came about? I expect that the brewers of Stella Artois are none too happy about it. Prove that ${x dy - y d x\over x^2 + y^2}$ is not exact If $z$ lies on the circle $|z-1|=1,$ then the value of $\frac{z-2}{z}$ is If $z$ lies on the circle $|z-1|=1, $ then the what is the value of $\frac{z-2}{z}$ ($z\ne 0 \ \text{and} \ 2$ ) is?  What I am aware of : the equation $|z-1|=1$ represent a circle with  centre $(1,0)$ and radius $1$. Also $$|z-1|=1 \implies (z-1)^2=1 \\ \implies  z^2-2z+1=1 \implies z(z-2) =0$$ $\implies z = 0; z =2 $ I think this is wrong.. please suggest thanks.. Is the set of all functions $f:Z_+\rightarrow Z_+$ that are eventually constant countable. Shrink Tempdb log file when reaching a specific size how I can shrink tempdb log file when reaching a specific size?? I'm scheduling job to shrink tempdb but still I face a problem of disk space due to tempdb is full! I have to prove this : "$n^7-n$ is a multiple of 7". This is what I have done this so far :  $P(n):n^7-n$ On putting $n=1,$ $P(1):1^7-1=0$, which is a multiple of 7. So, $P(1)$ is true. Let $P(k)$ be a multiple of 7. So, $k^7-k$ is a multiple of 7. So, $k^7-k=7m$, where $m$ is any natural number. Let $P(k+1)$ be true, Hence, $(k+1)^7-(k+1)$ is a multiple of 7.  Now, how do I evaluate $(k+1)^7$ without using the binomial theorem ? Or is there some other way to do it ? Is there a Windows standard way to do things such as "start fan", "decrease speed" or the like, from C/C++?  I have a suspicion it might be ACPI, but I am a frail mortal and cannot read that kind of documentation.  Edit: e.g. Windows 7 lets you select in your power plan options such as "passive cooling" (only when things get hot?) vs. "active cooling" (keep the CPU proactively cool?). It seems the OS does have a way to control the fan generically. Disable App Update Notifications on OSX? I know that the -f means --fix-broken from the manual and that it attempts to fix problems with the packages, but what exactly does? How it decides how to fix the packages or if they need fixing and the method of fixing? And why sometimes it fails? What makes a DSLR better than a Point & Shoot? Why should I put up with the inconvenience of lugging around a DSLR?  They look cool, but is there more substance to it? Evaluating this integral : $ \int \frac {1-7\cos^2x} {\sin^7x \cos^2x} dx $ The question :  $$ \int \frac {1-7\cos^2x} {\sin^7x \cos^2x} dx $$  I tried dividing by $\cos^2 x$ and splitting the fraction.  That turned out to be complicated(Atleast for me!)  How do I proceed now?