How can I get the path to the calling python executable
How to determine which Python install is being used by the interpreter?
I gzip directories very often at work. What I normally do is  tar -zcvf file.tar.gz /path/to/directory   Is there a way to specify the compression level here? I want to use the best compression possible even if it takes more time to compress. What are quarks made of? So atoms are formed from protons and neutrons, which are formed from quarks.  But where do these quarks come from? What makes them? How to move a database from SQL Server 2012 to SQL Server 2005 OS X lets me type special characters directly on the keyboard by holding the Option. For example: — is an em dash, “ and ” are curvy quotes, etc.  Is there a good cheat sheet listing all these keys somewhere? I tend to find myself holding option and running my hands up and down the keyboard looking for a specific character. What is the name of this theorem, and are there any caveats? For random variable $X$ that follows some distribution, $f(x)$ is the probability density function of that distribution if and only if $$\mathbb{E}[\phi(X)] = \int_{-\infty}^\infty \phi(x) f(x)dx$$ for all functions $\phi$.  Context: My professor used this in lecture to demonstrate a way to find the distribution of $cX$ given random variable $X$ that follows a specific distribution.   What is the name of this theorem? Have I missed any qualifications/caveats? I am in particular curious about whether "for all functions" is correct. My professor mentioned "positive, bounded, deterministic functions," but I am not sure what he meant by that. Where can I find a proof of this theorem? How does Spider-Man climb walls? Often in my papers I want to mention theorems in the introduction that are introduced in more detail and proved in a later section.  I'd like to include the statement of these theorems twice over, each time numbered as the theorem would naturally appear in its later section.  My current solution (using amsthm) is, e.g.  %(in the introduction) \newtheorem*{thm:associativity}{Theorem \ref{thm:associativity}} \begin{thm:associativity} Lorem ipsum ... \end{thm:associativity}  %(in a later section) \begin{thm} \label{thm:associativity} Lorem ipsum ... \end{thm}      Can anyone think of a cleaner solution? What happened to the Yin half of Kurama? Did Naruto get both halves of Kurama after fighting Sasuke, or did the other half of Kurama die when Minato was killed? If $f,g:X \to Y$ are continuous and $Y$ is $T_2$, then $\{x \in X\,|\,f(x)=g(x)\}$ is closed I'd like to know if the following proof is valid.  The only thing I'm not sure about (though I can't see why it's invalid if it is) is if we can always use the Hausdorfness of $Y$ to separate an open set from $f(C)=g(C)$.  "Let $X$ be a space, $Y$ a $T_2$-space, and $f,g:X \to Y$ continuous functions.  Prove that $C:=\{x \in \,|\,f(x)=g(x)\}$ is a closed subset of $X$."  Let $x \in X$ be such that $f(x) \ne g(x)$.  Since $Y$ is $T_2$, there are open sets $U_\alpha \ni f(x)$ and $V_\alpha \ni g(x)$ such that $U_\alpha \cap O_\alpha=V_\alpha \cap O_\alpha=\varnothing$ for all $\alpha \in A$ where $A$ is the set indexing the points of $f(C)=g(C)$, and $O_\alpha$ is an open set containing $x_\alpha \in f(C)=g(C)$.  Let $U:=\displaystyle\bigcap_{\alpha \in A} U_\alpha$ and $V:=\displaystyle\bigcap_{\alpha \in A} V_\alpha$.  Then $U \cap f(C)=V \cap f(C)=\varnothing$.  Therefore, since $f,g$ are continuous, $f^{-1}(U)$ and $g^{-1}(V)$ are open sets in $X$ disjoint from $C$.  Since $X\setminus A$ is the union of such open sets, it is open itself and therefore $C$ is closed.  Thanks. Captured variable in a loop in C# I met an interesting issue about C#. I have code like below.  List&lt;Func&lt;int&gt;&gt; actions = new List&lt;Func&lt;int&gt;&gt;();  int variable = 0; while (variable &lt; 5) {     actions.Add(() =&gt; variable * 2);     ++ variable; }  foreach (var act in actions) {     Console.WriteLine(act.Invoke()); }   I expect it to output 0, 2, 4, 6, 8. However, it actually outputs five 10s.  It seems that it is due to all actions referring to one captured variable. As a result, when they get invoked, they all have same output.  Is there a way to work round this limit to have each action instance have its own captured variable? What is the equation for the tension on the ends of a cable suspended at different heights? I'm looking for an equation to find the tension on the ends of a cable suspended between two poles (one higher than the other) with no load but the cable itself.    I determined that the tension would be different on each end, that the shape of the suspended cable would be a  truncated at one end, and that the following would be the variables necessary in the equation:   cable weight cable length vertical distance between ends horizontal distance between ends   Some links that could be helpful: finite and infinite product of discrete space Detecting Color of iPhone/iPad/iPod touch? I just read this very insightful post , where the author stated that the variance of $\hat\beta$ is:  $$\text{var}(\hat\beta) = \sigma^2(\textbf{X}^\prime \textbf{X})^{-1}.$$  I couldn't figure out why it is like this. Can anyone elaborate a bit? I'm very familiar with how symbols display differently in inline mode (with $ ... $) vs. how display math shows them (with \[ ... \] or $$ ... $$).  Two examples would be with limits  $\lim_{n\rightarrow \infty}f(x)$   vs.  \[ \lim_{n\rightarrow \infty}f(x) \]   and with sums  $\sum_{n=1}^{x} n^2$   vs.  \[ \sum_{n=1}^{x} n^2 \]   My Question is:     How do you display these things in inline mode (with all the nice inline formatting) as if they were in display mode ?   The inverse -- how to display things in display mode as if they were in inline mode -- is also of interest. In Photoshop I've taken Magic Wand as far as I can, I think. Now I'm left with this grayish edge around the coffee saucer. How do I remove it? I've tried altering tolerance in Magic Wand but don't seem able to get it. Any suggestions please? I am programming a tile based game and I have some basic tiles (grass, dirt, etc..), but I can't figure out how to make good random map generation, because when I do some really random selection, if the tile should be grass/dirt, I get this:    I understand why this is happening, but what I want is to create some random continuous areas of grass or dirt. Something that would make more sense, like this: "Please do not repeat the mistake" and "Please do not repeat the mistake again" Please do not repeat the mistake. Please do not repeat the mistake again.  Should the again be omitted? “Repeat” means “do again”. So to “repeat again” means “to do again again”. Is the second sentence grammatically wrong? Consider this reverse biased diode :     I read that no or very small current flows in reverse biased diode as depletion layers get widened and huge resistance is offered so no electrons can cross it. But, why the electrons or holes need to cross the depletion layer? In the diagram above, the positive charges (holes) are moving towards left and the current due to electrons is also in left, so won't the circuit be completed? Are data members allocated in the same memory space as their objects in C++?