How to calculate the total number of days between two date pickers and display the result in another text field?
How do I get the number of days between two dates in JavaScript?
Leaflet Customer Marker Changes Position with Scale A random variable with neither probability density function nor probability mass function... is this example wrong? This is from Shreve's Stochastic Calculus for Finance II, Appendix A.3. Consider infinitely many independent coin tosses with outcomes $\omega_n$, $n = 1, 2, \dots$ such that $\omega_n$ can be either $H$ = heads or $T$ = tails. Define \begin{equation} Y_n\left(\omega\right) = \begin{cases}1 &amp; \text{ if }\omega_n = H \\ 0&amp; \text{ if } \omega_n = T\text{.} \end{cases} \end{equation}  Define $\displaystyle Y = \sum\limits_{n=1}^{\infty}\dfrac{2Y_n}{3^{n}}$. Shreve shows that $Y$ can only take values in the Cantor set, and since that particular set has measure zero, its Lebesgue measure is zero as well, thus it does not have a probability density function (since integrating such a density function would give a value of $0$). This part I understand, as well as my professor.  Now Shreve claims that $Y$ does not have a probability mass function.      If it did, then for some number $x \in C$ [the Cantor set] we would have $\mathbb{P}\left(Y=x\right) &gt; 0$. But $x$ has a unique base-three expansion    \begin{equation} x = \sum\limits_{n=1}^{\infty}\dfrac{x_n}{3^{n}}\text{,} \end{equation}   where each $x_n$ is either 0, 1, or 2 unless $x$ is of the form $\dfrac{k}{3^{n}}$ for some positive integers $k$ and $n$. In the latter case, $x$ has two base-three expansions... In either case, there at most two choices of $w \in \Omega_{\infty}$ [that is, the infinite coin-toss space] for which $Y(\omega) = x$. In other words, the set $\{\omega \in \Omega; Y(\omega) = x\}$ has either one or two elements. The probability of a set with one element is zero, and the probability of a set with two elements is $0 + 0 = 0$. Hence $\mathbb{P}\left\{Y = x\right\} = 0$.   My professor and I were able to follow this until the statement "The probability of a set with one element is zero." Is this a true statement? How so?   I thought it would be perhaps the fact that the Lebesgue measure of $[a, a] = \{a\}$ is zero, but I don't see any reason why Shreve would only use the Lebesgue measure, since it is not a general probability measure. Clustering on the output of t-SNE I've got an application where it'd be handy to cluster a noisy dataset before looking for subgroup effects within the clusters.  I first looked at PCA, but it takes ~30 components to get to 90% of the variability, so clustering on just a couple of PC's will throw away a lot of information.    I then tried t-SNE (for the first time), which gives me an odd shape in two dimensions that is very amenable to clustering via k-means.  What's more, running a random forest on the data with the cluster assignment as the outcome shows that the clusters have a fairly sensible interpretation given the context of the problem, in terms of the variables that make up the raw data.  But if I'm going to report on these clusters, how do I describe them?  K-means clusters on principal components reveal individuals who are nearby to one another in terms of the derived variables that comprise X% of the variance in the dataset.  What equivalent statement can be made about t-SNE clusters?  Perhaps something to the effect of:     t-SNE reveals approximate contiguity in an underlying high-dimensional manifold, so clusters on the low-dimensional representation of the high-dimensional space maximize the "likelihood" that contiguous individuals will not be in the same cluster   Can anyone propose a better blurb than that? If I had a very shallow question, then I am sorry. $x,y,z\in\mathbb{N}^{+}$ and$$\frac{x}{y+z}+\frac{y}{x+z}+\frac{z}{y+x}=4$$find $x,y,z$.  I try with AM-GM, just get$$ \frac{x}{y+z}+\frac{y}{x+z}+\frac{z}{y+x}\geq\frac{3}{2}$$  This means that the equation must have a real solution, but can not be sure there is an integer solution.  Let: $x=ay=abz$, then the equation becomes:$$\frac{ab}{a+b}+\frac{b}{ab+1}+\frac{1}{a^2+ab}=4$$  Which makes the problem become non-homogeneous, and seems to become more difficult. I have no more ideas. Could anyone help me? Thanks a lot. How can I take shallow depth of field photos with a point-and-shoot camera? How to call child component controller function/helper from Parent Component Controller In a batch file I need to extract a month, day, year from the date command.  So I used the following, which essentially parses the Date command to extract its sub strings into a variable:  set Day=%Date:~3,2% set Mth=%Date:~0,2% set Yr=%Date:~6,4%   This is all great, but if I deploy this batch file to a machine with a different regional/country settings, it fails because month, day and year are in different locations.   How can I extract month, day and year regardless of the date format? Been looking to pivot rows (progress_check) into columns check 1, check 2 etc... No sum or totals required, just to display the results hopefully... Can anyone help, Thanks Ad Is there a way to disable the hardware on/off switch for the Wireless interface? Algorithm to return all combinations of k elements from n Prove: If $a$ and $b$ are odd integers, then $8\mid (a^2-b^2)$  So far I have: $$8\mid \left((2n+1)^2-(2m+1)^2\right)\Longleftrightarrow 8\mid \left(4n^2+4n+1-4m^2-4m-1\right) $$ Is this right so far? Where do I go from here? Step by step explanation please! VirtualBox - how to increase video memory? In electromagnetism, why does nature prefer the right-hand rule over the left-hand rule? I have a StreamReader object that I initialized with a stream, now I want to save this stream to disk (the stream may be a .gif or .jpg or .pdf).  Existing Code:  StreamReader sr = new StreamReader(myOtherObject.InputStream);    I need to save this to disk (I have the filename). In the future I may want to store this to SQL Server.   I have the encoding type also, which I will need if I store it to SQL Server, correct? Set origin to bottom center of multiple objects I have a lot of 3D objects of various sizes, shapes in blender 2.76b and I would like to set the origin to the bottom center of the objects bounds.  I cannot select the bottom edge and snap to cursor etc as each shapes edges are in different X/Y positions.  Is there a script or tool that will allow me to set the origin to the lowest edge z position? How to say that you have plans to go to the movies tonight (but you are not sure yet, maybe you will have a pizza)? I mean there are options:     I am going to the cinema tonight.   Way too much certainty in this. For me it means that you have already bought tickets, the least.     I am going to go to the cinema tonight.   Sounds a bit awkward.     I will go to the cinema tonight.   Sounds too formal to me. How to completely remove virtual packages? It turns out that removing a virtual package with apt-get only remove the package itself,  leaving behind the real packages that were installed by it  So how do you remove a virtual package, along with all the real packages that it installs? Is just after your PhD a good time to switch your research area? I am finishing my PhD soon. The area in which I pursued my PhD is very challenging as I was only able to publish couple of papers even after spending many years. I want to switch into other research are due these reasons   to attract more students  to be comfortable to do research (along with teaching, I should be able to do research)   Even though I like the research I am doing right now, I seem to be isolated in my university. If ten students join my university for a PhD, hardly one student takes this area. My research area is not like machine learning or deep learning etc, so researchers of my domain are also not that much interested in my work.   The thing is I can work different research area but: Is this the right time? I am heading to a post-doc and learning a new area will probably take several months. Although my switch is not 180 degree, I am still worried. I've recently gotten into The Flash TV show, and so I've been reading about his powers. What I don't understand is why his typical rogues pose a threat - it seems like there should be very little limit to his powers.  He can go back in time, so if he loses a battle or the bad guys do something, he can go back and preempt it. In the new 52, he can all but predict the immediate future, so he can see bad things that are going to happen and stop them. He can phase matter through matter, or let matter pass through him. This means he is all but immune to weapons fire.  I haven't read enough of the old comics so I don't the know challenges he's had. For a guy who can't be attacked, can time-travel and can race around the globe several times in a minute, I can't imagine there is much that could pose a threat. I messed up my system earlier, I was greeted with a black screen, when booting in to Ubuntu. When I started up my laptop, I selected the recovery option from the grub menu, and chose fallback at root terminal. I saw that I was able to use the add user command, with it, I probably could use to create a privileged user on my machine.   Isn't that a security issue?  One could have stolen my laptop and at startup chose recovery and add another user, I'm fudged then. Including my data.  Come to think of it, even if you somehow remove that entry, one could boot from a live-CD, get a chroot up and running and then add another user, with the right privileges that allows it to see all my data.   If I set the BIOS to boot at my HD only, no USB, CD/DVD, Network startup, and set a BIOS password, it still wouldn't matter, because you'd still have that grub recovery startup entry.  I am fairly certain that someone from China, Russia can't hack my Ubuntu Trusty Tahr, from the network, because it's secure like that. But, if one has physical access to my - your - machine, then, well, that's why I'm asking this question. How can I secure my machine so that hacking through physical access is not possible?    Bug Report: