Hii have the recursion code below and while stepping through it i noticed that the value of jsonElement is not preserved well after stepping out of inner recursions. How do i go about it?  allnodes = getArrayOfNodes(tree); function toJson(node){      childrenList = []      jsonElement = {}     jsonElement["name"] = node.data       allnodes.forEach(function(item, index){         if(isParentOf(node, item) == true){             allnodes.splice(index, 1)             childrenList.push(toJson(item))         }     })     jsonElement["children"] = childrenList      return jsonElement }
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?
How can I "normalize" the scale of what seems to be either an infinitely large or infinitely small object I'm having issues with an obj file I've imported into Blender. At first I thought the import was broken in some way because the import would go smoothly, but there was no model to be seen. Eventually I figured out that I could snap my view to the object by pressing . on the numpad and it was in fact there, just extremely small or large (I can't tell). I've tried scaling, but the sizes are so extreme that it doesn't seem to be working. Also due to the extreme nature of the object I can only see certain parts of it at a time depending on the angle in which im viewing it at it starts to de-render the parts not directly in front of the camera. Flying EU to UK to EU. Can I get duty free alcohol? On the 20 of March this year I will be flying from Ireland to the UK and then on the another EU country.  Can I buy duty free alcohol (as in alcohol with no tax) leaving the UK ? I just installed a fresh install of 32-bit 12.04 LTS Pangolin today. When I tried to install a few applications, it was really slow. But when I download a .deb or .tar.gz file from on my web browser, it is a lot faster.  Computer specs:  HP Pavilion Slimline s7700n PC  [Memory]         873.7 MiB  [Processor]      AMD Athlon(tm) 64 X2 Dual Core Provessor 3800+ x 2  [Graphics]       GeForce 6105 LE/integrated/SSE2/3DNOW!  [Disk Size] 638.5 GB  I normally get 200-400 kbps.  This is the comparison. How to shift graphics/adjust placement of figure with \includegraphics I composed a diagram that takes up the entire sheet of paper in landscape mode, called diagram.tex (compiled it to generate pdf). I'm trying to include that into an article, but only half of it is showing; the bottom half is cut off by the right end of the paper.  I was able to get it in the proper orientation by using  \includegraphics[angle=90]{diagram.pdf}  But because the bottom half of it is cut off, I need some sort of option where I can do something like this:  \includegraphics[angle=90, shift left = 5cm]{diagram.pdf}  to pull the rest of the image left (or up, depending on how you're looking at it).     So how can I move the figure around?   I'm not sure if this is relevant, but I'm using the following documentclass and packages in my paper:  \documentclass[11pt,a4paper,twoside]{article} \usepackage{tikz, graphicx}     Edit:  This is not an issue with pushing it past the margins. Half of the picture is not on the paper (sort of like if you stuck half of your left hand behind the left side of your monitor). I need to pull the paper left (just like you would shift your hand left to see it). If $\operatorname{rank}\left( \begin{bmatrix} A &B \\ C &D \end{bmatrix}\right)=n$ prove that $\det(AD)=\det(BC)$ Let $A,\ B,\ C,\ D \in \mathcal{M}_n(\mathbb{C})$. If $\operatorname{rank}\left( \begin{bmatrix} A &amp;B \\ C &amp;D \end{bmatrix}\right)=n$, prove that $\det(AD)=\det(BC)$. Is there a way to do proportional editing only on specific vertices? I read a collection of Sci-Fi short stories back in the 1970's or early 80's that had one about a couple in love who kept losing each other. The book was my dad's so the story itself could be much older than that. I am very fuzzy on the details as I was young when I read it and it was so long ago. I believe the woman/girlfriend was "taken" (by some bad guy aliens??) while she was sleeping. I think it involved time travel and the man had to search through time to find her. After he found her, when he was asleep one time, he somehow was then "taken" and I think transported through time and had to fight his way back to her again. He may have been some sort of police officer. I just remember in the end, at night when they went to bed, the couple always wore handcuffs so they were never separated when they went to sleep ever again. Does this ring a bell with anyone?  (There is a possibility it is in a short story collection that also contained " The Twonky " by Lewis Padgett (1942), as I remember reading that story around the same time) Can I use the Twig template engine? I do a lot of  development and I like their templating language. , the , looks very much like it.  How can I use Twig in Drupal 7 or even Drupal 6? There exists an injection from $X$ to $Y$ if and only if there exists a surjection from $Y$ to $X$. I have been working on this exercise for a while now. It's in B.L. van der Waerden's Algebra (Volume I), page $19$. The exercise is as follows:     The order of the symmetric group $S_n$ is $n!=\prod_{1}^{n}\nu$. (Mathematical induction on $n$.)   I don't comprehend how we can logically use induction here. It seems that the first step would be proving $S_1$ has $1!=1$ elements. This is simply justified: There is only one permutation of $1$, the permutation of $1$ to itself.  The next step would be assuming that $S_n$ has order $n!$. Now here is where I get stuck. How do I use this to show that $S_{n+1}$ has order $(n+1)!$?  Here is my attempt: I am thinking this is because all $n!$ permutations of $S_n$ now have a new element to permutate. For example, if we take one single permutation $$ p(1,\dots,n) = \begin{pmatrix} 1 &amp; 2 &amp; 3 &amp; \dots &amp; n\\ 1 &amp; 2 &amp; 3 &amp; \dots &amp; n \end{pmatrix} $$ We now have $n$ modifications of this single permutation by adding the symbol $(n+1)$:  \begin{align} p(1,2,\dots,n,(n+1))&amp;= \begin{pmatrix} 1 &amp; 2 &amp; \dots &amp; n &amp; (n+1)\\ 1 &amp; 2 &amp; \dots &amp; n &amp; (n+1) \end{pmatrix}\\ p(2,1,\dots,n,(n+1))&amp;= \begin{pmatrix} 1 &amp; 2 &amp; \dots &amp; n &amp; (n+1)\\ 2 &amp; 1 &amp; \dots &amp; n &amp; (n+1) \end{pmatrix}\\ \vdots\\ p(n,2,\dots,1,(n+1))&amp;= \begin{pmatrix} 1 &amp; 2 &amp; \dots &amp; n &amp; (n+1)\\ n &amp; 2 &amp; \dots &amp; 1 &amp; (n+1) \end{pmatrix}\\ p((n+1),2,\dots,n,1)&amp;= \begin{pmatrix} 1 &amp; 2 &amp; \dots &amp; n &amp; (n+1)\\ (n+1) &amp; 2 &amp; \dots &amp; n &amp; 1 \end{pmatrix} \end{align}  There are actually $(n+1)$ permutations of that specific form, but we take $p(1,\dots,n)=p(1,\dots,n,(n+1))$ in order to illustrate and prove our original statement. We can make this general equality for all $n!$ permutations: $p(x_1,x_2,\dots,x_n)=p(x_1,x_2,\dots,x_n,x_{n+1})$ where $x_i$ is any symbol of our finite set of $n$ symbols and $x_{n+1}$ is strictly defined as the symbol $(n+1)$.  We can repeat this process for all $n!$ permutations in $S_n$. This gives us $n!n$ permutations. Then, adding in the original $n!$ permutations, we have $n!n+n!=(n+1)n!=(n+1)!$. Consequently, $S_n$ has order $n!$.  How is my reasoning here? Furthermore, is there a more elegant argument? I do not really see my argument here as incorrect, it just seems to lack elegance. My reasoning may well be very incorrect, however. If so, please point it out to me. After the upgrade I can't figure out how the new shield system works. I have the option to discard the shield, and I notice I have a new potion in the inventory.  More importantly, I got attacked (and lost) twice in a short amount of time and don't have a shield. When do you now get shield? UK Visa in an expired Nigerian passport - what to use? login and payoff are nouns. But can they be used as verbs? I know that words like login and payoff are properly nouns but I increasingly notice many (not at all uneducated) people use them as verbs:     Will you payoff your credit card this month?   and     Please check this when you login.   To me (a non-native English user), that seems incorrect because separating the core noun from a preposition is what I was taught: Please check this when you log in. (My emphasis)  Is this use proper or not? Counterexample to Leibniz criterion for alternating series I have this statement and I need to say if it is true or false:  Let $\{a_n\}$ be a real sequence.  $$\lim_{n\to +\infty} a_n = 0 \quad \implies \quad \sum_{n=1}^{\infty}(-1)^na_n \quad \text{converges}$$  I know, from the Leibniz criterion that:     If $a_n \to 0$, $a_n$ is decreasing and positive then $\sum_{n=1}^{\infty}(-1)^na_n$ converges   From this fact I believe that the statement is false but I couldn't come up with an infinitesimal sequence that isn't decreasing and for that reason is divergent. I tried some function with $sin(\frac{1}{n})$ without any luck. Any help would be very appreciated, thank you! How can I typeset this accented, dotless i? See the rough sketch above. I am able to typeset the accented i shown in the middle (for which I used the \v macro) and, obviously, the plain and simple i shown on the left also. However, I can't figure out how to typeset the one shown on the right. How can I do that? Excel function that evaluates a string as if it were a formula? Are we inside a black hole? This is trigonometry from double angles and compound angles. Thus far I've simplified it up to this point. $$2 \sin^2θ – 3\sinθ +1 = 0$$  I'm trying to factorize this to solve for General Solution. I tried taking out a common but that +1 is giving me a problem. I used the quadratic equation to get 1 and 0.5 as an answer, but i don't know how to write it in terms of 2sin(squared)θ and -3sinθ.  Any help will be appreciated. I came across this statement while studying electric currents and I am confused:  "There is no electric field inside a conductor. Hence no current can flow through it".  Is there a fallacy in this statement?  Any help would be appreciated.  The conductor being discussed is ideal. What is the driving force for the current in this case? The timeout period elapsed prior to obtaining a connection from the pool I'm getting this error every few days. I won't see the error for a few days then I'll get a flurry of 20 or so all with in a minute or so.  I've been very thorough going throw my code so that I'm using this basic setup for my DB access.  try {   myConnection.Open();   mySqlDataAdapter.Fill(myDataTable);   myConnection.Close(); } Catch (Exception err) {   if (myConnection.State != ConnectionState.Closed) myConnection.Close();   throw err; }   The way I understand it this should execute my queries and immediately release the connection back to the pool but if something goes wrong with the query then I catch the excpetion close my connection then throw the error up, which eventually gets trapped at the application level and logs and emails me the error.  Even using this throughout my code I'm still running across the issue. What can I do to diagnose the root cause of the issue?