I am no JavaScript expert, but I found some code like this  a();  function a(){   alert('a'); }   and I was surprised to find it works (I think something like that will not work in Python). I expected that the function a can't be executed before being created. How does interpreter work and why functions can be called before declaration?
This code always works, even in different browsers:  function fooCheck() {   alert(internalFoo()); // We are using internalFoo() here...    return internalFoo(); // And here, even though it has not been defined...    function internalFoo() { return true; } //...until here! }  fooCheck();   I could not find a single reference to why it should work, though. I first saw this in John Resig's presentation note, but it was only mentioned. There's no explanation there or anywhere for that matter.  Could someone please enlighten me?
Electron Flow Confusion Using conventional notation in the diagram below, I understand that the circuit is not complete because the diode is in reverse bias. But knowing that the electrons actually flow from the negative to the positive terminal(direction of the arrows), wouldn't the electrons take a path from the negative terminal of the battery, go through the lamp and stop at the diode(the red path in the picture). If they would, then why doesn't the lamp light up with the first electrons that are able to flow through it before the voltage in the wire is built up and the current stops. For some reason, when I try to run any programs (I am trying to run a rootkit hunter: rkhunter) as root on the command line with sudo like this:  sudo rkhunter   Then I get this message:  You must be the root user to run this program   and then I get these lines:  sudo: error in /etc/sudo.conf, line 0 while loading plugin 'sudoers_policy' sudo: /usr/lib/sudo/sudoers.so must only be writable by owner sudo: fatal error, unable to load plugins   I try typing in just sudo but that comes up with the same three errors as above. Also in /etc/ sudo.conf does not exist.  I cannot run any other programs as root through sudo. It was also strange because I could run as root a day ago. I would like it to work.  Just so you know, I am the only user of this computer, and the administrator, running Lubuntu 14.04.1. Why do we say the following?        I'll have an hour's wait at the airport      Today's lesson      Yesterday's programme    Two weeks' worth of groceries.      They are not possessive, or are they? Why is the possessive apostrophe used with time expressions and adverbs? My task is to write a precise mathematical statement that "the sequence $(a_n)$ does not converge to a number $\mathscr l$"  So, I have my definition of a convergent sequence: "$\forall\varepsilon&gt;0$ $\exists N\in\Bbb R$ such that $|x_n -\mathscr l|&lt;\varepsilon$ $\forall n \in \Bbb N$ with $n&gt;N$"  Would the correct negation of this be "$\forall\varepsilon&gt;0$ $\exists N\in\Bbb R$ such that $|x_n -\mathscr l|&gt;\varepsilon$ $\forall n \in \Bbb N$ with $n&gt;N$"?  It doesn't seem that this is the answer as the next part of my task is to prove that a sequence is divergent using my formed proof, but it'd be difficult to do since it's a general proof of divergence and not just a proof that $(a_n)$ doesn't converge a specific number $\mathscr l$  Perhaps I should find a prove that $(a_n)$ tends to $\pm\infty$? This is more simple but it does not include monotone sequences such as $x_n:=(-1)^n$.  Can someone assist me with this task? All comments and answers are appreciated. Each site got a &quot;hot&quot; tab, where its contents are calculated based on . However take a look on the screenshots below and see for yourself that &quot;hot&quot; got nothing to do with many of the questions listed there. :    :    As you can see, there are questions with negative score, no answers, and even closed. I won't be surprised to see spam in there as well. This can't be any worse. What I suggest, instead of fixing the formula or patching it, simply have the hot tab show the same questions as the Hot Network Questions sidebar. (from the specific site only, of course.) Since the hot questions &quot;pool&quot; (as seen ) is limited to 100 for the whole network, either expand it or have the per-site list show questions with less hotness points - it would still be better than what we have now. Is it possible to see the history of changes to a particular line of code in a Subversion repository?  I'd like, for instance, to be able to see when a particular statement was added or when that statement was changed, even if its line number is not the same any more. Using Sequence to delete a part of an expression git-upload-pack: command not found, when cloning remote Git repo I have been using git to keep two copies of my project in sync, one is my local box, the other the test server. This is an issue which occurs when I log onto our remote development server using ssh;  git clone me@me.mydevbox.com:/home/chris/myproject Initialized empty Git repository in /tmp/myproject/.git/ Password: bash: git-upload-pack: command not found fatal: The remote end hung up unexpectedly fetch-pack from 'me@me.mydevbox.com:/home/chris/myproject' failed.   (the file-names have been changed to protect the guilty... !)   Both boxes run Solaris 10 AMD. I have done some digging,  if I add --upload-pack=$(which git-upload-pack) the command works, (and proves that $PATH contains the path to 'git-upload-pack' as per the RTFM solution)  but this is really annoying, plus 'git push' doesn't work, because I don't think there is a --unpack= option.    Incidentally, all the git commands work fine from my local box, it is the same version of the software (1.5.4.2), installed on the same NFS mount at /usr/local/bin.    Can anybody help? I'm not sure how to prove these basic theorems in propositional calculus. Instead of using the standard axioms, we're supposed to use:   Deduction Theorem (if $\Phi, \alpha \vdash \beta$ then $\Phi \vdash \alpha \to \beta$),  Reductio (if $\Phi, \alpha \vdash \, $, then $\Phi \vdash \lnot \alpha$), Cut Rule (if $\Phi \vdash \alpha$ and $\Psi, \alpha \vdash \beta$ then $\Phi \cup \Psi \vdash \beta$),  Inconsistency Effect (if $\Phi \vdash \, $, then $\Phi \vdash \beta$ for every formula $\beta$), and  the Principle of Indirect Proof (if $\Phi, \lnot \alpha \vdash \, $, then $\Phi \vdash \alpha$),    as all the axioms can be deduced using these theorems.  I don't really know how to start the proofs without using the axioms:  i) prove that $\lnot(\alpha \to \beta) ⊢ \alpha$  ii) prove that $\lnot\alpha \vdash \alpha \to \beta$  Any suggestions on how to start these proofs or any insight at all would be greatly appreciated!  Thanks! Use XeLaTeX in Texmaker instead of pdfLaTeX How to send emails and avoid them being classified as spam? I am using ArcGIS Desktop 10.1.   I am trying to find the location of the highest value pixel in my Direct Solar Radiation Raster. I can see the extent of the data in my raster but don't know where the highest value pertains to.   Is there a way to simply select pixel with highest value or create a point at highest value? How can I check which songs or videos that I purchased from the iTunes Store have DRM restrictions?  All of the mobile OSes are very impressive to me at the moment, and I'm thinking about trying a non-iOS device again. I want to know now the impact it has on my Apple-sourced music collection though.  Is there a date cut-off for purchases when items went DRM free? "SELECT *" why is it an antipattern On multiple questions here and on stack overflow i saw people saying in the comments and answers that select * from table is almost always an antipattern without any explaination why. Althrough I can sort of deduce why it is an antipattern. I may be looking over a detail that someone else with better understanding of the issue noticed.  So here is my question, why people say that select * is an antipattern. Double integral with transformation; possible error in limits I'm asked to show that the following integral is true with the transformation $u = x+y$ and $y=uv$:  $$\int_0^1 \int_0^{1-x} e^{y/(x+y)} dx dy = \frac{e-1}2 $$  I found the determinant of the jacobian of the transformation is $-u$, and the exponent is just $v$ so the integral becomes $$\iint_R |-u|e^v du dv = \frac {u^2}2 e^v|_R$$ $$=\frac{(x+y)^2}2e^{y/(x+y)}|_{x=0}^{1-x}\;|_{y=0}^1$$ And plugging it all in doesn't work (AFAICT). For one, the x's don't all cancel.  I've looked at it 100 times. It's definitely written dxdy not dydx even though there is definitely an x in the integral. Maybe this is a typo and why my calculation isn't working out? I tried reversing the order to dydx and it didn't work. I tried changing the limit of integration to $1-y$ and it didn't work out.  I'm not even sure how to figure out the domain of integration in the uv-plane. Flipping things around yields y=uv and x=u-uv. But if my domain is bounded by x=0 and y=0 and y=1 (ignoring the last limit for now), then I have uv=o=u and uv=1. !?!  Am I just making an algebra mistake plugging everything in? Is there a way to handle a variable in it's own integral that I'm unaware of? Find all solutions to the functional equation $f(x) +f(x+y)=y+2 $ New review navigation does not tell review-banned users what happened or why When I am review-banned, the direct effect is that when I click the review icon in the top-bar, I get this:        This doesn’t tell me anything about what's going on, just that all review queues have miraculously become unavailable to me. It doesn't show that it's because I've been banned, or why I've been banned, whether it's for failing audits or whether there is a custom message supplied by a moderator. Only when I new-tab-click that button, it takes me to /review, or when I manually navigate there, I get :        This is confusing for review-banned users who use the dropdown in their standard workflow (). I only performed the above test to reproduce the experience of a confused review-banned user on a site I moderate.  Please replace the dropdown message with something more informative in case of a review ban. We often get questions on bicycles.stackexchange about identifying a bicycles manufacturer, model, make, and year.  Often these questions are downvoted or closed -- usually with a comment attached to them that it's not necessary to know the exact model/make/year of a bicycle if you want to fix, repair, or ride your bike. Why should owners not care about the model/make/year of their bicycle? Especially when it comes to less expensive bikes (aka BSOs) and BMX bicycles? This is intended as a canonical question that we can point closed questions to. Also see      (generally not helpful for identifying a brand/model) Nicomachus theorem proof - what did I do wrong? The exercise asked me to proof $1^3=1$ $2^3=3+5$ $3^3=7+9+11$ $...$ I formulate the equation as (1)$$a^3 = \sum_{i=0}^{a-1} (a-1)a+1+2i$$ Proof base case: $$1^3=\sum_{i=0}^{1-1} (1-1)(1)+1+2i=1$$ Proof (a+1) case: (2) $$(a+1)^3=a^3+3a^2+3a+1$$ (3) $$(a+1)^3=\sum_{i=0}^{(a+1)-1}((a+1)-1)(a+1)+1+2i=\sum_{i=0}^{a}(a)(a+1)+1+2i$$ factor out last summation term, so number of iterations match (1): $$\sum_{i=0}^{a-1}[(a)(a+1)+1+2i]+(a)(a+1)+1+2a=\sum_{i=0}^{a-1}[(a)(a+1)+1+2i]+a^2+3a+1$$ rearrange the summation term, so part of equation match (1): $$\sum_{i=0}^{a-1}[(a)(a-1)+1+2i]+\sum_{i=0}^{a-1}(2a)+a^2+3a+1$$ substitute summation with (1): (4) $$a^3+\sum_{i=0}^{a-1}(2a)+a^2+3a+1=a^3+(2a)(a-1)+a^2+3a+1=a^3+3a^2+a+1$$ From (2) I got $a^3+3a^2+3a+1$ but from (3) &amp; (4) I got $a^3+3a^2+a+1$ My result with induction is off by 2a. Can someone please help me to understand where I did wrong? The set of integers $n$ expressible as $n=x^2+xy+y^2$ Let $S$ be the set of integers $n$, such there exist integers $x,y$ with $$n=x^2+xy+y^2$$   Is the implication $$a,b\in S\implies ab\in S$$ true? If yes, how can I prove it?  I worked out $$n\in S\iff 4n\in S$$ and $$n\in S\iff 3n\in S$$ I tried two approaches. The first is to express $$(a^2+ab+b^2)(c^2+cd+d^2)$$ in the form $$f^2+fg+g^2$$ with polynomials $f,g$ with integer coefficients. I however could not find suitable $f$ and $g$. The second approach is based on $$x^2+xy+y^2=\frac{(2x+y)^2+3y^2}{4}$$ If we have $n=x^2+xy+y^2$ , we have $u^2+3v^2=4n$ for some integers $u,v$ with equal parity. The main problem of this approach is to consider the equal parity. Any ideas ?