In javascript how can I compare two timestamps to see how many days difference they are?  Current code I have:          var todaysDate = Math.floor(Date.now() / 1000);          for (var i = 0; i &lt; 1; i++) {             var job = this.listOfJobs[i];                     var jobDate = Date.parse(job.timestamp) / 1000;              //now how would I compare these two timestamps to see how many days apart they are e.g. todaysDate and jobDate          }   The 2 timestamps I have for example are:  todays date: 1475336651 And the job created date: 1465337544  I've substracted those and it equals: 9999107  How many days is 9999107?
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;
The following MWE compiles (for me)  \documentclass{article}  \usepackage{pgfplots} \pgfplotsset{compat=newest} \usetikzlibrary{external} \tikzexternalize[prefix=figures/externalized/]   \begin{document} \begin{figure}     \centering     \begin{tikzpicture}          \begin{axis}  %           \addplot3[surf,mesh/rows=129,mesh/cols=129,mesh/ordering=y varies] table[x=X,y=Y,z=psi] {figures/data/LidDrivenCavity/Lid_SPIKE_128x128_Re1000_psi.dat};              \addplot3[contour gnuplot,mesh/rows=129,mesh/cols=129,mesh/ordering=y varies] table[x=X,y=Y,z=psi] {figures/data/LidDrivenCavity/Lid_SPIKE_128x128_Re1000_psi.dat};          \end{axis}      \end{tikzpicture}     \caption{ciao} \end{figure} \end{document}   where the data file is . If I de-comment the first \addplot3 and comment the second one, then I get an error. The final part of the log file (the interesting one, I think) is  ===== 'mode=convert with system call': Invoking 'pdflatex -shell-escape -halt-o n-error -interaction=batchmode -jobname "figures/externalized/prova-figure0" "\ def\tikzexternalrealjob{prova}\input{prova}"' ======== \openout3 = `prova.auxlock'.  runsystem(pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname  "figures/externalized/prova-figure0" "\def\tikzexternalrealjob{prova}\input{pr ova}")...executed.  \openout3 = `prova.auxlock'.   ./prova.tex:22: Package tikz Error: Sorry, the system call 'pdflatex -shell-esc ape -halt-on-error -interaction=batchmode -jobname "figures/externalized/prova- figure0" "\def\tikzexternalrealjob{prova}\input{prova}"' did NOT result in a us able output file 'figures/externalized/prova-figure0' (expected one of .pdf:.jp g:.jpeg:.png:). Please verify that you have enabled system calls. For pdflatex,  this is 'pdflatex -shell-escape'. Sometimes it is also named 'write 18' or som ething like that. Or maybe the command simply failed? Error messages can be fou nd in 'figures/externalized/prova-figure0.log'. If you continue now, I'll try t o typeset the picture.  See the tikz package documentation for explanation. Type  H &lt;return&gt;  for immediate help.  ...                                                l.22    \end{tikzpicture}  ?  PGFPlots: reading {figures/data/LidDrivenCavity/Lid_SPIKE_128x128_Re1000_psi.da t} Runaway argument? {\pgfkeyssetvalue {/pgfplots/execute at begin plot visualization}{}\pgfkeyssetv alue \ETC. ./prova.tex:22: TeX capacity exceeded, sorry [main memory size=5000000]. &lt;argument&gt; ...5e-1],2Y7.753628e-3]}{2Y8.20894\ETC.  l.22    \end{tikzpicture}  If you really absolutely need more capacity, you can ask a wizard to enlarge me.   Here is how much of TeX's memory you used:  20761 strings out of 493054  547383 string characters out of 6134761  5000001 words of memory out of 5000000  23958 multiletter control sequences out of 15000+600000  3640 words of font info for 14 fonts, out of 8000000 for 9000  1141 hyphenation exceptions out of 8191  62i,4n,84p,728b,1519s stack positions out of 5000i,500n,10000p,200000b,80000s ./prova.tex:22:  ==&gt; Fatal error occurred, no output PDF file produced!   similar (or the same) error appears if externalization is not enabled/used.  My TeX distribution is TeX Live on Mac OS X 10.9.5 and I use TeXShop as editor.  Once I (partially) solved a  on Windows+MikTeX+TeXniccenter by modifying/adding options to the command executed when compile button is pressed. I say partially since I actually solved the problem for some data file. Then I experienced the same problem with larger datafile and/or different plots (I don't remember anymore) and didn't find a way out, no matter how much I extended the memory.  What should I do now? (1)  If $E$ is a subset of $\mathbb R$ with finite outer measure, i.e. $m^{*}(E) &lt;\infty$; and   (2) $E$ is not Lebesgue measurable, i.e. there exists $F$ such that  $m^{*} (F) &lt; m^{*}(EF) + m^{*}(FE^{c}).$  [Claim] There exists an open set $O\supset E$ with finite outer measure, such  that   $$m^{*}(O E^{c})  &gt; m^{*} (O)  - m^{*} (E).$$  My  questions are the following.  (1) Is the above claim correct? I've seen this in Royden's book, but have a bit concern. Note that a set $E$ is Leb measurable if  it satisfies caratheodory condition: $m^{*} (F) = m^{*}(EF) + m^{*}(FE^{c})$ for  all subset $F$. If the claim is yes, it seems that measurability condition can  be reduced from all subset $F$ to Borel set $F$.  (2) If the claim is correct, a proof is needed. What exactly is the point of memoryview in Python I have problems with getting an Asus PCE-N53 11n N600 PCI-E Adapter card to work on my desktop computer.  As far as I can tell no drivers are installed for the card. I know I can manually download the drivers directly from Asus, but I would rather not go that route.  If there are anyone that knows about any packages or other things I can do to make this work would be much appreciated.  Some systems details:  $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 12.04.1 LTS Release:    12.04 Codename:   precise   $ sudo lshw -C network   *-network                       description: Ethernet interface        product: RTL8111/8168B PCI Express Gigabit Ethernet controller        vendor: Realtek Semiconductor Co., Ltd.        physical id: 0        bus info: pci@0000:03:00.0        logical name: eth0        version: 06        serial: d4:3d:7e:03:b9:1d        size: 100Mbit/s        capacity: 1Gbit/s        width: 64 bits        clock: 33MHz        capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation        configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168e-3_0.0.4 03/27/12 ip=192.168.0.173 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s        resources: irq:43 ioport:d000(size=256) memory:f2104000-f2104fff memory:f2100000-f2103fff  *-network UNCLAIMED        description: Network controller        product: Ralink corp.        vendor: Ralink corp.        physical id: 0        bus info: pci@0000:04:00.0        version: 00        width: 32 bits        clock: 33MHz        capabilities: pm msi pciexpress bus_master cap_list        configuration: latency=0        resources: memory:f7100000-f710ffff  $ lsmod Module                  Size  Used by nvidia              12319264  51  vesafb                 13844  1  snd_hda_codec_hdmi     32474  1  joydev                 17693  0  bnep                   18281  2  rfcomm                 47604  0  bluetooth             180104  10 bnep,rfcomm snd_hda_codec_realtek   224173  1  snd_seq_midi           13324  0  ppdev                  17113  0  snd_rawmidi            30748  1 snd_seq_midi usbhid                 47199  0  hid                    99559  1 usbhid nouveau               774641  0  parport_pc             32866  1  snd_hda_intel          33773  5  ttm                    76949  1 nouveau snd_hda_codec         127706  3 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel drm_kms_helper         46978  1 nouveau drm                   242038  3 nouveau,ttm,drm_kms_helper snd_seq_midi_event     14899  1 snd_seq_midi snd_hwdep              13668  1 snd_hda_codec snd_seq                61896  2 snd_seq_midi,snd_seq_midi_event i2c_algo_bit           13423  1 nouveau mxm_wmi                12979  1 nouveau wmi                    19256  1 mxm_wmi mac_hid                13253  0  snd_pcm                97188  3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec psmouse                97362  0  video                  19596  1 nouveau snd_timer              29990  2 snd_seq,snd_pcm snd_seq_device         14540  3 snd_seq_midi,snd_rawmidi,snd_seq snd                    78855  20 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_rawmidi,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_seq,snd_pcm,snd_timer,snd_seq_device serio_raw              13211  0  soundcore              15091  1 snd snd_page_alloc         18529  2 snd_hda_intel,snd_pcm mei                    41616  0  lp                     17799  0  parport                46562  3 ppdev,parport_pc,lp r8169                  62099  0 What is the non-parametric equivalent of a two-way ANOVA that can include interactions? Display the original question beneath the answer edit form Often when I edit one of my answers, it's because I want to better address the original question. The only problem is that I can't see the original question while I'm editing my answer!  I'd love to see the original question text beneath the "answer edit" form. This way I could scroll down slightly to read it if I wanted to, or just ignore it if not.  Current workaround is to click the 'return to answer' link and hope that you remember to launch it in a new tab/window, then tab back and forth.    Imported from this uservoice item: Set the default permission when creating a file Since the new top bar has been rolled out - a number of different people, established and new users alike, have asked questions on where a specific link has disappeared to with the new top bar design. Where has the link to &lt;X&gt; gone? This is my first time through playing Elder Scrolls and initially I grabbed every quest that has come available...  At first I thought I wanted to be part of the Imperial Legion but I feel like I picked the wrong side and am now regretting my choice.  So...is there any way to un-join the Legion and join up with the Stormcloaks, or will I have to wait and join them next time? How do I clear the render border? In the 3d viewport I am using a border region to only render things inside the selected region. I did this with CtrlB. I cannot get rid of the region. How can I make the border disappear? Show that if $a \equiv b \pmod n$, $\gcd(a,n)=\gcd(b,n)$ Every subspace of a vector space has a complement I want to see if my proof is true or I thought very trivially?    If $H$ is a subspace of a finite dimensional vector space $V$, show there is a subspace $K$ such that $H\cap K=0$ and $H+K=V$    So far I have tried :    $H\subseteq V$ is a subspace $\Rightarrow\,\exists\;K=(V-H)\subseteq V$ $K$ is a subspace because it's the sum of two subspace $V$ and $(-H)$ Now we should prove that $H\cap K=0$ We assume $H\cap K\neq0\Rightarrow\exists\,\vec u\neq0\,,\,\vec u\in H\cap K$ $\vec u\in H\cap K\Rightarrow \begin{cases}\vec u\in H\\\vec u\in K\,\Rightarrow\vec u\in V-H\Rightarrow\vec u\in V,\,\vec u\notin H\end{cases}$ That's a contradiction so our hypothesis was wrong and $\vec u=0$ We moved to a new place where the dryer connection is 3-prong instead of 4-prong. The dryer was originally 4-prong, so we bought a 3-prong cord and installed it. It works fine, except I am not entirely sure if I installed the ground wire correctly.   Originally, there was a green wire on the cord itself, and that was connected to the screw on the top of the first picture. This is, I assume, used to ground the case and prevent shocks when touching the exterior of the dryer.  Now with the 3-pronged plug, there is no ground wire on the cord. So where does the existing green wire in the case go? Do I leave it where it originally was like in the first picture or do I connect it to the central terminal like in the second picture?      There's no bonding strap running from the case to any terminal. I can't tell where the green wire is connected to. Fundamentally, what does a friction force do for a rolling object? I am very confused by the way my textbook explains it. In my textbook , it says:  A wheel rolling on a horizontal flat surface at a constant velocity experiences no friction force. Why?   On the same surface, there is an acceleration of the wheel pointing to the right (probably caused by a force), so the ball is angularly accelerating in the clockwise direction. In this case, a friction force appears, and it is also pointing to the right. How come? What does the friction do for this wheel?  On an inclined plane, a ball freely rolls down the surface. The direction of friction is up the ramp, which confuses me because in the previous example the friction force was in the direction of the wheel's acceleration.   And there is a difference if a wheel is freely rolling and if there is a torque acting on the ball's center of mass. WHY???  What does friction do in these cases? How does it cause an object to roll? Redirecting cout to a console in windows I have an application which is a relatively old. Through some minor changes, it builds nearly perfectly with Visual C++ 2008. One thing that I've noticed is that my "debug console" isn't quite working right. Basically in the past, I've use AllocConsole() to create a console for my debug output to go to. Then I would use freopen to redirect stdout to it. This worked perfectly with both C and C++ style IO.  Now, it seems that it will only work with C style IO. What is the proper way to redirect things like cout to a console allocated with AllocConsole()?  Here's the code which used to work:  if(AllocConsole()) {     freopen("CONOUT$", "wt", stdout);     SetConsoleTitle("Debug Console");     SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED); }   EDIT: one thing which occurred to me is that I could make a custom streambuf whose overflow method writes using C style IO and replace std::cout's default stream buffer with it. But that seems like a cop-out. Is there a proper way to do this in 2008? Or is this perhaps something that MS overlooked?  EDIT2: OK, so I've made an implementaiton of the idea I spelled out above. Basically it looks like this:  class outbuf : public std::streambuf { public:     outbuf() {         setp(0, 0);     }      virtual int_type overflow(int_type c = traits_type::eof()) {         return fputc(c, stdout) == EOF ? traits_type::eof() : c;     } };  int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) {     // create the console     if(AllocConsole()) {         freopen("CONOUT$", "w", stdout);         SetConsoleTitle("Debug Console");         SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED);       }      // set std::cout to use my custom streambuf     outbuf ob;     std::streambuf *sb = std::cout.rdbuf(&amp;ob);      // do some work here      // make sure to restore the original so we don't get a crash on close!     std::cout.rdbuf(sb);     return 0; }   Anyone have a better/cleaner solution than just forcing std::cout to be a glorified fputc? Why should I install hardware drivers if my computer is working fine? I've just installed Windows 7 on my PC.  I went online to look for drivers. For , Foxconn offers LAN drivers, on-board audio drivers, and chipset drivers. And for , Nvidia offers a graphics card driver, obviously.  But then I stopped and wondered... what benefit would I gain from installing them?   The LAN cable is plugged in and I'm online; no problems there.  The on-board audio is working fine.  A quick Google tells me that a chipset is responsible for moving data around my motherboard – which seems to be happening OK!  And my graphics look perfect.    So why should I install the drivers? What would they give me, other than badly designed "management" interfaces, and pointless "notifications" whenever I plug in an audio jack?  If there are different considerations for each of the components – chipset, audio, LAN, and graphics (and any others you think I should be aware of) – please break it down in your answer.     Update: I've had a couple of answers already, saying that I'll get better stability, bugfixes, etc.   Can I slightly expand my question... Can I get all these same benefits if I install the drivers via Windows Update? And if I do this, would I avoid having to install the vendor-specific UIs, which I find so annoying? Hyphens in words with prefixes like neo-Nazism I have a question regarding the use of hyphens in words with certain prefixes. For example,     Neo-Nazism   Neo-Confucianism   Neo-liberal     are words with a hyphen, but     Neoplatonism   Neocolonialism   are words without hyphens. I'm especially confused with neo-Confucianism and neoplatonism: one contains  a hyphen and a capital letter and the other doesn't.  Is there a specific rule for hyphens in words with prefixes or is it purely arbitrary? Number of Pairs of Subsets Find the number of Pairs $(A,B)$ of subsets of $[n]$ such that $A ⊆ B$? I just need clarification in my thought process. My professor's wording at times can through me off. I just want to know if I am on the right track. We will have $3$ regions: 1.Outside $B$ 2.Inside $A$ 3. Inside $B$, Outside $A$ I believe the number of pairs is $3^n$ but I am not sure. Any help would be appreciated. Add an alert when answering a question that has at least a close vote as duplicate I have one feature-request with the objective of having duplicate questions with no answers:   To (try to) avoid people answering duplicate questions, add an alert that says the question has a probable duplicate if it has a close vote as Exact duplicate, asking the answerer to go to the original and answer there.   What do you think? My objective is letting the duplicate question exist for search purposes, but the answers centralized in the root question. What is the strict aliasing rule?