Determining if Thread is sleeping
How to check if a thread is sleeping?
Possible Duplicate:          I was thinking about making a pacman clone, I know there is a similar question here  , but I know i can't use the original art from the game because it belongs to Namco, so if I design a character that has the shape of the slice circle it will look exactly like pacman, maybe if I use green instead of yellow? Also if the game plays like the original pacman, it is wrong?  I just want to make the game as a personal project and and publish it in my site without getting in trouble How can I have  for Ubuntu? Proof conclusion to: Let m,n $\in$ $\mathbb{N}$ $\backslash$ $\{0\}$ . Prove that $s |\tau (m^{s}) - \tau(n^{s})$, where $\tau$ is a divisor function.   Hello, so I have a tiny question about the summarization of my proof.  I got to the point where I defined my $\tau$ divisor function and got them both $\tau(m^s)$= $\prod$ something +1 and $\tau(n^{s})$ = $\prod$ something +1.    I've noticed that the last terms of the polynomial are both one. Why is it with the +1 part, I can conclude with that:  s| $\tau(m^s)$ - $\tau(n^s)$.   The line for why that is, isn't quite clear. The idea behind the sum of powers of 2 I know that the sum of power of $2$ is $2^{n+1}-1$, and I know the mathematical induction proof. But does anyone know how $2^{n+1}-1$ comes up in the first place.  For example, sum of n numbers is $\frac{n(n+1)}{2}$. The idea is that we replicate the set and put it in a rectangle, hence we can do the trick. What is the logic behind the sum of power of $2$ formula? Why is ANOVA taught / used as if it is a different research methodology compared to linear regression? ANOVA is equivalent to linear regression with the use of suitable dummy variables. The conclusions remain the same irrespective of whether you use ANOVA or linear regression.   In light of their equivalence, is there any reason why ANOVA is used instead of linear regression?   Note: I am particularly interested in hearing about technical reasons for the use of ANOVA instead of linear regression.   Edit  Here is one example using one-way ANOVA. Suppose, you want to know if the average height of male and females is the same. To test for your hypothesis you would collect data from a random   sample of male and females (say 30 each) and perform the ANOVA analysis (i.e., sum of squares for gender and error) to decide whether an effect exists.  You could also use linear regression to test for this as follows:  Define:  $\text{Gender} = 1$ if respondent is a male and $0$ otherwise. $$ \text{Height} = \text{Intercept} + \beta * \text{Gender} + \text{error} $$ where: $\text{error}\sim\mathcal N(0,\sigma^2)$  Then a test of whether $\beta = 0$ is a an equivalent test for your hypothesis. Is there a package to secure rendered pdf with a password? Is there a package and command that can secure rendered pdf with a password? I am a grad student developing an interest for statistics. I like the material over-all, but I sometimes have a hard time thinking about applications to real life. Specifically, my question is about commonly used statistical distributions (normal - beta- gamma etc.). I guess for some cases I get the particular properties that make the distribution quite nice - memoryless property of exponential for example. But for many other cases, I don't have an intuition about both the importance and application areas of the common distributions that we see in textbooks.   There are probably a lot of good sources addressing my concerns, I would be glad if you could share those. I would be a lot more motivated into the material if I could associate it with real-life examples. Possible Duplicate:          Is it correct to start a sentence with did.     Did my work.   instead of      I did my work.   while answering my emails? Sort lines based on a variable-width number at a fixed position Difference between myself and by myself I would like to either prevent or handle a StackOverflowException that I am getting from a call to the XslCompiledTransform.Transform method within an Xsl Editor I am writing. The problem seems to be that the user can write an Xsl script that is infinitely recursive, and it just blows up on the call to the Transform method.  (That is, the problem is not just the typical programmatic error, which is usually the cause of such an exception.)  Is there a way to detect and/or limit how many recursions are allowed?  Or any other ideas to keep this code from just blowing up on me? GoogleApiClient.isConnected() return always false How do you split a long exact sequence into short exact sequences? How does one split up a long exact sequence into short exact sequences?  Say you have some longs exact sequences of modules $$ 0\longrightarrow M_1\stackrel{\phi_1}{\longrightarrow}M_2\stackrel{\phi_2}{\longrightarrow}M_3\stackrel{\phi_3}{\longrightarrow}M_4\stackrel{\phi_4}{\longrightarrow}\cdots $$ I've read it's possible to split this into short exact sequences. What exactly does that mean? Would it be written as short exact sequences, one appended to another like $$ 0\longrightarrow N_1\longrightarrow M_1\longrightarrow N&#39;_1\longrightarrow 0\longrightarrow N_2\longrightarrow M_2\longrightarrow N&#39;_2\longrightarrow 0 \longrightarrow\cdots? $$ If so, how does this work? Merci. Why do we need a diagonal matrix? Apart from simplifying matrix powers, why do want to diagonalize a matrix? Do they have any appealing application which can be used to motivate to study diagonal matrices.  Thanks for any answers. Internet is working, but Firefox 67 browser cannot connect after update I'm having some trouble understanding the purpose of a salt to a password.  It's my understanding that the primary use is to hamper a rainbow table attack.  However, the methods I've seen to implement this don't seem to really make the problem harder.  I've seen many tutorials suggesting that the salt be used as the following:  $hash =  md5($salt.$password)   The reasoning being that the hash now maps not to the original password, but a combination of the password and the salt.  But say $salt=foo and $password=bar and $hash=3858f62230ac3c915f300c664312c63f.  Now somebody with a rainbow table could reverse the hash and come up with the input "foobar".  They could then try all combinations of passwords (f, fo, foo, ... oobar, obar, bar, ar, ar).  It might take a few more milliseconds to get the password, but not much else.  The other use I've seen is on my linux system.  In the /etc/shadow the hashed passwords are actually stored with the salt.  For example, a salt of "foo" and password of "bar" would hash to this: $1$foo$te5SBM.7C25fFDu6bIRbX1.  If a hacker somehow were able to get his hands on this file, I don't see what purpose the salt serves, since the reverse hash of te5SBM.7C25fFDu6bIRbX is known to contain "foo".  Thanks for any light anybody can shed on this.  EDIT:  Thanks for the help.  To summarize what I understand, the salt makes the hashed password more complex, thus making it much less likely to exist in a precomputed rainbow table.  What I misunderstood before was that I was assuming a rainbow table existed for ALL hashes. I have a SRD-12VDC-SL-C relay with this configuration:  And I want to trigger it with PIR Motion Sensor Detector Module HC-SR501  The problem with direct connection to PIR is, when I connect PIR with 12v DC the Relay remains always ON, i.e. trigger from PIR does not switch it off. And when I connect it via 5V supply the Relay remains always OFF. The trigger output of PIR is 3.3V how can I rectify this problem? by adding some resistor/FETs, or something else. Edit: The voltage at Relay-In(Green) is 10.5V and the relay is OFF it need to go below 9V in order to switch the Relay ON. When I connect it to PIR trigger it goes down to 2.7V (Thus Switching ON the relay, below 9V). And when the PIR trigger of 3.3V comes it goes up to 7.2V but because it is still below 9V) Relay does not switch. Distance between surfaces Xubuntu Dropbox icon fail The day before yesterday I think, my daughter asked me where we were going and since I was not planning to do the weekly shopping on that day and I just wanted to buy some stuff from two stores, I said offhand we are going to the shops! Looking back, it seems when I don't find a NAmE word I turn to UK if I know of.  So what do you say when:   go shopping (it's just go shopping!) you go to buy something specific; I mean you're not going shopping, and it's usually found in any store. You don't have to shop around. you want to buy non grocery or clothing stuff, maybe a can of paint and a spare part for your car together.    I have found some kind of answer for this question on , but I prefer to get a clear answer to my points above, and also if you agree with this native speaker about using store in singular form not plural:     Just as a side note, we don't use the plural in American English. "I'm   going to the store" (even if I may visit several stores), not "I'm   going to the stores". (If we know we are going to several stores I   think it would be more likely to say "I'm going shopping" or even "I'm   going downtown" in smaller towns.)