How not to ignore KeyboardInterrupt in try and except
How to properly ignore exceptions
How does the momentum operator act on state kets? How is the no-cloning theorem compatible with the fact that fan-out gates work? I have some difficulty with understanding no-cloning theorem. Simply speaking, according to the theorem, it is not possible to copy a quantum state.  On the other hand, CNOT gate can be used as so-called fan-out gate which purpose is to copy one qubit to another one, previously in state $|0\rangle$.  It seems that these two facts negate each other.   My question: How is no-cloning theorem compatible with the fact that fan-out gate works? In natural language parsing, what is the feature function? I'm working in the area of natural language processing, to be specific I'm reviewing the parsers that take advantage of data-mining techniques.   I've read an introduction to natural language processing, specifically the  by Della Pietra and others. In that paper, the authors explain that features are indicator functions that take into account certain aspects of the text. The problem is that this aspects affect the maximum entropy function.  In the case of parsing, I have problems understanding the concept of features. For parsing one must have:   Two sets, $X$ for the sentences and $Y$ for the parses For each sentence $x \in X$, one must have the N-best list of candidate parses; denoted $GEN(x) \subset Y$. Training samples $(x_j,y_j)$. The $x_j$ are sentences and the $y_j$ are parses. And a feature mapping $\Phi(X,Y)$ that maps each pair (x,y) to a vector of feature values.   The problem of parsing will consist of finding the weight vector such that the following expression is minimized  $$ -\sum log P(y_j|x_j,w) + \lambda ||w||_1 $$  where   $$ P(y_j|x_j,w) = \frac{exp \{w^T \Phi(x_j,y_j)\}   }{ \sum_{u \in GEN(x)} exp\{ w^T\Phi(x_j,u) \}  } $$  My question is, what are the features in this case? Some codified version of the parsing tree? Are the features a statistical concept?  I will also appreciate any bibliography that can be useful in tackling this issue.  UPDATE: I've talked to a professor and he had just told me that the features are obtained after doing a classification algorithm based on the parse-tree. Do you know what kind of classification is done with the parse tree? Note: TL;DR, scroll to bottom for summary. I recently set up my computer for a dual boot between Ubuntu 9.10 and Windows 7. My current drive setup is as follows.  | A1 |     A2       | | B1    |  B2  | B3 |        A1: 100 mb, windows 7 "System   Reserved" boot partition      A2: 230 gb, data section, this one   needs to be shared between the   operating systems      B1: 125 gb, windows 7 OS      B2: 123 gb, ubuntu OS      B3: 2gb, linux swap space     Pretty much I want to have my documents, music, pictures, videos, etc accessible from both operating systems. My first attempt involved making the data (a2) partition NTFS, and moving my home folder from ubuntu to the data partition. However, as I read NTFS does not work nice with permission, and it messed up my home folder. My next idea is one of the following: 1) format the data partition to ext2/3/4 and move my home folder from linux there, and get a driver to read ext partitions in windows 7. The problem with that is that most of the ext drivers/software are not compatible with windows 7 or do not integrate with windows explorer (I really don't want to open a separate software window just to access my data, plus it's probably not compatible with other software.)  looks promising, but I'm not sure how it works with ext4 and windows 7 (not officially supported, when trying in Vista Compatibility Mode, it tells me I need to format the ext drive to use it). My next idea, 2) keep the home folder in ubuntu where it is, but create symlinks for the Documents, Music, etc folders to an NTFS formatted Data (A2) partition, and add those locations to the windows 7 libraries. I'm not totally sure how the permissions would work out, but it should be fine since it's only the documents, music, etc and not the important config files in the rest of /home/user/. Correct me if I'm wrong. Currently, symlinks is my best idea, although i'm not sure how it will work.  Any suggestions, additions to my ideas, links, pointers, whatever would be greatly appreciated. Even if it means I should reformat both my drives and repartition (2 250gb drives if you want to suggest a setup for that), I won't be too opposed if that's the best suggestion (I've gone through the format/install/format/reinstall process 5 times over the past 3 days, once more won't hurt me).    TL;DR, summary:  I have two hard drives. One is partitioned for Ubuntu and Windows 7, the second one I want accessible to both operating systems to store documents, music, pictures, videos, etc. Suggestions on how to set up the data drive.    P.S. bonus if I can get an apache server document root folder working between the two OS's as well (permissions could become very complicated, so don't worry too much about that)  P.P.S. Related question, but data viewing is one way: So what I have right now is something like this:  PropertyInfo[] info = obj.GetType().GetProperties(BindingFlags.Public);   where obj is some object.  The problem is some of the properties I want aren't in obj.GetType() they're in one of the base classes further up.  If I stop the debugger and look at obj, the I have to dig through a few "base" entries to see the properties I want to get at.  Is there some binding flag I can set to have it return those or do I have to recursively dig through the Type.BaseType hierarchy and do GetProperties on all of them? How can I instantiate a generalized hash function? I've come across a bunch of "strange" hash function notations, such as the following ones and now I don't know how to choose / instantiate them.  Can you please explain me what this notation means and how I can actually instantiate such a hash function?  The notation in question: $$H_1:\mathcal M \rightarrow \mathbb F_p$$ $$H_2:\mathcal M \rightarrow \mathbb Z_n^*$$ $$H_3:\mathcal M \rightarrow \{0,1\}^l$$ $$H_4:\mathcal M_1\times ...\times \mathcal M_k\rightarrow \mathcal S$$  where $\mathcal M\in\{\mathbb F_p,\mathbb Z_n^*,\{0,1\}^*,\mathbb G,...\}$ where $\mathbb G$ is a generic (but there instantiated) group and $\mathcal S\in\{\mathbb F_p,\mathbb Z_n^*,\{0,1\}^l\}$ Notes:  Answers will occasionally be moved to the  when there are too many of them. When using them to report bugs, keep an eye on the post.    This site, Meta Stack Exchange, is usually used as a &quot;test bed&quot; for pending changes happening to the way text is rendered on all network sites. Changes to text rendering that are going to be rolled out to the network are usually deployed here first to test them out and fix any potential glitches. Currently, there are no such changes pending, but if there were, keep in mind that text posted here may render differently from the other sites until the changes roll out to them as well.    As per Jeff's suggestion in : You can use this question as a formatting sandbox. You can:  edit  itself ( questions such as this one require only 100 reputation to edit instead of 2,000) post answers to this question (This question might be , requiring earning 10 reputation on this site to answer) post comments to this question or its answers test suspected bugs with the editor or the rendering post ponies (only when mods are asleep)   Beware that since the  in December 2010, and  added in March 2011, no syntax highlighting is applied unless the question's tags or an inline hint enable it. So, to test highlighting here in the sandbox:  , you can use GitHub-flavor fenced code blocks in your posts, specifying the language after the opening fence: ```html While not hinted otherwise: &lt;html&gt;&lt;/html&gt; source &lt;b&gt;goes&lt;/b&gt; &quot;here&quot;. ```  ```js var a = 3; while (not (a &gt; 0)) {     alert(&quot;JavaScript code &lt;b&gt;goes&lt;/b&gt; here.&quot;); } ```   Or:  Create code blocks in any way (using the fence notation above, the four-space indent form, or using HTML &lt;pre&gt;&lt;code&gt; tags).  Save your post.  Use your browser's developer tools to edit the resulting HTML. To open developer tools, press F12, or ⌥⌘ I on Mac.  Find the &lt;pre&gt; element and add the attribute class=&quot;prettyprint&quot;, or change it into one of the valid syntax hints linked above, like class=&quot;lang-vb prettyprint&quot;.  Run the following in the location bar: javascript:prettyPrint(); or prettyPrint() in the console.     Answers that are considered annoying or obnoxious, or that cause breakage for users, will be deleted. This is . C# "internal" access modifier when doing unit testing I'm new to unit testing and I'm trying to figure out if I should start using more of internal access modifier. I know that if we use internal and set the assembly variable InternalsVisibleTo, we can test functions that we don't want to declare public from the testing project. This makes me think that I should just always use internal because at least each project (should?) have its own testing project. Can you guys tell me why I shouldn't do this? When should I use private? Precise connection between complexification of $\mathfrak{su}(2)$, $\mathfrak{so}(1,3)$ and $\mathfrak{sl}(2, \mathbb{C})$ I'm desperatly confused by notations and formulations so if someone could clarify the following things a little Í would be deeply grateful. The Lie algebra $\mathfrak{so}(1,3)_+^{\uparrow}$ of the proper orthochronous Lorentz group $SO(1,3)_+^{\uparrow}$ is given by \begin{equation} [J_i,J_j]=i \epsilon_{ijk} J_k \end{equation} \begin{equation} [J_i,K_j]=i \epsilon_{ijk} K_k \end{equation} \begin{equation} [K_i,K_j]=- i \epsilon_{ijk} J_k \end{equation} We can now define new generators with the old ones $N^{\pm}_i= \frac{1}{2}(J_i \pm i K_i)$ which satisfy \begin{equation} [N^{+}_i,N^{+}_j] = i \epsilon_{ijk} N^{+}_k ,\end{equation} \begin{equation} [N^{-}_i,N^{-}_j] = i \epsilon_{ijk} N^{-}_k ,\end{equation} \begin{equation} [N^{+}_i,N^{-}_j] = 0. \end{equation} where we can see that $N^{+}_i$ and $N^{-}_i$ make up a copy of the Lie algebra $\mathfrak{su}(2)$ each. My problem is to get what is going one here mathematically precise. Are the following statements correct and if not why:  When we build the new operators from the old generators we complexified $\mathfrak{so}(1,3)_+^{\uparrow}$ \begin{equation}(\mathfrak{so}(1,3)_+^{\uparrow})_\mathbb{C} = \mathfrak{so}(1,3)_+^{\uparrow}\otimes \mathbb{C} \end{equation} We saw that $\mathfrak{so}(1,3)_+^{\uparrow})_\mathbb{C}$ is isomorph to two copies of the complexified Lie algebra of $\mathfrak{su(2)}$: $(\mathfrak{so}(1,3)_+^{\uparrow})_\mathbb{C} \simeq \mathfrak{su(2)}_{\mathbb{C}} \oplus \mathfrak{su(2)}_{\mathbb{C}} $. Where exactly did we need that $\mathfrak{su(2)}$ is complexified here? The Lie algebras defined by $N^{\pm}_i$ are exactly those of $\mathfrak{su(2)}$ and we never use complex linear combination of $N^{\pm}_i$ or am I wrong here? $\mathfrak{su(2)}_{\mathbb{C}}$ is isomorph to $(\mathfrak{sl}(2,\mathbb{C}))_\mathbb{C}$: \begin{equation}\mathfrak{su(2)}_{\mathbb{C}} \simeq (\mathfrak{sl}(2,\mathbb{C}))_\mathbb{C} \end{equation} Here $(\mathfrak{sl}(2, \mathbb{C}))_\mathbb{C}$ denotes the complexified Lie algebra of $SL(2,\mathbb{C})$ Is $(\mathfrak{so}(1,3)_+^{\uparrow})_\mathbb{C} \simeq (\mathfrak{sl}(2, \mathbb{C}))_\mathbb{R}$ correct?  Here $(\mathfrak{sl}(2, \mathbb{C}))_\mathbb{R}$ denotes the real Lie algebra of $SL(2,\mathbb{C})$ Is $(\mathfrak{so}(1,3)_+^{\uparrow})_\mathbb{C} \simeq (\mathfrak{sl}(2, \mathbb{C}))_\mathbb{C} \oplus (\mathfrak{sl}(2, \mathbb{C}))_\mathbb{C}$ correct?  I looked this topic up in different books and each seemed to state something different. One book even used three differrent versions of $\mathfrak{sl}(2,\mathbb{C}) $ namely: $\mathfrak{sl}(2,\mathbb{C}) $, $(\mathfrak{sl}(2,\mathbb{C}))_\mathbb{C}$ and $(\mathfrak{sl}(2,\mathbb{C}))_\mathbb{R}$.  states simply that $\mathfrak{sl}(2,\mathbb{C}) $ is the complexification of $\mathfrak{su(2)}$ without making any reference to $SL(2,\mathbb{C})$ which does not help me either. Any help would be great. Trouble with Vakil's FOAG exercise 11.3.C I'm having trouble with the exercise in the title, even with part (a), which asks to prove that if $X$ is a closed subset of $\mathbb{P}^n_k$ of dimension at least 1 and $H$ is a non-empty hypersurface, then $X$ and $H$ meet.   Following the hint, I've done the following: By assumption, $X$ is given by $V(I)$ for some homogenous prime ideal $I\subset k[x_0,\dots x_n]=:A$ and $H$ by $V(f)$ for some homogenous polynomial $f\in A$. We wish to prove that there is a homogenous prime ideal $\mathfrak{p}$ (that's not the irrelevant one) containing both $I$ and $f$.  Consider the affine cone $\mathrm{Spec}\ A/I$ of $X$ in $\mathrm{Spec}\ A$. Being homogenous, both $I$ and $f$ are contained in the ideal $(x_0,\dots x_n)$. By Krull's principal ideal theorem, every minimal prime ideal containing $f\mod I$ has codimension one. $X$ having dimension at least one implies that there are homogenous prime prime ideals $\mathfrak{q}\supsetneq \mathfrak{r}\supset I$. This implies that $(x_o,\dots x_n)$ has codimension at least two. Thus there are prime ideals containing $f\mod I$ that are contained in $(x_o,\dots x_n)$. However, I'd need to show that there are homogenous such prime ideals, right? I'd rather get hints than full solutions. Examples and further results about the order of the product of two elements in a group Let $G$ be a group and let $a,b$ be two elements of $G$. What can we say about the order of their product $ab$?   says "not much":     There is no general formula relating the order of a product $ab$ to the orders of $a$ and $b$. In fact, it is possible that both $a$ and $b$ have finite order while $ab$ has infinite order, or that both $a$ and $b$ have infinite order while $ab$ has finite order.   On the other hand no examples are provided. $(\mathbb{Z},+), 1$ and $-1$ give an example of elements of infinite order with product of finite order. I can't think of any example of the other kind! So:   What's an example of a group $G$ and two elements $a,b$ both of finite order such that their product has infinite order?     Wikipedia then states:     If $ab = ba$, we can at least say that $\mathrm{ord}(ab)$ divides $\mathrm{lcm}(\mathrm{ord}(a), \mathrm{ord}(b))$   which is easy to prove, but not very effective. So:   What are some similar results about the order of a product, perhaps with some additional hypotheses? How to understand intuitively the Stolz-Cesaro Theorem for sequences? I have to give a presentation on the theorem in Real Analysis with a fellow student. While I've looked over the  and verified that, yes, step B does indeed follow logically from step A, etc. and have internalized the proof to the extent that I can replicate it myself on paper, I still feel that I have made little progress as to why this theorem works the way it does, i.e. what is the intuition behind the theorem, such that it should make sense that it follows the way it does. Therefore I ask: what kind of intuition is there about this theorem? It would also be helpful to understand how the theorem can be used effectively in analysis.  I have seen it referred to as a sort of L'Hopital's rule for sequences, which certainly seems to make sense, but I similarly have little intuitive understanding of how that rule works, either.  I am asking this question not only for my personal understanding, but also for the sake of being able to present it in an illuminating manner, such that the rest of the class can also come away with the same sort of intuition of how the theorem works and how it is useful. Any help would be greatly appreciated.  EDIT: I should point out that the formulation of the theorem we are being tasked to prove is the following:  Let $\lbrace a_n \rbrace$, $\lbrace b_n \rbrace$ be sequences, ${b_n}$ strictly increasing and unbounded. Then if $\lim\limits_{n \to \infty} \frac {a_{n+1} - a_n}{b_{n+1} - b_n} = l$ for some $l \in \mathbb R$, then $\lim\limits_{n \to \infty} \frac{a_n}{b_n} = l$ also. Video lectures on graduate level Classical Electrodynamics This is a rather broad question. Does anyone know of good video lectures for graduate level classical electrodynamics? Can HTML checkboxes be set to readonly? I thought they could be, but as I'm not putting my money where my mouth was (so to speak) setting the readonly attribute doesn't actually seem to do anything.  I'd rather not use Disabled, since I want the checked check boxes to be submitted with the rest of the form, I just don't want the client to be able to change them under certain circumstances. I keep on seeing a fair number of questions (such as ) which get marked as answered within 5-10 minutes of being posted. Sometimes the questions like this are insanely popular and actually see some proper discussion, however often I see questions have few views and only 1 answer. The trouble with these questions is that very few people have scrutinised the answer for correctness, or possibly a better solution. I always make a point of not accepting my answers until a day or so has passed — would it not be a good idea to put a short (1 hour or so) time limit on accepting answers on new questions with few views or votes, or perhaps just an additional confirmation dialog, something along the lines of:  Your question is new and not many people have had a chance to look at it yet.  Are you sure you don't want to wait to see if anyone else has a better suggestion? Looking for the proof of the lemma asserting that the conical surface (envelope) is a closed space. Thank you. Change ViewPager animation duration when sliding programmatically How to use "grep" command to find text including subdirectories Why xargs can't work with tail -f? I want tail -f /var/log/syslog | grep it with pattern "arpwatch" and send every line to myself via jabber: xmpp username@jabber.server using xargs  tail -f /var/log/syslog | grep arpwatch | xargs sendxmpp username@jabber.server   no working.  but tail  /var/log/syslog | grep arpwatch | sendxmpp username@jabber.server   works well.  I think it's some fundamental thing about xargs and tail -f that I don't understand. Combining the first and second law of thermodynamics we can get the following equation  $$TdS=dU-P_{ext}dV$$  First question: Is this equation applicable for irreversible processes such that that $dS≠\dfrac{dQ}{T}$?  Second question:If the system temperature $T_{sys}$ is smaller than the surrounding temperature $T_{sur}$, which temperature should we put in the equation?   I have this question because sometimes people use $T_{sur}$ instead of $T_{sys}$ (e.g. , ) but the equation is supposed to describe changes in the system.