Getting user input
How do I do simple user input in python?
A lot of people write makefiles that say something like  paper.pdf: paper.tex         pdflatex paper         bibtex paper         pdflatex paper         pdflatex paper   To handle re-running TeX to get new/changed references and so forth. Is there a better way to do this? Currently, moderators have the ability to reset a user's username and/or profile text, and propagate that to the rest of the network, resetting it everywhere. However, often, the user's stackexchange.com network profile will also need to be reset, and this is currently only possible to do by either the user in question or staff.  Instead of bothering staff every time, moderators should have something available similar to chat, where moderators can change a user's parent site and have access to a "refresh profile" button, which will fetch updated information such as username and avatar from the parent site.  Currently, the only thing that moderators can do on stackexchange.com is to see hidden accounts. It would make sense for moderators to be able to refresh profiles there, like chat, and avoid pinging CMs every time this comes up. How to open a terminal from within Atom? I'm currently working with Atom, and sometimes I want to open a terminal on the directory my working file is. To do this, I usually have to open the folder in nautilus (right clicking the file in atom) and then I open a terminal on that directory from nautilus (right click).  I wonder if there is a way to open the terminal in the file directory without having to open nautilus first. Let $X$ ~ $Bin(n,p)$ and $Y$ ~ $Bin(m,p)$ be two independent random variables. Find the distribution of $Z=X-Y$.   see also   I figured this out:  $$ P(Z=z)=\cases{\sum_{i=o}^{min(m,n)} Bin(k+i,n,p)*Bin(i,m,p), &amp;if $z\ge0$;\cr \sum_{i=0}^{min(m,n)} Bin(i,n,p) * Bin(i-z, m, p),&amp;otherwise. \cr}$$  I also validated it by Monte Carlo simulation. For $n=30$, $m=20$ and $p=0.5$, I get the following distribution, where the circles are the analytical probabilities and the line connects the MC estimates.    Because that looked to me pretty much like a binomial distribution, I gave it a try and figured out that its actually a binomial, just shifted by m to the left. This can be simply written as $P(Y=y) = Bin(y+m, m+n, p)$. Hence, given equal success probabilities, the sum of two independent binomially distributed random variables is binomial, but also their difference, just shifted to the left.  This question here  is actually the same as mine, but received no answer and only the comment that there would be no simple formula. But the above formula looks pretty simple to me.   Is it correct that for the case of equal success probabilities, the above equations actually describes the distribution of $Z=X-Y$? I read in a book that $Z$ could not be binomial distributed because it had negative support. Is it right to call it a shifted binomial? In MySQL, how do I get a list of all foreign key constraints pointing to a particular table? a particular column? This is the same thing as , but for MySQL. Execute command in remote active terminal Suppose you have a terminal emulator (T1) open with a PID of 6350.  From another terminal, type this command (C1):  echo "ls\n" &gt; /proc/6350/fd/0   This writes ls and the new line in T1 but does not execute it. Why?  I also tried using cat|bash with echo "ls\n" &gt; /proc/catid/fd/0 but it is still not executed.  How can I echo the command into another terminal and have the command executed?  possible answer :  $ mkfifo toto; $ bash &lt; toto; $ echo "ls" &gt; toto;   In this case you cannot write anymore directly in the terminal (everything is displayed the same way the command (C1) displayed thing in this terminal. Are nested functions a bad thing in gcc ? Skewness, kurtosis and how many standard deviations values are from the mean As is well known for the normal distribution, 68% of the probability mass is within one standard deviation of the mean, 95% within two standard deviations and 99.7% within 3 standard deviations.   However, I have some empirical distributions that are leptokurtic and negatively skewed. In such circumstances is there a formula based on their higher-order moments to calculate how much of the probability mass is within so many standard deviations of the mean?   I have a measurement and would like to give some sense of how far it is from the midpoint (mean or some other measure of central tendency).  Can this be done? No Time in Top Panel (Gnome Classic) I've been using Ubuntu with Gnome Classic for a while and I've noticed recently that in the "Indicator Applet Complete" in the Top Panel, my name and the clock have disappeared.    I think it happened a while ago when I was messing around with packages. Every time I did apt-get... it would say "the following packages can be removed by apt-get autoremove", so I did it and then the clock and my name stopped appearing.   Can anyone help me? Thanks. It would be greatly appreciated. How is light emitted by an incandescent lamp I am looking for better understanding of how light is produced in an incadescent lamp. More specifically: how is the kinetic energy of electrons converted to light?  Are we dealing with interband transitions or with intraband relaxation involving photons? Is this Bremsstrahlung (electrons lose their energy as light when colliding with crystal impurities/defects)? Or is this a thetmal radiation resulting from Joule heating? How is the emission affected by presence of impurities and imperfections of the crystal lattice? Do phonons play a role? What properties make a material more suitable for use as a filament: should it be a metal? Should it have a crystalline structure? Will any metal produce light, if a high current is passed through it in vacuum?  Update The term describing the processes in the incadescent lamp is , see the posts on this subject  and . Suppose $53$ percent of the population prefer red socks to green. If $100$ random people are asked, what is the probability that most (at least $50$) will say prefer GREEN:  So I set \begin{align*} N &amp; = 49.5\\   n &amp; = 100\\   p &amp; = 0.47 \end{align*}  Then.. \begin{align*}    P(N \geq 49.5) &amp; = P\left(\frac{N - np}{\sqrt{npq}}\right)\\                &amp; \geq \frac{49.5 - 47}{\sqrt{100*.47*.53}}\\                   &amp; = \varphi(0.50)\\                   &amp; = 0.3085   \end{align*} Except, that's not the right answer. What did I do wrong in my calculations? I have a ASUS R500A notebook.Original OS is Windows 7 64bit.Few days ago I tried to Install Windows 8.1 64 bit version.But it failed &amp; error message is,     windows cannot be installed on this disk. The selected disk is of the GPT partition style.   My Steps: First i Deleted C: Partition ( Already installed windows 7 ). Then i Formatted that partition. Tried to install Windows 8.1 64bit.  In this hard disk i have another several partitions with Important data.  How do i Install Windows 8.1 without loosing Data from the Other partitions ? Why do we use residuals to test the assumptions on errors in regression? Suppose that we have a model $Y_i = \beta_0 + \beta_1X_{i1} + \beta_2X_{i2} + \dots + \beta_kX_{ik} + \epsilon_i$.  Regression has a number of assumptions, such as that the errors $\epsilon_i$ should be normally distributed with mean zero and constant variance. I have been taught to check these assumptions using a normal QQ plot to test for normality of the residuals $e_i = Y_i - \hat{Y}_i$ and a residuals vs. fitted plot to check that the residuals vary around zero with constant variance.  However, these tests are all on the residuals, not the errors.  From what I understand, the errors are defined as the deviation of each observation from their 'true' mean value. So, we can write $\epsilon_i = Y_i - \mathbb{E}[Y_i]$. These errors cannot be observed by us. *  My question is this: how good of a job do the residuals do in mimicking the errors?   If the assumptions appear to be satisfied on the residuals, does this mean they are satisfied on the errors too? Are there other (better) ways to test the assumptions, like fitting the model to a testing dataset and getting the residuals from there?    * Furthermore, does this not require that the model is specified correctly? That is, that the response really does have a relationship with the predictors $X_1, X_2,$ etc. in the way specified by the model.  If we are missing some predictors (say, $X_{k+1}\ \text{to}\ X_p$), then the expectation $\mathbb{E}[Y_i] = \beta_0 + \beta_1X_{i1} + \beta_2X_{i2} + \dots + \beta_kX_{ik}$ would not even be the true mean, and further analysis on an incorrect model seems pointless.  How do we check whether the model is a correct one? I have a form with a lot of controls on it.  How can I detect when the mouse leaves the form?  I've tried wiring up a MouseLeave event for every single control and the form, but that does not work because those events fire all the time as the mouse passes over controls.  Is there a way that actually works.? Mechanics of Horizontal Stretching and Shrinking I know $y=2f(x)$ doubles the $y$ value in vertical shifting, and I know that $y=(1/2)f(x)$ halves the $y$ value. But, why does $y=f(2x)$ halve the $x$ value, and why does $y=f((1/2)x)$ double the $x$ value in horizontal shifting? I looked at the graphs, and I see the difference, but I want to know the math behind why it halves instead of doubling the $x$ value for $y=f(2x)$. Maybe this is a stupid question, but could someone help me out?  Thank you. Blocking comment spam without using captcha Let $a_1=1$ and $a_n=n(a_{n-1}+1)$ for $n=2,3,\dots$. Define $$P_n=\left(1+\frac{1}{a_1}\right)\left(1+\frac{1}{a_2}\right)\dots\left(1+\frac{1}{a_n}\right)$$Find $$\lim_{n \to \infty}P_n$$   Trial: $$1+\frac{1}{a_n}=1+\frac{1}{n(a_{n-1}+1)}\;.$$ But I can't simplyfy.Please help. I installed Dev C++ using Wine on Ubuntu 18.04 and the program is compiling but it not showing any output screen. For $p,q$ prime and $p \neq q$ show that $C_p \times C_q \cong C_{pq}$ Here are my thoughts so far:    $C_p = \langle x \mid x^p =e\rangle$ $C_q = \langle y \mid y^q =e\rangle$ $C_p \times C_q$ has elements of the form $(x^a,y^b)$ There are $p$ possible values for $x^a$ and $q$ possible values for $y^b$. So there are $pq$ possible elements in $C_p \times C_q$. $C_{pq} = \langle z\mid z^{pq} = e\rangle$ and there are $pq$ elements in this group. For an isomorphism from $C_p \times C_q$ to $C_{pq}$ we send $(e,e)$ to $e$ to ensure that the identities are mapped to each other. However, I'm not sure how to define an isomorphism for the other elements. Estimating the intersection of two lines I have two datasets, A and B, of weighted (x,y) pairs. I computed the best fit lines, L_A and L_B, respectively, of these datasets, and then computed the intersection of these two lines, (x*,y*).  Now, A and B are drawn from random distributions (of the form y=mx+b+e, where e is a normally distributed error term). I'd like to compute a confidence interval around x*. How can I do this?  A naive approach I tried involved computing confidence intervals for the slope/intercept estimates of L_A and L_B, generating approximate distributions for those 4 parameters, and repeatedly randomly sampling from these distributions. But a given line's slope and intercept estimates are not independent of each other, and I wasn't sure how to salvage this approach to account for that.