I'm working with .net core, and I having some issues formatting one number.  I have a decimal like this   decimal d = 362250;   And i want to show it rounded to 4 digits   3623    I was reading both  and  but i wans't be able to do it  I try :  Console.WriteLine($"{d:####}"); //show 362250 Console.WriteLine($"{d:####,}"); //show 362   How can i achieve that?  I know its so simple, but I fighting with it for 2 hours!
If I have a double (234.004223), etc., I would like to round this to x significant digits in C#.  So far I can only find ways to round to x decimal places, but this simply removes the precision if there are any 0s in the number.  For example, 0.086 to one decimal place becomes 0.1, but I would like it to stay at 0.08.
showing that a group of order 45 is abelian I'm trying to understand the following proof from Dummit &amp; Foote (pg. 137) which shows why a group of order 45 is abelian. I understand everything but the last two sentences. Why is it that $|G/C_G(P)|=1$? Also, is it always true that $G/Z(G)$ is abelian? Thank you! Determining user's reputation as of particular date? I would like to programmatically - or with the API determine what a user's reputation is on a particular day. As such, I have found this link:   However, it does not outline a programmatic method to do so. Comaximal ideals in a commutative ring Let $R$ be a commutative ring and $I_1, \dots, I_n$ pairwise comaximal ideals in $R$, i.e., $I_i + I_j = R$ for $i \neq j$. Why are the ideals $I_1^{n_1}, ... , I_r^{n_r}$ (for any $n_1,...,n_r \in\mathbb N$) also comaximal? I am currently facing a "performance problem" while using grep. I am trying to locate the occurrences of many (10,000+) keywords in many (think Linux kernel repository size) files. The objective is to generate a kind of index for each keyword:   keyword: my_keyword filepath 1 filepath 2 ------ keyword: my_keyword2 ...   Being fairly new to shell scripting, I have tried a few naive approaches:  while read LINE; do     echo "keyword: "$LINE &gt;&gt; $OUTPUT_FILE     grep -E -r --include='Makefile*' "($LINE)" . &gt;&gt; "$OUTPUT_FILE"     echo "-----" done &lt; $KEYWORD_FILE   This takes about 45 minutes to complete, with the expected results.  Note: all they keywords I search for are located in a file ("KEYWORD_FILE", so fixed before anything starts), and the files in which to search can be determined before the search starts. I tried to stored the list of files to search in before the search like that:  file_set=( $(find . -name "Kbuild*" -o -name "Makefile*") )   and then replace the grep call by  echo {$file_set[*]} | parallel -k -j+0 -n 1000 -m grep -H -l -w "\($LINE\)" &gt;&gt; "$OUTPUT_FILE"   It takes about an hour to complete&hellip;  Question: considering I can use whatever technique I want, provided it's sh compliant, how can this be done "faster" and/or more efficiently ?  Perhaps grep is not the tool to use, and my use of parallel is wrong&hellip; any ideas are welcome! Compactness of  Multiplication Operator on $L^2$ Suppose we have an bounded linear operator A that operates from $L^2([a,b]) \mapsto L^2([a,b])$.  Now suppose that $A(f)(t) = tf(t)$.    Is A compact?  Edit: I know $A = A^*$ but I'm not really sure how to start on this.  It's not homework, just summer fun :D Does commutativity imply Associativity? Convergence of cos, sin, tan functions In Radian mode, continually pressing the $\cos$ function of a number causes the result to converge to $x=0.739085133$, a fixed point of $\cos(x)$. Repeating this behavior with the $\sin$ function causes the result to converge to $x=0$, a fixed point of $\sin(x)$.   What happens if this is done using the tan function? It seems that $x=0$ is a repelling fixed point with no convergence in this case.  What would be the best way to explain these results mathematically? My PC has 8 Gb of ram. Is there any way to make ubuntu use most of it? I mean rarely drop caches and keep once opened programms in ram longer, preload apps on boot, etc. Question I use pgfplots with the ultra thick option ans without explicitly giving the domain for the y-axis. It seems that in this case, some part of my graph is &quot;eaten&quot; by the margin: see the picture below to understand what I mean. Is there a way to avoid this? Code \documentclass{article} \usepackage{pgfplots} \begin{document}  \begin{tikzpicture}  \pgfplotsset{every axis/.append style={                     axis x line=middle,    % put the x axis in the middle                     axis y line=middle,    % put the y axis in the middle                     axis line style={-&gt;},  % arrows on the axis                     xlabel={$x$},          % default put x on x-axis                     ylabel={$y$},          % default put y on y-axis                     grid = major                     }}  \begin{axis}[xmin=-5,xmax=5] \addplot[orange,smooth, ultra thick] {sin(deg(x))} ;                  \end{axis} \end{tikzpicture}  \end{document} I found the below in  web-site:     We use much in questions and negative clauses to talk about degrees of something.      We don’t use much in affirmative clauses.   Also, it the same web-site, I found the following:     She runs much faster than he does.    also I noticed that some web-sites use much with affirmative clauses:     May we all be having this much fun and getting this much exercise when we're his age!    Is it Okey to use much in affirmative clauses? If yes, when can we use it? and what is the rules?  Update:  Here is another example on how often the word "much" is used  in informal style:     After much consideration I will NOT be performing at the Inauguration with my improv group Capitol Hill-arious How can I implement "cut outs" for lighting in OpenGL? Cause of Alpha or Black Artefacts in Render I just bought a Ryanair plane ticket except that I did not see the QR code on the boarding pass, is that normal? the message is &quot;&quot;. thank you. How to force Logger.debug output in Play! framework specs2 tests? Parsing Command Prompt Output I am retrieving disk information via JavaScript with the wmic statement, wmic logicaldisk get freespace,name,size,volumename, which produces the following output, but in a single string.    "FreeSpace      Name  Size           VolumeName  " "560232755200   C:    999526756352   System      " "999369699328   D:    999558213632   SSD         " "1511570386944  E:    8001545039872  Get         " "4620751712256  F:    8001545039872  BR          " "788449492992   G:    4000650883072  Seen        " "2296009408512  H:    4000768323584  Seen 2      " "3594248679424  I:    8001545039872  2160        " "3507750227968  J:    8001545039872  1080        " "945300619264   K:    999625322496   Trailers    "   I parse the above output with the following JavaScript.  window.onload = function(){   const cp = require('child_process')   let drives   cp.exec('wmic logicaldisk get freespace,name,size,volumename', (error, stdout)=&gt;{     drives = stdout.trim().split('\r\r\n')       .map(value =&gt; value.trim().split(/\s{2,0}/))       .slice(1)   }) }   That JavaScript already produces my desired output. It produces an array of nested arrays. Each row of information in the command prompt output corresponds to a nested array. Each nested array has four values that correspond to the originally queried data points.  [   ["560232439808",  "C:", "999526756352",  "System"  ]   ["999369699328",  "D:", "999558213632",  "SSD"     ]   ["1511570386944", "E:", "8001545039872", "Get"     ]   ["4620751712256", "F:", "8001545039872", "BR"      ]   ["788449492992",  "G:", "4000650883072", "Seen"    ]   ["2296009408512", "H:", "4000768323584", "Seen 2"  ]   ["3594248679424", "I:", "8001545039872", "2160"    ]   ["3507750227968", "J:", "8001545039872", "1080"    ]   ["945300619264",  "K:", "999625322496",  "Trailer" ] ]   I am wondering whether or not there is a way to similarly parse the information, but with command prompt instead? Help with null hypothesis Eclipse Shortcut to Split Long Strings I swear I've seen someone do this, but I can't find it in the various lists of shortcuts.  Given:  String s = "A very long ............................ String";   Is there an Eclipse shortcut to turn it into:  String s = "A very long ............................ "      + "String"; How do you do load testing and capacity planning for databases? This is a  about capacity planning for databases. Related:      I'm looking to create a canonical question of tools and methods of capacity planning for databases. This is intended to be a canonical question. Obviously, the general workflow is:  Put your scenario in place Add monitoring Add traffic Evaluate results Remediate based on results Rinse, repeat until reasonably happy  Please feel free to describe different tools and techniques for different web-servers, frameworks, etc., as well as best-practices. Expectation of a function of a random variable from CDF Is it possible to calculate the expectation of a function of a random variable with only the the r.v.'s CDF? Say I have a function $g(x)$ that has the property $\int_{-\infty}^{\infty}g(x)dx \leq \infty $ and the only information I have about the random variable is the CDF.  For example, I have a scenario where there are three timers that can be modeled as exponential random variables $X_1,X_2,X_3$ with rate parameters $\lambda_1,\lambda_2,\lambda_3$ respectively. For each moment in time I earn a reward according to some reward function $g(x)$. That is, my reward for waiting until time $t$ can be written as $\int_0^tg(x)dx$. However, $g(x)$ experiences diminishing returns so the the marginal reward received from waiting one second at $t=0$ is greater than one second at say $t=27$. This 'game' ends when one of two things happens. Either both timers $X_1$ or $X_2$ must ring or timers $X_1$ or $X_3$ must ring. I'm trying to find the expected reward of playing this game.  Currently I can calculate the the CDF of the random variable modeling the time until the game ends, but I dont know how to use this information to when what I really need is reward associated with this time.  So far I have the additional random variables: $$ W_{12}=\max(X_1,X_2) \quad W_{13}=\max(X_1,X_3) \quad Z=\min(W_{12},W_{13})$$ Also let $F_i(x), i\in \{1,2,3\}$ denote the CDF of $X_i$ The CDF of $Z$, can be written as: $$F_Z(t) = F_1(t)F_2(t) + F_1(t)F_3(t) - F_1(t)F_2(t)F_3(t)$$  I know when a random variable takes on non-negative values, you can use a shortcut to calculate the expectation using the CDF. That is, $E[X] = \int_0^\infty F(X\geq x)dx$. Is there something similar I could use for a function of a random variable, or is it necessary to compute the pdf of $Z$ first to compute $\int_0^\infty g(t)f_z(t)dx$ Combine the first two commits of a Git repository? Suppose you have a history containing the three commits A, B and C:  A-B-C   I would like to combine the two commits A and B to one commit AB:  AB-C   I tried  git rebase -i A   which opens up my editor with the following contents:  pick e97a17b B pick asd314f C   I change this to  squash e97a17b B pick asd314f C   Then Git 1.6.0.4 says:  Cannot 'squash' without a previous commit   Is there a way or is this just impossible?