The following is a great simplification of my code:  data.h  #include "id.h"  namespace n1 {     struct data     {         /* Relies on struct id */     }; }   id.h  namespace n1 {      struct data; // Forward declaration      template &lt;int dims&gt;     struct id     {         id(unsigned n);         data operator*(unsigned n) const;     };      template &lt;int dims&gt;     data operator*(unsigned n, id&lt;dims&gt; i);  } // namespace n1   id.cpp  #include "id.h" #include "data.h"  using namespace n1;  // Force instantiation of struct id for template values 1, 2, and 3 template struct id&lt;1&gt;; template struct id&lt;2&gt;; template struct id&lt;3&gt;;  template &lt;int dims&gt; id&lt;dims&gt;::id(unsigned n) {}  template &lt;int dims&gt; data id&lt;dims&gt;::operator*(unsigned n) const {     return data(); }  // warning C4667: no function template defined that matches forced instantiation template data operator*&lt;1&gt;(unsigned n, id&lt;1&gt; i);  template &lt;int dims&gt; data operator*(unsigned n, id&lt;dims&gt; i) {     return i * n; }   I'm using Visual Studio 2013. The first problem I encounter with this approach is the warning C4667. An alternative is to declare friend data operator*(unsigned n, id i) inside struct id and not forcing instantiation of this operator, which gets rid of the warning, but nothing else.  The real problem occurs when I decide to actually use this operator, e.g. in main():  using namespace n1; id&lt;1&gt; i(7);      // Works fine data d1 = i * 5; // Works fine data d2 = 4 * i; // error LNK2019: unresolved external symbol                  // struct n1::data __cdecl n1::operator*&lt;1&gt;(unsigned int,struct n1::id&lt;1&gt;   , however it does not have an answer. My hoping is that my example is much simpler to identify the problem.  I tried all the suggestions from there, trying all combinations that I could find that were able to compile, but none of them were able to link. I guess an alternative would be to split structs id and data into multiple structs and files, however that may prove messy at this point.  Edit: The question is definitely not a duplicate of . As you can see from my code, I'm asking about explicit specialization for known data types, which I have been successful in implementing in a separate source file for everything except non-member operators. I have to admit that forced instantiation is a new trick for me, which I do not know how to use in this particular example.
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.)
Maxing out gear with maxed out smithing, enchanting and alchemy Suppose $53$ percent of the population prefer red socks to green. If $100$ random people are asked, what is the probability that most (at least $50$) will say prefer GREEN:  So I set \begin{align*} N &amp; = 49.5\\   n &amp; = 100\\   p &amp; = 0.47 \end{align*}  Then.. \begin{align*}    P(N \geq 49.5) &amp; = P\left(\frac{N - np}{\sqrt{npq}}\right)\\                &amp; \geq \frac{49.5 - 47}{\sqrt{100*.47*.53}}\\                   &amp; = \varphi(0.50)\\                   &amp; = 0.3085   \end{align*} Except, that's not the right answer. What did I do wrong in my calculations? In windows we have an option to view recently opened media files as my recent documents, I was  wondering does there exists something like that in Ubuntu?  via terminal or via GUI? Ubuntu 16.04 has been hanging on me ~1x per day.  This happens when I am in the middle of web browsing or using a desktop application, not when booting.  When it does, the mouse pointer will still move freely, but clicking or keystrokes have no effect on my system until I do a hard reboot.  What is the best way for me to debug this?  Here is some information:  selah@selah-Precision-Tower-5810:~$ uname -a Linux selah-Precision-Tower-5810 4.4.0-59-generic #80-Ubuntu SMP Fri Jan 6 17:47:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux   Also, in case it is relevant, I have a "very big" monitor, a Dell 42" at 3840x2160 resolution.  selah@selah-Precision-Tower-5810:~$ lspci | grep VGA 03:00.0 VGA compatible controller: NVIDIA Corporation GM107GL [Quadro K2200] (rev a2)     UPDATE:  Following Artyom's advice I found the following message in my error logs:   Apr 27 09:47:25 selah-Precision-Tower-5810 kernel: nouveau 0000:03:00.0: fifo: SCHED_ERROR 0a [CTXSW_TIMEOUT] Apr 27 09:47:29 selah-Precision-Tower-5810 kernel: nouveau 0000:03:00.0: fifo: SCHED_ERROR 0a [CTXSW_TIMEOUT] Apr 27 09:47:33 selah-Precision-Tower-5810 kernel: nouveau 0000:03:00.0: fifo: SCHED_ERROR 0a [CTXSW_TIMEOUT]   Which has let me to this bug which describes similar behavior: Math mode accents In my long document I, sadly, have to use several accents to denote different kinds of symbols. Currently, I use primes ($x'$), hat, tilde, and overline. In addition I use two colored symbols (red colored tilde and blue $\prescript\ulcorner$), as I need further distinguishment.  Now I'd like to have no colors in my document, while I still have at least six different ways to differentiate certain symbols.  Which alternatives could I use that are easy to recognize and 'stand out', while they are different to prime/hat/tilde/overline?  EDIT: The reader should be able to see the kind of accent used even if the symbol in question is in a sub-script (possibly even a sub-sub-script). How can I tell which version of Windows 8 I am running? Standard, Pro, Enterprise, or RT? I have searched everywhere but cannot find how to tell which version of Windows 8 I am running.  I have the system properties on the screen but it just says "Windows 8," nothing else.  Is this the standard edition?  EDIT 04142015:  My new favorite way to do this is to go to the commnand prompt and issue (same with Windows 7):    wmic os get caption  Response:  Microsoft Windows 8.1 Pro Evaluating $\int_0^\infty \frac{\log (1+x)}{1+x^2}dx$ Can this integral be solved with contour integral or by some application of residue theorem? $$\int_0^\infty \frac{\log (1+x)}{1+x^2}dx = \frac{\pi}{4}\log 2 + \text{Catalan constant}$$  It has two poles at $\pm i$ and  branch point of $-1$ while the integral is to be evaluated from $0\to \infty$. How to get $\text{Catalan Constant}$? Please give some hints. Windows 10 puts my first and last name to lock screen. How to avoid this? After upgrading to Windows 10, I see my LastName and FirstName on the lock screen. Is there a way to change this? On Windows 8.1 there was just my nickname and email address (maybe there were my first name and last name, but not displayed so large as they are now).  I mean the name and surname parameters specified in my Microsoft account.  Another question: I prefer the format FirstName LastName, not vice versa.  Is there any way to change this as well?   Apart from Lock Screen I see it on the Start Menu. Search text within multiple pdfs and docs I got a bunch of notes written by other students, but they are from an old textbook that didn't deal with everything in the same order, so I need to search through the notes for every chapter (each individual chapter is in a different .pdf or .doc) for "trace conditioning" for example.  I used to use Google Desktop for this, I have Launchy now and I told it to search pdfs, but it only searches the titles, not the content.  Thanks for any help. Lowest volume is still too loud—how can I make it even lower? The lowest volume I can get by pressing the volume keys is still too loud when I'm wearing headphones. How can I make it even lower?   I have a Mac Mini 2011 (5,1) running Mountain Lion. I'm trying to make a basic Windows application that builds a string out of user input and then adds it to the clipboard. How do I copy a string to the clipboard using Python? What is the purpose of  in Python — especially with respect to when I would want to use it, and when not? Using exec and tee to redirect logs to stdout and a log file in the same time In a bash script, how can I redirect all standard outputs to a log file and tee the output on the screen using exec ?  log_file="$HOME/logs/install.txt-`date +'%Y-%m-%d_%H-%M-%S'`" [ -f "$log_file" ] || touch "$log_file" exec 1&gt;&gt; $log_file 2&gt;&amp;1   This code redirect all the log to the log file but not to the screen . Why is Main method private? Dollar cost averaging - Should I still do it if I have a large pile of cash now? I currently have a large pile of cash savings ($240,000) which I really should have been investing all this time, but the past is past and no point dwelling on it.  I am currently 38 years old (2 kids. Wife who is also a high earner - $100,000), with a high salary ($150,000). I have read "The Intelligent Investor" and am really sold on dollar cost averaging as a strategy, using the index funds offered by Vanguard.  My current dilemma is what to do with the cash I already have. My current plan is to still follow the dollar cost averaging and slowly move it into vanguard over a period of 4 years (~$5000 per month). While leaving the remaining parts of the cash in term deposits. So $50,000 in a 3 year term deposit at 3%, $50,000 in a 2 year term deposit at 2.8% etc.  But in someways it feels overly conservative. Should I just move all the money now? Or perhaps in a shorter time frame (3 years? 2 years? 1 year?).  There are a few other questions on the site similar to mine, but they are from 2013/2014 etc. Given that currently the stock market is at a high and there is a lot of economic uncertainty on the horizon, putting everything in the stock/bond market at once now seems like a risky move. And it seems to violate the principle of dollar cost averaging. Or am I violating dollar cost averaging by trying to "time the market" by looking at it's current value?  Reading this section  seems to indicate that I should just invest everything now. But the first paragraph also seems to suggest giving more weight to that advice if the market was trending upwards (Which I am not certain the current market is/will be for long).  PS: My current investment horizon is long. Basically retirement, about 20 years from now. How is the Schroedinger equation a wave equation? How is Faulhaber's formula derived? proof relating to limit definition of e I'm studying the book A Primer for the Mathematics of FinancialEngineering, along with it's solution guide. I've ran into trouble with the solution to question 7 in chapter 1.    The problem is:  Show that $(1+\frac{1}{x})^x &lt; e &lt; (1+\frac{1}{x})^{x+1}$ .   Specifically, I'm having trouble with one step in the solution.    It says that  $$x\ln\left(1+\frac{1}{x}\right)&lt;1&lt;(x+1)\ln\left(1+\frac{1}{x}\right)$$  can be written as   $$\frac{1}{x+1} &lt;\ln\left(1+\frac{1}{x}\right)&lt;\frac{1}{x}, \forall \ge 1.$$  How can the first equality (or is it inequality?) be written as the second? List comprehension rebinds names even after scope of comprehension. Is this right? View referrals from one part of my site to another in Google Analytics I have an online shop with a blog structured this way:   Shop: example.com Blog: example.com/blog   Both index have the same Google Analytic Code (UA). In the blog I write articles about some products with a link to the product page.  Now the problem is, I want to see stat on visits whose referral links have this pattern example.com/blog/*.