JavaScript: using the var keyword inside vs. outside loops
JavaScript variables declare outside or inside loop?
What is the best way to repeatedly execute a function every x seconds? I want to repeatedly execute a function in Python every 60 seconds forever (just like an  in Objective C). This code will run as a daemon and is effectively like calling the python script every minute using a cron, but without requiring that to be set up by the user.  In , the solution appears to effectively just  for x seconds. I don't need such advanced functionality so perhaps something like this would work  while True:     # Code executed here     time.sleep(60)   Are there any foreseeable problems with this code? Why am I getting "No such file or directory" when I try to execute a binary? A continuous, injective function $f: \mathbb{R} \to \mathbb{R}$ is either strictly increasing or strictly decreasing. I would like to prove the statement in the title.  Proof: We prove that if $f$ is not strictly decreasing, then it must be strictly increasing. So suppose $x &lt; y$.  And that's pretty much how far I got.  Help will be appreciated. What is an English adjective that means "able to learn new things quickly"? Let $M$ be an A-module and $f \in \text{End}(M)$ an idempotent endomorphism. Show that $M = \ker(f) \oplus \ker (f-\text{id}_M)$. I don't know how to approach this exercise, using only properties of modules and direct sums, without projections. Can you help me? Thanks in advance. Subspaces of separable normed spaces Let $X$ be a separable normed space. Is it true that every subspace is separable? If it was Hilbert space I would take the dense set and then their projections.  It sounds trivial but I cannot prove or disprove it...  Thank you. I have a question regarding the two QGIS Versions 2 and 3. When I load exactly the same raster file into QGIS 2 and QGIS 3 I get different min/max values, how is this possible? I have used the same coordination system. 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. Pay real money to set bounties (another method, not replacing rep method) It may seem like a stupid thing, but could we please be able to pay real money to set a bounty.  For example, if I had only 1 rep, I want to be able have a bounty.   Here late the suggested prices in USD. Convert money    $0.49 for each 50 reputation $0.99 for each week $1.99 for a month $9.99 for a year   Every month, the bounty fee would come in. This would mean you would have to enable your account with a bounty fee button on your profile. Mutineers force captain to record instructions to spaceship's computer but he leaves out "please" The crew mutinies on a spaceship whose captain controls it with verbal orders. They test whether they can control the ship with recordings of the captain's voice with an order to increase orbital speed (currently orbiting a planet). It works, so they force the captain to record all the possible orders they may need, and execute him. Only then do they realize that the ship obeys only orders couched in polite language, and only the test recording was like this, but the other recordings are not. They will die once the ship's faster orbit somehow causes it to run out of fuel, or something like that. I seem to remember the ship's &quot;computer&quot; following the captain around on robotic legs. I read the story circa 1980, but it might have been published much earlier. I've been studying the postulates of QM and seeing how to derive important ideas from them. One thing that I haven't been able to derive from them, however, is the identity of the momentum operator.  For simplicity, I'm only thinking about no relativistic effects, no spin, no time-dependent potentials, and one spatial dimension. Also I'm assuming the position operator is simply multiplication by $x$, as in, I'm in position space. So the Hamiltonian operator is  $ H = -\frac{\hbar^2}{2m}\nabla^2+V$.  I know that the momentum operator is $p = -i\hbar \frac{\partial}{\partial x}$.  But how do I get there from the postulates? I know that it makes sense, as it results in the Ehrenfest Theorem, the De Broglie wavelength hypothesis, the Heisenberg Uncertainty Principle (for $x$ and $p$), the momentum operator being the generator of the translation operator, and possibly many other desirable theorems, and correlations with classical momentum.  But none of these are postulates (at least, not in the various formalisms I encountered), so you can't derive $p = -i\hbar \frac{\partial}{\partial x}$ from them. Rather, they are consequences of it. You need to know the operator beforehand to see that they are correct. Yes, this is just semantics, but that is the core issue for me:  Regardless of how much sense it makes, is the identity $p = -i\hbar \frac{\partial}{\partial x}$ (under the assumptions I made) a Postulate, meaning that you can't derive it from other postulates, or can it in fact be obtained from them? And in the latter case, could you show me how?  Note: I know that there are many different and equivalent sets of postulates for QM. But in none that I saw did they name it as a postulate nor properly derived it. What is the difference between logistic regression and Fractional response regression? As far as I know, the difference between logistic model and fractional response model (frm) is that the dependent variable (Y) in which frm is [0,1], but logistic is {0, 1}. Further, frm uses the quasi-likelihood estimator to determine its parameters. Normally, we can use glm to obtain the logistic models by glm(y ~ x1+x2, data = dat, family = binomial(logit)). For frm, we change family = binomial(logit) to family = quasibinomial(logit). I noticed we can also use family = binomial(logit) to obtain frm's parameter since it gives the same estimated values. See the following example library(foreign) mydata &lt;- read.dta(&quot;k401.dta&quot;)   glm.bin &lt;- glm(prate ~ mrate + age + sole + totemp,                 data = mydata, family = binomial('logit')) summary(glm.bin)  return,  Call: glm(formula = prate ~ mrate + age + sole + totemp,      family = binomial(&quot;logit&quot;),      data = mydata)  Deviance Residuals:      Min       1Q   Median       3Q      Max   -3.1214  -0.1979   0.2059   0.4486   0.9146    Coefficients:               Estimate Std. Error z value Pr(&gt;|z|)     (Intercept)  1.074e+00  8.869e-02  12.110  &lt; 2e-16 *** mrate        5.734e-01  9.011e-02   6.364 1.97e-10 *** age          3.089e-02  5.832e-03   5.297 1.17e-07 *** sole         3.636e-01  9.491e-02   3.831 0.000128 *** totemp      -5.780e-06  2.207e-06  -2.619 0.008814 **  --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1  (Dispersion parameter for binomial family taken to be 1)      Null deviance: 1166.6  on 4733  degrees of freedom Residual deviance: 1023.7  on 4729  degrees of freedom AIC: 1997.6  Number of Fisher Scoring iterations: 6  And for family = quasibinomial('logit'), glm.quasi &lt;- glm(prate ~ mrate + age + sole + totemp,   data = mydata ,family = quasibinomial('logit')) summary(glm.quasi)  return,  Call: glm(formula = prate ~ mrate + age + sole + totemp,      family = quasibinomial(&quot;logit&quot;),      data = mydata)  Deviance Residuals:      Min       1Q   Median       3Q      Max   -3.1214  -0.1979   0.2059   0.4486   0.9146    Coefficients:               Estimate Std. Error t value Pr(&gt;|t|)     (Intercept)  1.074e+00  4.788e-02  22.435  &lt; 2e-16 *** mrate        5.734e-01  4.864e-02  11.789  &lt; 2e-16 *** age          3.089e-02  3.148e-03   9.814  &lt; 2e-16 *** sole         3.636e-01  5.123e-02   7.097 1.46e-12 *** totemp      -5.780e-06  1.191e-06  -4.852 1.26e-06 *** --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1  (Dispersion parameter for quasibinomial family taken to be 0.2913876)      Null deviance: 1166.6  on 4733  degrees of freedom Residual deviance: 1023.7  on 4729  degrees of freedom AIC: NA  Number of Fisher Scoring iterations: 6  The estimated Beta from both `family` are the same, but the difference is the SE values.  However, to obtain the correct SE, we have to use `library(sandwich)` as in this [post][1].  Now, my questions:  1. What is the difference between these two codes? 2. Is frm about to obtain robust SE?  If my understanding is not correct, please give some suggestions.      [1]: https://stackoverflow.com/questions/37584715/fractional-response-regression-in-r How to show via inductive proof (and without the use of the binomial theorem) that $ {n\choose k} \in \mathbb{N} $? How do I show via inductive proof (and without the use of the binomial theorem) that $$ {n\choose k} \in {\mathbb{N}} $$ $$\text{ for  all }\: n,k \in \mathbb{N}_0\: \text{ with }\: n≥k .$$ For my induction proof, I would show that$$  {n\choose k-1}+{n\choose k} = {n+1 \choose k}   $$ is true. However, how do I start the induction correctly with the base cases and the hypothesis? As far as I know, I cannot simply assume $$ {n\choose k-1}+{n\choose k}, $$  so how do I come to this derivation? How to colorize an image as in the example? Black screen after suspend-after moving to the nvidia official drivers (not priority) So, when I used the priority drivers, the suspend worked normal. But the official drivers works better, so I installed the official driver. Then suspend won't work.  Should I change any text/documants to make it work? Any solution will be aprreciated, thanks you all! Using conditional statements in ArcGIS Field Calculator? I have two fields, "P_Area" and "PC_Area", whose sizes I'd like to compare in a third field, "Areas_Equal". The "Areas_Equal" field should contain a "Yes" if the other two are equal and a "No" if they aren't.  How can I do this with Field Calculator and its Python Parser? I am looking for a way to delete all files older than 7 days in a batch file.  I've searched around the web, and found some examples with hundreds of lines of code, and others that required installing extra command line utilities to accomplish the task.  Similar things can be  in just a couple lines of code. It seems that something at least remotely easy could be done for batch files in Windows. I'm looking for a solution that works in a standard Windows command prompt, without any extra utilities. Please no PowerShell or Cygwin either. How do I check if an array includes a value in JavaScript? What is the most concise and efficient way to find out if a JavaScript array contains a value? This is the only way I know to do it: function contains(a, obj) {     for (var i = 0; i &lt; a.length; i++) {         if (a[i] === obj) {             return true;         }     }     return false; }  Is there a better and more concise way to accomplish this? Programmatically combining images in PHP I'm a big fan of Yahoo's  for speeding up websites. One of the recommendations is to combine images where possible to cut down on size and the number of requests. However, I've noticed that while it can be easy to use CSS sprites for layouts, other image uses aren't as easily combined. The primary example I'm thinking of is a blog or article list, where each blog or article also has an image associated with it. Those images can greatly affect load time and page size, especially if they aren't optimized. What I'm looking for, in concept or in practice, is a way to dynamically combine those images while running them through a loss-less compression using PHP.   A few added thoughts or concerns:   Combining the images and generating a dynamic CSS stylesheet to position the backgrounds of the images might be one way to go about it, but I also worry about accessibility and semantics. As far as I understand, CSS images should be used for layout elements and the img tag (with the alt attribute) should be used for images that are meant to convey information. I could set the image as a background to a div element and substitute a title attribute for the alt attribute, but I'm unsure about the accessibility and semantic implications of doing so. Might the GD library be a good candidate for something like this? Can you recommend other options? Minecraft webpage links in chat?