I've created a class that's designed to rotate a vector. (I realize this functionality basically already exists in STL, I'm just trying get a handle on template classes.)  My specification file:  template &lt;class T&gt; class ShiftVec { private:     vector&lt;T&gt; vec;  public:     ShiftVec(vector&lt;T&gt;);     vector&lt;T&gt; getVec();     void shiftRight(int);     void shiftLeft(int); };   My implementation file:  template &lt;class T&gt; ShiftVec&lt;T&gt;::ShiftVec(vector&lt;T&gt; v) {     vec = v; }  template &lt;class T&gt; vector&lt;T&gt; ShiftVec&lt;T&gt;::getVec() {     return vec; }  template &lt;class T&gt; void ShiftVec&lt;T&gt;::shiftRight(int n) {     rotate(vec.begin(),            vec.end()-n, // this will be the new first element  template class ShiftVec&lt;int&gt;; template class ShiftVec&lt;double&gt;; template class ShiftVec&lt;bool&gt;; template class ShiftVec&lt;string&gt;;   When I run this, I get a bunch of errors that look like this:  Undefined symbols for architecture x86_64:   "ShiftVec&lt;int&gt;::shiftRight(int)", referenced from:       _main in main.o   "ShiftVec&lt;int&gt;::getVec()", referenced from:       _main in main.o   "ShiftVec&lt;int&gt;::ShiftVec(std::__1::vector&lt;int, std::__1::allocator&lt;int&gt; &gt;)", referenced from:       _main in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)   I'm not sure exactly what's going wrong here. A push in the right direction would be helpful.
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.)
Dual boot UEFI Windows 7 and Ubuntu 12.04 (both 64 bits). W7 entry doesn't appear in GRUB List of Figures + Beamer? I want to have a List of Figures in my Beamer presentation.  I spent some time searching the web for a solution and only found desperate people telling others that it's not possible, i.e.  or .  I also made some experiments on my own, i.e. "abuse" tocloft to do the job. However, even \usepackage{tocloft} causes pdflatex to fail with ! LaTeX Error: \l@section undefined. (and lying to tocloft by defining the command as empty beforehand doesn't to any good either).  I can't really see why it should be that difficult to make a List of Figures in beamer, since \tableofcontents works flawlessly.   I'm not afraid of doing some coding on my own, but I'm not deep enough into TeX to really understand the magic behind the "List of Figures", "Table of Contents" and alike.  Is anyone out there having suggestions or links that might help me figure this out?  \documentclass{beamer}  % uncomment the following line % to get the error message % `! LaTeX Error: \l@section undefined.`  %\usepackage{tocloft}   % uncomment the following lines INSTEAD % to lie to tocloft % and get the next error message  %\makeatletter %\newcommand\l@section{} %\makeatother %\usepackage{tocloft}  \begin{document}  \begin{frame}{A frame} \begin{figure} \mbox{A} \caption{An 'A'} \end{figure} \end{frame}  \begin{frame}{List of Figures} \listoffigures \end{frame}  \end{document}   EDIT: Solution  Starting from Marco Daniels answer to my question, I modified his code to reflect my needs. Here is what I came up with. Please feel free to comment, improve and reuse this.  \RequirePackage{ifthen}  \makeatletter  \AtEndDocument{%   \clearpage   \beamer@tempcount=\c@page\advance\beamer@tempcount by -1%   \if@filesw   \newwrite\tf@lof   \immediate\openout\tf@lof\jobname.lof\relax   \newwrite\tf@lot   \immediate\openout\tf@lot\jobname.lot\relax   \fi }  \long\def\beamer@makecaption#1#2#3#4{%   \def\insertcaptionname{\csname#1name\endcsname}%   \def\insertcaptionnumber{\csname the#1\endcsname}%   \edef\insertframenumber{\theframenumber}%   \ifthenelse{\equal{#3}{\empty}}{%       \def\insertlistcaption{#2}%   }{%     \def\insertlistcaption{#3}%   }   \def\insertsource{#4}%   \def\insertcaption{#2}%   \ifthenelse{\equal{#1}{figure}}{%       \addtocontents{lof}{\protect\listoffigureformat{\insertcaptionnumber}{\insertlistcaption}{\insertframenumber}{\insertsource}}{}{}%   }{}   \ifthenelse{\equal{#1}{table}}{%       \addtocontents{lot}{\protect\listoftableformat{\insertcaptionnumber}{\insertlistcaption}{\insertframenumber}}{}{}%   }{}   \nobreak\vskip\abovecaptionskip\nobreak   \sbox\@tempboxa{\usebeamertemplate**{caption}}%   \ifdim \wd\@tempboxa &gt;\hsize   \usebeamertemplate**{caption}\par   \else   \global \@minipagefalse   \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%   \fi   \nobreak\vskip\belowcaptionskip\nobreak% }  \def\listoffigureformat#1#2#3#4{%   \makebox[2ex][r]{#1}%   \hspace{1ex}%   {\usebeamercolor[fg]{bibliography entry author} #2}%   \ifthenelse{\equal{#4}{\empty}}{}{ -- #4}%   \dotfill%   \makebox[2ex][r]{#3}\par% } \def\listoffigures{%   \setlength{\leftskip}{3ex}   \setlength{\parindent}{-3ex}   \@starttoc{lof}% } \def\listoftableformat#1#2#3{\makebox[2ex][r]{#1}\hspace{1ex}#2\dotfill\makebox[2ex][r]{#3}\par} \def\listoftables{%   \setlength{\leftskip}{3ex}   \setlength{\parindent}{-3ex}   \@starttoc{lot}% }  \long\def\@caption#1[#2]#3{   \par\nobreak   \begingroup     \@parboxrestore     \if@minipage       \@setminipage     \fi     \beamer@makecaption{#1}{\ignorespaces #3}{\ignorespaces #3}{\ignorespaces #2}\par\nobreak     \endgroup}  \makeatother How could a raw, untrained Force user be so adept at using the Force? Everything that I seemed to know about the Star Wars universe indicated that in order to be successful at being a force user, the user required decades of training and experience.  Which is why I thought that the Jedi trained their pupils from birth to be force users. The lengthy training period was also why the Jedi council said Anakin was too old, and subsequently why Yoda said Luke was too old to begin the training. This can be seen in comparing Luke's raw abilities in the original trilogy compared to that of the Jedi in the prequel trilogy.   However, in The Force Awakens,      Rey not only fends off Kylo Ren, she comes very close to killing him outright, even though she had never even held a lightsaber before.   This happens not long after      she uses her Force persuasion power to escape prison, despite not even believing she was Force sensitive until that point.   It doesn't make any sense that the fight wasn't over in a matter of seconds. What am I missing? Showing that $\displaystyle\lim_{s \to{1+}}{(s-1)\zeta(s)}=1$ I need prove the following: ($\zeta(s)$ is the Riemann zeta function)  $\displaystyle\lim_{s \to{1+}}{(s-1)\zeta(s)}=1$  I really don't know, I have tried hard, but have obtained nothing for now. Which answer is correct?       Tony _______to have children until his little daughter was born. After   she won his heart, he decided he wanted a big family.       A. didn't want.   B. hadn't wanted.   This is a multiple choice question from the Understanding and Using English Grammar Workbook 3rd edition by Betty Azar. To me, both answers are correct as I cannot see the diffrence. Please show me the wrong option to delete. Script for display wrapper class Account list of records? Hi i am trying to write script for display list of records from wrapper class.   @remoteaction     public static wrappercls getaccounts(){         string account = 'select id,name,accountnumber from account';         listacc = database.query(account);         count = listacc.size();         system.debug('#####'+count);         wrappercls wra = new wrappercls(count,listacc);         return wra;     }      public class wrappercls{         public integer count11;         public list&lt;account&gt; account;          public wrappercls(integer count11,list&lt;account&gt; account){             this.count11 = count11;             this.account = account;         }     }    This class returns list of account records and record count parameter.Need to display these records in page.Is it possible if possible Please help me on this..  Script  &lt;script&gt;   function getallaccounts(){     exremote.getaccounts(         function(result,event){             if(event.status){              }             else {              }        },{escape:true}     ); } &lt;/script&gt;   Thanks in Advance... Antecedent Precedence? I have a directory that I am trying to clean out that contains both files and subdirectories.  What I am trying to do is simple: move all the files into another directory, but leave all the sub-directories as they are.  I am thinking something like:  mv [*_but_no_dirs] ./other_directory   It seems like there should be a simple way to do this with wildcards * and regex...  Anyone have ideas? Constants of integration in integration by parts Context  I'm having trouble understanding the limited situations in which qualifiers can be distributed.  I am given that the rules are:  $$\forall x\left[P(x)\land Q(x)\right]\equiv\forall xP(x) \land\forall xQ(x) \tag{1}$$ $$\exists x\left[P(x)\lor Q(x)\right]\equiv\exists xP(x) \lor\exists xQ(x) \tag{2}$$  $$\forall x\left[P(x)\lor Q(x)\right]\not\equiv\forall xP(x) \lor\forall xQ(x) \tag{3}$$ $$\exists x\left[P(x)\land Q(x)\right]\not\equiv\exists xP(x) \land\exists xQ(x) \tag{4}$$    Questions   What are examples of $P(x)$ and $Q(x)$ that illustrate when these statements are true? How can I show these statements always hold using proofs? Why can't "$\forall x$" be distributed in example 3 or "$\exists x$" in example 4? Is there a description of Stack Exchange/Stack Overflow sites? Are Canon EOS and Nikon DSLR lenses interchangeable? Can we use the lenses from, say a Canon EOS 550D kit (Canon EF-S 18-55mm) with a Nikon DSLR D5000 for example) ? Also, is the reverse possible ?  I'm looking at interchangeability between recent DSLR lenses only, and not with older lenses. Also, for "average" lenses, and not ultra wide/ultra zoom.  The reason for this question is that I'm trying to decide between a Nikon D5000 and a Canon EOS 500D. I like the Nikon better, but Canon is more popular here amongst people I can interchange lenses with :) Is there a way to set initial state with rigid bodies? Let's say I set up a Rigid Body simulation in Blender (not in GE), and then run the simulation for a number of frames. Is there a way to tell Blender to use the current state and position as the initial state? So that when I go back to frame 1, the rigid bodies stay in the same place they did in frame X.  For instance, if I want a pile of bricks, I first place the bricks in the air and then let them drop down on the ground, coming to rest. When they have come to rest, I want to use that position as the starting position. ResultSet: Retrieving column values by index versus retrieving by label When using JDBC, I often come across constructs like    ResultSet rs = ps.executeQuery(); while (rs.next()) {     int id = rs.getInt(1);     // Some other actions }   I asked myself (and authors of code too) why not to use labels for retrieving column values:    int id = rs.getInt("CUSTOMER_ID");   The best explanation I've heard is something concerning performance. But actually, does it make processing extremely fast? I don't believe so, though I have never performed measurements. Even if retrieving by label would be a bit slower, nevertheless, it provide better readability and flexibility, in my opinion. So could someone give me good explanation of avoiding to retrieve column values by column index instead of column label? What are pros and cons of both approaches (maybe, concerning certain DBMS)? Kinetic energy conservation in a collision Kinetic energy conservation in collision.  In any type of collision type of collision if we take the system to comprised of both bodies then the net external force is zero. So the work done by external force is also zero. By the relation $W=K_f-K_i$ as $W$ is zero hence kinetic energy is conserved. But this not the case.   Can you tell me what is the flaw in my argument? Some people say that the argument has neglected the fact that some kinetic energy is transformed into heat. But heat is created due to the interactions between bodies during collision which is thus an internal force and thus shouldn't affect kinetic energy. When functions commute under composition File permissions and saving Let's say you open a file on which you have write permission. Meanwhile you change permissions and remove write permission while you still have the file open in some editor.  What will happen if you edit and save it? For a lot of questions here on TeX.SE and on other fora regarding MiKTeX, it turns out that the underlying problem actually lies in the not understood distinction between administrative and user modes. So let me ask these questions:  What’s the difference between administrative and user mode in MiKTeX, and in which situation should I use either one of these modes? Sometimes, I want to have enumerate lists in LaTeX start at other than the first value (1, a, i, etc.) How can I make an enumerate list start at an arbitrary value? How to remove the left part of a string?