I am trying to make an array of N+1 bins for a distribution of N discrete scores.  I assumed numpy's arange could be used for that. However, the function gives me odd values, which have a significant effect on the resulting numpy histograms. Here's a minimal example:  n = 10 a = np.arange(0, 1.01 + 1/n, 1/n)  print(a) for i in a:     print(i)     [0.  0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.  1.1]  0.0 0.1 0.2 0.30000000000000004 0.4 0.5 0.6000000000000001 0.7000000000000001 0.8 0.9 1.0 1.1   The fact that simply printing the array outputs seemingly normal values is extra misleading. This is a big issue if I want to use this array as a bins argument to numpy's histogram() function because my values are k/10 decimals. In particular, all data points with the value of 0.7 will be placed in the [0.6000000000000001, 0.7000000000000001] bin, whereas I'd expect them to be inside [0.7, 0.8], as per np.histogram() documentation.  The question is whether this is a bug or a feature.
Consider the following code:   0.1 + 0.2 == 0.3  -&gt;  false   0.1 + 0.2         -&gt;  0.30000000000000004   Why do these inaccuracies happen?
Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) Upon trying to upgrade from 10.10 to 11.04 all seemed to go well until the restart. This error message is what comes up:  Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)   How do we fix that? Finding the n-th lexicographic permutation of a string I have an ordered set of symbols S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }. I want to find the 1,000,000-th permutation in lexicographic order of S. It is a programming puzzle, but I wanted to figure out a way without brute-forcing the task.  So my thinking was like this:  For 10 variable symbol positions, we have 10! permutations, obviously. Now we want to find the first symbol.  If we fix the first symbol, then the remaining 9 symbols can have 9! combinations.  That means that 0 or 1 cannot be the first symbol, because the highest possible position is 2*9! = 725,760, which is lower than 1,000,000.  The lowest position for a leading 3 is 3*9! + 1 = 1,088,641, so it can't be 3 or higher, either.  Therefore, the first number must be 2. 2*9! is the largest multiple of 9! no greater than 1,000,000, so I need the 2nd symbol (zero-based) from the current set.  So now the question becomes, of the remaining S := S \{2}, which permutation of these symbols is at lexicographic position (1,000,000 - 2*9!) = 274,240?  6*8! = 241,920 is the largest multiple of 8! which is smaller than 274,240, so I need the 6th-smallest symbol of the remaining set, which is 7. So the prefix should be 27 by now.  That way, I keep going and finally arrive at: 1,000,000 = 2*9! + 6*8! + 6*7! + 2*6! + 5*5! + 1*4! + 2*3! + 2*2! + 0*1! + 0*0!  which results in "2783905614" as my solution.  However, according to the , (free reg. req.) that is incorrect.  Where did I go wrong in thinking or applying? Just noticed the "meta user" link under the picture and reputation on the Stack Exchange user's page. It doesn't seem to work for all users. Error is "Page Not Found".   Not working:  /  Working:  /    My guess is this is because they've never logged into the meta site. Uncountable subset with uncountable complement, without the Axiom of Choice Let $X$ be a set and consider the collection $\mathcal{A}(X)$ of countable or cocountable subsets of $X$, that is, $E \in \mathcal{A}(X)$ if $E$ is countable or $X-E$ is countable. If $X$ is countable, then $\mathcal{A}(X)$ coincides with the power set $\mathcal{P}(X)$ of $X$. Now suppose that $X$ is uncountable. Assuming the axiom of choice, we can conclude that $\mathcal{A}(X) \ne \mathcal{P}(X)$, since $|X| = |X| + |X|$. So the question is:     Can we prove in ZF that $\mathcal{A}(X) \ne \mathcal{P}(X)$ for every uncountable set $X$?   I'm assuming that a set $X$ is uncountable if there is no injective function $f : X \rightarrow \mathbb{N}$. How to rotate the curve but not the axes? Rewiring a switch controlled receptacle to a ceiling light I have come across numerous questions where I am given the picture such as the above one been asked "how many rectangles are there?". I have even come across some slightly different images that instead of rectangles you are supposed to find the number of triangles. Well, I was thinking whether there is any formula or strategy that is used to solve these problems without having to manually count every shape.  Help would be appreciated.  Thank you :) I have an exercise found on a list but I didn't know how to proceed. Please, any tips?  Let $X$ be a connected subset of a connected metric space $M$. Show that for each connected component $C$ of $M\setminus X$ that $M\setminus C$ is connected. "Knowledge of" vs. "knowledge on" What happens when I terminate a process and the socket send buffer is not empty? In Windows (and probably in other operating systems), if a process has a TCP connection with another process on another machine, and then I terminate the process, an RST packet will be sent to the other machine to indicate the end of the connection.  Now imagine that when the process is terminated, there were still some data left in the send buffer. What will happen in this case, will these remaining data be sent to the other machine followed by an RST packet, or will these remaining data be ignored and only an RST packet is sent? Why didn't Voldemort murder the Dursleys? Voldemort couldn't kill Harry as long as he called the Dursleys home. Why didn't he just murder the Dursleys? This would prevent Harry from being able to live there. I am thinking of building a model predicting a ratio $a/b$, where $a \le b$ and $a &gt; 0$ and $b &gt; 0$. So, the ratio would be between $0$ and $1$.  I could use linear regression, although it doesn't naturally limit to 0..1.  I have no reason to believe the relationship is linear, but of course it is often used anyway, as a simple first model.  I could use a logistic regression, although it is normally used to predict the probability of a two-state outcome, not to predict a continuous value from the range 0..1.  Knowing nothing more, would you use linear regression, logistic regression, or hidden option c? I reviewed  in the First Posts queue.  Which said      i changed it to 'localsystem' and done. thanks much   So it obviously was a potential low quality post. But sometimes such answers can be spot on, so I checked it out, better safe than sorry. I turned out the post had been deleted. Great! So I clicked "No action needed". Then I got this:    You can imagine I felt "wrongfully accused".  I think that deleted posts should not be used for review audits, because the meaning of "No action needed" is not clear in this context. Sphere intersection Stuck I have two spheres that are bounded by spheres for collision detection. I do not want them to intersect. My intersection works. But it gets stuck. Once the function returns true, I cannot get it out. I tried  collideBool = ObjectOne.Intersect(ObjectTwo);  if(collide == true) {     leftright = leftright;     updown = updown; } else { if(GetAsyncKeyState(VK_RIGHT)) leftright -= dt; if(GetAsyncKeyState(VK_LEFT)) leftright += dt; if(GetAsyncKeyState(VK_DOWN)) updown += dt; if(GetAsyncKeyState(VK_UP)) updown -= dt; }  collide = false;   My sphere gets stuck. What is a way around this? I've been using gksudo nautilus and sudo nautilus through Alt+F2.   What's the difference? They look very similar! I have cobbled together a command to return the process ID of a running daemon:  ps aux | grep daemon_name | awk "{ print \$2 }"   It works perfectly and returns the PID, but it also returns a second PID which is presumably the process I'm running now. Is there a way I can exclude my command from the list of returned PIDs?  I've tested it a few times and it appears my command is always the second PID in the list, but I don't want to grab just the first PID in case it's inaccurate. Is there a measurable set $A$ such that $m(A \cap B) = \frac12 m(B)$ for every open set $B$? Is there a measurable set $A$ such that $m(A \cap B)= \frac12 m(B)$ for every open set $B$?  Edit: (t.b.) See also  for further answers. I want to know, is there a way to make a tungsten lightbulbs filament withstand a mass amount of thermal shock while still producing a vast amount of heat? Why don't I have the right to create a text file in my root directory? Where is the cron / crontab log?