Assume these two cc files: 0.cc #include &lt;iostream&gt;  template &lt;class T&gt; T test(){  return 5; }  int main(){  return test&lt;int&gt;(); }  1.cc template &lt;class T&gt; T test(){  return 5; }  We compile them with g++ 0.cc 1.cc. This compiles and runs successfully but if above functions were not templates then we would get a duplicate symbol error during compilation and linking phase. Why using templates does not generate a link error?
Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)
How do I completly remove XP from my pc. I currently have a dual boot with XP and Windows 7. Since installing Windows 7, I have never used XP. Can I remove it without causing problems with Windows 7? Running this script on: "Red Had Enterprise Linux Server release 5.11 (Tikanga)"  Mail is: version 8.1 6/6/93 (appears quite old).  Have tried various things and cannot seem to get this to work..  echo "Email message" | mail -a /home/user/checks/notprocessed.txt -a /home/user/checks/dirlist.txt -s "Subject" recipient@company.com /home/user/checks   Resulting message:     mail: invalid option -- a   mutt is not installed and I have limited access to this system as it is owned by the company I work for.  I could add in other components, but has to go through change management, and related processes.  uuencode is not available either.  Here is what I am using today and I am trying to add a second file to:  if grep 'Not Empty' /home/user/checks/notprocessed.txt    then    echo "files were found";     SUBJECT="NIGHTLY DIRECTORY LISTING OF FILES SENT TO VENDOR";    FROM="SENDER&lt;sender@company.com&gt;"    # EMAIL="JOHN DOE&lt;recipient@company.com&gt;"    EMAIL="MARY DOE&lt;recipient@company.com&gt;";    /bin/mail -s "$SUBJECT" "$EMAIL" -- -f "$FROM" &lt; /home/user/checks/notprocessed.txt /home/user/checks/dirlist.txt     exit -20 fi   And..  /home/user/checks/dirlist.txt is not attached or included as part of the e-mail.  I would like /home/user/checks/dirlist.txt to be actually an attachment  This actually does work - but includes the notprocessed.txt as the body of the email..  if grep 'Not Empty' /home/user/checks/notprocessed.txt    then    echo "files were found";     SUBJECT="NIGHTLY DIRECTORY LISTING OF FILES SENT TO VENDOR";    FROM="SENDER&lt;sender@company.com&gt;"    # EMAIL="JOHN DOE&lt;recipient@company.com&gt;"    EMAIL="MARY DOE&lt;recipient@company.com&gt;";    /bin/mail -s "$SUBJECT" "$EMAIL" -- -f "$FROM" &lt; /home/user/checks/notprocessed.txt     exit -20 fi How does the two slit experiment work? Whilst going through 'A brief history of time', I faced difficulty in understanding the . How can an individual electron cause fringes on screen? I was unable to understand it? Please explain it simply. Word style "keep with next" except on last item How would I identify what's causing my Mac to permanently hang on shutdown? Whenever I try to shutdown or reboot my Mac (Macbook Pro 15" Retina late 2013, OS X 10.11.3) it closes all programs like normal and then it goes into that black screen with the progress bar. When it gets to about halfway it permanently hangs and won't ever finish rebooting. I looked at the log viewer and couldn't find anything in particular. Is there a way to monitor a shutdown more closely and find out what's causing it to get stuck? Coordinate-Free Definition of Trace. Erlang server, Java client - TCP messages get split? 80's Animated movie: An old man joins mission to save a boy stranded on a hostile world A guy on a space ship picks up a distress call, a boy is stranded on a planet with a hostile environment. He &amp; his crew go to the rescue, stopping on the way to pick up an old man who comes with them. Most of the top of the old guy's skull is metal, from an old injury.  They've various adventures on the way (their ship is boarded by pirates/bandits/hostile forces at one point).  They get to the planet with the boy. They've limited time to save him as the planet is being moved back in time. (I can't remember why) When they find the boy, he's being attacked by giant wasp-type-things.   The boy is injured on the top of his head. The old guy dies protecting him. The boy gets shifted back in time with the planet and - you guessed it - survives, grows up and turns out to be the old guy.  Now that I've remembered some of it, the bits I can't remember are driving me crazy. I'd love to see this again, if I could identify it I might be able to track down a copy.  I'd swear I saw this mid 80's on morning TV, but it I could be out by 5 years either way. Thanks Does the  tag position in HTML affects performance of the webpage? We can easily find out if the vectors are dependent or not by finding determinant of matrices formed from the vectors. But if the matrix is not a square matrix, we cannot find the determinant. Then how do we know if the vectors are linearly independent? Equivalent conditions for a preabelian category to be abelian Let's fix some terminology first. A category $\mathcal{C}$ is preabelian if:  1) $Hom_{\mathcal{C}}(A,B)$ is an abelian group for every $A,B$ such that composition is biadditive,  2) $\mathcal{C}$ has a zero object,  3) $\mathcal{C}$ has binary products,  4) $\mathcal{C}$ has kernels and cokernels.  A category $\mathcal{C}$ is abelian if it is preabelian and satisfies:  5) every monomorphism is a kernel and every epimorphism is a cokernel.  Define the coimage of a map to be the cokernel of its kernel, and the image to be the kernel of its cokernel. We have the following commutative diagram:    where $\overline{f}$ is the only existing map (because of universality of kernel and cokernel).  I'm having trouble proving the following:     A preabelian category $\mathcal{C}$ is abelian iff $\overline{f}$ is an isomorphism.   The converse is easily shown, I'm having trouble proving $\Rightarrow$... How to remove spikes from switching transistor? I can't run this latex script DDL Trigger in MySQL? This is just a curiosity. I have come across multiple proofs of the fact that there are infinitely many primes, some of them were quite trivial, but some others were really, really fancy. I'll show you what proofs I have and I'd like to know more because I think it's cool to see that something can be proved in so many different ways.  Proof 1 : Euclid's. If there are finitely many primes then $p_1 p_2 ... p_n + 1$ is coprime to all of these guys. This is the basic idea in most proofs : generate a number coprime to all previous primes.  Proof 2 : Consider the sequence $a_n = 2^{2^n} + 1$. We have that  $$ 2^{2^n}-1 = (2^{2^1} - 1) \prod_{m=1}^{n-1} (2^{2^m}+1), $$  so that for $m &lt; n$, $(2^{2^m} + 1, 2^{2^n} + 1) \, | \, (2^{2^n}-1, 2^{2^n} +1) = 1$. Since we have an infinite sequence of numbers coprime in pairs, at least one prime number must divide each one of them and they are all distinct primes, thus giving an infinity of them.  Proof 3 : (Note : I particularly like this one.) Define a topology on $\mathbb Z$ in the following way : a set $\mathscr N$ of integers is said to be open if for every $n \in \mathscr N$ there is an arithmetic progression $\mathscr A$ such that $n \in \mathscr A \subseteq \mathscr N$. This can easily be proven to define a topology on $\mathbb Z$. Note that under this topology arithmetic progressions are open and closed. Supposing there are finitely many primes, notice that this means that the set $$ \mathscr U \,\,\,\, \overset{def}{=} \,\,\, \bigcup_{p} \,\, p \mathbb Z $$ should be open and closed, but by the fundamental theorem of arithmetic, its complement in $\mathbb Z$ is the set $\{ -1, 1 \}$, which is not open, thus giving a contradiction.   Proof 4 : Let $a,b$ be coprime integers and $c &gt; 0$. There exists $x$ such that $(a+bx, c) = 1$. To see this, choose $x$ such that $a+bx \not\equiv 0 \, \mathrm{mod}$ $p_i$ for all primes $p_i$ dividing $c$. If $a \equiv 0 \, \mathrm{mod}$ $p_i$, since $a$ and $b$ are coprime, $b$ has an inverse mod $p_i$, call it $\overline{b}$. Choosing $x \equiv \overline{b} \, \mathrm{mod}$ $p_i$, you are done. If $a \not\equiv 0 \, \mathrm{mod}$ $p_i$, then choosing $x \equiv 0 \, \mathrm{mod}$ $p_i$ works fine. Find $x$ using the Chinese Remainder Theorem.   Now assuming there are finitely many primes, let $c$ be the product of all of them. Our construction generates an integer coprime to $c$, giving a contradiction to the fundamental theorem of arithmetic.  Proof 5 : Dirichlet's theorem on arithmetic progressions (just so that you not bring it up as an example...)  Do you have any other nice proofs? Substituting table salt or sea salt for kosher salt? The roasted chicken recipe I'm following of course calls for kosher salt, but I don't have any, and getting some is out of the question.  I have sea salt and table salt on hand.  Can I substitute one of those instead, and if so, what is the proper ratio of the kosher salt the recipe calls for to either sea salt or table salt? Catching poisoned arrows When catching an arrow tipped with poison (like the ones used by yuan-ti) with an ability like the one the monk has or the one given by arrow catching gloves: does the ability reduce the poison damage? If so, is the total damage or the piercing one caused by the arrow only the damage that must be downed to 0 to catch the missile? Calculate sum of series $\sum \frac{n^2}{n!}$ I have to calculate sum of series $\sum \frac{n^2}{n!}$. I know that $\sum \frac{1}{n!}=e$ but I dont know how can I use that fact here.. What is $\int_0^1\frac{x^7-1}{\log(x)}\mathrm dx$? /A problem from the 2012 MIT Integration Bee is $$ \int_0^1\frac{x^7-1}{\log(x)}\mathrm dx $$ The answer is $\log(8)$. Wolfram Alpha gives an indefinite form in terms of the logarithmic integral function, but times out doing the computation. Is there a way to do it by hand? Is it possible to put commands in /etc/motd? Can I put shell commands in the /etc/motd login banner file? I have tried:   $(uptime)   and  `uptime`   Is this possible?