How to change multiple values in a file without a second file?
How to modify a text file?
Have red shifted photons lost energy and where did it go? I think the title says it. Did expansion of the universe steal the energy somehow? I've run across (personally or by proxy) a bunch of storage media that exhibited physical problems during their life. Hard disks, solid state drives and other flash storage media all fail after some time. The situation is worse with USB flash drives and flash cards because of the large amount of suppliers with inferior flash cell and flash controller quality.  How can I reliably detect if a storage drive suffers from physical damage?  Note that this question isn't about file system integrity (which can be checked with ). How to completely remove virtualbox I had installed VirtualBox but it started giving me problems. So I uninstalled it using:-  sudo apt-get remove virtualbox-\* sudo apt-get purge virtualbox-\*   But when I reinstalled VirtualBox it again resumed to previous settings and started giving same problems. How can i completely remove VirtualBox from my laptop and then reinstall it such that it wont give same problem again? @class vs. #import Why the middle mouse button in Blender 2.80 changes the orthographic view to perspective? If I choose an orthographic view by using the numpad and then try to orbit the geometry by clicking the middle mouse button Blender goes from orthographic to perspective. Why is that the default now? Wouldn't it be more logical if instead of that Blender kept the orthographic mode? In other words: Why Auto Perspective is turned on by default? Modern movie where rich people can buy a personal assistant that sit in a small egg This is a modern movie and rich people can buy this egg with a personal assistant. It's an actual person in it (or a person's mind). I believe it can even operate a toaster.  I believe later in the movie, a person (or their mind) can be transferred to such an egg. As a punishment, they increase the speed of time inside that egg to make the person inside the egg bored to death, so to speak. proof relating to limit definition of e I'm studying the book A Primer for the Mathematics of FinancialEngineering, along with it's solution guide. I've ran into trouble with the solution to question 7 in chapter 1.    The problem is:  Show that $(1+\frac{1}{x})^x &lt; e &lt; (1+\frac{1}{x})^{x+1}$ .   Specifically, I'm having trouble with one step in the solution.    It says that  $$x\ln\left(1+\frac{1}{x}\right)&lt;1&lt;(x+1)\ln\left(1+\frac{1}{x}\right)$$  can be written as   $$\frac{1}{x+1} &lt;\ln\left(1+\frac{1}{x}\right)&lt;\frac{1}{x}, \forall \ge 1.$$  How can the first equality (or is it inequality?) be written as the second? How do you properly use namespaces in C++? Fastest way to determine if an integer's square root is an integer 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 . Replacing the core of a solenoid to increase the pulling force jQuery appended table adds closing tag at the end of the text automatically. Why? For an irrational number $\alpha$, prove that the set $\{a+b\alpha: a,b\in \mathbb{Z}\}$ is dense in $\mathbb R$ I am not able to prove that this set is dense in $\mathbb{R}$. Will be pleased if you help in a easiest way. $A=\{a+b\alpha: a,b\in \mathbb{Z}\}$ where $\alpha$ is a fixed irrational number. How to insert the content of a file into another file before a pattern (marker)? File1 contents:  line1-file1      "1"  line2-file1      "2" line3-file1      "3"  line4-file1      "4"    File2 contents:  line1-file2     "25"   line2-file2     "24"   Pointer-file2   "23"   line4-file2     "22"  line5-file2     "21"   After the execution of perl/shell script, File2 content should become:  line1-file2     "25"   line2-file2     "24"  line1-file1      "1"  line2-file1      "2" line3-file1      "3"  line4-file1      "4"  Pointer-file2   "23"  line4-file2     "22"  line5-file2     "21"   i.e  paste the contents of File1 in File2 before the line that contains "Pointer". Can domain masking be used to move content from a subdomain to a subdirectory? example.com is hosted on IP address c.c.c.c at host1, no access any windows server admin at all blog.example.com is  on IP a.a.a.a at host2, full access to Linux server admin, using WordPress   So basically, I can fiddle with subdomain all I want.  I can't 301 redirect because the content on host 1 is an eCommerce site that I have no server control over. Can't put WordPress on it, can't run scripts, can't do anything on the server period.  Is there a method to "mask" all the URLs on root blog.example.com so they appear as example.com/blog/ folder?  They can't actually be sent to example.com/blog/ as that doesn't exist. It just needs to look to the surfer as if they are there.  Can this be done with some kind of masking or something?  Will this be better for SEO as hopefully search engines will see the blog in a directory on the main domain? Orthogonality and linear independence [Theorem] Let $V$ be an inner product space, and let $S$ be an orthogonal subset of $V$ consisting of nonzero vectors. Then $S$ is linearly independent.     Also, orthogonal set and linearly independent set both generate the same subspace.  (Is that right?)    Then orthogonal $\rightarrow$ linearly independent but orthogonal $\nleftarrow$ linearly independent is that right?    One more question. For T/F, Every orthogonal set is linearly independent (F) Every orthonormal set is linearly independent (T) Why? Change Proxy Settings In Ubuntu I want to use the Ubuntu Software Center to install software, but I cannot download them.  How can I give my proxy settings in Ubuntu terminal (just like we use cmd in Windows to choose IE proxy settings)? The impression that I got from the  films was that if  was successful, most of the world was going to suffer greatly. Basically everyone would serve Voldemort as slaves or die. So what's the point of serving someone who's probably going to ultimately end up betraying and/or enslaving you? I know the  hated , but is that really enough to justify tearing down Wizard society? Why exactly do the Death Eaters serve Lord Voldemort? Fear? Is the post-Voldemort world not that bad? (I for one welcome our ) Can open, unsafe nuclear fusion reaction burn the atmosphere? I happened to hear people saying that the nuclear fusion bomb tests could set the atmosphere on fire. I have some serious doubts about that - but I have no facts. Nuclear fusion reaction requires $15*10^{6}$ kelvins to start. If we produce such temperature in "open air" would the atmosphere become a fuel for further fusion? Shouldn't the whole thing just be torn apart by its terrible pressure? Pointwise Convergence and Convergence in the mean of Riemann-integrable functions Let $(f_n)_{n\in\mathbb{N}}$ be a sequence of Riemann-integrable functions on $[a, b]$.   Assume that $(f_n)_{n\in\mathbb{N}}$ converges pointwise to $f$ on $[a, b]$ and converges in the mean to $g$ on $[a, b]$, where $f$ and $g$ are both continuous. Show that $f = g$.   ($(f_n)_{n\in\mathbb{N}}$ converges in the mean to g on $[a , b]$ means that $\lim_{n\to\infty} d(f_n, g) = 0$, where $d$ is the $L_2$ metric.)  I am studying real analysis now and want to prove this statement. But I don't know how to use condition "$(f_n)_{n\in\mathbb{N}}$ converges in the mean to g on $[a , b]$." How can I prove this? How can I log into a different Google account? It only shows one of my Google accounts. I want to log into a different one but I don't want them connected in any way. What do I do?