This script counts the days between two dates and shows the result on a span element:  &lt;span id="result"&gt;&lt;/span&gt;   But instead I want to show the result as value of an input element:  &lt;input name="name" type="text" id="name" value="i want count days here " /&gt;   How can I do this?  This is the complete code:  &lt;!DOCTYPE html&gt; &lt;html&gt;     &lt;head&gt;         &lt;meta charset="utf-8" /&gt;         &lt;title&gt;jQuery UI Datepicker - Default functionality&lt;/title&gt;         &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" /&gt;         &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt;         &lt;script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"&gt;&lt;/script&gt;         &lt;link rel="stylesheet" href="/resources/demos/style.css" /&gt;         &lt;style&gt;             .ui-datepicker {font-size:11px;}         &lt;/style&gt;         &lt;script&gt;             $(function() {                 $( "#from" ).datepicker({                     onSelect: calculate                 });             });             $(function() {                 $( "#to" ).datepicker({                     onSelect: calculate                 });             });         &lt;/script&gt;     &lt;/head&gt;     &lt;body&gt;         &lt;form class="formwhite"&gt;             &lt;table&gt;                 &lt;tr&gt;&lt;td&gt;From:&lt;/td&gt;&lt;td&gt;&lt;input type="text" id="from" onKeyUp="calculate();" /&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;                 &lt;tr&gt;&lt;td&gt;To:&lt;/td&gt;&lt;td&gt;&lt;input type="text" id="to" onKeyUp="calculate();" /&gt;&lt;/td&gt;&lt;/tr&gt;             &lt;/table&gt;         &lt;/form&gt;         &lt;span id="result"&gt;&lt;/span&gt;         &lt;script&gt;             var calculate = function() {                 var from = document.getElementById("from").value;                 var fromdate = from.slice(3, 5);                 fromdate = parseInt(fromdate);                 var frommonth = from.slice(0, 2);                  frommonth = parseInt(frommonth);                 var fromyear = from.slice(6, 10);                  fromyear = parseInt(fromyear);                 var to = document.getElementById("to").value;                 var todate = to.slice(3, 5);                  todate = parseInt(todate);                 var tomonth = to.slice(0, 2);                  tomonth = parseInt(tomonth);                 var toyear = to.slice(6, 10);                  toyear = parseInt(toyear);                 var oneDay = 24*60*60*1000;                 var firstDate = new Date(fromyear,frommonth,fromdate);                 var secondDate = new Date(toyear,tomonth,todate);                  var diffDays = Math.round(Math.abs((firstDate.getTime() - secondDate.getTime())/(oneDay)));                 if (diffDays)                     document.getElementById("result").innerHTML=diffDays;             }         &lt;/script&gt;     &lt;/body&gt; &lt;/html&gt;
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;
Proving an inclusion related to algebraic sets and interpreting it We learned in Thor: Ragnarok that Mjolnir is only a focus for Thor's power, not the source. If so, when a worthy​ being lifts Mjolnir and gains "the power of Thor", where are they getting the power from? Why don't we consider jerk in physics classes? When I got more into physics, I started asking myself if just like acceleration represents the growth of speed, something else could also represent the growth of acceleration itself. And it came that is exists and is called jerk. Before I thought about this, I thought that acceleration was the highest derivative that made sense on physics.  My question is, why can we perform accurate calculations without account for jerk? I never needed it in a single physics class! I've also read that it is seldom used.  Also, while position, speed and acceleration seem familiar to me due to everyday experience, why doesn't jerk seem familiar to me? I never tell someone when driving a car "you're jerking too much", whereas I could say "you are accelerating too much".  Is it that jerk has little influence because it is almost constant? Even if it is not, what about higher order derivatives? Why don't derivatives higher than acceleration have much influence on calculations? We perform a lot of reasoning in everyday life without resorting to it! How can I create a cross product like the one in the picture.    \documentclass{article} \usepackage{tikz} \begin{document}  \begin{tikzpicture}[line width=.7pt] \draw [-&gt;] (-.2,0)node[below]{$o$}--(4.5,0)node[below]{$x$}; \draw [-&gt;] (0,-.2)--(0,2)node[left]{$y$};  \end{tikzpicture}  \end{document} How do I check if a package is installed on my server? I recently installed Ubuntu Server edition 13.10 (Saucy Salamander). But I have run into a bit of problem. At the end of the installation, it asks about several extra packages whether you want them or not, like OpenSSH server and virtual machine host. Here's what I'm looking at:  Now, my problem is that I can't remember if I have checked the &quot;virtual machine host&quot; checkbox. How do I check if my server has the corresponding packages? What packages come with the virtual machine host? Merge duplicate records into 1 field Yesterday, I have received two : Revival, and Self-Learner. However I was only notified of the Revival badge, because apparently the Self-Learner badge is not considered "".  What badges have their notification suppressed if the user has a 200-rep account somewhere on the Stack Exchange network, i.e. they won't trigger a new item in our achievements dialog? In Stein's Fourier Analysis i'm having trouble Justifying the following calculations for the Fourier Coefficients in $(1.)$  $(1.)$  Let $f(\theta) = \theta$ for $ -\pi \leq \theta \leq \pi$ in the case when $n \neq 0$:  $$f(n)=\frac{1}{2 \pi}\int_{-\pi}^{\pi}\theta e^{-in \theta} d \theta = \frac{1}{2 \pi}[-\frac{\theta}{in}e^{-in \theta}]_{-\pi}^{\pi} + \frac{1}{2 \pi in} \int_{-\pi}^{\pi}e^{-in\theta}d \theta = \frac{(-1)^{n+1}}{in} $$  Then the Fourier Series of $f$ is given by:  $$ f(n) = \sum_{n \neq 0}  \frac{(-1)^{n+1}}{in}$$ How can I convert a complex number into an exponent form Android - Call log/ history : Retrieve a dialed number when there was no network coverage I dialed a number when I had no network support but it does not appear in the call history of my android phone.  Is there any way to get it ? (system logs or whatever)  THanks a lot in advance, Jack onChange event doesn't trigger Elevated Priviliges for Startup Applications in Windows? Is there any way to configure application that requires administrator privilages (elevation) so it's automatically started with elevated privileges and does not request elevation on every startup?  For example, I have Riva Tuner that always starts with Windows. And it always asks for elevation via UAC. I need Riva Tuner to silently start with elevated privileges and without any message from user account control (without disabling it). Can US citizens go to Cuba freely and vice versa after the recent diplomatic relation restoration? A recent full diplomatic relation restoration between the US and Cuba took place, does that mean that US citizens can go to Cuba freely and vice versa? Stopping a Thread in Java? I'm in the process of writing a piece of code that connects to a server spawns a bunch of threads using that connection and does a bunch of "stuff".  There are certain instances where the connection fails and I need to stop everything and start from scratch with a new object.  I wanted to clean up after the object but calling thread.stop on the threads, but this method is seemingly deprecated.  What is the recommended alternative to doing this? Should I write my own cleanup and exit method for each of the threads? Set the thread to null? or something else? Let me say first that I am fairly new here (about 3 weeks) and absolutely love Stack Overflow. At first I let some of the negative attitudes get to me a little, left a few snarky comments, but that phase has passed. I see the tremendous value for this site in the long run and sincerely do want to help make it a better place.  I find myself going for  the downvote very frequently -- currently about 35% of my votes are downvotes. I even make an extra effort to upvote good content to offset this a bit, so the number should probably be more like 60%. I always try to leave constructive comments and try to help out the confused ones who are really trying.  I truly can't tell if it is just me, or if these folks deserve it. I don't know if you guys noticed, but there are a lot of really bad questions being posted, and a lot of people trying to pass off things like "use jQuery", "use Firebug", and "use Google" as good answers (and getting upvotes!). I even saw someone copy/paste my "What does Firebug say?" comment as an answer and get 3 votes within moments. Sometimes This answer is unclear or not useful just doesn't do it justice.  I feel like some of the people just drive me nuts, but then again I feel this way IRL :) Am I being too harsh, or is it really that bad on SO? Has there recently been a surge of new users, and the quality of content is degrading, or was it like this in the "good old days"? Have I perhaps misunderstood the expected behavior on Stack Overflow -- should I just ignore these crappy questions and answers rather than downvote them? What is Electromotive force (EMF)? How is it related to potential difference? What is  (EMF)? How is it related to the potential difference? Is it created by the potential difference in any conductor? Is it a process? Why is it called force?  Does writing EMF instead of voltage make any difference in AC circuits? (Studying alternating current I found some books using EMF while others used voltage.) Print on terminal and into file simultaneously? Title of novel with girl who can read minds by observing body language, later communicates with a hive mind on an alien planet's surface As a kid I was greatly influenced by a book where a girl (I believe her name was Marlena) lived in a ship orbiting an alien planet.  The ship was intended to colonize the planet but the humans had encountered difficulty.  People on the surface early on had gone incurably mad.  The planet was covered with single cell organism, but no other life.  Other than the "bacteria" it was sterile.    The girl, along with most of the colonists, was still living on the orbiting ship for the foreseeable future.  The girl had an uncanny knack of reading people's minds by noting minute changes in behavior and body language, kind of like Sherlock Holmes' famous observations.  Eventually she got a chance to go to the surface, and found the planet trying to communicate with her.  In one memorable scene the swirls in the water of a stream formed a face and started trying to call her name, "Eeeena, Aaleeena, Aarleena, Marlena!"  It turns out that the single celled organisms on the planet comprised a hive mind which had tried to communicate telepathically with previous humans by altering their brains slightly, causing the madness.  The girls's brain was different, however, constantly modifying and changing itself so that it was not damaged by the hive mind's attempts to communicate with it. Will i be granted ESTA after getting rejected thrice on different nationality? I had applied for B1/B2 on my previous nationality but it got rejected Thrice.  I had planned on visiting my mother as she lives there. my last refusal was 3 years back. Now i have gained an European nationality and I am thinking of applying for ESTA so I can visit my mother. I have doubts if it will be accepted because I'll have to disclose about my previous refusals.  What should I do? because if I don't disclose my previous refusals I fear I might be rejected permanently. Deep cloning objects I want to do something like:  MyObject myObj = GetMyObj(); // Create and fill a new object MyObject newObj = myObj.Clone();   And then make changes to the new object that are not reflected in the original object.  I don't often need this functionality, so when it's been necessary, I've resorted to creating a new object and then copying each property individually, but it always leaves me with the feeling that there is a better or more elegant way of handling the situation.  How can I clone or deep copy an object so that the cloned object can be modified without any changes being reflected in the original object?