I'm currently writing the working hour calculation with Time In and Time Out to show working hour with decimal with 1 point. In my case i used .toFixed(1) and any other times are working well but when time in is 09:10 and time out is 17:30 .. It's result show as 8.333333333333334. .toFixed(1) not working in that decimal number. How should i do that.  Here is my code.  var time_in = $(elm).closest('tr').find('.time_in').text(); var time_out = $(elm).closest('tr').find('.time_out').text(); var working_time = (new Date("1970-1-1 " + time_out) - new Date("1970-1-1 " + time_in)) / 1000 / 60 / 60 ; alert(working_time); var total_work_hour = working_time.toFixed(1) - 1;    //get fixed decimal number and minus 1 for lunch time. var w_time = $(elm).closest('tr').find('.work_time'); w_time.text(total_work_hour);
Consider the following code:   0.1 + 0.2 == 0.3  -&gt;  false   0.1 + 0.2         -&gt;  0.30000000000000004   Why do these inaccuracies happen?
Problems with \pgfplotstableread and relative paths Is it "me" or "I" and why? LM317 getting hot Should an LM317 (specifically a ) rated for 500ma output current really be getting hot to touch when only pulling 170ma at 5V?  Package is SOT-223, input is 9V.  Is this normal? How can I change the color of the lines (the frame) in a tabular environment? In the following MWE:  \begin{tabular}{c|c|c} a&amp;b&amp;c \\ \hline d&amp;e&amp;f \\ \hline g&amp;h&amp;i \end{tabular}   I would like the horizontal and vertical lines of the table to have, say a blue color. Word for feeling conflicting emotions simultaneously Writing C# debug output to .txt file I'm new to data mining and I'm trying to train a decision tree against a data set which is highly unbalanced. However, I'm having problems with poor predictive accuracy.  The data consists of students studying courses, and the class variable is the course status which has two values - Withdrawn or Current.   Age Ethnicity Gender Course  ... Course Status   In the data set there are many more instances which are Current than Withdrawn. Withdrawn instances only accounting for 2% of the total instances.  I want to be able to build a model which can predict the probability that a person will withdraw in the future. However when testing the model against the training data, the accuracy of the model is terrible.  I've had similar issues with decision trees where the data is dominated by one or two classes.  What approach can I use to solve this problem and build a more accurate classifier? Explanation of method for showing that $\frac{0}{0}$ is undefined (This was asked due to the comments and downvotes on this  answer. I am not that good at maths, so was wondering if I had made any basic mistakes)  Ignoring limits, I would like to know if this is a valid explanation for why $\frac00$ is undefined:     $x = \frac00$    $x \cdot 0 = 0$        Hence There are an infinite number of values for $x$ as anything multiplied by $0$ is $0$.   However, it seems to have got comments, with two general themes.  Once is that you lose the values of $x$ by multiplying by $0$.  The other is that the last line is:      $x \cdot 0 = \frac00 \cdot 0$   as it involves a division by $0$.  Is there any merit to either argument? More to the point, are there any major flaws in my explanation and is there a better way of showing why $\frac00$ is undefined? shortcut for commands I use following commands very often, and they're too long.  sudo /etc/init.d/kerio-kvc start sudo /etc/init.d/kerio-kvc stop   how can I create a shortcut command for them? something like sudo kerio start or sudo kerio stop How do I send HTML email using linux 'mail' command? What if the LHC doesn't see SUSY? A question in four parts.   What are the main problems which supersymmetry purports to solve?  What would constitute lack of evidence for SUSY at the proposed LHC energy scales (e.g. certain predicted superpartners are not in fact observed)?  Are there alternative theoretical approaches which would address the SUSY problem set and which would still be credible in such an LHC no-SUSY-scenario? Where would LHC-disconfirmation of SUSY leave String Theory?   I would like to think that these four points could be taken together as one question. What is the difference between a tatkal and premium tatkal ticket in Indian Railways? Quick question to anyone who has used this LaTeX template:    Any ideas on how to change the left margin to get more words onto one page? What are some good books for learning general relativity? Is there a GUI IDE for programming python just like java has netbeans?  I wanted one where we could drag &amp; drop test boxes &amp; labels just as we do in swing components using netbeans or eclipse.  Or is there an add-on present in either netbeans or eclipse itself? Hungerford's book of algebra has exercise $6$ chapter $3$ section $6$ [Probably impossible with the tools at hand.]:     Let $p \in \mathbb{Z}$ be a prime; let $F$ be a field  and let $c \in  F$. Then $x^p - c$ is irreducible in $F[x]$ if and only if $x^p - c$   has no root  in $F$. [Hint: consider two cases: char$(F) = p$ and   char$(F)$ different of $p$.]   I have attempted this a lot. Anyone has an answer? Cause of Alpha or Black Artefacts in Render Why does a 95% Confidence Interval (CI) not imply a 95% chance of containing the mean? It seems that through various related questions here, there is consensus that the "95%" part of what we call a "95% confidence interval" refers to the fact that if we were to exactly replicate our sampling and CI-computation procedures  many times, 95% of thusly computed CIs would contain the population mean. It also seems to be the consensus that this definition does not permit one to conclude from a single 95%CI that there is a 95% chance that the mean falls somewhere within the CI. However, I don't understand how the former doesn't imply the latter insofar as, having imagined many CIs 95% of which contain the population mean, shouldn't our uncertainty (with regards to whether our actually-computed CI contains the population mean or not) force us to use the base-rate of the imagined cases (95%) as our estimate of the probability that our actual case contains the CI?   I've seen posts argue along the lines of "the actually-computed CI either contains the population mean or it doesn't, so its probability is either 1 or 0", but this seems to imply a strange definition of probability that is dependent on unknown states (i.e. a friend flips fair coin, hides the result, and I am disallowed from saying there is a 50% chance that it's heads).  Surely I'm wrong, but I don't see where my logic has gone awry... I am hearing my screen cvc-complex-type.2.4.a: Invalid content was found starting with element 'init-param'