Am I missing something basic in Java Math calculations for float numbers ? I can use Math function round(), However I want accurate value 6.4 as the input given is simple and doesn't have many values after the decimal point.   System.out.println(1.8f+1.0f+1.9f+1.7f); // Expected 6.4 but actual is 6.3999999999999995 how ?
Consider the following code:   0.1 + 0.2 == 0.3  -&gt;  false   0.1 + 0.2         -&gt;  0.30000000000000004   Why do these inaccuracies happen?
Can I smoothly upgrade from one LTS to next LTS release? "wait more than" vs. "wait FOR more than" If you make him wait (for) more than ten minutes, he'll just walk away.  I found both instances on Google Books:  and . So I'm a bid confused. How to keep any Window "Always on Top"? Some software have an option for their window to be "Always on Top". Is there any way to get the same functionality for any window. Let me give an example where this would be useful.  Suppose I have a small browser window with real time stats from a game. The window is automatically updated at the rate of once every 10 seconds. I would like the small window to be always on top. so that I can just look at it whenever I want to, without actually going to it and at the same time I could continue working in my main application, which is at full screen.  Is there any Windows hack or App which can give me this functionality? Fundamental group of a torus with points removed Regular expression to match balanced parentheses I need a regular expression to select all the text between two outer brackets.  Example: some text(text here(possible text)text(possible text(more text)))end text  Result: (text here(possible text)text(possible text(more text))) Why do we say "is it" when asking a question rather than "it is"? What it says on the tin, a foreign friend of mine has asked and I can't tell him; apart from it sounding horrible.  For example:  "Why is it raining today?"   Instead of:  "Why it is raining today?" Rename ToC, List of Figures, References I would like to know how to rename the standard list of figures, table of contents, and references. What I saw so far relying on \renewcommand{\contentsname}{name} did not work so far.  Here's the list of preambles I use:  \documentclass[12pt]{report} \usepackage[utf8]{inputenc}  \usepackage{fourier} \pagestyle{headings} \usepackage{marvosym} \usepackage[pdftex]{graphicx} \usepackage[margin=2.5cm]{geometry} \usepackage{rotating} \usepackage{amsmath} \usepackage{booktabs} \usepackage{url} \usepackage{natbib} \usepackage{setspace} \linespread{1.5} \newenvironment{remark}{\par\mbox{}\par\noindent{\bfseries             \emph{Remark}\/}:\normalfont}{\par} \newenvironment{defin}{\par\mbox{}\par\noindent\bfseries \emph{\Pointinghand\     }\normalfont}{\par} \setcounter{toc**strong text**depth}{2}  \usepackage[colorlinks=true, a4paper=true, pdfstartview=FitV, linkcolor=blue, citecolor=blue, urlcolor=blue]{hyperref} \pdfcompresslevel=9 \setstretch{1.0} %vertical stretch \usepackage{fontspec} \setmainfont[BoldFont       = AvenirNextRoundedPro-Bold.otf , ItalicFont     =AvenirNextRoundedPro-Italic.otf]{AvenirNextRoundedPro-Reg.otf} \defaultfontfeatures{Mapping=tex-text} \usepackage{multirow} \usepackage{array} \usepackage{booktabs} \usepackage{hyperref} \hypersetup{ hidelinks, } \usepackage{ragged2e} \usepackage{euler} \usepackage[euler-digits,euler-hat-accent]{eulervm} \usepackage[labelfont=bf]{caption} \usepackage{wrapfig} \usepackage{amsmath} \usepackage{amssymb}  \usepackage[english]{babel} \usepackage[nottoc]{tocbibind} %Adds "References" to toc \usepackage{titlesec} \titleformat{\chapter}[display]{\bfseries\huge}{\filleft\Large\chaptertitlename~\thechapter}{1ex}{\vspace{1ex}\filright}[\vspace{0.5ex}\titlerule] \usepackage{float} \usepackage{etoolbox} \makeatletter \patchcmd{\@caption}{\csname the#1\endcsname}{\csname fnum@#1\endcsname:}{}{} \renewcommand*\l@figure{\@dottedtocline{1}{2em}{6em}} \let\l@table\l@figure  \makeatother % default for 3rd arg: 2.3em - for list of figures and tables \usepackage{background} \definecolor{textcolor}{HTML}{000000}             \newcommand\Text{c\quad o\quad n\quad f\quad i\quad d\quad e\quad n\quad t\quad i\quad a\quad l} \SetBgColor{textcolor}\SetBgOpacity{0.3}\SetBgAngle{90}         \SetBgPosition{current page.center} \SetBgVshift{-0.33\textwidth} \SetBgScale{1.8}         \SetBgContents{\sffamily\Text} %for confidential   I also use TexMaker. I do not know how relevant it is, but here my document language is set to English (even if it's not the language I write in, in that document, but it isn't a problem seemingly). What I also saw is that, if I remove babel and the references, I can rename my ToC and LoF, LoT. But I need the references though. Any tip would be very welcome!  Edit: I cannot provide text data from my project, because it is confidential. Here's what I can provide from the main document. Here is what I can include more.  \begin{document} \include{02_front}  \setcounter{page}{0} \pagenumbering{roman} \tableofcontents \listoffigures \listoftables \newpage \setcounter{page}{0} \pagenumbering{arabic} \chapter{blabla} \section{test é è åøæ î} \appendix \bibliographystyle{plain}  \bibliography{80_refs}   \end{document}   Also, I actually finished writing my thesis but I need to summarize it briefly in another language, am would be extremely unwilling to test and remove packages that "might be" not very useful. I literally only have to change these names of ToC, LoF, ToF and references. I'm creating side skirts for a truck and I am duplicating the frames I want. The problem is it's making the duplicated object into another object. How do I put it into the same one? I need to format a drive containing an old install of Ubuntu 10.04, to install Vista (not my idea!) Vista setup apparently refuses to format non-FAT32 or NTFS partitions. However, I can't seem to format it from my live CD (Ubuntu 11.04) at all; I keep getting "device is busy" errors. What is the simplest way to format this drive? Why is there such a big difference between "Size" and "Size on disk"? A 'for' loop to iterate over an enum in Java Why doesn't an orbiting body keep accelerating? As a physics newbie I'm trying to get a grip on basic orbital mechanics. I think I'm beginning to get grasp on how bodies interact with each other. When a body approaches another body it accelerates due to gravity. It can reach a point where its velocity is high enough to keep falling but also keep missing the object it is falling towards. What keeps it from accelerating (because of gravity) and eventually reaching escape velocity? I feel like I'm either looking at things the wrong way or I have the entire thing wrong. Why is Ubuntu 14.04 so slow on my laptop? Bootstrapped confidence intervals: different values at every computation? I am running an ANOVA and computing bootstrapped CIs for my effect sizes. I am using for this the Measures of Effect Size Toolbox for Matlab.  To my surprise, if I re-run the same line of code, i.e. compute the same thing for the same data, the lower&amp;upper margins of the CI are slightly different each time.  I know that bootstrapped CIs are built from permutation analyses based on random generations of distributions. Still, I do not remeber reading anywhere this odd property of CIs of being never twice the same! How do single photons travel from here to there I know there have been similar questions but I'm still unclear what the overall consensus is. (1) I assumed and have read that photons travel in straight lines unless deflected by gravity but there are conflicting theories. (2) I have heard that single photons takes every possible path but that makes no sense. Why would a single photon traveling from here to the moon go to every other place in the universe along the way.  (3) I can understand a single photon traveling as a particle or packet of energy but I have a hard time understanding a single photon traveling as a wave. I have never understood any attempts to answer this.  (4) Does a single photon have a frequency and what causes the frequency? If not then how does it have energy? I have many questions about single photons and their frequency. How prove that $\lim\limits_{x\to+\infty}f(x)=\lim\limits_{x\to+\infty}f'(x)=0$ if $\lim\limits_{x\to+\infty}([f'(x)]^2+f^3(x))=0$? Question:     Let $f$ be differentiable on $[0,+\infty)$, such as$$\lim_{x\to+\infty}\left([f'(x)]^2+f^3(x)\right)=0$$show that $$\lim_{x\to\infty}f(x)=\lim_{x\to\infty}f'(x)=0$$   I think this problem is similar to  and (the  background)  For my problem I guess that if  $$\lim_{x\to+\infty}\left([f'(x)]^{2m}+f^{2n+1}(x)\right)=0,m,n\in N^{+},n,m&gt;1$$ then we have $\lim_{x\to\infty}f(x)=\lim_{x\to\infty}f'(x)=0$. Why is lock(this) {...} bad? The  says that public class SomeObject {   public void SomeOperation()   {     lock(this)     {       //Access instance variables     }   } }  is &quot;a problem if the instance can be accessed publicly&quot;. I'm wondering why? Is it because the lock will be held longer than necessary? Or is there some more insidious reason? I want to prove  \begin{equation*} \tan A  + \tan B + \tan C = \tan A\tan B\tan C \quad\text{when } A+B+C = 180^\circ \end{equation*}  We know that   \begin{equation*} \tan(A+B) = \frac{\tan A+\tan B}{1-\tan A\tan B}~\text{and that}~A+B = 180^\circ-C. \end{equation*}  Therefore $\tan(A+B) = -\tan C.$ From here, I get stuck. Please help. I use a macbook pro 2015 with macOS High Sierra. I installed windows 10 using bootcamp, which resized the macOS partition and created a 80GB windows partition. The machine boots into windows just fine.  Unfortunately I can't go back to macOS because the macOS partition is not selectable as a boot source in bootcamp and "boot into X" boots into windows again. When I start from recovery (ctrl+R) I can see both partitions in diskutil. I tried to repair the macOS partiton but it had no effect.  How can i resurrect the macOS partion so I can choose which OS to start?  Update: I can start macOS by booting with option/alt pressed and chose the mac partition.  diskutil list output:  Capsicum:~$ diskutil list /dev/disk0 (internal, physical):    #:                       TYPE NAME                    SIZE       IDENTIFIER    0:      GUID_partition_scheme                        *251.0 GB   disk0    1:                        EFI EFI                     209.7 MB   disk0s1    2:                 Apple_APFS Container disk1         170.0 GB   disk0s2    3:       Microsoft Basic Data BOOTCAMP                80.3 GB    disk0s3    4:           Windows Recovery                         503.3 MB   disk0s4  /dev/disk1 (synthesized):    #:                       TYPE NAME                    SIZE       IDENTIFIER    0:      APFS Container Scheme -                      +170.0 GB   disk1                                  Physical Store disk0s2    1:                APFS Volume Macintosh HD            101.3 GB   disk1s1    2:                APFS Volume Preboot                 20.2 MB    disk1s2    3:                APFS Volume Recovery                506.6 MB   disk1s3    4:                APFS Volume VM                      2.1 GB     disk1s4  /dev/disk2 (external, physical):    #:                       TYPE NAME                    SIZE       IDENTIFIER    0:     FDisk_partition_scheme                        *2.0 TB     disk2    1:                  Apple_HFS Passport                2.0 TB     disk2s1   thanks a lot for any clarification what is wrong! How this java code produces deadlock?