Rounding up to the next 10 cents (dime) in C#
How do you round a number to two decimal places in C#?
Can we have some tools to handle link rot? There are many links posted in answers, and some in questions, that are either stale or broken.  An example is the change to  on-line documentation this year to do away with separate 'Optional' and 'Core' tasks areas in the documentation - the old links 404 now.  I've fixed a bunch of 'optionaltasks' broken links, but searching for 'coretasks' in Stack&nbsp;Overflow questions returns over 300 matches...  Are there any tools for us to review and fix these - with an emphasis on the fixing - without sifting through completely manually?  Is it time for some refactoring tools for Stack&nbsp;Overflow content, in particular, for links?  Also, I'd be interested to know if there is an analysis of links (as found in the Stack&nbsp;Overflow data dumps) out there. Answer: there is a  of a sample of links and images, but it's getting a bit out-of-date. What exactly do quotation marks around the table name do? I thought that the quotation mark (") was simply a type of grouping marker but I'm debugging some NHibernate code and notice that while  SELECT * FROM site WHERE site_id = 3;   Works fine  SELECT * FROM "site" WHERE site_id = 3;   fails with a table or view does not exist error.  What gives? Can I get individual man pages for the bash builtin commands? Is there anywhere you can download a manpage for every builtin commands?  I know you can just use help or man bash and search to find info about it, but I want them separated, so I can just do man read and get the read manpage. Making holes in a mesh Direct Proof that $1 + 3 + 5 + \cdots+ (2n - 1) = n\cdot n$ Prove that for all integers $n$, $n \geq 1$,   $$1 + 3 + 5 + \cdots + (2n - 1) = n\cdot n$$   How would I go about proving this? Electron Flow Confusion Using conventional notation in the diagram below, I understand that the circuit is not complete because the diode is in reverse bias. But knowing that the electrons actually flow from the negative to the positive terminal(direction of the arrows), wouldn't the electrons take a path from the negative terminal of the battery, go through the lamp and stop at the diode(the red path in the picture). If they would, then why doesn't the lamp light up with the first electrons that are able to flow through it before the voltage in the wire is built up and the current stops. Why is the CDF of a sample uniformly distributed I read  that given a sample $ X_1,X_2,...,X_n $ from a continuous distribution with cdf $ F_X $, the sample corresponding to $ U_i = F_X(X_i) $ follows a standard uniform distribution.  I have verified this using qualitative simulations in Python, and I was easily able to verify the relationship.  import matplotlib.pyplot as plt import scipy.stats  xs = scipy.stats.norm.rvs(5, 2, 10000)  fig, axes = plt.subplots(1, 2, figsize=(9, 3)) axes[0].hist(xs, bins=50) axes[0].set_title("Samples") axes[1].hist(     scipy.stats.norm.cdf(xs, 5, 2),     bins=50 ) axes[1].set_title("CDF(samples)")   Resulting in the following plot:    I am unable to grasp why this happens. I assume it has to do with the definition of the CDF and it's relationship to the PDF, but I am missing something...  I would appreciate it if someone could point me to some reading on the subject or help me get some intuition on the subject.  EDIT: The CDF looks like this: Jordan Canonical Form determined by characteristic and minimal polynomials in dimension $3$, but not beyond Why and how is the  of a matrix in $M_3(\mathbb C)$ fully determined by its characteristic and minimal polynomials? And why does it fail for $n &gt;3$?   Thanks. Prove that $i^i$ is a real number Is my Ubuntu vulnerable to SambaCry? I read these two threads:         And I got a little bit worried, is my Ubuntu machine safe? Or am I vulnerable to this vulnerability?  The second article mentioned that:     The flaw actually resided in the way Samba handled shared libraries.   The other thing that they say is all versions from versions 3.5.0 onwards since 2010 are vulnerable.     At that time, nearly 485,000 Samba-enabled computers were found to be exposed on the Internet, and researchers predicted that the SambaCry-based attacks also have potential to spread just like WannaCry ransomware widely.   .   I don't have a samba server however I've got samba-libs package installed.  What, if anything, should I do?  I'm running Ubuntu 16.04. What is a more efficient way to draw this tree? I have drawn the following tree in TikZ. What I don't like about it is   that I have to manually adjust the sibling distance for each level; and the syntax is too cumbersome.   It has been suggested to me by @percusse and @AlanMunn that using tikz-qtree and/or forest may be a more efficient way to produce the same result. But I don't have experience in using either package.   It would be nice if someone can reproduce my example using either of these packages, so that I can have quick example to learn from instead of reading a 150-page manual trying to find an answer.    \documentclass{standalone} \usepackage{tikz} \usepackage{amsmath}  \begin{document}  \tikzset{   % Two node styles for game trees: solid and hollow   solid node/.style={circle,draw,inner sep=1.2,fill=black},   hollow node/.style={circle,draw,inner sep=1.2}, }  % macro for entering payoffs \newcommand\payoff[1]{   $\begin{pmatrix} #1 \end{pmatrix}$ }  \begin{tikzpicture}[font=\footnotesize]   \tikzset{     level 1/.style={level distance=15mm,sibling distance=65mm},     level 2/.style={level distance=15mm,sibling distance=30mm},     level 3/.style={level distance=15mm,sibling distance=15mm},     level 4/.style={level distance=15mm,sibling distance=10mm},   }    \node[hollow node,label=above:{Nature}]{}     child{node[solid node,label=left:{P1}]{}       child{node(l1)[solid node]{}         child{node[solid node,label=below:{\payoff{1\\-1}}]{}edge from parent node[left]{L}}         child{node[solid node,label=below:{\payoff{0\\0}}]{}edge from parent node[right]{R}}         edge from parent node[left]{U}       }       child{node(l2)[solid node]{}         child{node[solid node,label=below:{\payoff{0\\0}}]{}edge from parent node[left]{L}}         child{node[solid node,label=below:{\payoff{2\\-2}}]{}edge from parent node[right]{R}}         edge from parent node[right]{D}       }       edge from parent node[left,xshift=-10]{A}     }     child{node[solid node,label=right:{P1}]{}       child{node(r1)[solid node]{}         child{node[solid node,label=below:{\payoff{-2\\2}}]{}edge from parent node[left]{L}}         child{node[solid node,label=below:{\payoff{0\\0}}]{}edge from parent node[right]{R}}         edge from parent node[left]{U}       }       child{node(r2)[solid node]{}         child{node[solid node,label=below:{\payoff{0\\0}}]{}edge from parent node[left]{L}}         child{node[solid node,label=below:{\payoff{-1\\1}}]{}edge from parent node[right]{R}}         edge from parent node[right]{D}       }       edge from parent node[right,xshift=10]{B}     }   ;    \draw[dashed](l1)--(l2)--node[midway,above]{P2}(r1)--(r2); \end{tikzpicture}  \end{document} Can a lambda function call itself recursively in Python? A regular function can contain a call to itself in its definition, no problem.  I can't figure out how to do it with a lambda function though for the simple reason that the lambda function has no name to refer back to.  Is there a way to do it?  How? How do I fix my locale issue? What does an ampersand after this assignment operator mean? I find myself repeating a lot of:  mkdir longtitleproject cd longtitleproject   Is there a way of doing it in one line without repeating the directory name? I'm on bash here. 'No Such File or Directory" Error When Working with Shared File I'm attempting to open a file on a Linux computer through file sharing. The file is stored on a Macbook Pro and both computers are running Blender 2.77. However, when I try to open the file on the Linux computer, I get an error of, "No Such File or Directory." I don't think this is a file permissions error as my permissions settings are set so that "Everyone" can read and write my file. What can I do to solve this? combinatorics: sum of product of integer compositions Norm $N$ on $\Bbb Z[\sqrt d]$ is multiplicative, $N(x)$ prime $\Rightarrow x$ irreducible Java FileReader encoding issue I tried to use java.io.FileReader to read some text files and convert them into a string, but I found the result is wrongly encoded and not readable at all.  Here's my environment:   Windows 2003, OS encoding: CP1252 Java 5.0   My files are UTF-8 encoded or CP1252 encoded, and some of them (UTF-8 encoded files)  may contain Chinese (non-Latin) characters.  I use the following code to do my work:     private static String readFileAsString(String filePath)     throws java.io.IOException{         StringBuffer fileData = new StringBuffer(1000);         FileReader reader = new FileReader(filePath);         //System.out.println(reader.getEncoding());         BufferedReader reader = new BufferedReader(reader);         char[] buf = new char[1024];         int numRead=0;         while((numRead=reader.read(buf)) != -1){             String readData = String.valueOf(buf, 0, numRead);             fileData.append(readData);             buf = new char[1024];         }         reader.close();         return fileData.toString();     }   The above code doesn't work. I found the FileReader's encoding is CP1252 even if the text is UTF-8 encoded. But the JavaDoc of java.io.FileReader says that:     The constructors of this class assume   that the default character encoding   and the default byte-buffer size are   appropriate.   Does this mean that I am not required to set character encoding by myself if I am using FileReader? But I did get wrongly encoded data currently, what's the correct way to deal with my situtaion? Thanks. How do I use tab stops in enumerate or itemize? Current code is:  \begin{enumerate}[label=LEVEL \arabic{*},leftmargin=*]     \item Description of Level 1 \quad L1 \\ \emph{more text}     \item Description of Level 2 \quad L2 \\ \emph{more text}  \end{enumerate}   but the \quad does not align L1 and L2 uniformly vertically. I want to replace \quad with a tab but the tabbing environment does not allow mixing with an enumerate!