Using template for a function inside a namespace in a header
Why can templates only be implemented in the header file?
Inequality Proof in Real Numbers: If $p+q=1$ then $pq\le\frac14$ Let $p,q \in \mathbb R$, and $p+q=1$. Prove that $$pq \le \frac{1}{4}.$$   The first thing I did was define 3 possibilities that we can have from $p+q=1$:  1º  $p$ or $q$ is negative. Example:   $p=-10$, $q=11$   $-10+11=1$  $(-10)(11)=-110$  So if $p$ or $q$ are negative the inequality $pq$ $\le$ $\frac14$ holds.  2º $p$ or $q$ is $0$, that makes the inequality $pq$ $\le$ $\frac14$ be $0$ $\le$ $\frac14$, the inequality holds.  3º The final possibility I saw  was $0$ $\lt$ $p,q$ $\lt 1$, here i just see that the max value from $p,q$ can be $p,q = 1/2$ making $\frac12 + \frac12 = 1$ and $(\frac12) (\frac12) \le \frac14$, but i do not see the elegant way of proving that with other values the inequality holds.  I apologize in advance if I made any mistake or missed something. Why can't we initialize members inside a structure? Possible Duplicate:          On  it's a stated fact that if $I$ and $J$ are coprime ideals of a ring $A$, then $I^k$ and $J^\ell$ are also coprime for any integers $k,\ell$.   There's no proof given. Why is this fact true? I've found a couple of references () that suggest using final as much as possible and I'm wondering how important that is. This is mainly in the the context of method parameters and local variables, not final methods or classes. For constants, it makes obvious sense.  On one hand, the compiler can make some optimizations and it makes the programmer's intent clearer. On the other hand, it adds verbosity and the optimizations may be trivial.  Is it something I should make an effort to remember? $\mbox{rank}(A)=1$ implies $\det(A+I)=\mbox{trace}(A)+1$ This problem comes from exercise from my lecturer  Let $A$ be a square matrix such that $\mbox{rank}(A)=1$. Prove that $\det(A+I)=\mbox{trace}(A)+1$.  ($I$ is the identy matrix)  I usually haven't any idea in solving linear algebra problem. Bought in, bought on, bought from, bought at? Declaring static data members of normal class and class template How to enable hibernation? In Avatar: The Last Airbender, Aang's eyes glow when he goes into the Avatar State. This seems to be the case with all Avatars, but Aang and the other airbending Avatars tattoos glow too.      Is there any reason for why airbending Avatars tattoos glow as well as their eyes? JSF 2.1 ViewScopedBean @PreDestroy method is not called How do you create a daemon in Python? reveals x2 code snippets. The first result is to  which has a lot of documentation and explanation, along with some useful discussion underneath.   However, , whilst not containing so much documentation, includes sample code for passing commands such as start, stop and restart. It also creates a PID file which can be handy for checking if the daemon is already running etc.  These samples both explain how to create the daemon. Are there any additional things that need to be considered? Is one sample better than the other, and why? Decreasing font size in verbatim How can I modify the following command to make it work?  \newcommand{\code}[1]{\begingroup \fontsize{10pt}{10pt}\selectfont \begin{verbatim} #1 \end{verbatim} \endgroup}   I currently get the following error on the close of the following verbatim block:  ! Undefined control sequence. &lt;argument&gt; ...endgroup ^^M^^M$\eta_{xi} = r_{xi} -                                                    q_i \cdot p_x$ \\^^M$q_i ... l.227     \end{verbatim} Volume of the torus with an integral sort() and reverse() functions do not work How to dynamically change a web page's title? I have a webpage that implements a set of tabs each showing different content. The tab clicks do not refresh the page but hide/unhide contents at the client side.  Now there is a requirement to change the page title according to the tab selected on the page ( for SEO reasons ). Is this possible? Can someone suggest a solution to dynamically alter the page title via javascript without reloading the page? When to use "do" in phrases which are not questions? Example: You do need to drink more water.   or   You need to drink more water.   What is the difference? Find   $$\lim _{x\to \infty }x\Big(\ln\left(x+1\right)-\ln x\Big)$$  Here's how I do it:  $$x\Big(\ln(x+1)-\ln x\Big) = x\Bigg(\ln(x(1+\frac{1}{x}) - \ln x\Bigg)$$ $$x\Big(\ln x + \ln(1+\frac{1}{x}\Big)-\ln x =x\ln\Big(1+\frac{1}{x}\Big)$$ $$\ln\Bigg( \Big(1+\frac{1}{x}\Big)^x \Bigg) \rightarrow \ln 1^\infty = 0$$  What am I doing wrong? The answer is supposed to be $1$, but I get $0$. I'm interested in the properties of zero-diagonal symmetric (or hermitian) matrices, also known as hollow symmetric (or hermitian) matrices.   The only thing I can come up with is that it cannot be positive definite (if it's not the zero matrix): The Cholesky decomposition provides for positive definite matrices $A$ the existence of a lower triangular $L$ with $A=LL^*$. However the diagonal of $LL^*$ is the inner product of each of the rows of $L$ with itself. Since the diagonal of $A$ consists of zeros, so $L$ (and thus $A$) must be the zero matrix.  The sorts of questions that interest me are:   which symmetric matrices can be transformed orthogonally into a zero-diagonal matrix? what can we say about the eigen-values of a zero-diagonal symmetric matrix?. any other interesting known properties?? How do I "replay" the "Caveats" section from a homebrew recipe help you learn vs. help you to learn Source:  by Douglas Crockford (2008) Example:  My goal here is to help you to learn to think in JavaScript. I will show you the components of the language and start you on the process of discovering the ways those components can be put together.  Although it is usually the case that you mostly hear people say something like &quot;this will help you become a better person&quot;, is there any particular reason as to why he chose not to leave out the to and say help you to learn instead? If you've got something interesting to say, could you please elaborate on it as well? I would very much like to receive some coherent explanation and get this thing finally straight. The only time I know of, though, that you would use the to is when you say it like this:  It helps a lot to think of the rather difficult concept of classes used in modern software development as mere blueprints that architects and builders use to build houses. In life, it really helps to know your times tables by heart because not all the time do you have a calculator on you.  Because the aspect of the verb &quot;help&quot; is a little bit different here. But in all other cases, help do or help you do something is by far more common.