How to find the difference between the return date and departure date in ReactJs jsx map loop.   JSON response:   {     departureDate: '2020-07-28',      returnDate: '2020-09-16',  }   Component   const DaysDiff = () =&gt; {             const days = 1000 * 60 * 60 * 24;        return(          Object.keys(datajson).map((key,index): ReactElement =&gt; (                  &lt;h2&gt;{((datajson[key].returnDate) - (datajson[key].departureDate)) / days) } &lt;/h2&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;
Why do I get different values for $x from the snippets below?  #!/bin/bash  x=1 echo fred &gt; junk ; while read var ; do x=55 ; done &lt; junk echo x=$x  #    x=55 .. I'd expect this result  x=1 cat junk | while read var ; do x=55 ; done echo x=$x  #    x=1 .. but why?  x=1 echo fred | while read var ; do x=55 ; done echo x=$x  #    x=1  .. but why? Let be $u,v\in\mathbb{R}^n$, then $\det(I+uv^\intercal)=1+v^\intercal u $ where $I$ denotes the identity matrix of order $n$. How to prove this?   what I did:   let be $A=\{n\in\mathbb{N}: \forall u,v \in \mathbb{R^n}, \det(I+uv^\intercal)\neq1+v^\intercal u  \} $, and suppose $A\neq \varnothing $, then for the well-orderer-principle there exists $n_0\in A$ such $n_0\leq n,\;\forall n\in A$. since $1\notin A,\; n_0\neq 1 \rightarrow n_0-1\in\mathbb{N}\setminus A  $ so: $$\forall u,v\in\mathbb{R^{n_0-1}}: \det(I+uv^\intercal)=1+v^\intercal u $$ Then, let be $u,v\in\mathbb{R}^{n_0}$, so $$\det(I+uv^\intercal)= \displaystyle\sum_{j=1}^{n_0}(-)^{1+j}a_{1j}\det(A_{1j})$$ where $a_{ij}=\begin{cases} u_iv_j+1 &amp; i=j \\ u_iv_j &amp; i\neq j \end{cases}$, and $A_{1j}$ is the  submatrix of $I+uv^\intercal$ that results deleting the i-file and j-column. Then I try to open the term for $j=1$ and try to use the relation for the new matrix of $n_0-1$ order with the determinant because it holds the same form but I have other terms which difficult me the work. Do you know other method?.  Ps. , in page 2 I've found something similar but I don't understand what it means PS. I'm taking a course of numerical analisys Why does water pouring from a glass sometimes travel down the side of the glass? If you have a glass of water, say, three quarters full and you pour it at an angle of say, $45^{\circ}$ with respect to the the table, the water comes out of the glass and goes directly down towards the floor.  However, when the glass is more full, or even three quarters full and the 'angle of pouring' is far less with respect the table, when the water comes out of the glass, rather than going straight down it kind of stays stuck to the glass and travels down the outside of it.  Why does this happen? (I'm sure many of you have observed it yourself by accident and ended up making a mess). Why is $1$ not considered a prime number?  Or, why is the definition of prime numbers given for integers greater than $1$? Put the book back on the table.   I'm having trouble. I think it is a preposition. Irreducible Components of the Prime Spectrum of a Quotient Ring and Primary Decomposition Print box drawing characters with pdfLaTeX I need to print some unicode characters (of box drawing family) in my document. I found this  that is very similar to mine but is valid only for XeLaTeX. There is a valid way to do this with pdfLaTeX or I have to use XeLaTeX instead? Conditional conundrum A friend and I are having a debate about a most perplexing piece of English grammar. Now, I am a native English speaker, and he is Polish - this means that he is rather clued up on the grammatical side of things, whereas I know diddly squat, but know what feels right.   We were discussing Poland's next world cup match tomorrow, when Poland plays against Colombia, and I wrote to him after he me sent a heartwarming video (jokingly, of course), that 'I think threats of stoning if they don't succeed would be more effective.'  He replied that such a sentance should be in the second conditional tense, and thus go like 'I think threats of stoning if they didn't succeed would be more effective.'  So after a lively debate as to whether this is the second, first, or not even a conditional, I have no choice but to turn to the denizens of the interweb, to ask them to apply their grammatical expertise to resolve this vital question.  Thanks in advance, Conor Is $29$ the only prime of the form $p^p+2$? Can we have a moderator only "flag for community team/developer attention" link on posts? There are times when moderators come across things that only Stack Exchange employees can deal with. These include things like deleting sensitive information permanently from posts disassociating users from posts that require direct database access.  (The previous use case is now possible for moderators to do directly the moderator redaction tool)  Currently the workflow is:   See the post (either in normal site usage or via a flag) Go to chat Ping one of the community team (if they are around) Explain the problem   A far better workflow for the moderator would be to simply able to flag the post so it then appeared in an "employee only" queue somewhere. This could either be a page on the main Stack Exchange site or (better still) their inbox.  (OK I admit I hadn't fully thought this last bit out.)  This could either be a moderator "flag to devs" link on the post or a new option on the existing flag dialog (probably the better solution).  Now that moderators can't merge we have a fairly common situation where this would be very useful. A new users posts an answer (or question on sites that don't require registration) then loses their cookies and ends up creating another unregistered account (or two). Eventually the might even create a registered account. It used to be easy to merge the unregistered accounts into the registered ones, but now we either have to badger the OP to use the "merge accounts" form or ping the team somehow.  Having the "flag for team" option would be very useful in this scenario. When a user who approved an edit is removed, an incorrect "-2 reverted" event appears in reputation history I am aware that . But now there is an extraneous "reverted" event to go along with user removal:     Source: .   The edit was not reverted, it's . In any case, I should not lose 2 points twice for the total of -4. And indeed, my reputation only dropped from 131 to 129 despite what the history suggests.   So the line with "-2 reverted" is a bug.     A more extreme example:  got 21 "reverted" events on 2017-06-30, none of which should be there. His rep loss is 42, not 84 as the reputation history says. Just curious whether the process takes a while, and whether it scrapes through history to determine if it was once valid or not. Currently, I have 6 0-vote accepted answers and 20 1+-vote answers (), and that makes it > 5 and > 20% but not for long if voting goes up or down from here. ;-P  Update:  Special thanks to Grace Note for pointing out the  to follow. I upgraded this to a bug because it's been 48 hours during which the criteria supposedly were met. 6 0-votes, 20-23 1+ votes during the whole period. The criteria only last so long, so it may go out of scope soon. If it only checks every 3 days, I'm not sure if that's intentional or a bug. How can I display a short chapter name in the header and a long chapter name in the ToC? I am writing a book and one of my chapters has a very long title. As it can't be displayed correctly on the top of even pages, I provide a "short title name" via the   \chapter[short title]{long title}   command. But then, "short title" appears in the table of contents instead of the original/true/long one.  How can I have the "short title" in the header of even pages, and the "long title" in the ToC and in the "Title header"?  For reference, here is the code I use:  \documentclass[11pt,a4paper]{book} \begin{document} \tableofcontents  \chapter[Short title]{Very vey very very very very very very long title     i can't display in the header} Lorem ipsum dolor sit amet, consectetur adipiscing elit. \end{document} Let $T:V→V$ be a linear transformation satisfying $T^2(v)=-v$ for all $v\in V$. How can we show that $n$ is even? can't create a jobs user profile Does the  tag position in HTML affects performance of the webpage? How do I install Citrix receiver? Has anyone managed to get the Citrix receiver client (icaclient) working in Ubuntu? How to "unpivot" or "reverse pivot" in Excel? I have data that looks like this:  Id | Loc1 | Loc2 | Loc3 | Loc4 ---+------+------+------+----- 1  | NY   | CA   | TX   | IL 2  | WA   | OR   | NH   | RI   And I want to convert it to this:  Id | LocNum | Loc ---+--------+---- 1  |   1    | NY 1  |   2    | CA 1  |   3    | TX 1  |   4    | IL 2  |   1    | WA 2  |   2    | OR 2  |   3    | NH 2  |   4    | RI   What's the easiest way to do this in Excel 2007? How to bind RadioButtons to an enum? I've got an enum like this:  public enum MyLovelyEnum {     FirstSelection,     TheOtherSelection,     YetAnotherOne };   I got a property in my DataContext:  public MyLovelyEnum VeryLovelyEnum { get; set; }   And I got three RadioButtons in my WPF client.  &lt;RadioButton Margin="3"&gt;First Selection&lt;/RadioButton&gt; &lt;RadioButton Margin="3"&gt;The Other Selection&lt;/RadioButton&gt; &lt;RadioButton Margin="3"&gt;Yet Another one&lt;/RadioButton&gt;   Now how do I bind the RadioButtons to the property for a proper two-way binding? Position vs Part