I'm relatively new to C++ and I feel like I'm in over my head. I'm trying to create a graph structure that can take any kind of data by using templates. Here is c_graph.h  #pragma once #include &lt;vector&gt; #include &lt;unordered_map&gt; #include &lt;unordered_set&gt;  template &lt;class T&gt; class c_graph {     private:         std::unordered_map&lt;T,std::unordered_set&lt;T&gt;&gt; adj_matrix;      public:          '' GRAPH OPERATIONS OMITTED '' };  template &lt;class M&gt; struct node { public:     M val;      node() {      }      node(M v) {         val = v;     } };   I would like to support using data directly (hence the template T on the graph), or wrapping the data in a node struct, which is defined at the bottom. My reason for the node struct is sometimes you want different nodes in the graph to have the same data, which wouldn't work with the unordered_map on the outside of the adjacency matrix without a data wrapper.  However I've run into an issue with the unordered_set class. It doesn't have a hash function for node. I read about this problem online and the solution seems to be something like  namespace std {     template &lt;class M&gt; class hash&lt;node&lt;M&gt;&gt; {     public:         size_t operator()(const node&lt;M&gt; &amp;n) const         {             return reinterpret_cast&lt;size_t&gt;(&amp;n);         }     }; };   I have another .cpp file that is trying to use c_graph&lt;node&lt;char&gt;&gt;  However for the life of me I can't get my code to compile. I've tried placing the hash snippet inside c_graph.h, where I get a bunch of linker errors  error LNK2019: unresolved external symbol "public: void __thiscall c_graph&lt;struct node&lt;char&gt; &gt;::add_node(struct node&lt;char&gt;)"...    and I've tried placing it inside c_graph.cpp, where I get  error C2338: The C++ Standard doesn't provide a hash for this type.
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.)
Slow math typing I have been using LaTeX for quite some time, but I find the math writing to be a bit frustrating. It seems to take me a relatively long time to code-write long math expressions, and sometimes it's hard to see where { start and end.  I am interested in writing as fast as possible.  Is code-typing each symbol really the fastest way? Is there any good program (in the spirit of Word's MathType) that enables producing math expressions by button clicking, that you recommend? Where are the Unity desktop wallpapers located? How do you prove a number is prime? I am a software engineer but try to keep up with maths as I really enjoyed the subject at school. I just saw a great TED talk:   The talk states that the current largest known prime is $2^{57885161}-1$  This got me thinking - how does one actually prove whether a number this large is prime or not?  Is it just done by brute force via a computer algorithm or are there any well known mathematical techniques for doing so?  I would be really grateful for any pointers as I am eager to learn about these techniques (if they exist). $X$ is a Hausdorff space and $\sim$ is an equivalence relation.  If the quotient map is open, then $X/{\sim}$ is a Hausdorff space if and only if $\sim$ is a closed subset of the product space $X \times X$.  Necessity is obvious, but I don't know how to prove the other side. That is, $\sim$ is a closed subset of the product space $X \times X$ $\Rightarrow$ $X/{\sim}$ is a Hausdorff space. Any advices and comments will be appreciated. Consider a "wavefunction" $\psi(x)$, which has a Fourier transform $\tilde \psi(p)$  Suppose that we know, for each $x$, $|\psi(x)|^2$, and that we know, for each $p$, $|\tilde \psi(p)|^2$.  Have we enough information to reconstruct the "wavefunction" $\psi(x)$, that is, obtain the phase of the "wavefunction" for all $x$ (up to a global phase, we are only interesting to the relative phases between the $x$)? Changing back button in iOS 7 disables swipe to navigate back Independence of Gaussian variables Finding value of $S-T$ in $2$ binomial sum. If $\displaystyle S=\sum^{n}_{k=0}(-1)^k\frac{1}{k+m+1}\binom{n}{k}$ and f $\displaystyle T=\sum^{m}_{k=0}(-1)^k\frac{1}{k+n+1}\binom{m}{k}$.Then $S-T$ is   Try:$$S=\sum^{n}_{k=0}(-1)^k\int^{1}_{0}x^{k+n}\binom{n}{k}dx=\int^{1}_{0}x^n\sum^{n}_{k=0}(-x)^k\binom{n}{k}dx$$  Could some help me, thanks One of the drivers behind the 'Rule of Two' is that with fewer Sith, the dark side will become more concentrated in those users and they will be more powerful as a result. Is there any indication that the same is true for Jedi? If HTML, CSS, and Javascript are client-side, why are they components of a PHP file? Manually installing a program on Debian How do I check if an array includes a value in JavaScript? Simulating group_concat MySQL function in Microsoft SQL Server 2005? I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that's life).  In the original app, we used almost entirely ANSI-SQL compliant statements, with one significant exception -- we used MySQL's group_concat function fairly frequently.  group_concat, by the way, does this: given a table of, say, employee names and projects...  SELECT empName, projID FROM project_members;   returns:  ANDY   |  A100 ANDY   |  B391 ANDY   |  X010 TOM    |  A100 TOM    |  A510   ... and here's what you get with group_concat:  SELECT      empName, group_concat(projID SEPARATOR ' / ')  FROM      project_members  GROUP BY      empName;   returns:  ANDY   |  A100 / B391 / X010 TOM    |  A100 / A510   So what I'd like to know is: Is it possible to write, say, a user-defined function in SQL Server which emulates the functionality of group_concat?   I have almost no experience using UDFs, stored procedures, or anything like that, just straight-up SQL, so please err on the side of too much explanation :) How to create LV(Logical Volume) after ubuntu is installed? everyone. I need to create LV for xen guest. There is only one disk of 70G. While installing, I use the default process and not the LVM. Do I need to reinstall Ubuntu to create the LV? Is there some better method? Thanks a lot.  root@vswitch-BlackfordESB2:/home/vswitch# vgdisplay   No volume groups found root@vswitch-BlackfordESB2:/home/vswitch# vgcreate vm /dev/sda1   No physical volume label read from /dev/sda1   Can't open /dev/sda1 exclusively.  Mounted filesystem?   Unable to add physical volume '/dev/sda1' to volume group 'vm'. root@vswitch-BlackfordESB2:/home/vswitch# pvdisplay  root@vswitch-BlackfordESB2:/home/vswitch# df -h Filesystem            Size  Used Avail Use% Mounted on /dev/sda1              60G  4.2G   53G   8% / udev                  3.6G  4.0K  3.6G   1% /dev tmpfs                 1.5G  1.1M  1.5G   1% /run none                  5.0M     0  5.0M   0% /run/lock none                  3.6G     0  3.6G   0% /run/shm Schrödingers MySQL table: exists, yet it does not From yesterday, openweather extention on the top panel does not show the weather. Its shows "Please wait Loading".  I tried to find the solution. There was a post of creating account on openweather website and use API id. I found that it is a subscription base plan. There was a free plan which allows 60 calls free for weather data.  I thought that the extention is open source. And may be I deleted any package that is required to work the extention so I reinstall the OS. But there is no difference of doing that.    What could possibly go wrong any guidance? What is the noun for someone who receives a referral? When a referrer (noun) gives a referral (noun) to another person, what is the term (noun) used for the recipient of the referral? "The referred" may work, but am I missing another term? "Referred" indicates past-tense, but I intend to use the term in future and present tense as well. I am trying to produce a presentation where code for a pair of arrays appear in the same position of a beamer slide.  I tried something like this (with different combinations and braces) and did not work.  \begin{verbatim}\only&lt;1&gt;       V1 V2 V3 V4 [1,]  0  1  1  0 [2,]  1  0  1  0 [3,]  1  1  0  0 [4,]  0  0  0  0   \only&lt;2&gt;       V1 V2 V3 V4 [1,]  0  1  0  0 [2,]  1  0  1  0 [3,]  0  0  0  0 [4,]  0  0  0  0  \end{verbatim}    Appreciate any suggestions.  Thanks! "Open in browser" does nothing when Android app is set as default How was the torque-force relationship discovered