I need some help here. I am trying to convert some numbers and running in to some weird things.   I declare a double to the value 264210.35. I then multiply it with 100, and in my opinion i get the wrong result.               double value = 264210.35;              double sum = value.Value*100;             //sum = 26421034.999999996              var longSum = (long) sum;             //longSum = 25421034   When i then multiply it with 100 i excpect to get the sum of 26421035, but i don't. I get 26421034.999999996. When i use a normal calculator and multiplies the value with 100 i get 25421035. How come i don't in this case?  And when i then cast it to a long, it ends up being 26421034. Which then makes it one didgit wrong.
Consider the following code:   0.1 + 0.2 == 0.3  -&gt;  false   0.1 + 0.2         -&gt;  0.30000000000000004   Why do these inaccuracies happen?
Why does my user number show up in the search box when clicking my profile information? Hey all-  I just noticed that if you click on your username on the top bar, when your profile shows up, in the search bar at the top you'll find an explicit search for your user account.  For my meta account, for example, I see user:157031 whenever I click on my profile.  Is this deliberate?  If so, can I suggest removing that text?  It means that I have to manually delete the contents of the search field if I want to do a search from my profile screen.  Thanks! Deleted users who created a synonym are listed as "anon" in the tag synonyms list While browsing the  I came across the synonym [vote-to-close] -&gt; [closing] in which the creator is listed as &quot;anon&quot; — the username is not hyperlinked, just like how the user IDs of deleted users are listed in other places like in the list of close voters of a question, etc.  If this really were a deleted user, then I would have expected their user ID to be shown, and not &quot;anon&quot;. So, I checked using  for data on the tag synonym. And sure enough, it shows that the deleted user with the ID 147263 created the synonym. To double-check, I looked up the  and came across a bunch of synonyms created by &quot;anon&quot;. Checking with , these were all created by the now deleted user with the ID 80. Similarly, in the  there are several created by &quot;anon&quot;, but  says that these were created by the now deleted user with the ID 54262.  Feature request: Show the user ID of the tag creator under the &quot;Creator&quot; column in the list of tag synonyms if the user is deleted, to be consistent with how posts and actions by deleted users are attributed everywhere else. My best friend of the moment - 'Essential Grammar in Use' for elementary students by Raymond Murphy - says that 'we normally use -'s for people.'     I stayed at my sister's house. (not the house of my sister).   Then, bellow in the same unit (64) says that 'we use of... for things, places, etc.'     Look at the roof of that building. (not that building's roof)   After that I thought:  Finally!!! I understand the rules for apostrophes!!!  But soon I lost all that naif excitement when I saw other written examples on the internet that were not following those 'rules'.     I've learnt that we can apply apostrophes to ...     one year's pay   and, finally, amazingly enough ... to , which means ANY kind of nouns (I deduce uncountable nouns are also part of the possibilities). This demolishes what is said in the grammar. So, it seems that eventually:     That building's roof -> is valid   So, now I need your help.    1) Can you tell me the rules concerning the apostrophe to show possession in respect to its usage with nouns? Can we really apply to all kind of nouns? e.g. teeth's, vehicle's, Paula's, forest's, manager's, Ireland's, etc     Scotland's worst drivers   Metadata improves information's accessibility       2) Is there a sense that justifies what is written in the grammar: 'we normally use -'s for people'? or it does not make sense at all? I want to reinstall Ubuntu from scratch.   I have read ( and ) that it is recommended to have 3 partitions for the desktop installation: root, home and swap as having a separate home and root can simplify the process if you want to upgrade or reinstall Ubuntu (if you break something by mistake).  But there is no type of formula (that I can find) on how big each partition should be. I know this is somewhat dependant on what you plan to install. I want to have flexibility down the line to install new software without having to worry about shifting the partition sizes around.  Does anyone know of a formula or percentage breakdown that they have used to successfully calculate partition sizes?  i.e. x% of space will be allocated to the swap, y% of space to the root partition and z% of space to the home partition In a comment on this , someone said that they weren't sure what functools.wraps was doing. So, I'm asking this question so that there will be a record of it on StackOverflow for future reference: what does functools.wraps do, exactly? I want to do:  cat update_via_sed.sh | sed 's/old_name/new_name/' &gt; new_update_via_sed.sh   in my program.  But I want to use variables, e.g.  old_run='old_name_952' new_run='old_name_953'   I have tried using them but the substitution doesn't happen (no error). I have tried:  cat update_via_sed.sh | sed 's/old_run/new_run/' cat update_via_sed.sh | sed 's/$old_run/$new_run/' cat update_via_sed.sh | sed 's/${old_run}/${new_run}/' Storage order vs Result order This is a spin-off question from .   says this on the subject of storage order (clustered index) and the output order     A lot of people believe that a clustered index guarantees a sort order on output. But that's not what it does; it guarantees a storage order on disk.   See, for example, .   I've read the blog post by Hugo Kornelis and understands that an index doesn't guarantee that the sql server reads the records in a specific order. Yet I have a hard time accepting that I can't assume this for my scenario?  CREATE TABLE [dbo].[SensorValues](   [DeviceId] [int] NOT NULL,   [SensorId] [int] NOT NULL,   [SensorValue] [int] NOT NULL,   [Date] [int] NOT NULL, CONSTRAINT [PK_SensorValues] PRIMARY KEY CLUSTERED  (   [DeviceId] ASC,   [SensorId] ASC,   [Date] DESC ) WITH (     FILLFACTOR=75,     DATA_COMPRESSION = PAGE,     PAD_INDEX = OFF,     STATISTICS_NORECOMPUTE = OFF,     SORT_IN_TEMPDB = OFF,     IGNORE_DUP_KEY = OFF,     ONLINE = OFF,     ALLOW_ROW_LOCKS = ON,     ALLOW_PAGE_LOCKS = ON)   ON [MyPartitioningScheme]([Date])   My original query was this:  SELECT TOP 1 SensorValue   FROM SensorValues   WHERE SensorId = 53     AND DeviceId = 3819     AND Date &lt; 1339225010   ORDER BY Date DESC   But I suggest that I could as well use this one (read below for my explanation):  SELECT TOP 1 SensorValue   FROM SensorValues   WHERE SensorId = 53     AND DeviceId = 3819     AND Date &lt; 1339225010   As you can see, my table rows are small (16bytes) and I've got only one index, a clustered. In my scenario, the table consists of 100.000.000 records at this moment (and this will most likely increase tenfold).  When the database server queries this table it has two ways of finding my rows, either it seeks the primary key and thereby reading and returning my values in desc. order of Date, or it has to do a full table scan. My conclusion is that a full table scan on all those records will be way too slow and the database server will therefore always seek the table via its primary key and thereby returning the values sorted by Date DESC Why does the One Ring make the wearer's clothes invisible? The One Ring turns invisible the person wearing it.  Is there an explanation for how it does this? It seems that direct contact with the skin activates the Ring's invisibility effects;  why would it also affect the person's clothing, weapons, etc, as well? The Invisible Man's clothing is visible, so why aren't Frodo's clothes visible?  The Hobbit makes it clear that Bilbo's clothing is invisible, since Smaug doesn't see it.  Is there any possiblity that this varies from character to character? Table of contents numbering is strange Let $L$ and $R$ be $n \times n$ matrices. I am trying to solve the following minimization problem  $$ L^{k+1} := \arg \min_{L} \lambda \|L\|_{\ast} + \frac{1}{2\mu}\|L-R^{k}\|_{F}^{2} $$ $$ \mbox{s.t.}\ L \succeq 0 $$  where $\|\cdot\|_{\ast}$ and $\|\cdot\|_{F}$ denote the nuclear and Frobenius norms, respectively. Also, $k$ expresses the $k$th iteration when solving an optimization problem successively.  I don't know how to solve this problem. Would you tell me the way? Given an infinite set of cardinality $X$, is there a chain in $\mathcal P(X)$ of the same cardinalty of $\mathcal P(X)$? $P(\mathbb N)$ = power set of $\mathbb N$. $A \subset P(\mathbb N)$ is a chain if $a,b \in A \implies$ either $a \subseteq b$ or $ b \subseteq a$ That is, we have something like this: $$\cdots a \subseteq b \subseteq c \subseteq\cdots$$ where $a,b,c \in A$ are distinct. We can show easy enough that there is an uncountable chain - this is done by noting $\mathbb N\sim\mathbb Q$ then using Dedekind cuts in $\mathbb Q$ to define $\mathbb R$ we see that a family of (nearly arbitrary) cuts satisfy the condition. For instance the family $L_r=\{q \in \mathbb Q : q &lt; r \}$ for $r &gt; 0$ gives us the sets we need and obviously we can pick others. I tried doing this for $ \mathbb R$ and don't seem to be getting anywhere.  To be more specific, does there exist a chain in $P(\mathbb R)$ with cardinality $2^ \mathbb R$? Given a set of cardinality $X$ (necessarily non-finite), is there a chain in $P(X)$ of the same cardinalty of $P(X)$? How to prove that the set of rational numbers are countable? Can any one tell me how to prove that the set of rational numbers are countable? Prove give me a prove?  Thanks. Any subgroup of index $p$ in a $p$-group is normal. I'm thinking of following some kind of education in physics online. I have a master degree in Computer Science and have reasonable good knowledge in physics. I would like a program of 1-2 years and I'm more interested in particle physics.   Is there any good online program that offer something similar? How can I remove duplicate rows? What is the best way to remove duplicate rows from a fairly large SQL Server table (i.e. 300,000+ rows)?  The rows, of course, will not be perfect duplicates because of the existence of the RowID identity field.  MyTable  RowID int not null identity(1,1) primary key, Col1 varchar(20) not null, Col2 varchar(2048) not null, Col3 tinyint not null How can I format to show text inside ""? I've posted a lot to StackOverflow, and I've noticed something kind of irritating with the formatting in writing questions and comments. If I need to put something inside a &lt; and a >, without spaces in the middle (like right there), it will think it's code and not show up, like this   (obviously it won't come up what I wrote there, or else this wouldn't be an issue, but if you open up the question to edit you can see what's written there.)  If I want it to show up, right now I have to add an extra set of brackets inside of the originals with a junk variable, like right &lt;here> (again, open in edit window to see).  This is really annoying when trying to show variables like lists that require those brackets, and I feel like the junk variables could confuse people looking at the edits. Is there a way to get around this formatting? Thanks! Service or services? I've read many articles that use the term 'emergency services ' and ' location services' .   Why not service instead? Why must it be plural? Thank you (Originally  by AJAY.)  What is the geometric, physical, or other meaning of the third derivative of a function at a point?  If you have interesting things to say about the meaning of the first and second derivatives, please do so. What is an efficient way to implement a singleton pattern in Java? ́╗┐' is not recognized as an internal or external command When executing certain files (mainly batch) using PsExec I get these weird ́╗┐' symbols before my command. My initial thought was, that I were using wrong encoding, but after checking, I realized that all my files were using UTF-8.