Removing character from string in place
Why do I get a segmentation fault when writing to a "char *s" initialized with a string literal, but not "char s[]"?
Are there any countable Hausdorff connected spaces? Do countable Hausdorff connected topological spaces exist? Should I buy a Canon 55-250mm lens or 70-300mm for my Rebel T3i? I have the basic 18-55mm lens that came with my camera but I need a next step up that's not too expensive.   What are the most common types of photos shot with either lenses? Or what is each lens best for? Too many of your edits were rejected, try again in 7 days First time I've got the following message on SO:     Too many of your edits were rejected,   try again in 7 days.   Although, I have made ~50 accepted edits this day.  I'm sure that should outweigh the ~5 rejected edits, right?    My suggestion:  bool allowEdit(USER u) {     if(u.rejected * 5 &gt; u.accepted)         return(false);     else         return(true); }   Think of it this way: if I do a 1000 accepted edits, and mess up on 5 [rejected], does that mean I should get banned for 7 days?    Hmmm... There seems to be a bug; the message only appears when clicking edit from review.  But otherwise, I can't edit , even when going to it from the homepage. The question is:      Prove that if $p \in \mathbb{Z}$ is irreducible, then $p$ is also prime.    Irreducible is defined as follows: $n \in \mathbb{Z} $ is irreducible iff the only way to write $n=ab$ for some integers $a$ and $b$ is if $a = \pm1$ or $b = \pm1$. Prime is defined as follows: an integer $n$ is prime iff whenever $a,b \in \mathbb{Z} $ and $p\mid ab$ then it must be true that $p\mid a$ or $p\mid b$ (or both).    Hint: Prove that if $n\mid ab$ but $n$ does not divide $a$, then $\gcd(a,n) = \pm1$. Then use Bézout's theorem and prove $n\mid b$. Forward vs Forwards How do I delete a file whose name begins with "-" (hyphen a.k.a. dash or minus)? How do you remove a file whose filename begins with a dash (hyphen or minus) -?  I'm ssh'd into a remote OSX server and I have this file in my directory:  tohru:~ $ ls -l total 8 -rw-r--r--    1 me  staff  1352 Aug 18 14:33 --help ...   How in the world can I delete --help from a CLI?  This issue is something that I come across in different forms on occasion, these files are easy to create, but hard to get rid of.  I have tried using backslash  rm \-\-help   I have tried quotes  rm "--help"   How do I prevent the minus (dash or hyphen) character to be interpreted as an option? "Add" button doesn't work with JavaScript off I'm using stackoverflow.com with JavaScript off. I accept this comes with somewhat less functionality, however for the most part SO works fine.  If I look at the home page (), every single button on there except for two types works with JS off.  The first second is that the "x Votes; y answers;z views" mouse-over indicates they're links but clicking them does nothing. This one is less of an issue because the user can still click the question title, and they're only implied buttons anyway.  The second (and bigger) issue is the "Add" buttons next to "Favorite Tags" and "Ignored Tags". These are explicit buttons that don't do anything with JS off. There is no working JS substitute for them (the "tag subscriptions" link itself works, but the page it goes to doesn't work with JS off, but that's another bug report). How do I get $\cos{\theta} \lt \frac{\sin{\theta}}{\theta} \lt 1$? Ping is a a program owned by root with the user id bit set.  $ ls -l `which ping` -rwsr-xr-x 1 root root 35752 Nov  4  2011 /bin/ping   As I understand it, if a user runs the ping process, then the effective user id will change from the real user id (i.e. the user id of the person who launched the process) to the user id root. However when I try this and look at the output of ps to see if the ping process is running as the root user, I still get the real user id showing.  ps -e -o user,ruser,euser,cmd,args | grep ping sashan   sashan   sashan   ping -i 10 -c 1000 www.goog ping -i 10 -c 1000 www.google.com I am currently facing a "performance problem" while using grep. I am trying to locate the occurrences of many (10,000+) keywords in many (think Linux kernel repository size) files. The objective is to generate a kind of index for each keyword:   keyword: my_keyword filepath 1 filepath 2 ------ keyword: my_keyword2 ...   Being fairly new to shell scripting, I have tried a few naive approaches:  while read LINE; do     echo "keyword: "$LINE &gt;&gt; $OUTPUT_FILE     grep -E -r --include='Makefile*' "($LINE)" . &gt;&gt; "$OUTPUT_FILE"     echo "-----" done &lt; $KEYWORD_FILE   This takes about 45 minutes to complete, with the expected results.  Note: all they keywords I search for are located in a file ("KEYWORD_FILE", so fixed before anything starts), and the files in which to search can be determined before the search starts. I tried to stored the list of files to search in before the search like that:  file_set=( $(find . -name "Kbuild*" -o -name "Makefile*") )   and then replace the grep call by  echo {$file_set[*]} | parallel -k -j+0 -n 1000 -m grep -H -l -w "\($LINE\)" &gt;&gt; "$OUTPUT_FILE"   It takes about an hour to complete&hellip;  Question: considering I can use whatever technique I want, provided it's sh compliant, how can this be done "faster" and/or more efficiently ?  Perhaps grep is not the tool to use, and my use of parallel is wrong&hellip; any ideas are welcome! How do I get an array of repeated characters from a string using LINQ? Are \( and \) preferable to dollar signs for math mode? Along the lines of , what reasons are there (if any) to favor \( ... \) over $ ... $? Eigenvectors of real symmetric matrices are orthogonal Can someone point me to a paper, or show here, why symmetric matrices have orthogonal eigenvectors? In particular, I'd like to see proof that for a symmetric matrix $A$ there exists decomposition $A = Q\Lambda Q^{-1} = Q\Lambda Q^{T}$ where $\Lambda$ is diagonal. If I want to investigate how two continuous variables are linked, what is the difference between calculating the correlation coefficient (Pearson's $r$) versus calculating the (simple linear) regression coefficient?  I see people who, if the regression coefficient is significantly different from zero, talk about the two variables as if they are correlated, which is confusing as it suggests that the two coefficients (correlation, regression) are the same thing.  Having said that, isn't $r$ a measure of the (regression line) slope anyway? I'm confused!! Describe the equivalence classes in terms of familiar mathematical objects Flying Turkish Airlines, what are credit card rules? I have return tickets flying out of SFO on Turkish airlines for the whole family. The credit card I used to book the tickets has since been replaced by the bank with a new card.   In order to board, can I present the new credit card (same name) at the checkin counter, or must I present the original credit card (which is no longer valid and has been discarded)?  By 'discarded' - I mean cut up and thrown away in trash. It was no longer valid, since it was replaced with a new card. So can I use the new card to travel on a booking that was made using the original card?    The new card has a new number; and the ticket was purchased through an agent. Weighted principal components analysis After some searching, I find very little on the incorporation of observation weights/measurement errors into principal components analysis. What I do find tends to rely on iterative approaches to include weightings (e.g., ). My question is why is this approach necessary? Why can't we use the eigenvectors of the weighted covariance matrix? apache2 mod_rewrite redirect without http body I have the problem, that PHP replaces all spaces with underscores in POST and GET variables. For example if I have the URL: http://localhost/proxy.php?user name=Max the browser will convert it to http://localhost/proxy.php?user%20name=Max. But if I give the $_GET parameters out, the key is not user name but user_name (note the underscore)! Is there any possibility to change this behaviour? While I was looking at the values of the zeta function for the first natural numbers, I noticed that the sum of the values minus $1$, converge to $1$. Better put: $$\sum_{n=2}^{\infty} \left(\zeta(n)-1\right) = 1 $$ Furthermore, if you use only the even numbers for the zeta function, the sum will converge to $\frac{3}{4}$, or $$\sum_{n=1}^{\infty} \left(\zeta(2n)-1\right) = \frac{3}{4}$$  Leaving $$\sum_{n=2}^{\infty} \left(\zeta(2n-1)-1 \right)= \frac{1}{4}$$  This is probably common knowledge among mathematicians, but I couldn't find much about it on the internet. Is there a proof of this or perhaps even a simple explanation why this is so?