Some "undefined reference error" questions are already posted on StackOverflow but I couldn't find solution to my problem.  My project contains 5 files: 5.cpp vector_base.h vector_base.cpp vector.h vector.cpp  I compile it with:  g++ -std=c++11 vector_base.cpp vector.cpp 5.cpp -o 5   And get the following error:  /tmp/ccO8NeGJ.o: In function `main': 5.cpp:(.text.startup+0x21): undefined reference to `Vector&lt;int, std::allocator&lt;int&gt; &gt;::Vector(unsigned int, int const&amp;, std::allocator&lt;int&gt; const&amp;)' 5.cpp:(.text.startup+0x2b): undefined reference to `Vector&lt;int, std::allocator&lt;int&gt; &gt;::destroy_elements()' collect2: error: ld returned 1 exit status   well, code looks fine for me. Where did I mess up?  The code is as follows:   5.cpp  #include "vector.h"  int main() {     Vector&lt;int&gt; a{10, 0}; }   vector.h  #ifndef VECTOR_H #define VECTOR_H  #include "vector_base.h"  template&lt;class T, class A = std::allocator&lt;T&gt;&gt; class Vector { private:     vector_base&lt;T,A&gt; vb;     void destroy_elements();  public:     using size_type = unsigned int;      explicit Vector(size_type n, const T&amp; val = T(), const A&amp; a = A());     ~Vector() { destroy_elements(); } };  #endif //VECTOR_H   vector.cpp  #include "vector.h"  #include &lt;algorithm&gt; #include &lt;memory&gt;  template&lt;class T, class A&gt; Vector&lt;T,A&gt;::Vector(size_type n, const T&amp; val, const A&amp; a)     :vb{a, n} {     std::uninitialized_fill(vb.elem, vb.elem + n, val); }  template&lt;class T, class A&gt; void Vector&lt;T,A&gt;::destroy_elements() {     for(T* p = vb.elem; p!=vb.space; ++p){         p-&gt;~T();     }     vb.space=vb.elem; }   vector_base.h  #ifndef VECTOR_BASE_H #define VECTOR_BASE_H  #include &lt;memory&gt;  template&lt;class T, class A = std::allocator&lt;T&gt;&gt; struct vector_base {      T* elem;     T* space;     T* last;     A alloc;      using size_type = unsigned int;      vector_base(const A&amp; a, typename A::size_type n)         :alloc{a}, elem{alloc.allocate(n)}, space{elem+n}, last{elem+n} {}      ~vector_base() { alloc.deallocate(elem, last-elem); } }; #endif //VECTOR_BASE_H   vector_base.cpp  #include "vector_base.h" #include &lt;algorithm&gt;  template&lt;class T, class A&gt; vector_base&lt;T,A&gt;::vector_base(const vector_base&amp;&amp; a)     :alloc{a.alloc}, elem{a.elem}, space{a.space}, last{a.last} {     a.elem = a.space = a.last = nullptr; }  template&lt;class T, class A&gt; vector_base&lt;T,A&gt;&amp; vector_base&lt;T,A&gt;::operator=(const vector_base&amp;&amp; a) {     swap(*this, a);     return *this; }   I tried compile every cpp file separately and then link all but it didn't work also.
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.)
Would a compass with unmagnetized needle work? We know that the needle that is used in a compass is a permanently magnetized ferromagnetic material and commonly steel is used.  If we used an unmagnetized iron needle instead, would it still align with Earth's magnetic field lines? If yes, how? Extracting text from HTML file using Python I'd like to extract the text from an HTML file using Python.  I want essentially the same output I would get if I copied the text from a browser and pasted it into notepad.    I'd like something more robust than using regular expressions that may fail on poorly formed HTML.  I've seen many people recommend Beautiful Soup, but I've had a few problems using it.  For one, it picked up unwanted text, such as JavaScript source.  Also, it did not interpret HTML entities.  For example, I would expect &amp;#39; in HTML source to be converted to an apostrophe in text, just as if I'd pasted the browser content into notepad.  Update html2text looks promising. It handles HTML entities correctly and ignores JavaScript.  However, it does not exactly produce plain text; it produces markdown that would then have to be turned into plain text. It comes with no examples or documentation, but the code looks clean.    Related questions: Prove that ${{n}\choose{k}} = {{n - 2}\choose{k}} + 2{{n - 2}\choose{k - 1}} + {{n - 2}\choose{k - 2}}$. I'm looking for some guidance in solving this. I have read through my text multiple times trying to find something similar to this and I'm coming up with nothing. I'm not really sure where to start on solving this problem.  The question simply states     Prove that ${{n}\choose{k}} = {{n - 2}\choose{k}} + 2{{n - 2}\choose{k - 1}} + {{n - 2}\choose{k - 2}}$.   I'm very new to binomial coefficients, and extremely lost. How far can/should one press philosophical doubt? Should we keep on questioning until nothing is left to question or is there a point on which we need to stand (which we often tend to do)? Descartes used 'I think' as this fixed point where the skepticism abates, there may be others. But what is a rational way to find one, if any? How is this question addressed in modern philosophy? I'm close to maxing out my character and I want to beat Ganon solely for the TRUE ending, but I'm too scared of losing some of my personal favorites from the Guardian Spear++ to fighting those damned Guardians (it was so fun).  So, after beating Ganon    Do monsters disappear? - Including the corrupted Guardians, but also the blood moons, I don't want to just face off against the Yiga Clan... Am I gonna run out of resources? - As a survival game Zelda BOTW has some emphasis on the survival genre but to me it is a survival-esque action-adventure game. Are special weapons still available when you max out? - Like the Savage Lynel Spears or Swords) How to show the solution of $\dot{x} = Ax $ is an invariant subspace? Consider the linear dynamical system $\dot{x} = Ax $ in $V$ a finite dimensional vector space.  The definition of an invariant subspace $U$ is as follows:  For all $x_0 \in U$, (initial condition), the solution $x(t)$ with initial condition $x(0)=x_0$ lies in $U$, i.e. $x(t) \in U$ for all $t \in \mathbb{R}$. Intuitively, it means if we start in a subspace we never leave that subspace.  Prove that a subspace $U \subset V$ is an invariant subspace if and only if $AU \subset U$. Concatenate multiple rows I'm working on a project that requires me to get some of the position and rotation values to give to an Arduino via pyserial, but after sifting through the Blender documentation I can't find how to get them through script. Limit memory usage for a single Linux process I'm running pdftoppm to convert a user-provided PDF into a 300DPI image.  This works great, except if the user provides an PDF with a very large page size.  pdftoppm will allocate enough memory to hold a 300DPI image of that size in memory, which for a 100 inch square page is 100*300 * 100*300 * 4 bytes per pixel = 3.5GB.  A malicious user could just give me a silly-large PDF and cause all kinds of problems.  So what I'd like to do is put some kind of hard limit on memory usage for a child process I'm about to run--just have the process die if it tries to allocate more than, say, 500MB of memory.  Is that possible?  I don't think ulimit can be used for this, but is there a one-process equivalent? Can command substitution be nested in variable substitution? The origin of spin is some what a puzzle to me, everything spin from galaxies to planets to weather to electrons.  Where has all the angular momentum come from? Why is it so natural?  I was also thinking do photons spin? we always think of the wave as a standard 2d sin wave but could this rotate in 3d? What implications would this have?   And what about spacetime how does all the spinning effect?  This has always been avoided in all lectures and classes I ever went to. I can never remember how I do this because it comes up so infrequently for me. But in C or C++, what is the best way to read a character from standard input without waiting for a newline (press enter).  Also ideally it wouldn't echo the input character to the screen. I just want to capture keystrokes with out effecting the console screen. Is there any way to use a nether portal to travel to y = 250? Why do statisticians like "$n-1$" instead of "$n$"? Is a 2-hour transit time enough to catch a connecting flight in Muscat airport? Both flights are with Oman Air I am flying from Dubai to India with Oman Air with a layover of 2 hours at Muscat airport. Is 2 hours enough for me to catch my connecting flight from Muscat to New Delhi? My flight from Dubai to Muscat as well as the connecting flight from Muscat to New Delhi are with Oman Air. Do I need to re-check in my luggage? Am I taking a risk or should I take an earlier flight from Dubai to get more layover time to be on the safer side? After I installed Ubuntu 13.04, I can't mount my NTFS partition.  Error mounting /dev/sda5 at /media/mrxfly/xFLyDiskData: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sda5" "/media/mrxfly/xFLyDiskData"' exited with non-zero exit status 14: The disk contains an unclean file system (0, 0). Metadata kept in Windows cache, refused to mount. Failed to mount '/dev/sda5': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option. Moving from HTTP to HTTPS in Google Search Console I'm moving from HTTP to HTTPS for my entire site. The site is currently added to Google Search Console (formerly Google Webmaster Tools) as www.example.com and all the pages are indexed without using SSL.  How do I go about moving to the new HTTPS URLs on Google Search Console?   Do I just submit an updated sitemap which has the HTTPS URLs or do I add a new site as https://www.example.com and submit the sitemap with HTTPS URLs? All current URLs are set to redirect to their HTTPS counterparts. Do I add multiple properties to Google Search Console? When I use the mobile app to vote for an answer that was awarded a bounty,  the bounty is no longer shown until I reload the answers. Securing WMS against unauthorized access? In a project the customer wants the images of the WMS to be secured against unauthorized access.   What are the common solutions to realize that?   Are they compatible with the OGC-standards? Find the sum $\frac{1}{2\cdot 3}+\frac{1}{3\cdot 4}+\dots+\frac{1}{99\cdot 100}$ Please help me calculate the following sum     $$\frac{1}{2\cdot 3}+\frac{1}{3\cdot 4}+\dots+\frac{1}{99\cdot 100}$$