Why does z() execution context not override global x variable?      var x = 10;  function z(){   var x = x = 20; } z(); console.log(x); // why is 10 printed? Shouldn’t it be 20.   var  a = b = c = 0;  It means b and c are being declared as globals, not locals as intended.  For example -   var y = 10;  function z(){   var x = y = 20; // global y is overridden } z(); console.log(y); // value is 20   Going by above logic, x = x = 20 in z() means x is global which overrides the local x variable but still global value of x is 10
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?
Influence of charged particle's own electric field on itself I read this in my textbook: A charged particle or object is not affected by its own electric field.  Since I find this completely unintuitive and my mind is yelling "wrong! wrong! how could a particle even distinguish between its own field and the external fields?" I would really like to hear an explanation about why this is true, if it is.  (A corollary question that comes to my mind after thinking about this is... What about gravity and mass considering the analogous situation? And the other two forces?) Modelling a spiral around a sphere I'm trying to figure out the best way to model the sphere-spiral here:    Is it possible to make this shape directly? Or do you have to make it as a cylinder and wrap it to a sphere? Linear algebra skew symmetric What Happens to electrons after Alpha Decay and Nuclear Fission? String concatenation: concat() vs "+" operator Assuming String a and b:  a += b a = a.concat(b)   Under the hood, are they the same thing?  Here is concat decompiled as reference. I'd like to be able to decompile the + operator as well to see what that does.  public String concat(String s) {      int i = s.length();     if (i == 0) {         return this;     }     else {         char ac[] = new char[count + i];         getChars(0, count, ac, 0);         s.getChars(0, i, ac, count);         return new String(0, count + i, ac);     } } How can I check dependency list for a deb package Proving the sum of two independent Cauchy Random Variables is Cauchy Is there any method to show that the sum of two independent Cauchy random variables is Cauchy? I know that it can be derived using Characteristic Functions, but the point is, I have not yet learnt Characteristic Functions. I do not know anything about Complex Analysis, Residue Theorem, etc.   I would want to prove the statement only using Real Calculus. Feel free to use Double Integrals if you please.   On searching, I found . However, I was wondering if I could get some help directly on the convolution formula:  $$f_Z(z)=\int_{-\infty}^\infty f_X(x)f_Y(z-x)\,dx=\int_{-\infty}^\infty\frac{1}{\pi^2}.\frac{1}{1+x^2}.\frac{1}{1+(z-x)^2}dx\tag{1}$$  Here I have supposed that $X,Y$ are Independent Standard Cauchy. But I think the general formula can be derived easily after some substitutions. I need some help on how to proceed from $(1)$.  EDIT: Just as what the hint in the hyperlink said, I got the answer using that hint. However, I am not quite sure that the hint is algebraically correct. Maybe there has been some typing mistake in the book. Common screen resolution? I'm developing a web application which is quite information heavy. This means that every pixel available in the screen for display helps a lot, to avoid the UI looking too cluttered and to display relevant data.  I was wondering: which is the "common" screen resolution? Years ago it was something like 1024&times;768, but nowadays it must be something much higher. I can't rely on what I use as I'm a developer and I probably have bigger screens and resolution than the average Joe user.  So, where can I find the currently recommended resolution for webapps? iOS emails stuck in All Inboxes In the iOS Mail app, there are 4 emails in the "All Inboxes" section. Those 4 emails are NOT in the actual inbox on Gmail.  I thought, oh well I don't mind deleting them entirely since they're just newsletters. I deleted them directly on gmail, but they still appeared in iOS. So I tried deleting them via iOS and ... they keep coming back!  Even stranger, the 4 emails ONLY appear in "All Inboxes", they don't appear in any of the sub-account inboxes.  So, I disabled "Mail" in my gmail account. They're still here! I no longer have a "gmail" sub-account, but those 4 emails are still in All Inboxes. I tried to quit the app a few times, restart the phone. Still here...  When I tap on one of those messages, I get a black screen (dark mode), no errors. How to collapse unused parameters in moderncv? I am writing my CV using the moderncv package. I already have adjusted the CV to meet my needs. Therefore I amplified the maximum number of parameters possible in the \cventry command. However, now I have some ugly spacing in case I do NOT use all parameters (see second \cventry in the MWE for illustration):  Any suggestions to make the spacing collapse in case not all parameters are occupied? As you can see from the MWE I already have adjusted for \ifthenelse command. I use texlive 2014.  \documentclass[11pt,a4paper,sans]{moderncv} \moderncvstyle{banking} \moderncvcolor{blue} \usepackage[scale=0.7]{geometry} \name{John}{Doe} \title{Resume title} \address{street and number}{postcode city}{country} \phone[mobile]{+1~(234)~567~890}  \renewcommand*{\cventry}[9][.4em]{%  \begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}r}%  \ifthenelse{\equal{\bfseries #4}{}}{}{{\bfseries #4}} &amp; \ifthenelse{\equal{\bfseries #5}{}}{}{{\bfseries #5}} \\%   \ifthenelse{\equal{\itshape #3}{}}{}{{\itshape #3\ifthenelse{\equal{#6}{}}{}{, #6}}} &amp; \ifthenelse{\equal{\itshape #2}{}}{}{{\itshape #2}}\\%  \ifthenelse{\equal{#7}{}}{}{{#7}} &amp; \ifthenelse{\equal{#8}{}}{}{\\ {#8} &amp; \\}% \end{tabular*}%  }  \begin{document} \makecvtitle \section{Education} \cventry{Grade}{Degree}{Institution}{year--year}{M.Sc.}{Majors}{Majors}{} \cventry{}{Degree}{Institution}{City}{}{}{}{} \cventry{year--year}{Degree}{Institution}{City}{Grade}{Majors}{Majors}{} \end{document} See all my questions across all Stack Exchange sites? Why is Dictionary preferred over Hashtable in C#? In most programming languages, dictionaries are preferred over hashtables. What are the reasons behind that? How to remove a repository? I am going to Nepal and probably, same as everyone, through Delhi. I was considering going overland from Delhi to Kathmandu, however I have found many posts that advise against it in favor of a flight. The following concerns are the key to the proper decision, I think.  Does the overland route offer a good scenery and cultural experience or is it  better to spend that time in Nepal?  What is the rough cost of an overland journey and how does it compare with a flight?  In case of a flight, is the Indian visa necessary? How to approach proving $f^{-1}(B\setminus C)=A\setminus f^{-1}(C)$? I've come across quite a few answers that request the asker to, for example: "send the user an email", after which the answerer will provide them with the code or other resources they're looking for.  A few examples:          Should we take action against these questions?  I feel like these answers aren't appropriate (see my answer below).  Update:  Perhaps there are some cases where this is acceptable. I've seen a few questions regarding a particular piece of commercial software where the author/developer of the software answers, telling the asker to contact either them or their organization's in-house support.  I'm on the fence about this case. If I came across a question here describing a similar problem I was having, it would be useful to me to have the support information and know that I could contact it for assistance.  I'm interested in others' opinions on this situation in particular. Suppose k is an integer such that $6k + 1$, $12k + 1$, $18k + 1$ are primes. Show that $n = (6k + 1)(12k + 1)(18k + 1)$ is a Carmichael number. Suppose k is an integer such that $6k + 1$, $12k + 1$, $18k + 1$ are primes. Show that $n = (6k + 1)(12k + 1)(18k + 1)$ is a Carmichael number.  This is a question on a past exam that I find difficulty to answer. Can anyone help? 4 GB of RAM installed but only 2.97 GB usable. What gives? Possible Duplicate:        I just bought a used MacBook on  that came installed with 4 GB of . The first thing I did was installing Windows&nbsp;7 using . Here's where it gets weird. When I finally booted it up in Windows&nbsp;7, I checked the Computer properties, and it said that there were 4&nbsp;GB of RAM, but only 2.97&nbsp;GB is usable. Why is that? Is there anything I can do about this? How to determine if a string is a valid variable name? How can I get rid of those little white dots? I am using Blender 2.70a.