Ubuntu wakes up after few seconds of sleep
laptop fails to suspend or hibernate (wakes up after 2-5 seconds without user interaction)
json parse error with double quotes How to do logistic regression subset selection? I am fitting a binomial family glm in R, and I have a whole troupe of explanatory variables, and I need to find the best (R-squared as a measure is fine). Short of writing a script to loop through random different combinations of the explanatory variables and then recording which performs the best, I really don't know what to do. And the leaps function from package  does not seem to do logistic regression.  Any help or suggestions would be greatly appreciated. How does Java's PreparedStatement work? I am planning to replace repeatedly executed Statement objects with PreparedStatement objects to improve performance. I am using arguments like the MySQL function now(), and string variables.   Most of the PreparedStatement queries I have seen contained constant values (like 10, and strings like "New York") as arguments used for the ? in the queries. How would I go about using functions like now(), and variables as arguments? Is it necessary to use the ?s in the queries instead of actual values? I am quite confounded. How can I display the current branch and folder path in terminal? Rerouting stdin and stdout from C UK visit visa: What documents prove genuine relationship with the visitor? In the UK immigration rules for visitor visa  it states if;      Funds, maintenance and accommodation provided by a third party      V 4.3 A visitor’s travel, maintenance and accommodation may be   provided by a third party where the decision maker is satisfied that   they:      (a) have a genuine professional or personal relationship with the   visitor;and      (b) are not, or will not be, in breach of UK immigration laws at the   time of decision or the visitor’s entry to the UK; and      (c) can and will provide support to the visitor for the intended   duration of their stay.   I'm a UK  citizen. I'm planning to invite my brother-in-law and another close friend to the UK. In my invitation letter, I have clearly mentioned that I'm going to provide them accommodation only. They have prove sufficient funds to support themselves. I have sent them an invitation letter along with a copy of my passport and tenant agreement.   What other documents do I need to provide to indicate that it is a genuine professional or personal relationship with the visitor? Is ArcSDE no longer needed at ArcGIS 10.1? If the original question is "What time is it?" and I want to communicate it to another person, are these Embedded Questions OK?        I don't know what time is it.       or        I didn't know what time was it. (if communicated later) How to add citation for a whole paragraph? If I write a report and a whole paragraph is based on one source but not cited verbally it seems unnecessary to include the reference after every sentence:  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua (source 1). Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat (source 1).  Now I found a Phd thesis that puts the reference after the last dot of the paragraph to indicate that it is based on this very source:  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. (source 1)  Is this a common practice? Is it generally understood? What are other ways to add the reference for a whole paragraph? A probability theory question about independent coin tosses by two players Say Bob tosses his $n+1$ fair coins and Alice tosses her $n$ fair coins. Lets assume independent coin tosses. Now after all the $2n+1$ coin tosses one wants to know the probability that Bob has gotten more heads than Alice.    The way I thought of it is this : if Bob gets $0$ heads then there is no way he can get more heads than Alice. Otherwise the number of heads Bob can get which allows him to win is anything in the set $\{1,2,\dots,n+1\}$. And if Bob gets $x$ heads then the number of heads that Alice can get is anything in the set $\{0,1,2,..,x-1\}$. So\begin{align}P(\text{Bob gets more heads than Alice})&amp;= \sum_{x=1}^{n+1} \sum_{y=0}^{x-1} P( \text{Bob gets x heads }\cap \text{Alice gets y heads }) \\[0.2cm]&amp;= \sum_{x=1}^{n+1} \sum_{y=0}^{x-1} \left(C^{n+1}_x \frac{1}{2}^{x} \frac{1}{2}^{n+1-x}\right)\left( C^n_y \frac{1}{2}^y \frac {1}{2}^{n-y}\right)\\[0.2cm]&amp; = \sum_{x=1}^{n+1} \sum_{y=0}^{x-1} \frac{C^{n+1}_x C^n_y}{2^{2n+1}}\end{align}   How does one simplify this?      Apparently the answer is $\frac{1}{2}$ by an argument which looks like this, Since Bob tosses one more coin that Alice, it is impossible that they toss both the same number of heads and the same number of tails. So Bob tosses either more heads than Alice or more tails than Alice (but not both). Since the coins are fair, these events are equally likely by symmetry, so both events have probability 1/2. How to efficiently count the number of keys/properties of an object in JavaScript? Why is carbon dating limit only 40,000 years? Labels cannot be moved although data-defined settings are active I'm trying to manually move labels but having some trouble. I'm trying to move the labels while in edit mode. I've added fields for x coordinate (all null), y coordinate (all null), rotation (all =0), and font-size (all =10). This makes the "move label" and "rotate label" buttons active, but when I click on the labels, no box around the label appears and it's impossible to move the label. What am I doing wrong? Accuracy Vs. Precision  What I would like to know is whether I should use System.currentTimeMillis() or System.nanoTime() when updating my object's positions in my game?  Their change in movement is directly proportional to the elapsed time since the last call and I want to be as precise as possible.  I've read that there are some serious time-resolution issues between different operating systems (namely that Mac / Linux have an almost 1 ms resolution while Windows has a  50ms resolution??).  I'm primarly running my apps on windows and 50ms resolution seems pretty inaccurate.  Are there better options than the two I listed?  Any suggestions / comments? Package in Java How do I programmatically obtain the version in JBoss AS 5.1? I am wondering how to recreate some kinds of effects (you can easily do in Photoshop) in Blender.  I want to create the gradient textures like ones pictured below, should I render objects and blur them in compositor? Or can I achieve it using only material nodes? What do you call the frequent conjunction {juxtaposition} of two words? The statement that I want to make is:     "Impostor syndrome" ... why does this (conjunction of words) sneak into every text I read these days?   What is the right or best expression for "conjunction of words"? In the statement I don't want to refer to the syndrome itself, but rather to the expression. If it was one word instead of two I would want to say     ... why does this word sneak into every text I read these days.   However, writing     ________ why do these two words sneak into every text I read these days.   would miss the point, because it's not these two words that sneak into every text at various location but rather their conjunction. Why doesn't a commutator cause the rotation to reverse periodically or stop? I understand the field magnets attracting/repelling the armature/coil so that it turns one half-turn and then, because the commutator is turned, its contact with the brushes has switched sides, and the current goes in the opposite direction, reversing the electromagnetic polarity. Then, because the polarity is swapped, it attracts/repels to complete the second half-turn. The thing is, isn't it a bit of a gamble that it will turn in the same direction? Couldn't the it just be pulled/pushed back, more or less undoing the half-turn?  I'm also a bit confused how the rotation doesn't just stop once the commutator is oriented so that the brushes are contacting both sides of the commutator. In other words, there's a brief period just as the commutator switches the current directions where each both the brushes are in contact with both sides of the commutator where the current is neutralized. Shouldn't this stop the motor?    For reference, I'm just talking about a simple DC motor. Execute managebean method from javascript onload event