I am having doubt in following code how const is working. below code runs without error and showing Z is 8 . what my expectation is it should throw refrence error z is already defined . Can anyone explain this     (function() {   {     const z = 4;      if (true) {       const z = 8;       console.log("Z is " + z);     }   } })()
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?
Citation: refer to author or paper? What is the British English way of referring to a source in-text.  Is it plural because there are two authors, like this:         X and Y (2011) describe ...   Or is it singular because you are referring to a singular source, like this:     X and Y (2011) describes...   So what I am asking is whether you refer to the source or to the authors? I have been using this command successfully, which changes a variable in a config file and then executes a Python script within a loop: for((i=114;i&lt;=255;i+=1)); do echo $i &gt; numbers.txt; python DoMyScript.py; done  As each DoMyScript.py instance takes about 30 seconds to run before terminating, I'd like to relegate them to the background while the next one can be spawned. I have tried what I am familiar with, by adding in an ampersand as below: for((i=114;i&lt;=255;i+=1)); do echo $i &gt; numbers.txt; python DoMyScript.py &amp;; done  However, this results in the below error: -bash: syntax error near unexpected token `;' Use Complete Induction of set theory to prove $\frac{1}{\sqrt{1}} + \frac{1}{\sqrt{2}} + \frac{1}{\sqrt{3}} + ... + \frac{1}{\sqrt{n}} > \sqrt{n}$. Proove by the Complete Induction for every $n\in \mathbb{N}, n \geq 1$ $$\frac{1}{\sqrt{1}} + \frac{1}{\sqrt{2}} + \frac{1}{\sqrt{3}} + ... + \frac{1}{\sqrt{n}} &gt; \sqrt{n}$$.  I know only the basis - $\frac{1}{\sqrt{1}} \geq \sqrt{1}$.  But, I dont know how to do the change from the regular induction to the induction of Set theroy(Complete Induction). Why does "for good" mean "forever"? A very recent and similar  was closed asks what "for good" means.  While general reference can answer the question, I became curious as to the etymology of the idiom.   around got me nowhere, which is unusual.  The closest I found was a thread in :     OED   for good (and all): as a valid conclusion; hence, as a final act, finally.    15.. Parl. Byrdes Aij, Than desyred al the Byrdes great and smal to mewe the hauke for good and all. 1603 in Crt. &amp; Times Jas. I (1849) I. 25 D’Auval.. is gone for good and all. 1687 CONGREVE Old Bach. I. i, Ay, you may take him for good-and-all if you will. 1711 SWIFT Jrnl. to Stella 4 July, This day I left Chelsea for good, (that’s a genteel phrase). a 1732 T. BOSTON Crook in Lot (1805) 37 He was obliged for good and all to leave his country. 1850 J. H. NEWMAN Diffic. Anglic. 324 Throw off, for good and all, the illusions of your intellect. 1882 W. E. FORSTER Let. To Gladstone 10 Apr. in T. W. Reid Life (1888) II. viii. 421 This morning we released Parnell—not for good, but on parole.   However, this only traces some historical usages, and suggests that for good and all used to be a more popular version of the current idiom.  Is there anything more substantial?  Why did "for good" come to mean "forever"? Is $\cot(z)-\frac1z$ bounded on a given circle? Leave only two decimal places after the dot This error message is being presented, any suggestions?     Allowed memory size of 33554432 bytes exhausted (tried to allocate   43148176 bytes) in php I have noticed that some questions get a lot of responses quickly, and the cool fact is that most of the time these initial responses are correct.  I see users are motivated to accept answers. Because many questions take less than 24h to get an acceptable response, I'm unsure what to do when I have a question that takes more than 24h to get a response that I feel is complete enough to warrant being marked as accepted.  And even for acceptable responses, I often hesitate to accept them out of concern that posters will pass my question by if it already has an accepted answer (unless it has lots of upvotes). Does this really deter the higher-quality posters, though? How to open Nautilus (File Manager) preferences? Why do I have different IP addresses on different websites? My wireless router shows the IP address is 113.46.75.*, which some websites like ip138.com, www.ip.cn show as my IP.   But other websites, like googling for "what is my ip", www.whatismyip.com, www.whatsmyip.org, show that my IP is 121.18.126.*.   I am very curious why this happens and how is it possible.   So, why do different websites show that I have different IPs?  Thanks all!  Plus: I changed my IP address several times (restarting the modem) and all addresses is like 113.46.*.*, but my IP address does not change when googling for "what is my ip".  My ISP is a small company, so I think it is true that when visiting some websites, I am NATted or proxied to some IP addresses which have access to those websites -- not to avoid firewall though, since I am still blocked from some websites.  But I still want some more information or resources to support our guess. Thank you! I have seen many programs consisting of structures like the one below  typedef struct  {     int i;     char k; } elem;  elem user;   Why is it needed so often? Any specific reason or applicable area? The title of  of  is, "Is it posible [sic]?"  This doesn't provide any information at all. It should be mandatory for everyone asking questions on the Internet to read , which says:     Help your community learn from the question. When you field a good question, ask yourself "How would the relevant documentation or FAQ have to change so that nobody has to answer this again?" Very good linear algebra book. I plan to self-study linear algebra this summer. I am sorta already familiar with vectors, vector spaces and subspaces and I am really interested in everything about matrices (diagonalization, ...), linear maps and their matrix representation and eigenvectors and eigenvalues. I am looking for a book that handles every of the aforementioned topics in details. I also want to build a solid basis of the mathematical way of thinking to get ready to an exciting abstract algebra next semester, so my main aim is to work on proofs for somehow hard problems. I got Lang's "Intro. to Linear Algebra" and it is too easy, superficial.  Can you advise me a good book for all of the above? Please take into consideration that it is for self-study, so that it' gotta work on its own. Thanks. Example where convergence in mean does not imply convergence in quadratic mean Is there an example where convergence in mean does not imply convergence in quadratic mean. $E|X_n-X|\rightarrow 0$ but $E|X_n-X|^2 \nrightarrow 0$.  It seems like this should be fairly straightforward, but I cannot really come up with an answer.  I'd imagine the answer would look something like   $$X_n=\begin{cases}a &amp; \text{with probability } \frac{1}{n} \\\  0&amp; \text{with probability } 1-\frac{1}{n} \end{cases}$$ Validate inputs that are not inside a form with jQuery Validation plugin How can I validate some inputs that are not inside a form tag?  All the samples I found have a form tag, but I want to validate some inputs that are not inside a form. "The train will leave" vs. "is going to leave" vs. "leaves" vs. "is leaving" From the grammatical point of view all are correct, just the meaning are different, please bring your clarification, thank you.        The Train will leave at 10:00 tomorrow morning.   The Train is going to leave at 10:00 tomorrow morning.   The Train leaves at 10:00 tomorrow morning.   The Train is leaving at 10:00 tomorrow morning. Why did Voldemort take the wand of one of his most loyal servants? In Harry Potter and the Deathly Hallows, chapter one The Dark Lord Ascending, Voldemort believes he must use a wand other than his own in order to kill Harry, when Harry is moved from Privet Drive. He demands Lucius Malfoy's wand, and gets it.   My question is, why did Voldemort take the wand of one of his most loyal servants, rendering Lucius Malfoy useless if a battle was to occur?  If I remember correctly, he had Ollivander at his disposal, and he was the one who told him to use another wand in first place. Why not ask Ollivander to create another wand, or just use ones that he had ready to sell in his shop at Diagon Alley? He could even have taken Ollivander's own wand. If my memories are correct, a wand's importance was compared to that of a limb. Problem statement  Prove that if $A$ is an uncountable set and $B$ is a countable set, then $A\setminus B$ must be uncountable.  What I think  The statement does not mention $A$ and $B$ relationship. I think there are two possibilities:   If $A \cap B = \emptyset $, then $A\setminus B$ is trivially uncountable If $A \cap B = B$, then $B \subset A$ and as a bijection can not be made between $A\setminus B$ and $\mathbb{N}$, $A\setminus B$ is uncountable.   And there is where I'm stuck. How can I prove that a bijecton can't be made?  TIA. SQL Server Max Memory not limiting use of RAM I would like your input on this. I have a sql server 2008r2 Ent. Ed. 64bit with 16 cores and 64GB RAM. There is one instance of SQL server patched fully as of 20111014.  The max ram is set to 60000MB. Amount of free ram is 0 according to task manager after a few days online.  If I change the max ram to below 53GB it will after a few days to stabilize and have some free ram.   It is the sql process that does allocate the ram according to task manager. How do i come to terms with what the problem really is? It goes without saying that i did alot of testing already but havn't solved this to my liking yet. and ohh we do not get the typical memory starvation lagging when the available ram is down to 0 free.  Update 1:  Inspired by another Q/A related to RAM on this page  . I used these two to see what the RAM is being used for.  SELECT TOP ( 10 )         [type] AS [Memory Clerk Type] ,         SUM(single_pages_kb) AS [SPA Mem, Kb] FROM    sys.dm_os_memory_clerks GROUP BY [type] ORDER BY SUM(single_pages_kb) DESC OPTION  ( RECOMPILE ) ;  SELECT  DB_NAME(database_id) AS [Database Name] ,         COUNT(*) * 8 / 1024.0 AS [Cached Size (MB)] FROM    sys.dm_os_buffer_descriptors --WHERE   database_id &gt; 4 -- system databases --        AND database_id &lt;&gt; 32767 -- ResourceDB GROUP BY DB_NAME(database_id) ORDER BY [Cached Size (MB)] DESC OPTION  ( RECOMPILE ) ;   The amount used shown by these are  first select 7948432    Kb second one 44030,57812  MB that is a total of about 52GB used by sql server... so where did the rest of my RAM go? :-) Task manager show right now cached 363, available 401, free 40 and sqlservr.exe has Memory private set 64 459 656. Max Ram set to 60000MB as before. Representation of electromagnetic wave?