So, I am trying to have a program kill a child process once control-C is called. I am trying to do it with control-c with this part of my code.:  void signalHandler(int sig_num) {     kill(pidKillTracker, SIGINT);     //signal(SIGINT, signalHandler);     printf("\nChild PID is terminated: %d\n", pidKillTracker);     fflush(stdout); }  int main(int argc, char ** argv) {     signal(SIGINT, signalHandler); //......    Here is the output I show:  :sleep 20 28345^C Child PID is terminated: 28345 :sleep 20 28383^C^C^C^C^C:   The number before ^C is where I print out the child process ID (I fflush after, so its not that). I do it to prove that the signal is killing the child ID correctly.  As you can see, when I call CTRL-C the first time, it works fine and terminates and prints the child process terminated.  YET, the second time I do it, the process won't terminate no matter how many times I hit CTRL-C.  I can't find anything wrong with this code. Also, I am making sure that pidKillTracker is set to the current child process everytime in the parent foreground, right before waitpid(). It is set equal to what comes out of fork() and is the child process. So it should be calling the current child process ID number every time.  Any ideas as to why this won't work a second time?  I have read that it may be suggested that I use sigaction, yet I really am unclear how to use that with what I am doing, not familiar at all with it, even after reading about it. I fail to understand how to use it.   Could someone point me in the right direction to make CTRL-C work more than once?
I was about to add an extra signal handler to an app we have here and I noticed that the author had used sigaction() to set up the other signal handlers. I was going to use signal(). To follow convention I should use sigaction() but if I was writing from scratch, which should I choose?
t-test or z-test: assume normality or s≈σ? Let's say I have a large sample ($n&gt;30$) with mean $\bar{X}$ and standard deviation $S$. I can calculate only: $T=\frac{\bar{X}-\mu}{S/\sqrt{n}}$.  If I want to use t-test for a hypothesis, then I have to assume normality of the population. If I want to use z-test for a hypothesis, then I have to assume that $\boldsymbol{s\approx\sigma}$.  What is the less important assumption? What test should I do? Should I do t-test, z-test or doesn't matter? "Could not identify document class." error when trying to count words I'm trying to count words in a cyrillic LaTeX document with .  I run the command perl texcount.pl index.tex and get following output:  D:\wd&gt;perl texcount.pl index.tex  !!! Could not identify document class. !!! File: index.tex Encoding: utf8 Words in text: 0 Words in headers: 5 Words outside text (captions, etc.): 0 Number of headers: 1 Number of floats/tables/figures: 0 Number of math inlines: 0 Number of math displayed: 0  (errors:1)   index.tex starts with following line:  \documentclass[a5paper,pagesize,10pt,bibtotoc,pointlessnumbers, normalheadings,DIV=9,twoside=false]{scrbook}   So documentclass tag is present.  How can I fix this error? I heard Andrew Ng (in a video I unfortunately can't find anymore) talk about how the understanding of local minima in deep learning problems has changed in the sense that they are now regarded as less problematic because in high-dimensional spaces (encountered in deep learning) critical points are more likely to be saddle points or plateaus rather than local minima.   I've seen papers (e.g. ) that discuss assumptions under which "every local minimum is a global minimum". These assumptions are all rather technical, but from what I understand they tend to impose a structure on the neural network that make it somewhat linear.  Is it a valid claim that, in deep learning (incl. nonlinear architectures), plateaus are more likely than local minima? And if so, is there a (possibly mathematical) intuition behind it?   Is there anything particular about deep learning and saddle points? Today I bought an ibook G4 from a garage sale. The people who sold it to me didn't know the password for the 2 accounts on it. Apparently it was the guys late father's laptop. Any suggestions on how to get into the laptop and set a new admin account and password? This error occurs whenever I try to work with sudo. I changed the permissions of /var/ folder to 777 and I think this causes the error. Please help me get back a functional sudo and /var. REST API composite query: How do I use the result of a query subrequest in the referenceId of another subrequest? Word for person always after what he does not have and not cherishing what he has Possible Duplicate:          Is there a word for a person who is always after what he does not have and does not cherish what he has? If not, any idiom or phrase? The question is to calculate the radius of convergence of $\sum\limits_{n=0}^\infty n!x^{n^2}$.  I dont know how to calculate R.O.C for such type of questions involving $n^2$ as power of x. How do we do this? Any help appreciated. I have the following annoying problem with Excel 2010. I use Conditional formatting to apply bold formatting to each line of the spreadsheet that meets a condition expressed by a formula. In the "applies to", I write =$A$2:$Q$149, which is the current extent of my spreadsheet. But I want this range to grow with my spreadsheet, i.e., I want the formatting to permanently apply to the whole spreadsheet. Regularly, my "applies to" field is transformed into a complex range, that selects most lines of spreadsheet, but not all, like =$A$2:$Q$138;$A$140:$Q$147. Have you ever encountered such a problem? Is there a solution? How to redirect apache /var/www to the home directory and access all the directories and files in my home directory? I have installed Apache(LAMP) web server on my ubuntu machine and I want to do the above mentioned thing.I have tried creating symbolic links in the /var/www directory but it only shows files but not directories inside the directory linked.I want to redirect /var/www to my home folder so that I can access all the files and directories contained therein.Please help me. How do I serialize a C# anonymous type to a JSON string? I'm attempting to use the following code to serialize an anonymous type to JSON:  var serializer = new DataContractJsonSerializer(thing.GetType()); var ms = new MemoryStream(); serializer.WriteObject(ms, thing); var json = Encoding.Default.GetString(ms.ToArray());    However, I get the following exception when this is executed:     Type   '&lt;>f__AnonymousType1`3[System.Int32,System.Int32,System.Object[]]'   cannot be serialized. Consider marking   it with the DataContractAttribute   attribute, and marking all of its   members you want serialized with the   DataMemberAttribute attribute.  See   the Microsoft .NET Framework   documentation for other supported   types.   I can't apply attributes to an anonymous type (as far as I know).  Is there another way to do this serialization or am I missing something? I'm trying to write a blog post which includes a code segment inside a &lt;pre&gt; tag. The code segment includes a generic type and uses &lt;&gt; to define that type. This is what the segment looks like:  &lt;pre&gt;     PrimeCalc calc = new PrimeCalc();     Func&lt;int, int&gt; del = calc.GetNextPrime; &lt;/pre&gt;   The resulting HTML removes the &lt;&gt; and ends up like this:  PrimeCalc calc = new PrimeCalc(); Func del = calc.GetNextPrime;   How do I escape the &lt;&gt; so they show up in the HTML? why each left ideal of this is minimal? Writing to NTFS drive in Linux Is a DNA molecule a single strand of polynucleotide or two of them linked together? I was curious about how other people use the this keyword. I tend to use it in constructors, but I may also use it throughout the class in other methods. Some examples:  In a constructor:  public Light(Vector v) {     this.dir = new Vector(v); }   Elsewhere  public void SomeMethod() {     Vector vec = new Vector();     double d = (vec * vec) - (this.radius * this.radius); } Storing third-party libraries in source control Should libraries that the application relies on be stored in source control? One part of me says it should and another part say's no. It feels wrong to add a 20mb library that dwarfs the entire app just because you rely on a couple of functions from it (albeit rather heavily). Should you just store the jar/dll or maybe even the distributed zip/tar of the project?  What do other people do? Find The Last 3 digits of the number $2003^{2002^{2001}}$ Find The Last 3 digits of the number $2003^{2002^{2001}}$  BY number theory or otherwise,   Also i would like to ask is there a property observed in the numbers of the form $k^n$, where for some $k, n$ is varied then the digits of $k^n$ are periodic,  for example,  $2^n$,  its last digit is periodic with period 4, its second last digit is periodic $4\cdot 5 = 20$ its third last digit is periodic with periodic with period $20\cdot 5 =100$  I have observed this property with other numbers as well, though period might vary,for different values of $k$. How do I remap the keys on my keyboard? I broke my laptop and had to buy a new one with a new keyboard that I am struggling to get familiar with, especially with the keys like home, page-up, page-down and end, which aren't standardized at all.  I found myself doing this for like the 5th time in the last several years, and I think it is really annoying.   Is there an app that can reliably map one key to another?  By reliably I mean that key mapping works with Shift, Alt, and other modifiers.  UPDATE  Windows 7, Samsung Chronos 7 Proof that $\sum\limits_i \frac{(p-1)!}i$ is divisible by $p$