How to call method with arbitrary template arguments? I obtained a .hpp file online which contained both the class declaration and definition together as such:  //Foo.hpp class Foo{     Foo();      &lt;template T&gt;     Foo&amp; func1(const &amp;T t); };  inline Foo::Foo(){     //constructor }  &lt;template T&gt; Foo&amp; Foo::func1(const T&amp; t){     //function  }   I have to include this header file (basically a library) in multiple source files. Since it contains the definitions of the methods, I get redeclaration (or redefinition, I forgot) errors when I include it more than once in the project. So I decided to split the definitions into a .cpp file and I'm using the library in main.cpp as shown.  //Foo.hpp class Foo{     Foo();     &lt;template T&gt;     Foo&amp; func1(const T&amp; t); };   and  //Foo.cpp #include "Foo.h" Foo::Foo(){     //constructor }   &lt;template T&gt; Foo&amp; Foo::func1(const T&amp; t){    //function  }   For the function call  //main.cpp #include "Foo.h"  int main (void){     Foo bar;     bar.func1(5);  //shows error as "undefined reference to"     bar.func1&lt;int&gt;(5); //doesn't work either }   From what I've found, I think that the acceptable types for the template should be declared by instantiating the template. However I don't know the syntax and the location to do so. Thanks in advance for any assistance.  FYI: just as a temporary workaround, I have explicitly stated the argument types as "int" for func1() in both the prototype in Foo.hpp and definition in Foo.cpp and getting rid of the template all together. No errors returned.  This is just temporary as there are many other similar templated functions as func1() and it does not seem like a pretty way to solve the issue. I strongly believe that "int" should be declared as one of the data types for template T, i just don't know how.
Why can templates only be implemented in the header file? 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.)
In the biblatex doc, it says ( Version 1.7, p.11):     thesis      A thesis written for an educational institution to satisfy the   requirements for a degree. Use the type field to specify the type of   thesis.      Required fields: author, title, type, institution, year/date      Optional fields: subtitle, titleaddon, language, note, location,   month, isbn, chapter, pages, pagetotal, addendum, pubstate, doi,   eprint, eprintclass, eprinttype, url, urldate   I would like to know if there is any "canonical" way to add the name of the supervisor(s) in a field of the .bib file (no .bbl manipulation please, I want my bibliography to be usable "as it" in several documents).  The expect result could be something like  :     Meand Myself. “A brilliant result, explained”. PhD thesis**, under the   joint supervision of Pr. Toto and Pr. Tata**. Université Paris 24,   Nov. 2013.   The "under the (joint) supervision" could be a string that would be declined in four ways:   under the supervision of  under the joint supervision of and the abridged forms Python ( or general programming ). Why use  instead of != and are there risks? I did an upgrade today to the latest version of ubuntu. Everything looked good and fine only for me to discover that I cannot find my applications after clicking the 'Show Applications' icon. The same applies when I search for an application in the search bar, I do not see it. It shows me an endless search.  These are the screenshot images of the problem:      In the meantime, I access my applications from the menu at the top bar and also use the terminal to run applications with CLI. Here's a pickle: reference style links in markdown are fantastic. Numbered footnotes, however, can be a pain. Named references are a beautiful solution, but the editor seems to choke on them in certain contexts, throwing an error:  your post appears to contain code that is not properly formatted as code...  I've looked at a  and tested it out quite a bit and I'm pretty sure line breaking isn't the problem, named references are valid , and I can get multi-word named references to work basically every time (in this post, even). Is there a reason for named references to be seen as improperly formatted code in certain contexts? At the risk of being verbose (but for the sake of completeness), here's the source of the specific question I was trying to post when I encountered the problem: I'm trying to build a [Google Apps Script] that integrates with [Trello], the idea being to use it to push information from spreadsheets and forms into the [Trello API] and create cards on a `pending` list on a certain board.  I found this [question] on here that pointed me in the right direction, and added in OAuth based on the [GAS OAuth Documentation]. The problem is I can't post the the board. I run the script, the OAuth prompt fires, and the script completes with no errors. I can also `GET` data from the private board, so I assume the authorization is working properly.  So, what am I doing wrong that prevents my script from `POST`ing to Trello?  Here's the code I'm working with:      var trelloKey = [Trello API key];     var trelloSecret = [Trello API key secret];     var trelloList = [the id of the list we're posting to];      var oauthConfig = UrlFetchApp.addOAuthService('trello');         oauthConfig.setAccessTokenUrl('https://trello.com/1/OAuthGetAccessToken');         oauthConfig.setRequestTokenUrl('https://trello.com/1/OAuthGetRequestToken');         oauthConfig.setAuthorizationUrl('https://trello.com/1/OAuthAuthorizeToken');         oauthConfig.setConsumerKey(trelloKey);         oauthConfig.setConsumerSecret(trelloSecret);      function createTrelloCard() {        //POST [/1/cards], Required permissions: write       var payload = {'name': 'apiUploadedCard',                       'desc': 'description',                       'pos': 'top',                       'due': '',                       'idList': trelloList};        var url = 'https://api.trello.com/1/cards'       var options = {'method' : 'post',                      'payload' : payload,                      'oAuthServiceName' : 'trello',                      'oAuthUseToken' : 'always'};        UrlFetchApp.fetch(url, options);     }  [Trello]: http://trello.com [Google Apps Script]: https://developers.google.com/apps-script/ [Trello API]: https://trello.com/docs/ [other question]: http://stackoverflow.com/questions/18710641/trello-api-how-to-post-a-card-from-google-apps-script-gas [GAS OAuth Documentation]: https://developers.google.com/apps-script/guides/services/external#making_requests_to_services_with_oauth  If I'm being a complete dunce, please let me know. It seems like one of those errors where it's either a hardcore backend bug or a really stupid user mistake and I'm ready to admit to the latter. Unreasonable RAM usage in Windows 7 I have a fresh install of Windows 7, and my RAM in normal startup goes up to 2.5GB. I looked at Task Manager, and there's at least 1.5GB missing from there and in Resource Monitor as well. There's no indication of what's using that RAM. Can someone tell me how I can find out what's consuming my memory? I believe it's a virus, but none of the free antivirus programs tracked it down.   I added the pictures below. If this is normal usage of Windows 7 as some answers imply, then I don't get this at all.   P.S. My Windows 8 Installation was running below 2.5GB, actually it was 1. something, until recently that I transferred some files from another computer which had the same problem that mine has now. I deleted Windows 8 and installed Windows 7, since I would do that anyway, and now I'm getting high memory usage in Windows 7 as well.   (Click images to enlarge) Add the ability to add "top questions" to Careers 2.0 Profile Allow me to add my own "top questions" too! I know, I know, the site should be more heavily weighted to answering, but sometimes, how and what people ask is important too! For example I recently asked  which I think is a fairly good question. Clearly I'm going to avoid questions where I've asked something very simple, but I know of a user or two who are implementing their own C standard libraries and the depth of those questions is important/ought to be on show.  Of course, the argument I can just look at their profile holds, but that awesome q/a might have been from a year or so ago in which case finding it is difficult. What is the rigor behind U subsitution? $ \int f(g(x)) dx = \int \frac {f(u)}{u'} du$  requires that  $ \int f(x) dx = \int f(x) \cdot dx$  but dx just represents the variable that F(x) +c is a function of. So why is it legal for dx to be treated algebriacally?  I tried investigating this property by using riemann summation:  $\lim\limits_{n \to \infty}(\sum_{k=1}^n f(\frac{kx}{n} )\frac{x}{n}) = \int_0^x f(t)dt= (F(x)+c)-(F(0)+c)$  and so you can define   $ \lim\limits_{n \to \infty} (\sum_{k=1}^n f(\frac{kx}{n} )\frac{x}{n})+F(0)+c)  = \int f(x) dx$  you can write $\frac{x}{n} = dx$ and $k\frac{x}{n}=kdx= x_k$  then you have  $ \lim\limits_{n \to \infty} (\sum_{k=1}^n f(x_k)dx)+F(0)+c) = \int f(x) dx$  since  dx is being written to be multiplied by the series, then you can define dx in different terms to aquire an integral in terms of other variables.   but that exists only in abstraction. I can't quite sufficiently complete the task of doing so. I have read that watchdog timer pushes microprocessor/controller into reset state whenever it experiences any software anomaly like executing in infinite loop. and after some time a very senior prof told us that after reset the processor resumes operation from the next instruction to the erroneous one.  when watchdog timer resets the processor, from where does the processor start its next execution?  I just wanted to know what is correct or if some other concept is employed? Loop doesn't see value changed by other thread without a print statement Stack Overflow technology makes me write bad answers Today I had some time and felt like writing a relatively good answer on Stack Overflow; explaining both the underlying mechanisms and good practices, unlike usual declarative answers in a "do that" style.  It took me like an hour of time, $50 if I were free lance. It'll bring me nothing but 3-5 occasional views, and - if I get lucky - some ignorant comments.  You know, it's quite discouraging.  Instead of pride for the job that was done, I feel frustrated. I know, this answer may offer help to the OP, if he ever notices it (being already satisfied with other answers).  So the only fate the answer will meet is to sink forever, below thousands other questions, falling like snow.  So, being a programmer, I am thinking of efficiency. It's a waste of time to spend so much effort to answer one question when there is no way to [actually] reuse it. So, I wouldn't do it again but just turn back into short answers mode without explanations.       Seeing other answers, I don't think I am only one with such feeling.  The current policy is driving knowledgeable and educational users away, yet it attracts inexperienced ones in numbers. Ones who will tell you to use [some technology] which they never have laid their hands upon. Ones who write answers just because they have learned some "good practice" from other questions, and this "knowledge" becomes an endless source of rep points.  The idea of Stack Overflow is rotten. It was excellent when trees were high and traffic was low.  It turned bad now; it has become a honeypot for all the "enthusiast programmers" of the world, eager to share their 2 cents faster than you can say the word "close".  You're killing a great resource. Despite all the nice words and proper declarations, it discourages the reuse of the knowledge. And encourages fast on-site answers.  Of course, the rules will tell you contrary. It's all nice and proper (if you don't mind it's strict mutual exclusivity). But mechanically, technologically it works in the way I described.  I tried to write a tag wiki. You know, it was biggest waste of time in my life. As a matter of fact, it is not a wiki at all; you can't even link to a certain section. Not to mention that nobody ever has the idea to read tag wikis.  Reference questions? Don't make me laugh. There is no good mechanism to store and categorize links. Favorites, although intended for the different purpose, are a chunk of crap when you want to use it as a reference. So, you can't compete with 30-seconds answers: a question will get 5 answers before you can even find an appropriate link.  Okay, I can organize links myself but, there are some problems:   I am just a human. I cannot remember everything I am just a human and I cannot answer questions at rate of 1 qpm. One person cannot fight the Tide. It's helpless. When technology makes people writing fast [incomplete] answers -  no good will of proper declarations can do a thing.  Even if a question gets finally closed, it won't hurt anyone - the hydra grew two more already.   You'll call me a brute for insulting honest users and innocent volunteers, but that's fact: There are much more inexperienced users than experienced ones. And inexperienced users have much more spare time to hang over than experts who have their job to do. So, from that fact we can conclude that most of the answers on Stack Overflow have a low quality. Nobody cares. But I do.   There should be a technical way to limit the activity of not-so-knowledgeable-yet-eager-to-answer users. There should be a technical preference for the closing a question over answering it (have a silly answer for the silly question? welcome to comments). There should be a technical solution to accumulate and structure knowledge, a system that lets you choose a good answer instead of writing it by hand.   That's the only way. Otherwise Stack Overflow will remain an automated dispenser of bad practices.  Well, I just felt like letting it out again. Thank you for reading. In a multi server architecture, is it possible to find out from which machine a user logged into current machine using ssh?  For example, user1 logged into host1. From there, the user logged into host2 as sruser using ssh.  In above example, would it be possible to trace the sruser session of host2 back to user1 session in host1?  Would it be possible to get the hostname or terminal of user1 session? How can I turn off the shrine indicator (or make it stop beeping)? Using the affine linearized polynomial $f(x)=x^p-x-b$ is irreducible over $\mathbb{F}_q$ if and only if $\operatorname{Tr}_{\mathbb{F}_q/\mathbb{F}_p} \neq 0$. But here $\mathbb{F}_3$ is not a field extension of $\mathbb{F}_5$.  Also we have that: Let $a \in \mathbb{F}_q$ and let $p$ be the characteristic of $\mathbb{F}_q$. Then the trinomial $x^P - x - a$ is irreducible in $\mathbb{F}_q[x]$ if and only if it has no root in $\mathbb{F}_q$. Java Enum definition I thought I understood Java generics pretty well, but then I came across the following in java.lang.Enum:  class Enum&lt;E extends Enum&lt;E&gt;&gt;   Could someone explain how to interpret this type parameter? Bonus points for providing other examples of where a similar type parameter could be used. How to create a SQL Server function to "join" multiple rows from a subquery into a single delimited field? To illustrate, assume that I have two tables as follows:  VehicleID Name 1         Chuck 2         Larry  LocationID VehicleID City 1          1         New York 2          1         Seattle 3          1         Vancouver 4          2         Los Angeles 5          2         Houston   I want to write a query to return the following results:  VehicleID Name    Locations 1         Chuck   New York, Seattle, Vancouver 2         Larry   Los Angeles, Houston   I know that this can be done using server side cursors, ie:  DECLARE @VehicleID int DECLARE @VehicleName varchar(100) DECLARE @LocationCity varchar(100) DECLARE @Locations varchar(4000) DECLARE @Results TABLE (   VehicleID int   Name varchar(100)   Locations varchar(4000) )  DECLARE VehiclesCursor CURSOR FOR SELECT   [VehicleID] , [Name] FROM [Vehicles]  OPEN VehiclesCursor  FETCH NEXT FROM VehiclesCursor INTO   @VehicleID , @VehicleName WHILE @@FETCH_STATUS = 0 BEGIN    SET @Locations = ''    DECLARE LocationsCursor CURSOR FOR   SELECT     [City]   FROM [Locations]   WHERE [VehicleID] = @VehicleID    OPEN LocationsCursor    FETCH NEXT FROM LocationsCursor INTO     @LocationCity   WHILE @@FETCH_STATUS = 0   BEGIN     SET @Locations = @Locations + @LocationCity      FETCH NEXT FROM LocationsCursor INTO       @LocationCity   END   CLOSE LocationsCursor   DEALLOCATE LocationsCursor    INSERT INTO @Results (VehicleID, Name, Locations) SELECT @VehicleID, @Name, @Locations  END      CLOSE VehiclesCursor DEALLOCATE VehiclesCursor  SELECT * FROM @Results   However, as you can see, this requires a great deal of code.  What I would like is a generic function that would allow me to do something like this:  SELECT VehicleID      , Name      , JOIN(SELECT City FROM Locations WHERE VehicleID = Vehicles.VehicleID, ', ') AS Locations FROM Vehicles   Is this possible?  Or something similar? Can Rails Routing Helpers (i.e. mymodel_path(model)) be Used in Models? Tasks in custom Environment I need to wrap a tasks environment inside a custom \NewEnviron. Apparently, tasks chokes on code besides its \task or \item due to the , presumably causing it to do so on \BODY. Any way to get around this? Exact error given is "Something's wrong--perhaps a missing \item", as per:  \documentclass[a4paper]{book} \usepackage{environ} \usepackage[more]{tasks}  \NewTasks[style=enumerate,counter-format=tsk[1]),label-width=2ex]{mytaskenum}[\item](3) \NewEnviron{mytaskenv}[1][Exercises]{   % Misc. stuff to precede the tasks env here   \begin{mytaskenum}   \BODY   \end{mytaskenum}   % Misc. stuff to follow }{}  \begin{document}  \begin{mytaskenv}   \item item 1   \item item 2   \item item 3 \end{mytaskenv}  \end{document} Asserting that Atheism and Theism are both faith based positions I am recently testing an assertion that I have concluded namely that atheism is a faith based position just like theism is a faith based position.  The reason I arrived at this conclusion is that theists have no proof that God actually exists. It's purely a matter of faith. Yes, there maybe strong implicit proof that God exists in their opinion (scriptures, history, etc) but there is no concrete proof of God's existence. In my view, atheists also suffer from the same problem of providing a proof of their position. Specifically that they cannot prove that God is non-existent.  The typical rebuttal I get is that the burden of proof is on the theists. But I view this as a cop out and they hide behind the wall of burden of proof which is just a bias in the debate.  Given the above, I claim that both atheism and theism are positions based on faith. Would it be incorrect to claim that? Fundamental group of a torus with points removed Question 5.33 from "Topology and its Applications"  by Baesner is to compute the fundamental group of the torus ($T^2$) with $n$ points removed. I can "see" in my mind that if we remove one point we get a bouquet of two circles. Less clear is what happens when we remove two (or more) points. Any hints? Random place change in row with restrictions How could I randomly change places of characters in a text file, with some probability (say 10%)?  file:  1  34567 2  12356 3  16987   outcome:  1  35674 2  12653 3  61987