Today is 3/26/2016. I want to Print out how many days are until  4/05/2016 ex.  The answer is 10 days. I want to do this with Javascript Code.  With standard javascript or with the use of a Library or Framework. Just to calculate the Difference between two dates. Easy, no too complicated.  InsertDateHere     -------         3/26/2016     InsertDateHere  ------  4/05/2016     ResultHere     -------------- AnswerHere ("10" ex.)  if anyone can help, please Do. Thanks a lot People!
How do I get the number of days between two dates in JavaScript? For example, given two dates in input boxes:  &lt;input id="first" value="1/1/2000"/&gt; &lt;input id="second" value="1/1/2001"/&gt;  &lt;script&gt;   alert(datediff("day", first, second)); // what goes here? &lt;/script&gt;
How to set the Identify Feature tool in QGIS 2.4? The Identify Results window does not appear when using the identify feature tool  in QGIS 2.4. I guess there's a check box somewhere I need to check/uncheck, but the settings of the tool changed compared to the previous version (see attached printscreen). Set "this" variable easily? I have a pretty good understanding of Javascript, except that I can't figure out a nice way to set the "this" variable.  Consider:  var myFunction = function(){     alert(this.foo_variable); }  var someObj = document.body; //using body as example object someObj.foo_variable = "hi"; //set foo_variable so it alerts  var old_fn = someObj.fn;   //store old value someObj.fn = myFunction;   //bind to someObj so "this" keyword works someObj.fn();               someObj.fn = old_fn;       //restore old value   Is there a way to do this without the last 4 lines?  It's rather annoying...  I've tried   binding an anonymous function, which I thought was beautiful and clever, but to no avail:  var myFunction = function(){     alert(this.foo_variable); }  var someObj = document.body;        //using body as example object someObj.foo_variable = "hi";        //set foo_variable so it alerts someObj.(function(){ fn(); })();    //fail.   Obviously, passing the variable into myFunction is an option... but that's not the point of this question.  Thanks. Proof Verification : Prove -(-a)=a using only ordered field axioms I need to prove for all real numbers $a$, $-(-a) = a$ using only the following axioms:     Thanks to many members of the Mathematics Stackexchange Community, I have the following proof worked out:  Theorem: The Additive Inverse Identity is Unique  $ ( \forall a,b,c \in \mathbb{R} )(a+b=0) \land (a+c=0) \\ ( \forall a,b,c \in \mathbb{R} )(a+b=a+c) \\ ( \forall a,b,c \in \mathbb{R} )(b=c) \\ \text{QED} \\ $  Theorem $\textbf{a} \cdot \textbf{0 = 0}$  $ \begin{align} a \cdot 0 &amp;= a \cdot 0 \\ a \cdot (0 + 0) &amp;= a \cdot 0 \\ a \cdot 0 + a \cdot 0 &amp;= a \cdot 0 \\ a \cdot 0 + a \cdot 0 + (-a) \cdot 0 &amp;= a \cdot 0 + (-a) \cdot 0 \\ a \cdot 0 &amp;= 0 \\ &amp;\text{QED} \\ \end{align} $  Theorem: $-\textbf{1} \cdot \textbf{(a) = (}-\textbf{a)}$  $ \begin{align} a \cdot 0 &amp;= 0 \\ a \cdot \left[ 1 + (-1) \right] &amp;= a + (-a) \\ 1 \cdot a + (-1) \cdot a &amp;= a + (-a) \\ -1 \cdot (a) &amp;= (-a) \\ &amp;\text{QED} \\ \end{align} $  Theorem: $-\textbf{(}-\textbf{a) = a}$  $ \begin{align} 0 &amp;= 0 \\ -a \cdot 0 &amp;= 0 \\ -a \cdot \left[ 1 + (-1) \right] &amp;= 0 \\ -a \cdot 1 + -a \cdot (-1) &amp;= 0 \\ -a + \left[ -(-a) \right] &amp;= 0 \\ -(-a) &amp;= a \\ \text{QED} \\ \end{align} $  Does everything look alright? Have I missed anything?  Also--why is it necessary to show that the additive inverse is unique?  Many thanks in advance. Use variable with TOP in select statement in SQL Server without making it dynamic What is the icon next to Spotlight in menu bar, and how to remove it? What is this icon   in OS X menu bar and how do you remove it? How can I copy a file from another directory to the current one? I have this problem as part of a school assignment:  NOTE: In case it's hard to read in the image above, here's the directory tree: $ tree . `-- sample_dir1     `-- sample_dir         |-- admin         |-- cambridge         |   |-- cafeteria         |   |-- library         |   `-- security         |       |-- annex         |       |-- building         |       `-- parking         |-- faculty         |-- history.exe         |-- markham         |   |-- annex         |   |-- building1         |   `-- parking         |-- oxford         |   |-- outline.doc         |   |-- programming         |   |   `-- report.pdf         |   `-- security         `-- stenton             |-- gen_ed             `-- lib_arts                 |-- english.txt                 `-- match.doc  15 directories, 11 files  I tried doing the command: $ cp ../cambridge/security/parking ./parking2  ...but it isn't working. The question in the image above states that the current directory is stenton, and that we need to make a copy of the file named parking (from the security directory), and to name the new file parking2, and place it in the current directory, stenton, using relative pathnames. What am I doing wrong? My cp command seems to be correct. Compute $\Gamma(2.7)$ All I know of the Gamma function is $$\Gamma(\alpha) = \int\limits_{0}^{\infty}x^{\alpha - 1}e^{-x}\text{ d}x$$ and the recursive formula $$\Gamma(\alpha) = (\alpha-1)\Gamma(\alpha - 1)\text{.}$$ A friend asked me to try to find $\Gamma(2.7)$. I assume this involves complex analysis, which I have absolutely no background on (except for the basic Euler formula). Using Wolfram, I found that  $$\Gamma(2.7) = e^{0.434821}$$ which suggests to me perhaps writing out $e^{-x}$ as a Taylor series: $$\Gamma(\alpha) = \int\limits_{0}^{\infty}x^{\alpha - 1}\sum\limits_{i=1}^{\infty}\dfrac{(-x)^{i}}{i!}\text{ d}x$$ but alas, this doesn't look helpful.  How does one derive that $\Gamma(2.7) = e^{0.434821}$? I have two tables, movies and categories, and I get an ordered list by categoryID first and then by Name.  The movie table has three columns ID, Name and CategoryID. The category table has two columns ID and Name.  I tried something like the following, but it didn't work.  var movies = _db.Movies.OrderBy( m =&gt; { m.CategoryID, m.Name }) "If I would have lost you" vs "If I had lost you" I watched a (Hollywood?) film the other day where a character visiting his just-hospitalised wife (who it seems will actually survive) says "If I would have lost you [I don't know what I'd do]".  I'd always thought this was an error made by non-native speakers (I myself would only expect "If I had lost you"), but there was nothing to suggest that in the movie. Is it a regionalism?  EDIT: Actually, that wasn't true about only expecting "If I had lost you". I'd have been perfectly happy with "If I'd have lost you", so long as I didn't think too hard about what was being elided. I'd usually elide "have" there to just a schwa (neutral vowel) anyway, and think no more about it. new finding by Minev et al. seems to suggest that transitions between atomic states are not instantaneous, but continuous processes wherein a superposition smoothly adjusts from favoring one state to another (if I understand it correctly). The authors also claim to be able to catch a system "mid-jump" and reverse it. Popular articles are  and .  I am curious if this finding rules out any interpretations of QM. It seems to generally go against the Copenhagen attitude, which describes measurements as collapsing physical systems into a definite classical state. The popular articles indeed claim that the founders of QM would have been surprised by the new finding.  The link with the asterisk mentions that something called "quantum trajectories theory" predicts what was observed. Is this an interpretation, or a theory? And are they implying that other interpretations/theories don't work? I try to delete Action.005 permanently.    But I don't know how. If I click on the X    then it is still in the list.    I already researched without success, I even managed to loose all my animations by attempting to apply a fix, so I want to be cautious now... How can I do this? Extracting matrix rows when one of its elements is part of a list (without a loop) Rational + irrational = always irrational? I had a little back and forth with my logic professor earlier today about proving a number is irrational. I proposed that 1 + an irrational number is always irrational, thus if I could prove that 1 + irrational number is irrational, then it stood to reason that was also proving that the number in question was irrational.  Eg. $\sqrt2 + 1$ can be expressed as a continuous fraction, and through looking at the fraction, it can be assumed $\sqrt2 + 1$ is irrational. I suggested that because of this, $\sqrt2$ is also irrational.  My professor said this is not always true, but I can't think of an example that suggests this.  If $x+1$ is irrational, is $x$ always irrational?   Actually, a better question is: if $x$ is irrational, is $x+n$ irrational, provided $n$ is a rational number? How do I check the series $\sum_{n=2}^{\infty} \frac{(-1)^n }{n+(-1)^n}$ for absolute convergence/conditional convergence ?  How can I solve this problem? Syntax highlighting in app differs from normal web view Is it true that one should not use NSLog() on production code? I was told this a few times in this very site, but I wanted to make sure this is really the case.  I was expecting to be able to sprinkle NSLog function calls throughout my code, and that Xcode/gcc would automatically strip those calls out when building my Release/Distribution builds.  Should I avoid using this? If so, what alternatives are most common between experienced Objective-C programmers? He is loved.   This is something that I've always kind of wondered.  In a sentence like this, is loved a verb or an adjective? Can it be considered either? Are users' reputation scores on the home page supposed to stand out that much now? It seems a couple minutes ago, a change was applied to the styling of the homepage, with users' rep scores now being much darker (and standing out more):        Compare with the former light grey colouring (image courtesy of ):        Is this intentional? If so, why? It highlights something that's not really relevant, in my opinion. Was Red Shirt Security a rotating detail, like K.P, or was it a dedicated branch of Star Fleet like the M.P's are to the US Army? As I channel surfed the other day, I accidentally found an episode of Star Trek TOS, and I settled in to watch it. As always, it was a bad day to be a landing party Red Shirt Security person.    Their apparent lack of skill (training?) made me wonder: Was Red Shirt Security a rotating detail, like K.P. (Kitchen Patrol), that crew members with regular assigned duties were ordered to do when it was their turn, or was it a dedicated branch of Star Fleet like the M.P's (Military Police) are to the US Army? Environment variable substitution in sed If I run these commands from a script:  #my.sh PWD=bla sed 's/xxx/'$PWD'/' ... $ ./my.sh xxx bla   it is fine.  But, if I run:  #my.sh sed 's/xxx/'$PWD'/' ... $ ./my.sh $ sed: -e expression #1, char 8: Unknown option to `s'    I read in tutorials that to substitute environment variables from shell you need to stop, and 'out quote' the $varname part so that it is not substituted directly, which is what I did, and which works only if the variable is defined immediately before.  How can I get sed to recognize a $var as an environment variable as it is defined in the shell?