I have a situation where a committed file is reviewed by the bug tracker tool and once it reviews the commit message has to change.  So my question is, Is there a way to change the commit message of a file that is already committed into my local git repository?
I wrote the wrong thing in a commit message.  How can I change the message? The commit has not been pushed yet.
Ideal charging / discharging percentage for maximum battery life? One of my friends has a relatively new Samsung smartphone. He has this app that notifies him whenever the charging is up to 80%, and tells him to unplug the charger.  He tells me that it will increase the number of charging cycles for his battery. He says that if he lets it charge all the way up to 100%, it will mean he has to replace the battery of the phone more often.  Is this true?  Somehow, I feel this is a thing of the past. I thought the internal architecture of batteries these days was made so that it wouldn't drop too low or too high. (In other words, when the phone is at 100%, it isn't really 100%. It's what the battery can safely be charged to in order not to degenerate too much.)  Here's a  which taught me something about this. I'm looking for the fastest way to determine if a long value is a perfect square (i.e. its square root is another integer):    I've done it the easy way, by using the built-in  function, but I'm wondering if there is a way to do it faster by restricting yourself to integer-only domain. Maintaining a lookup table is impractical (since there are about 231.5 integers whose square is less than 263).   Here is the very simple and straightforward way I'm doing it now:  public final static boolean isPerfectSquare(long n) {   if (n &lt; 0)     return false;    long tst = (long)(Math.sqrt(n) + 0.5);   return tst*tst == n; }   Note: I'm using this function in many  problems.  So no one else will ever have to maintain this code.  And this kind of micro-optimization could actually make a difference, since part of the challenge is to do every algorithm in less than a minute, and this function will need to be called millions of times in some problems.    I've tried the different solutions to the problem:   After exhaustive testing, I found that adding 0.5 to the result of Math.sqrt() is not necessary, at least not on my machine. The  was faster, but it gave incorrect results for n >= 410881.  However, as suggested by , we can use the FISR hack for n &lt; 410881. Newton's method was a good bit slower than Math.sqrt().  This is probably because Math.sqrt() uses something similar to Newton's Method, but implemented in the hardware so it's much faster than in Java.  Also, Newton's Method still required use of doubles. A modified Newton's method, which used a few tricks so that only integer math was involved, required some hacks to avoid overflow (I want this function to work with all positive 64-bit signed integers), and it was still slower than Math.sqrt(). Binary chop was even slower.  This makes sense because the binary chop will on average require 16 passes to find the square root of a 64-bit number. According to John's tests, using or statements is faster in C++ than using a switch, but in Java and C# there appears to be no difference between or and switch. I also tried making a lookup table (as a private static array of 64 boolean values).  Then instead of either switch or or statement, I would just say if(lookup[(int)(n&amp;0x3F)]) { test } else return false;.  To my surprise, this was (just slightly) slower. This is because . How do I parse an ISO 8601-formatted date? Prove that $ S=\{0\}\cup\left(\bigcup_{n=0}^{\infty} \{\frac{1}{n}\}\right)$ is a compact set in $\mathbb{R}$. Prove that $ S=\{0\}\cup\left(\bigcup_{n=0}^{\infty} \{\frac{1}{n}\}\right)$ is a compact set in $\mathbb{R}$, but $\bigcup_{n=0}^{\infty} \{\frac{1}{n}\}$ is not a compact set.   (Can we use definition of compact set for this problem? ) "wait more than" vs. "wait FOR more than" If you make him wait (for) more than ten minutes, he'll just walk away.  I found both instances on Google Books:  and . So I'm a bid confused. What is taking up so much space on my disk, beside the filesystem? How to mix three different shaders on the same material? So I came across some difficulties with the &quot;Mix shader&quot; node in cycles. I have 3 textures on a label: gold, paper and rough black letters.  How can I mix these effects? I can make 2 textures work together, but not the 3rd one. Here's the node graph.  Here's the reference. Evaluating string "3*(4+2)" yield int 18 Is there a function the .NET framework that can evaluate a numeric expression contained in a string and return the result? F.e.:  string mystring = "3*(2+4)"; int result = EvaluateExpression(mystring); Console.Writeln(result); // Outputs 18   Is there a standard framework function that you can replace my EvaluateExpression method with? I want to have a vector with a superscript:  \vec{o}^t   But this gives very bad results: the t is overlapping with the vector arrow. How do I fix this (and why does this give bad results in the first place) ? Curious about text alignment on websites. For a blog, for example, is it better to have left-aligned or justified text? I like the look of justified text but I'm not sure if there's any downsides to it. How can an uneducated but rational person differentiate between science and religion? I recently found myself unable to respond to the statement "But the big bang theory is just another creation myth!" during a science vs. religion argument. I found it very difficult to explain the difference between the big bang theory and creation myths without going through a crash course in Newtonian and then Relativistic mechanics.   This had me thinking of the following scenario: Consider a person who for various reasons never got a formal education beyond basic reading and writing. He/She doesn't know any science or math, and was never exposed to any scientific reasoning and experiments. She/He is however an open minded, level headed, and rational person (I've met more than one such person myself).   How would such a person differentiate science from religion? As far as he/she is concerned science has the exact same structure as religion:    A hard to understand scripture: Science treatises and journal papers.  An ordained clergy with a high entry barrier: Doctors, professors, scientists, etc... Seemingly arbitrary injunctions against certain behaviors: "Don't smoke", "Don't pollute",.... Various metaphysical (from his/her perspective) claims about the world around us: The big bang, other galaxies, blackholes, quarks,... Organizations which control and oversee doctrine: The FDA, The NIH, The NFS,...   From his/her perspective, all of these characteristics are no different than the way organized religion presents itself as being the source of truths about the world.   In particular if such a person were to heed the advice of the :         Do not go upon what has been acquired by repeated hearing (anussava),   nor upon tradition (paramparā),   nor upon rumor (itikirā),   nor upon what is in a scripture (piṭaka-sampadāna)   nor upon surmise (takka-hetu),   nor upon an axiom (naya-hetu),   nor upon specious reasoning (ākāra-parivitakka),   nor upon a bias towards a notion that has been pondered over (diṭṭhi-nijjhān-akkh-antiyā),   nor upon another's seeming ability (bhabba-rūpatāya),   nor upon the consideration, The monk is our teacher (samaṇo no garū) Kalamas, when you yourselves know: "These things are good; these   things are not blamable; these things are praised by the wise;   undertaken and observed, these things lead to benefit and happiness,"   enter on and abide in them.'      Following the Buddha's advice (ironically himself a religious figure), such a rational but uneducated person would have just as much reason to doubt the various results of scientists as to doubt the dogmas of organized religion.    How would it be possible for such a person to distinguish scientific facts from religious dogma?  How can we convince such a person of the validity of ideas like those of modern cosmology or evolutionary biology, without first having to teach them enough biology and physics to understand those concepts? How to plot the first n rows of a table using pgfplots? Are we slightly lighter during the day and slightly heavier at night, owing to the force of the Sun's gravity? Using $g = \frac{Gm}{r^2}$, the force on a point mass located at 1 AU from the Sun ($m = 2 \cdot 10^{30} \text{ kg}$) is about ~0.006 N/kg.  Does that mean that, e.g., a 70 kg person is ~42g lighter during the day, and ~42g heavier at night? That seems like it could make a big difference for things like measuring gold bars or other weight-sensitive items. (Gold arbitrage: buy your gold during the day and sell it during the night! Risk-free profit!)  This makes me suspect that I'm overlooking something obvious, because a ~0.05% weight difference seems like something everyone would have noticed long ago. So what am I missing?    Edit: A few answers below indicate that there shouldn't be any weight difference, because the Earth orbits the Sun in free-fall. But if that's the reason, does that mean that a 1:1 tidally-locked Earth-Sun system wouldn't experience differential gravity from the Sun on opposite sides? That doesn't seem right. In H. P. Lovecraft's The Case of Charles Dexter Ward, Dr. Willett      Enters Joseph Curwen's dungeon and resurrects a dead person identified as No. 118 by reciting the incantation of the Ascending Node over his salts.   Dr. Willett is told by      The resurrected Joseph Curwen, impersonating Charles Dexter Ward, who he secretly murdered,   that   " 'twas Number 118, and I conceive you would have shook had you looked it up in my list in t'other room."  No. 118 himself gives Dr. Willett a note asking the doctor to      kill Joseph Curwen.   It soon becomes clear that No. 118 is opposed to the nefarious dealings that have been transpiring and desirous of being an ally of Dr. Willett.  Who is No. 118?  Earlier in the story,      The grave of Ezra Weeden, a primary instigator in Joseph Curwen's initial downfall and the romantic rival of Curwen, is robbed. There doesn't seem to be any other mention of Weeden in the 20th century occurrences, so without a further connection the passage seems superfluous.   The shared goals of these two people seem to indicate that No. 118 may, in fact, have been that person, but the      Note given by No. 118 to Dr. Willett in eighth century Latin seems to indicate someone much older than Ezra Weeden.   It also occurred to me that No. 118 could be      The recently murdered Charles Dexter Ward himself. Ward's reference to killing Dr. Allen (who is actually an alias of Curwen) and dissolving his body with acid and No. 118's mention of doing the same to Curwen seem to support the idea, but that still doesn't explain the archaic note. Ward is described as writing in a somewhat modern style, at least as opposed to Curwen. It also doesn't explain why Curwen would want to murder Ward if he was going to resurrect him later anyway. How can I determine if a C++ object has been deallocated? Repeatedly taking differences on a polynomial yields the factorial of its degree? Padding a number in a filename to a fixed length I have a directory of files such as:  file.1.png file.2.png … file.10.png … file.1000.png file.1001.png …   How can I pad the number to 4 digits? It should end up like this:  file.0001.png file.0002.png … file.0010.png … file.1000.png file.1001.png … Looking for a short story about an insect-like alien captured by humans on its own planet This poor creature is taken aboard the spaceship and the humans do not know that it is intelligent.  The alien can repeat what it hears, e,g, "pass the sugar".  It is able to escape at night and it communicates messages to its fellow aliens.  It directs that they turn up the heat of the atmosphere (somehow they can do this) so as to force the humans to leave.  The alien protagonist states that it will die w/ the humans or leave with them. Both myself and my boyfriend have PS4s.  Can I just get a single PSN account and sign both consoles into the same account, or do I need to get two separate accounts? Example 4.21 in Baby Rudin: Why is the inverse of this function not continuous at this point? Here's Theorem 4.17 in the book Principles of Mathematical Analysis by Walter Rudin, 3rd edition:      Suppose $f$ is a continuous 1-1 mapping of a compact metric space $X$ onto a metric space $Y$. Then the inverse mapping $f^{-1}$ defined on $Y$ by $$ f^{-1}( f(x) ) = x \ \ \ \ \ \ \ ( x \in X ) $$ is a continuous mapping of $Y$ onto $X$.    Now in Example 4.21 Rudin illustrates that compactness of $X$ is essential in Theorem 4.17.   So here is Example 4.21:   Let $X$ be the half open interval $[0, 2 \pi )$ on the real line, and let $\mathbf{f}$ be the mapping of $X$ onto the circle $Y$ consisting of all points whose distance from the origin is $1$, given by $$ \mathbf{f}(t) = ( \cos t, \sin t ) \ \ \ \ \ \ ( 0 \leq t &lt; 2 \pi). $$ Then this function $\mathbf{f}$ is of course continuous and injective. But Rudin asserts that the inverse function is discontinuous at the point $(1, 0) = \mathbf{f}(0)$. How to demonstrate this fact rigorously?  So far in the book, Rudin has not discussed the functions $\cos$ and $\sin$. So can we come up with an example that uses only what Rudin has discussed?