Say I have a double x, whose value is > 0 and &lt; 1 million. I want to move its decimal point left until it is > 1 million and &lt; 10 million. So for example, 23.129385 becomes 2313938.5.  What I'm doing now is just multiplying by 10 until reaching the stopping condition. However I'm performing this algorithm a lot so if I can optimize it somehow it would be helpful. A constant time solution, irrelevant of the magnitude of x, is obviously ideal but so far I haven't been able to come up with one.
What is the most efficient way given to raise an integer to the power of another integer in C?  // 2^3 pow(2,3) == 8  // 5^5 pow(5,5) == 3125
Why does sstatic.net serve cookies? According to :  This is a fast, cookieless domain intended for static content delivered to the   However, all responses from the server set a cookie anyway: $ http https://sstatic.net/ HTTP/1.1 200 OK CF-RAY: 162b88245bc406be-LHR Cache-Control: max-age=604800 Connection: keep-alive Content-Encoding: gzip Content-Type: text/html Date: Sun, 31 Aug 2014 19:11:04 GMT ETag: W/&quot;d5474fdfb5c3cf1:0&quot; Last-Modified: Fri, 29 Aug 2014 18:20:12 GMT Server: cloudflare-nginx Set-Cookie: __cfduid=db60cc6f3e7f6482e37f1f2b85c9dc5881409512264375; expires=Mon, 23-Dec-2019 23:50:00 GMT; path=/; domain=.sstatic.net; HttpOnly Transfer-Encoding: chunked Vary: Accept-Encoding [...]  Is this intentional, or just funny? Edited to add: I understand that the cookie is used to track visiting browsers so that cloudflare can distinguish them from misbehaving hosts using the same or a nearby IP address. However, if the policy is intentionally to serve cookies, then the self-documentation of sstatic.net as a &quot;cookieless domain&quot; is incorrect. Value passed with request.setAttribute() is not available by request.getParameter() How to remove RVM (Ruby Version Manager) from my system Using the expression "the same" for a previously mentioned item How do I avoid the "S to Skip" message on boot? After upgrading my laptop from karmic to lucid, my fat32 partition won't mount automatically. I get the message:  The disk drive for /osshare is not ready yet or not present Continue to wait; or Press S to skip mounting or M for manual recovery   Funny thing is, if I skip, then /osshare/ is mounted once I log in.   I've a similar setup on my desktop, and it works fine. Fstab on desktop:  UUID=4663-6853  /osshare        vfat    utf8,umask=007,gid=46 0       1   /etc/fstab on laptop:  UUID=1234-5678 /osshare vfat utf8,auto,rw,user 0 0 Show that if $n$ is not divisible by $2$ or by $3$, then $n^2-1$ is divisible by $24$.   I thought I would do the following ... As $n$ is not divisible by $2$ and $3$ then $$n=2k+1\;\text{or}\\n=3k+1\;\text{or}\\n=3k+2\;\;\;\;$$for some $n\in\mathbb{N}$. And then make induction over $k$ in each case.$$24\mid (2k+1)^2-1\;\text{or}\\24\mid (3k+1)^2-1\;\text{or}\\24\mid (3k+2)^2-1\;\;\;\;$$This question is in a text of Euclidean Division I'm reviewing, and I wonder if there is a simpler, faster, or direct this way. How can I replace a string in a file(s)? Replacing strings in files based on certain search criteria is a very common task. How can I    replace string foo with bar in all files in the current directory? do the same recursively for sub directories? replace only if the file name matches another string? replace only if the string is found in a certain context? replace if the string is on a certain line number? replace multiple strings with the same replacement replace multiple strings with different replacements Computing the Galois group of polynomials $x^n-a \in \mathbb{Q}[x]$ I have some problems with this exercise. I don't know if it can be done. Consider the polynomial $ x^n - a \in \mathbb{Q} $ Can I compute the Galois group of this over $\mathbb{Q}$? Maybe having a nice "basis.  The splitting field is given by $\mathbb{Q}(\zeta_n,\alpha)$ , where $\zeta_n$ is a primitive root of unity , and $\alpha$ is some number such that $\alpha^n = a $. Well first of all, I want a $\underline{"good basis"}$ for the splitting field. In the sense that the minimal polynomials, of the adjoined elements, are different (in this case the computation of the galois group is very simple).  For example one easy case, it's when $a&gt;0$, then $(a)^{\frac{1}{n}} \in \mathbb{R}$ , so clearly the minimal polynomial of $(a)^{\frac{1}{n}} , \zeta_n$ are distincs, and I'm done. If $n$ is odd then , it's also easy, since one root it's also real, for example $x^3-3 $, the real root is $ \root 3 \of { - 3}  =  - \root 3 \of 3  $ , so I can consider the splitting field as $\mathbb{Q}(-\root 3 \of 3 , \zeta_3 )=\mathbb{Q}(\root 3 \of 3 , \zeta_3 )$. The difficult case is when $n$ is even and $a&lt;0$ , for example  $x^8+20$ or $x^4+20$ in some cases as in the second, there are particular cases since there exist algorithms for the Galois group of quartics, but in general. It can be done?  $\underline{Remark}$ I'm searching a $\underline{"good basis"}$ for the splitting field. In the sense that the minimal polynomials, of the adjoined elements, are different since in this case the computation of the galois group is very simple. I'm having trouble with the exercise in the title, even with part (a), which asks to prove that if $X$ is a closed subset of $\mathbb{P}^n_k$ of dimension at least 1 and $H$ is a non-empty hypersurface, then $X$ and $H$ meet.   Following the hint, I've done the following: By assumption, $X$ is given by $V(I)$ for some homogenous prime ideal $I\subset k[x_0,\dots x_n]=:A$ and $H$ by $V(f)$ for some homogenous polynomial $f\in A$. We wish to prove that there is a homogenous prime ideal $\mathfrak{p}$ (that's not the irrelevant one) containing both $I$ and $f$.  Consider the affine cone $\mathrm{Spec}\ A/I$ of $X$ in $\mathrm{Spec}\ A$. Being homogenous, both $I$ and $f$ are contained in the ideal $(x_0,\dots x_n)$. By Krull's principal ideal theorem, every minimal prime ideal containing $f\mod I$ has codimension one. $X$ having dimension at least one implies that there are homogenous prime prime ideals $\mathfrak{q}\supsetneq \mathfrak{r}\supset I$. This implies that $(x_o,\dots x_n)$ has codimension at least two. Thus there are prime ideals containing $f\mod I$ that are contained in $(x_o,\dots x_n)$. However, I'd need to show that there are homogenous such prime ideals, right? I'd rather get hints than full solutions. Solving a Second Order Constant Matrix Differential Equation Given that $A$ is a constant coefficient matrix, how would one find a non-zero solution to the following equation: $$ x''+2Ax'+A^2x=0 $$ I am thinking this could incorporate systems of linear equations, but I am not sure how to use $x'=Ax$ or $x'=P(t)x +g(t)$ in this situation.   Any hints or suggestions are appreciated. How to create a function to sum the required multiple column I have a scenario where i want to sum the multiple column   The data in the file is :  ID|NAME|SAL|COST|PER|TAG  1|A|10|10|20|10|  1|B|10|15|20|10|  1|C|10|17|25|80|  1|D|115|110|20|100|  1|E|10|10|10|10|   i want sum of COLUMN - SAL | COST | PER | TAG   one i did with simple command but how to do by creating function  awk '{FS="|"}{s+=$3}END{print s}' file.txt   The function should be parameterised so that when i pass column name it should calculate sum for that column   The sum column's may differ. their may be requirement like only two column sum needed then it should take the two column names and process the sum for that Explain why $\mathbb{Z \times Z}$ and $\mathbb{R \times R}$ is not a field The batcave, in any version of Batman, is large.  Plus there's the batmobile, which required special construction, plus the batcomputer and numerous other batwidgets.  How did a good sized batcave get built without the land above it being torn up and without requiring a huge construction crew?  And, after the cave was built, how was the batmobile built in secret, without someone involved in it being able to make the connection between the car they built and the one that shows up in the news when Batman is first seen?  (While he's in Gotham, a masked vigilante is news that would end up nation wide.)  There would also be the need for secrecy so vilains can't find out how it is built and what the specs are.  And then there's the continual supply of batwidgets.  Just as with the batmobile, there's the need for these items and how they work to be kept secret.  It'd take several factories to produce all that Batman uses and major construction for any batcave I've seen (which is in movies and on TV).  How is all this done in secret?  (Or is there a trail of bodies?) AJAX call using admin-ajax URL is returning 400 bad request Allow bounty to be set with reputation from another site? When app is moved to SD card, where is the app data stored on SD card? System of congruences with variable I am looking over , and I came across a solution containing this:  Problem Bernardo chooses a three-digit positive integer $N$ and writes both its base-5 and base-6 representations on a blackboard. Later LeRoy sees the two numbers Bernardo has written. Treating the two numbers as base-10 integers, he adds them to obtain an integer $S$. For example, if $N = 749$, Bernardo writes the numbers $10,\!444$ and $3,\!245$, and LeRoy obtains the sum $S = 13,\!689$. For how many choices of $N$ are the two rightmost digits of $S$, in order, the same as those of $2N$? $\textbf{(A)}\ 5 \qquad\textbf{(B)}\ 10 \qquad\textbf{(C)}\ 15 \qquad\textbf{(D)}\ 20 \qquad\textbf{(E)}\ 25$ Solution 1 First, we can examine the units digits of the number base 5 and base 6 and eliminate some possibilities. Say that $N \equiv a \pmod{6}$ also that $N \equiv b \pmod{5}$ Substituting these equations into the question and setting the units digits of $2N$ and $S$ equal to each other, it can be seen that $b &lt; 5$ (because otherwise $a$ and $b$ will have different parities), and thus $a=b$. $N \equiv a \pmod{6}$, $N \equiv  a \pmod{5}$, $\implies N=a \pmod{30}$, $0 \le a \le 4$ Therefore, $N$ can be written as $30x+y$ and $2N$ can be written as $60x+2y$ Just keep in mind that $y$ can be one of five choices: $0, 1, 2, 3,$ or $4$, ; Also, we have already found which digits of $y$ will add up into the units digits of $2N$. Now, examine the tens digit, $x$ by using $\mod{25}$ and $\mod{36}$ to find the tens digit (units digits can be disregarded because $y=0,1,2,3,4$ will always work) Then we take $N=30x+y$ $\mod{25}$ and $\mod{36}$ to find the last two digits in the base $5$ and $6$ representation.[N \equiv 30x \pmod{36}][N \equiv 30x \equiv 5x \pmod{25}]Both of those must add up to[2N\equiv60x \pmod{100}] $N\equiv{30x\mod{36}}\\N\equiv{30x}\equiv{5x\mod{25}}$ Both of these must add up to $2N\equiv{60x\mod{100}}$ [...]  I'm not really sure which modular arithmetic rule to apply in the final three congruences, or where to start. How would I go about understand this? Understanding central limit theorem What is wrong with the following sentence:      The Central Limit Theorem  implies that, as the sample size grows, the error distribution approaches normality.   Am I correct by saying that it should in stead state the MEAN of the sample error approaches zero as sample size grows? I had booked a ticket for travel through Indian Railways using IRCTC and got a confirmed ticket. While booking, I forgot to mention the details of a one year old child who will also be traveling.     Will it create any problem while boarding the train? How do I give text or an image a transparent background using CSS?