Can't compile/link class with templated member from separate .cpp
Why can templates only be implemented in the header file?
I'm running tests of a variable-size-and-contents test set. Data files are added and removed frequently. I'm looking for an automated way of gathering a file list.  All files are in subdirectories of D; I need the full directory and name added to a text file. However, I only need those files that have a "paired" file, which has the same filename but a different extension (so... different filename, but in a structured way). So, if there is a MyFileName.A and MyFileName.B, then I want D/.../MyFileName added to the file list.  There are .A files without .B files, but no .B files without .A files. If a .A has a .B file, then both files are in the same directory.   Any advice? Suppose I have something like the following:      \begin{eqnarray*} \mathrm{gcd}(x^3 + 6x^2 + 5x + 5, x^3 + 13x^2 + 6x + 3) &amp;=&amp; 102x^2 + 108x + 2 \ \mathrm{with} \ p = 109 \\ \mathrm{gcd}(x^3 + 2x^2 + 9x + 4, x^3 + 3x^2 + 7x + 9) &amp;=&amp; 1 \ \mathrm{with} \ p = 131 \\ \mathrm{gcd}(x^3 + 3x^2 + 9x + 12, x^3 + 6x^2 + 12x + 4) &amp;=&amp; 6x + 122 \ \mathrm{with} \ p = 157 \end{eqnarray*}   How do I align the statements at the end of each line (i.e. the "with p = ..." bit) to the right? Can I see a list of gyms I left a pokemon at? During Winter Bash, users can earn hats. But sometimes it seems that a hat was awarded even though its requirements weren't (yet) met, or vice versa.  What could be the reason for this? How many authors should attend a conference? I wrote a paper with  3 other students regarding my final year project in mechanical engineering. It was recently selected for a conference in NIT Delhi. Minimum one author is required to present and the price is pretty steep for the participation certificate.Should all of us attend the conference or just one of us? Does the certificate hold any value? identifying which item is clicked in a multi level list using jquery Stack Overflow has HTTPS in some places! However, this breaks most existing image links. Could those be made protocol-relative, or react to the requesting protocol, or just always use HTTPS?  The same applies to .sponsor-tag-img. Can Rails Routing Helpers (i.e. mymodel_path(model)) be Used in Models? Say I have a Rails Model called Thing. Thing has a url attribute that can optionally be set to a URL somewhere on the Internet. In view code, I need logic that does the following:  &lt;% if thing.url.blank? %&gt; &lt;%= link_to('Text', thing_path(thing)) %&gt; &lt;% else %&gt; &lt;%= link_to('Text', thing.url) %&gt; &lt;% end %&gt;   This conditional logic in the view is ugly. Of course, I could build a helper function, which would change the view to this:  &lt;%= thing_link('Text', thing) %&gt;   That solves the verbosity problem, but I would really prefer having the functionality in the model itself. In which case, the view code would be:  &lt;%= link_to('Text', thing.link) %&gt;   This, obviously, would require a link method on the model. Here's what it would need to contain:  def link   (self.url.blank?) ? thing_path(self) : self.url end   To the point of the question, thing_path() is an undefined method inside Model code. I'm assuming it's possible to "pull in" some helper methods into the model, but how? And is there a real reason that routing only operates at the controller and view layers of the app? I can think of lots of cases where model code may need to deal with URLs (integrating with external systems, etc). ART has better performance and better battery life on paper at least.  Should I consider switching to it on my moto g? What are the results I can expect? What precautions should I take? Is it easy to turn back to dalvik? I have just installed 12.04 LTS on my laptop and I'm kinda new in this. I am required to write some program in Fortran 77 and I need a Fortran 77 compiler. I have tried installing g77 as described in the Ubuntu website but was unable to do so. I have typed in the following in terminal:  sudo apt-get install g77   and get the following:  Reading package lists... Done Building dependency tree        Reading state information... Done Package g77 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'g77' has no installation candidate   May I know what is the problem? I have tried searching g77 in the software center but apparently it is not there. Does this mean it is not available for 12.04?  I'm currently using an Asus K43S laptop with Intel Core i5-2450M processor and my Ubuntu is installed alongside Windows. I read a novel when I was 12 or 13 (late 80's, early 90's) about two timelines combining on Earth.  It was a full length novel for adults that I swiped from my mom (she doesn't remember it at all.)  I've been trying to figure out what the title is for some time but my google-fu is unable to find the right search terms.    The book was published in the 80's or perhaps early 90's.  The story: It was set on Earth and featured two timelines running concurrently (in the 80's?)  Timeline 1:  The nuclear missile crisis had gone badly and a low level nuclear war had more or less destroyed the US, but small towns still survived but are slowly fading away.  Much of the story was about the scarcity of goods, and the protagonist in the main thread of the book started the story by finding a 6 pack of Coke buried in a ruined house.  Throughout the story people were finding things that had grown scarce (deer, bullets, human beings.)  One strange scene I recall involved mutant/radioactive sweet potatoes that had driven a man insane.  Eventually people in this timeline began having dreams of their lives in Timeline 2.  Some of the people were not having dreams, and it was eventually discovered that they had died in Timeline 2.    Timeline 2:  There is panic in a world recognizable as our 1980's as nuclear war draws near.  Since more and stronger missiles have been developed, the end of humanity is at hand.  Things start disappearing from that world as the war begins.  Timeline 2 was mostly seen as vignettes of panicked people running around.  Combination of Timelines: In a weird, incongruous, almost surely poorly written scene, Gaia (yes, Earth itself) is seen to be combining a dying timeline with a doomed timeline in order to save humanity.  At the end of the novel, kids from Timeline 2 are transported into Timeline 1 in order to repopulate.  The new kids drink all the Coke, in case you were wondering...  Any help finding the title would be welcome.  I recall enjoying the book a lot when I was a kid, but I suspect my mom traded it in at our local used book store because at some point it just disappeared. How to work with iAds using xcode 3.1.3 command not found and syntax error near unexpected token I have this script to divide a file over a 100000 or even more in 50000 lines.  desc()                                                     {                                                       echo $1 $2|awk '{d=$1;}                                 BEGIN {a=1;b=0}                                            { f=d"0"a;                                                while ((getline x&lt;d)&gt;0)                                   { print x&gt;&gt;f".txt"                                        if (b++&gt;=50000)                                            {                                                         close(f);b=0;a++;f=(a&lt;10)?d"0"a:f=d""a                }                                                  }                                                   }                                                   END {print "Terminado ... ! "}'                         }                                                      if [ -f $1 ]; then                                              desc $1 $2                                      fi                                                        When I execute it I got this error message:  sh-3.2$ parte.sh pa.txt                                  : command not found                                      '/parte.sh: line 2: syntax error near unexpected token ` '/parte.sh: line 2: `desc()                              sh-3.2$                                                    Can anyone help to solve it? There are often situations where buying two separate one-way tickets from A to C via B is cheaper than buying a normal multi-leg ticket. This can be especially useful with airlines such as Ryanair, which specifically avoids selling multi-leg tickets.  Is there a search engine which allows one to search for such flights? I'd like to call a function in python using a dictionary.  Here is some code:  d = dict(param='test')  def f(param):     print(param)  f(d)   This prints {'param': 'test'} but I'd like it to just print test.  I'd like it to work similarly for more parameters:  d = dict(p1=1, p2=2) def f2(p1, p2):     print(p1, p2) f2(d)   Is this possible? Can I speed up iCloud photo sync between iPhone and Macbook? I have an iPhone 5 running iOS 9.1 and a Macbook Pro running Yosemite.  Both devices are set up to sync photos to and from iCloud.  When I take a photo on the iPhone (for further processing on the Macbook), it takes an inordinate amount of time until the photo shows up in the Macbook's photos library - sometimes up to 10-20 minutes. Sometimes it seems to work faster if I quit the Photos app on both devices, and start it again.  I often end up sending myself photos through E-Mail because it's quicker. That seems ridiculous!  Is there a way to force a sync on the iPhone, or to speed up the process some other way? Energy conservation in General Relativity How to see data from .RData file? My computer only has one USB-C port and I want to connect multiple USB-C devices to it.  I have trawled through Amazon but am amazed that I cannot find a single one. There are many hubs that have USB 3.1 USB-A ports but not USB-C ones.  Is there a limitation in the spec that prevents this being possible? Toggle Switch to swap the connections of two buttons I am trying to mod my arcade stick so I can switch two commonly swapped buttons on the controller.  Essentially they are simple 2 terminal momentary switches connected directly to the controller PCB. I would like to switch their responsibilities, so in my case the Back button and the LB button on the XBox pcb I would like to swap so the Back actuates the LB button on the PCB and the LB actuates the Back button.  My assumption is that I would need a switch with 8 terminals, 4 in 4 out.  What type of switch am I looking for?