I want to have a macro that behaves differently based on the context. Assume I write a tutorial in X language. A term that I use must be written in X language followed by the corresponding English translation (enclosed and italicized in ()) only when it occurs at the first time. The remaining occurrence will only be written in X language.   I can do it with the following code.  \newif\ifVector \newcommand{\Vector}{%     \ifVector         vektor%     \else         vektor (\textit{vector})%         \Vectortrue     \fi}   But a new problem arises. How to make the macro change its capitalization when it appears in the beginning of a sentence? Here is my complete dummy code for you.  \documentclass[preview,border=12pt]{standalone}  \newif\ifVector \newcommand{\Vector}{%     \ifVector         vektor%     \else         vektor (\textit{vector})%         \Vectortrue     \fi}   \begin{document} \Vector\space isg kush guste vien. Fur sji nam von gis ta marjo navar \Vector. \Vector\space is fin nom bis kan da dej vanm. \end{document}
Is it possible to make macros give different results at the beginning of a new sentence? Suppose that I want the macro "\secname" to write "Section" at the beginning of a new sentence, and "section" anywhere else. How can I do so?
Prove that $A \smallsetminus (A \smallsetminus B) = A \cap B$ $A$ and $B$ are any sets, prove that $A \smallsetminus (A \smallsetminus B) = A \cap B.$ This formula makes sense when represented on a Venn diagram, but I am having trouble with proving it mathematically.  I have tried letting $x$ be an element of $A$ and continue from there, but it doesn't seem to work out as a valid proof anyways.   Could anyone please point me in the right direction?  Many thanks. I need to find all group homomorphisms of $S_n\to\mathbb{C}^*$ (for $n\ge2$), and also all group homomorphisms of $A_n\to\mathbb{C}^*$ (for $n\ge2$).  Someone on this site, two years ago, seems to have already asked the same question (). I understand what the questioner says there, but I don't understand it when he says:     Therefore there is exactly one $g:\mathbb{Z}/2\mathbb{Z}\to\mathbb{C}^*$, so all elements of $a\in\mathbb{C}^*$ give us $\operatorname{ord}(a)\mid g[\mathbb{Z}/2\mathbb{Z}]$, so $a$ can only be $-1$ or $1$. Now we know that $f:S_n\to\{-1,1\}$ &hellip;   What is he saying there? And how to go on from there? (I do not understand the answer given either &hellip;)  I hope that someone here can help me further. (And if I'm not allowed to ask this question because is has already been asked two years ago, please tell me what to do instead).  Thank you in advance! Galois extension is (not) transitive Let $ K/ L /F $ be fields. If $K / L$ is Galois and $ L / F $ is Galois, then $ K / F$ is Galois. We mentioned this very quickly in today's class without justifying. But I have trouble seeing this. Any help is appreciated.  Our definition for $ K / F$ being Galois is the $F$-automorphism group $G = G( K / F) : = \{ \sigma \in aut (G) : \sigma_F = id_F \}$ fixes only $F$, i.e. $ \{ x \in K : \sigma (x) = x \text { for all } \sigma \in G  \} = F$.  But we also showed that $ K /F$ is Galois if and only if $ K/F$ is normal and separable. $$\sqrt{x + \sqrt{x + \sqrt{x + \cdots}}}= 5$$ Spacings between continuous uniform random variables Writing function definition in header files in C++ I have a class which has many small functions. By small functions, I mean functions that doesn't do any processing but just return a literal value. Something like:  string Foo::method() const{     return "A"; }   I have created a header file "Foo.h" and source file "Foo.cpp". But since the function is very small, I am thinking about putting it in the header file itself. I have the following questions:   Is there any performance or other issues if I put these function definition in header file? I will have many functions like this. My understanding is when the compilation is done, compiler will expand the header file and place it where it is included. Is that correct? static variables in an inlined function I have a function that is declared and defined in a header file. This is a problem all by itself. When that function is not inlined, every translation unit that uses that header gets a copy of the function, and when they are linked together there are duplicated. I "fixed" that by making the function inline, but I'm afraid that this is a fragile solution because as far as I know, the compiler doesn't guarantee inlining, even when you specify the "inline" keyword. If this is not true, please correct me.  Anyways, the real question is, what happens to static variables inside this function? How many copies do I end up with? Sign of Work and potential energy in electrostatics Conceptual question:  Suppose we have a configuration of point charges. If the potential of the energy of the system is negative, this means work is positive.   I'm kind of rusty with my mechanics, does the fact that the work is positive mean that to arrange the configuration you have to do work against the electric field? I.e. supply energy via some external force?  In terms of electrostatics, is there a general way of interpreting the sign of potential energy and work? How can I show or hide boot messages when Ubuntu starts? Normally Star Trek seems to based on some sort of logic, but the time travel in "Star Trek: Enterprise" seems to have no logic at all, or  am I just missing it?  Example: If they go back in time to change something it takes time until it has any effect in the future? I can't see any reason for this. Let $R$ be a commutative ring with unit, $I$ an ideal of $R$ and consider the following three constructions.   The  $R_I$ of $R$ at $I$ (i.e. the localization of $R$ at the multiplicative system $R\setminus I$) gives a morphism $$ f_1:\operatorname{Spec}(R_I)\to \operatorname{Spec}(R)=:X $$ The  $\widehat{R}_I$ of $R$ at $I$ gives a morphism $$ f_2:\operatorname{Spec}(\widehat{R}_I)\to X $$ For the special case $I=(a)$, the localization $R_a$ (i.e. the localization of $R$ at the multiplicative system $\{1,a,a^2,\ldots\}$) gives a morphism $$ f_3:\operatorname{Spec}(R_a)\to X $$   My question is:     What is the geometric meaning of all three constructions and how are they related?   This is what I ''know'' already or describes at least the style of answer I would appreciate. As remarked in the comments, $I$ has to be a prime ideal.   $R\to R_I$ is injective iff $R\setminus I$ contains no zero divisors which is the case if $I$ is a prime ideal. The scheme $\operatorname{Spec}(R_I)$ is the intersection of all the neightbourhoods of $I$ in $X$. This is a little contra-intuitive for me since the last statement sounds like ''$f_1$ is injective'' but the $\operatorname{Spec}$-operator should turn 'injective'' and ''surjective'' around somehow (I know this is literally not true but I only want to get a feeling like ''is contained'', ''is bigger'', ''is smaller'', etc.). $\operatorname{Spec}(R_a)$ is somehow the opposite of $\operatorname{Spec}(R_{(a)})$ (= the intersection of all the neightbourhoods of $(a)$ in $X$) because $\operatorname{Spec}(R_a)$ seems to be something like the union of all the open sets of $X$ not containing the point $(a)$. $R\to\widehat{R}_I$ is injective iff $\cap I^n=(0)$ and this holds very often (e.g. for $R$ noetherian and either an integral domain or a local ring). Hence (this is probably false intuition as remarked before), $f_2$ should be something like a ''projection'' (from something ''big'' into something ''small''). But what is geometrically the difference between localization and completion. I don't have a geometric idea of completion at all.   As remarked by Qiaochu Yuan in the comments below, one should not think of $\operatorname{Spec}$ as injective-surjective switching. Does $ \int_0^{\infty}\frac{\sin x}{x}dx $ have an improper Riemann integral or a Lebesgue integral? In  wikipedia article for improper integrals,  $$ \int_0^{\infty}\frac{\sin x}{x}dx $$ is given as an example for the integrals that have an improper Riemann integral but do not have a (proper) Lebesgue integral. Here are my questions:   Why does this one have an improper Riemann integral? (I don't see why $\int_0^a\frac{\sin x}{x}dx$ and $\int_a^{\infty}\frac{\sin x}{x}dx$ converge.) Why doesn't this integral have a Lebesgue integral? Is it because that $\frac{\sin x}{x}$ is unbounded on $(0,\infty)$ and Lebesgue integral doesn't deal with unbounded functions? Solving the diophantine equation $y^{2}=x^{3}-2$ It is known that the diophantine equation $y^{2}=x^{3}-2$ has only one positive integer solution $(x,y)=(3,5)$. The proof of it can be read from the book "About Indeterminate Equation" (in Chinese, by Ke Zhao and Sun Qi). But the method I have known of solving this problem is algebraic number theory.  My question:      Does there exists an elementary method for solving the diophantine equation $y^{2}=x^{3}-2$?   I have gotten an elementary method by the assumption that "$x$" is a prime. That is, we can get a conclusion from the equation that $3\mid x$. Since $x$ is a prime we get the only solution $(x,y)=(3,5)$. But if $x$ is not a prime, the answer seems to be difficult.  Thank you for your help. I'm trying to compute this integral, $$\int_{0}^{\infty}\frac{\ln x}{x^{a}(x+1)}dx \hbox{ where } 0&lt;a&lt;1$$ I drew a typical Pacman contour with branch cut at positive real axis. Then, we have $$\int_{\Gamma}\frac{\ln z}{z^{a}(z+1)}dz=\left(\int_{L_{1}}+\int_{L_{2}}+\int_{C_{R}}+\int_{C_{\epsilon}}\right)\frac{\ln z}{z^{a}(z+1)}dz$$ The function has a pole at $z=-1$. Then, by residue theorem, the whole integral becomes  \begin{align*} \int_{\Gamma}\frac{\ln z}{z^{a}(z+1)}dz&amp;=2\pi i\text{res}(\frac{\ln z}{z^{a}(z+1)};-1)\\&amp;=2\pi i\lim_{z\rightarrow-1}(z+1)\frac{\ln z}{z^{a}(z+1)}\\&amp;=2\pi i\lim_{z\rightarrow-1}\frac{\ln z}{z^{a}}\\&amp;=2\pi i\frac{\ln e^{i\pi}}{e^{i\pi a}}\\&amp;=2\pi i\frac{\ln1+i\pi}{e^{i\pi a}}\\&amp;=-\frac{2\pi^{2}}{(e^{i\pi})^{a}} \end{align*} On $L_1$, $z=xe^{i\epsilon}$ where $\epsilon\leq x\leq R$  On $L_{2}$, $z=xe^{i(2\pi-\epsilon)}$ where $\epsilon\leq x\leq R$  On $C_{R}$, $z=Re^{i\theta}$ where $\epsilon\leq\theta\leq2\pi-\epsilon$  Lastly on On $C_{\epsilon}$, $z=\epsilon e^{i\theta}$ where $\epsilon\leq\theta\leq2\pi-\epsilon$  So I tried to compute them separately and I anticipate the curves will both go to $0$ by ML inequality, and two linear integrals will consist of the term $\int_{0}^{\infty}\frac{\ln x}{x^{a}(x+1)}dx$ and hence simply solve for it. But I'm having trouble physically solving it out. I think the log is throwing me off. Can anybody please help me? What does "it" refer to in "it's raining"? I wanted to leave the question title as is so as not to take away from my amusement :).  Anyway,     It's raining.   What is raining? Is it the sky? The clouds? The weather? The rain? What is "it"? Any historical insights on the statement? What is the logic behind the timer of the Sojourner Badge? Does the 24 hours timer start:     when you hack a portal on a particular day     or     does it use the calendar days and check if you did hack a portal on a particular day   or     does it simply use a fixed international timezone to calculate the 24 hour cycle   or     does it use the agent's hacking cell's timezone to start it?   If it's the calendar days method than the explanation of the badge would be a little bit misguided because you could hack a portal on 00:01 on Saturday and then hack another one on 23:59 on Sunday and it would be practically two days between two hacks.  If it's based on the agent's last hack for a particular day then the explanation still would be problematic?  The third option would be a little bit unfair (or timezone racist) for the rest of the world.  The last option (the cell's timezone) would/could be both unfair for travellers and/or non-travellers.  Does anyone know any details about it? Replace a long string with the sed command: Argument list too long error I'm trying to execute this command  sed -i -e "s/BASE_64/$BASE_64/" FILE_NAME   where $BASE_64 is a base 64 representation of a file content.  sed gives me an error since the string is too long.     Argument list too long   How is it possible to avoid this error? Prove the following equality using mathematical induction: Prove the following equality using mathematical induction: For any integer $n \ge 1$  $$\sum_{i=1}^{n} \frac{1}{i(i+1)} = \frac{n}{n+1}$$  I understand for the base base I need to have $n=1$. If I substituted $n$ for 1 and $i$ for 1 I would get   \begin{align} \sum_{i=1}^{1} \frac{1}{1(1+1)} &amp;= \frac{1}{1+1} \\ \sum_{i=1}^{1} \frac{1}{2} &amp;= \frac{1}{2} \end{align}  As for the inductive step, I inputted $n +1$ but it did not work for me because honestly I did not know what to do with the $i$ and what I should do next.  How would I go about doing the next step and an explanation for $i$ would be helpful. How to install Unity 8? I'm using Ubuntu 14.04 and found out that we can install Unity 8 on it. Will Unity 8 replace Unity 7 once I install it? And if it does can I switch back to Unity 7 if I want? How would one go about it? Issues with win key and right alt key after Windows Update (Polish diacritical signs not working)