I want to search for a string and replace it with another string recursively under a directory. for example: I want to search for a string   "var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");"   and replace it with   var _gaq = _gaq || [];_gaq.push(['_setAccount', 'UA-7044592-1']);_gaq.push(['_setDomainName', 'news4u.com']);_gaq.push(['_trackPageview']);   How to achieve it ?
I'm trying to search and replace a string in all files matched by grep: grep -n 'foo' * will give me output in the form: [filename]:[line number]:[text]  For each file returned by grep, I'd like to modify the file by replacing foo with bar.
“Screen overlay detected” dialog? Turned off everything, doesn't work I started receiving the “Screen overlay detected” dialog when trying to change apps settings.  Tried to turn off all "draw over other apps" as it says here - , first without system and then with, but it still doesn't work.  Then, I restored apps to original settings and it just made a bigger mess, dialog continue appearing. Any way to go back to previous settings???  Thanks! Are software titles italicized? The titles of freestanding works (books, movies, plays, albums, etc.) are italicized; smaller parts within these works (chapters in a book, articles in a magazine, songs within an album) are not (they are put in quotes, instead).  How are software titles treated?  My understanding is that if a particular program resembles a book or a dramatic work (like a video game), its title is italicized -- otherwise, it is treated as a proper noun, just like any other product.     I played Grand Theft Auto, instead of reading "Democracy in Ancient Greece" in Microsoft Encarta and preparing my presentation in PowerPoint.   Is this approach correct? I am trying to find and replace the * (star, or shift+8) character in a bunch of formulas in Excel 2007.  * of course matches the ENTIRE contents of the cell, which is not what I want.  How do I disable this behavior? What is the purpose of a serial number? What's the correct way to do division using a backslash? If I write $a/bc + d$, will that be equal to $(a/(bc))+d$?   Basically, if I place a slash, will I divide by what's directly behind the slash $(b)$, the term that's behind the slash $(bc)$, or everything after the slash $(bc+d)$? Whenever I install vsftpd on centos, I only setup the jail environment for the users and rest is default configuration of vsftpd. I create user and try to connect with filezila ftp client, but I could not connect with passive mode. I always change the transfer settings to active mode to successfully connect to the ftp server otherwise I get        Error: Failed to retrieve directory listing   So is there a way to change any directive in vsftp.conf file and we can connect with passive mode to the server? Why does GPS depend on relativity? Intuition for why the sum of Bernoulli trials is a sufficient statistic via cancellations on numerator and denominator? Suppose that $X_1, \ldots, X_n$ are iid Bernoulli trials with parameter $p$, and that $Y = \sum_{i=1}^nX_i$. Then, we have that $Y$ is a sufficient statistic by the following condensed proof:  $$ P(X_1 = x_1,  ... , X_n = x_n |Y = y) = \frac{p^y(1-p)^{n-y}}{\binom{n}{y}  p^y(1-p)^{n-y}} =\frac{1}{\binom{n}{y}}   \text{ if } \sum_{i=1}^{n}x_i = y $$  I am trying to see why this is the case. My reasoning is that there is some cancellation property on top and bottom that "kills" off the parameter $p$. In that whatever is on top through $p$ is perfectly matched by whatever is on the bottom minus scaling factors (in this case $\binom{n}{y}^{-1}$).   However, I am wondering what the deeper meaning behind this is, that the numerator of the joint distribution of the data and the sufficient statistic has its EXACT form on the bottom, except for constants which are only multiplicative (to facilitate cancellations). Am I onto something bigger and deeper here? Farm Solution Vs. SandBox Java Mail API - Encoding problems A woman's butt was allegedly touched by a man several times during a commute on the MRT.   How to use butt, bottom, buttock and ass? I am confusing with these words. What's the difference between absolute path &amp; relative path when using any web server or Tomcat? "Heard me [infinitive]" vs. "heard me [present participle]" "Heard me [infinitive]" vs. "heard me [present participle]"             At that time, you wouldn't have heard me talk about it.   At that time, you wouldn't have heard me talking about it.         At that time, you wouldn't have heard me condemn it.   At that time, you wouldn't have heard me condemning it.         Which one of the above sentences are incorrect and why? How can I recover a deleted file on Android? I just deleted a file on my Nexus S that I really need back. (It was actually part of an app using a sqlite database that did a drop table when upgrading to a new version.)  Presumably I need to root the phone first (which I hear is easy on Nexus phones) but am I in a catch-22 here? Namely, does rooting the phone mean wiping/overwriting the partition where the data lives?  If not, what do you recommend for data recovery tools? Presumably the file was just unlinked and not actively overwritten (per usual when "deleting" a file) so technically the data must be there... Visiting two Schengen countries, coming back home in between, do I apply for single-entry or multiple-entry visa? Assume that the matrices $A,\: B\in \mathbb{R}^{n\times n}$ satisfy  $$ A^k=0,\,\, \text{for some $\,k\in \mathbb{Z^+}$}\quad\text{and}\quad AB=BA. $$  Prove that $$\det(A+B)=\det B.$$ Possible to have 2 unity launchers? Why are there 2 packages for some applications (e.g. Chromium) in Ubuntu Software? When I search for Chromium in Ubuntu Software on Ubuntu 16.04, There are 2 options.    Which one should I select?    The same can be observed with , ,  etc. Prove the existence of an analytic function Let $\Delta=\{z\in \mathbb C: |z| &lt; 1\}$. Let $f: \Delta \rightarrow \mathbb C$ be a one-to-one analytic function fixing the origin. Prove that there is a one-to-one analytic function $g: \Delta \rightarrow \mathbb C$ such that $[g(z)]^2=f(z^2)$. Further, show that such a function is odd.  The only idea which comes to my mind is the following (not sure whether it is the right direction though). Let $h: \Delta \rightarrow \Delta \rightarrow \mathbb C,\ z\mapsto z^2\mapsto f(z^2)$. Note that $h'(0)=0,\ h''(z)=2f'(z^2)+4z^3f''(z^2)$; since $f$ is one-to-one and analytic, its derivative never vanishes, so $h''(0)\ne 0$. So $h$ is an analytic function of $\Delta$ with a zero of order two at the origin. Then there is an analytic function $g$ defined in an open disc about the origin with a simple zero at the origin such that $[g(z)]^2=f(z^2)$.   This is the only thing I came up with, but it seems to be a little bit irrelevant since I don't see any way of extending this $g$ to the whole $\Delta$, and also the injectivity and oddness of such a $g$ are unclear. Finding distance between consecutive points using ArcGIS Desktop?