I am puzzled...  This is the *.h-file:  #include &lt;string&gt; #include &lt;vector&gt;  template&lt;typename T&gt; class pvector { private:     std::string filename;     std::vector&lt;T&gt; v;     void readvector();  public:     pvector(std::string fname) : filename(fname) { readvector(); }     void push_back(const T &amp;el) { v.push_back(el); }     void pop_back() { v.pop_back(); } };   And this is the *.cpp:  #include &lt;fstream&gt; #include &lt;string&gt; #include "pvector.h"  using namespace std;  template&lt;typename T&gt; void pvector&lt;T&gt;::readvector() {     ifstream ifs(filename);     for(;;)     {         T x; ifs &gt;&gt; x; if(!ifs.good()) break;         v.push_back(x);     } }       If I want to generate the following object:  pvector&lt;string&gt; myVec("testfile.txt");   ... i get:      pvector.h:24: undefined reference to `pvector::readvector()'   Why???
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.)
Looking for a short story title about a "weird house" How many ways can $r$ nonconsecutive integers be chosen from the first $n$ integers? During self-study, I ran across the question of how many ways six numbers can be chosen from the numbers 1 - 49 without replacement, stipulating that no two of the numbers be consecutive.  I can obtain a simple lower bound by saying that, in the worst-case scenario, when you choose a particular number, there are now three numbers that cannot be chosen next.  For example, if I first pick 17, then I can't choose 16, 17, or 18 for the remaining choices.  This gives me the lower bound  $$\frac{49*46*43*40*37*34}{6!} = 6,773,770 \frac{8}{9}$$  This is about 48% of ${}_{49}C_6 =  13,983,816$.  The real answer must be bigger (and an integer).  I haven't found a way to calculate it, though.  The original problem asked to show that the probability of having non-consecutive integers when you choose six is greater than 50%, so if the problem is complicated to count exactly, better approximations that show the answer is above 50% would also be appreciated.   Of course, I can use a computer to do the counting, but I'm interested in learning what methods I'm missing. How to keep any Window "Always on Top"? Some software have an option for their window to be "Always on Top". Is there any way to get the same functionality for any window. Let me give an example where this would be useful.  Suppose I have a small browser window with real time stats from a game. The window is automatically updated at the rate of once every 10 seconds. I would like the small window to be always on top. so that I can just look at it whenever I want to, without actually going to it and at the same time I could continue working in my main application, which is at full screen.  Is there any Windows hack or App which can give me this functionality? I need your help with references. I have 1 main reference section, and I want to include a second list of references as an appendix. For the main reference I use:  \newpage  \bibliographystyle{plainnat}  \bibliography{library}   The problem is that I don't know how to include the second list using a different bib file, and then calling the function \nocite{*} to show every sources inside the file.   I have the appendix part workout. I need your help to design the function to call the second bibliography, and that does't interfere with the main reference:   \newpage  \appendix  \section{Other Sources} \label{app:ReferencesB}   In addition, I will prefer that the word References is not shown after Other Sources.  Thank you so much!! Estimate of analytic function in a unit disk Ralink MT7601U (148f:7601) Wi-Fi adapter installation How can I check if a directory exists in a Bash shell script? What command can be used to check if a directory exists or not, within a Bash shell script? Ignoring accented letters in string comparison I need to compare 2 strings in C# and treat accented letters the same as non-accented letters. For example:  string s1 = "hello"; string s2 = "héllo";  s1.Equals(s2, StringComparison.InvariantCultureIgnoreCase); s1.Equals(s2, StringComparison.OrdinalIgnoreCase);   These 2 strings need to be the same (as far as my application is concerned), but both of these statements evaluate to false. Is there a way in C# to do this? Suppress a biblatex field in only one of split bibliographies? I am aware of \clearfield, \clearlist etc (cf. ) - but I'm really not sure how to apply it in this context:  Say you have a split bibliography (i.e. several calls to \printbibliography in one document). How can you filter a specific field in a bibliography item - but only in one bibliography (i.e. only in one call to \printbibliography)?  For instance, in the MWE below (compiles with pdflatex test.tex &amp;&amp; biber test &amp;&amp; pdflatex test.tex &amp;&amp; pdflatex test.tex), let's say I'd like to filter urldate (i.e. urldate is not typeset) only in the first bibliography - but for the second one, the original/default behavior should be restored (i.e. urldate is typeset). How to I do that?  \documentclass{article} \usepackage{filecontents} \begin{filecontents*}{\jobname.bib} @online{ctan,   title        = {CTAN},   date         = 2006,   url          = {http://www.ctan.org},   subtitle     = {The Comprehensive TeX Archive Network},   urldate      = {2006-10-01},   label        = {CTAN},   langid       = {english},   langidopts   = {variant=american}, } @misc{google,   title        = {Google},   date         = 2007,   url          = {http://www.google.com},   urldate      = {2007-10-01}, } @misc{hotmail,   title        = {Hotmail},   date         = 2008,   url          = {http://www.hotmail.com},   urldate      = {2008-10-01}, } @misc{yahoo,   title        = {Yahoo},   date         = 2009,   url          = {http://www.yahoo.com},   urldate      = {2009-10-01}, } @misc{aol,   title        = {AOL},   date         = 2010,   url          = {http://www.aol.com},   urldate      = {2010-10-01}, } @misc{altavista,   title        = {AltaVista},   date         = 2011,   url          = {http://www.altavista.com},   urldate      = {2011-10-01}, } \end{filecontents*} \usepackage[utf8]{inputenc} \usepackage[backend=biber,defernumbers=true,style=ieee]{biblatex} \bibliography{\jobname}  \begin{document}  \section{Section 1} \begin{refsection}  Citing some stuff here: first \cite{ctan}, then \cite{google}, and finally \cite{hotmail}.  \printbibliography[sorting=none,section=\therefsection,resetnumbers=true]  \end{refsection}  \section{Section 2} \begin{refsection}  Citing some stuff here: first \cite{yahoo}, then \cite{aol}, and finally \cite{altavista}.  \printbibliography[sorting=none,section=\therefsection,resetnumbers=true]  \end{refsection}  \end{document}   Output: Are PHP variables passed by value or by reference? What is the best place for storing binary files that are related to data in your database? Should you:   Store in the database with a blob Store on the filesystem with a link in the database Store in the filesystem but rename to a hash of the contents and store the hash on the database Something I've not thought of   The advantages of (1) are (among others) that atomicity of transactions is preserved. The cost is that you might dramatically increase storage (and associated streaming/backup) requirements  The goal of (3) is to preserve atomicity to some degree - if you can enforce that the filesystem you are writing to does not allow files to be changed or deleted, and always has the correct hash as filename. The idea would be to write the file to the filesystem before permitting the insert/update referencing the hash - if this transaction fails after the filesystem write but before the database DML, that is fine because the filesystem is 'faking' being the repository of all possible files and hashes - it doesn't matter if there are some files in there that are not being pointed to (and you could clean them up periodically if you are careful)  EDIT:  It looks like some RDBMSs have this covered in their individual ways - I'd be interested to know how others do it - and particularly in a solution for postgres "Use self" doesn't work? I'm currently working with drivers in Blender 2.81 and want to use self but it doesn't work.   For example drive the rotation by the location, I'm adding a driver to the rotation, check the Use Self box and write self.location.x  Blender return the message: ERROR Invalid Python expression.  Have I missed something, is it a bug?  edit: XML serialization without null XMLArray Where To start Learning With Salesforce Development How well does jQuery support backward compatibility? We have had issues with Mootools not being very backward compatible specifically in the area of drag and drop functionality. I was wondering if anyone has had any similar problems with jQuery not being backward compatible. We are starting to use it quite heavily and are thinking about upgrading to a newer version to start using several plugins that require it. Will we have any issues if we get rid of the older version? Markdown source:  `http://google.com`  - `http://google.com`     - `http://google.com`   Rendered result:  http://google.com   http://google.com   http://google.com    Note that the third code span is a link. Adding a newline before the list item makes the link disappear. Ruby can add methods to the Number class and other core types to get effects like this:  1.should_equal(1)   But it seems like Python cannot do this. Is this true? And if so, why? Does it have something to do with the fact that type can't be modified?  Update: Rather than talking about different definitions of monkey patching, I would like to just focus on the example above. I have already concluded that it cannot be done as a few of you have answered. But I would like a more detailed explanation of why it cannot be done, and maybe what feature, if available in Python, would allow this.  To answer some of you: The reason I might want to do this is simply aesthetics/readability.    item.price.should_equal(19.99)   This reads more like English and clearly indicates which is the tested value and which is the expected value, as supposed to:  should_equal(item.price, 19.99)   This concept is what  and some other Ruby frameworks are based on. Novel about a guy who is possessed by the divine essence and the world ends? I read this novel back in the mid-80's but I'm pretty sure it was written in the 70's.  Strange things start to happen around a homeless man - like the laws of chance are changed.  The investigators discover that they can figure out what is going to happen next by interpreting the dreams/vision of the man.  One such dream is of a large body of water that is split into two pieces. Turns out that means that "C" (sea) - the speed of light has been halved.  The homeless man had become the embodiment of the creator essence. The creator was hiding, because it was tired of trying to keep the universe working and from the fight with is adversary - chaos.  At the end of the book, the creator allows the world to be destroyed and recreates it - except that planets are cubes and move in squares.  Yes - it was rather bizarre. A closed ball in a metric space is a closed set Inequalities for combinations of $\int f $ and $\int (1/f)$ where $m\le f\le M$ on an interval