I'm trying to replace all instances of $timestamp = mysqli_real_escape_string($db_conx, $_POST['Timestamp']); with $timestamp = date("Y-m-d H:i:s"); in all files under /home/user/public_html/  I have tried many variations of the below command but can't seem to get the escaping right!  find /home/user/public_html/ -type f -print0 | xargs -0 sed -i 's/\$timestamp = mysqli_real_escape_string(\$db_conx, \$_POST['\''Timestamp'\'']);/\$timestamp = date(\"Y-m-d H:i:s\");/g'
Take the following script:  #!/bin/sh sed 's/(127\.0\.1\.1)\s/\1/' [some file]   If I try to run this in sh (dash here), it'll fail because of the parentheses, which need to be escaped. But I don't need to escape the backslashes themselves (between the octets, or in the \s or \1). What's the rule here? What about when I need to use {...} or [...]? Is there a list of what I do and don't need to escape?
Prove the Probability of Two Events I'm taking my first course in Probability and one of my homework problems is to prove that for any two sets:  $$P(A \cup B) = P(A) + P(B) - P(A \cap B) $$  Note that the function $P$ is the probability of an event happening.  From the third axiom, we are given that for any two disjoint sets, that is $ A \cap B = \emptyset$:  $$P(A \cup B) = P(A) + P(B)$$    My thought process follows from this third axiom, but I run into a problem near the end:  Since $A$ and $B$ are disjoint sets, $P(A)=P(A-B)$ and $P(B)=P(B-A)$, so  $$P(A \cup B) = P(A) + P(B)=P(A-B)+P(B-A)$$  From this, it appears that we are essentially taking the symmetric difference of A and B.  This, to me, seems to be equivalent to:  $$P(A-B)+P(B-A)=P(A)+P(B)-P(A \cap B)$$  Hence, by my logic:  $$P(A \cup B) = P(A)+P(B)-P(A \cap B)$$  Which, in essence, doesn't care whether two sets are disjoint or not as we are subtracting the intersection of them.  If the sets are disjoint, then the intersection is merely null.  If they intersect, then we are removing the "extra pieces".  I feel like this is inadequate proof despite my ability to convince myself that it is true..  Where, if anywhere, did I go wrong?  Thanks! How to reset Canon 70D WiFi? When I go to the WiFi Settings in Camera (Canon 70D) all I see is:  Connection:   Exit Confirm Set Error Details (greyed out)   I can't recall the password or find any way to reset it. Some I found () say the Camera should say Infrastructure mode. Inside the Confirm Settings I can see on page 3 it shows:     Connect'n method: Camera access point mode   But again I see no way to change this.  On my Smartphone EOS Remote app there's a Connection Guide with completely different menus from what I'm seeing on the Camera.  Any idea how I can reset the WiFi Name and Password on the Canon 70D? The $ l^{\infty} $-norm is equal to the limit of the $ l^{p} $-norms. Get the title instead of the number of a referenced chapter/section? Prevent people from downloading / copying / making a copy of data in Google doc "is" operator behaves unexpectedly with integers I basically need to highlight a particular word in a block of text. For example, pretend I wanted to highlight the word &quot;dolor&quot; in this text: &lt;p&gt;     Lorem ipsum dolor sit amet, consectetuer adipiscing elit. &lt;/p&gt; &lt;p&gt;     Quisque bibendum sem ut lacus. Integer dolor ullamcorper libero.     Aliquam rhoncus eros at augue. Suspendisse vitae mauris. &lt;/p&gt;  How do I convert the above to something like this: &lt;p&gt;     Lorem ipsum &lt;span class=&quot;myClass&quot;&gt;dolor&lt;/span&gt; sit amet, consectetuer adipiscing elit. &lt;/p&gt; &lt;p&gt;     Quisque bibendum sem ut lacus. Integer &lt;span class=&quot;myClass&quot;&gt;dolor&lt;/span&gt; ullamcorper     libero. Aliquam rhoncus eros at augue. Suspendisse vitae mauris. &lt;/p&gt;  Is this possible with jQuery? Edit: As  , this is quite possible without jQuery - but I was hoping there might be a special method of jQuery which would let you do selectors on the text itself. I'm already using jQuery heavily on this site, so keeping everything wrapped up in jQuery would make things perhaps a bit more tidy. What is the expected minimum euclidean distance between $N$ points uniformly and independently chosen on the shell(sphere) of 3-D ball of radius $R$?   Note that the expected minimum distance might be difficult to compute, so a good lower bound is also fine.   My approach  I take the approach similar to this   .   Suppose we put $N$ circles of radius $r$ uniformly on the surface of the ball. Therefore we could compute the expected minimum distance by the following expression \begin{align} E[D]=\int_0^\infty P(D&gt;t) dt. \end{align}  So, it remains to compute  $P(D&gt;t)$. Actually, since we are after a lower bound on  $E[D]$ it is enought to give a lower bound on $P(D&gt;t)$.  Let $S_i$ be the event that the pair of circles does not intersect which should be given by \begin{align} P(S_i) =  \frac{ Surf(R)-Surf(r)}{Surf(R)}= 1-\frac{  \pi r^2}{ 4\pi R^2}=1-\frac{ r^2}{ 4 R^2} \end{align}  Now the probability that euclidean minimum distance $D$ between $N$ balls is bigger than $t$ should be similar to  \begin{align} P[ D \ge t] \stackrel{?}{=}  P[ \cap S_i] \end{align} However, I think we somehow need to converte from the geodesic distance to euclidean distance but I am not very sure how to do that? "The following packages have been kept back:" Why and how do I solve it? I just added a PPA repository for the development version of the GIMP, but I get this error:  $ apt-get update &amp;&amp; apt-get upgrade ... The following packages have been kept back:   gimp gimp-data libgegl-0.0-0 libgimp2.0   Why and how can I solve it so that I can use the latest version instead of the one I have now? Sharepoint 2010 - Deploy webpart as Feature scope = web When does the amount of skew or prevalence of outliers make the median preferable to the mean? I know that "deviations in the data are devil", and when the distribution is highly skewed, it is better to consider median as average rather than mean, but how to decide these hard-limits.  For example:   CASE 1:   Assume X = 10,20,30,40,50,60,70 In this case, I think that it is better to use mean and that it will give very accurate results.  CASE 2:   Assume X = 10,20,30,40,50,60,70,7000 In this case, I think that it is better to use median instead of using the mean.  CASE 3:    Assume X = 10,20,30,400,500,600,700 In this case, I think it is better to use IQR (Inter Quartile Range)    But I'm stuck with how to decide these hard-limits i.e. which to use in which condition, in general.   I've found a tool working on subjected principle, which takes context-less sample-distribution as input and determines whether mean is close/moderate or against the null-hypothesis.  Find References:-     (For Mean Test)  (For Median Test)   What I'm really looking is a good answer which states how to derive these conclusions. Why doesn't Steam start? When I try to start Steam nothing happens. Reinstall doesn't help.  $ steam Running Steam on ubuntu 13.04 64-bit STEAM_RUNTIME is enabled automatically Installing breakpad exception handler for appid(steam)/version(1378500910_client) Installing breakpad exception handler for appid(steam)/version(1378500910_client) Installing breakpad exception handler for appid(steam)/version(1378500910_client) unlinked 0 orphaned pipes removing stale semaphore last operated on by process 7278 with name 0eBlobRegistryMutex_DC7EBB4AEA41D3C6C74E5EFFD6757CEC removing stale semaphore last operated on by process 7278 with name 0eBlobRegistrySignal_DC7EBB4AEA41D3C6C74E5EFFD6757CEC removing stale semaphore last operated on by process 7278 with name 0emSteamEngineInstance removing stale semaphore last operated on by process 7278 with name 0eSteamEngineLock Gtk-Message: Failed to load module "overlay-scrollbar" Installing breakpad exception handler for appid(steam)/version(1378500910_client) [0913/182910:WARNING:proxy_service.cc(958)] PAC support disabled because there is no system implementation   How to fix it? Today I started having the following issues in Pokémon GO:   I can't spin pokéStops and get rewards When I catch pokémon, even the lowest CP ones, they escape every time. I've tried using razz berries, that doesn't work. Neither does using great balls.   I do have Internet. I'm not on wifi. I can send messages and browse Internet.  NOTE: I did try to modify my gps location and I was unsuccessful. I only got a pokémon or two and deleted them immediately. I do apologize for trying to hack it but I'm now fully legit. I'm not sure how password hashing works (will be implementing it later), but need to create database schema now.  I'm thinking of limiting passwords to 4-20 characters, but as I understand after encrypting hash string will be of different length.  So, how to store these passwords in the database? Is it possible that galaxies' redshift is caused by something else than the expansion of space? I was thinking that maybe photons loss energy naturally when they travel great distances.  Or maybe the mass of all matter is increasing over time and therefore photons emitted in the past are necessarily less energetic.  Or is the expansion of space backed up by so much other evidences that trying to find another explanation is completely foolish? Send request for "reason for down vote"? Each question in SO keeps a list of the users who voted it down. As we all know, the list is never shown to anyone. Only the down voter can see which questions he down voted.   Sometimes, down voters down vote rather hastily. Thats okay because no one is perfect (except chuck norris). But sometimes, the down voter might have a good reason to down vote but may not leave a reason behind. As a result, the poster is left wondering if his question is stupid/bad or okay. To remedy this situation, I suggest a feature below -   The poster should have a button "request down voters for reason" which can be pushed only once. The down voters in the down voter list get the notification and can choose to respond to it. I feel that this can serve as a polite reminder to those who down vote a question which would seem to be an okay (if not good) question to most people.   Example of question which I feel should have at least 0 votes -    If okay, then this feature can be combined with -    Do you agree to the proposal ?  As an aside, do you agree that the SO question above should not get negative points ? I read a comment under :     There are plenty of events that can occur that have zero probability.   This reminds me that I have seen similar saying before elsewhere, and have never been able to make sense out of it. So I was wondering    if zero probability and impossibility mean the same? if an event with zero probability doesn't mean that the event is impossible to occur, how probability theory represents/describes impossibility?   Thanks and regards! Weather Resistant Outlets vs Weather Proof Box Can anybody please help me to prove this:  Let $p$ be greater than or equal to $1$. Show that for the space $\ell_p=\{(u_n):\sum_{n=1}^\infty |u_n|^p&lt;\infty\}$ of all $p$-summable sequences (with norm $||u||_p=\sqrt[p]{\sum_{n=1}^\infty |u_n|^p}\ )$, there is an inner product $&lt;\_\,|\,\_&gt; $ s.t. $||u||^2=&lt;u\,|\,u&gt;$ if and only if $p=2$. Been looking to pivot rows (progress_check) into columns check 1, check 2 etc... No sum or totals required, just to display the results hopefully... Can anyone help, Thanks Ad