there. I am new to C++ and trying to practice something with graph algorithm. I defined two structs in a class:    #include &lt;vector&gt; using namespace std;  enum GraphType{undigraph, digraph, undinetwork, dinetwrok};  template &lt;class T&gt; struct EdgeType {     T head, tail;     int cost;     EdgeType(T head, T tail, int cost)     {         this-&gt;head = head;         this-&gt;tail = tail;         this-&gt;cost = cost;     } };  template &lt;class T&gt; struct Edge {     T adjvex;     int lowcost; };  template &lt;class T&gt; class MGraph { private:     int vexnum, edgenum;     GraphType kind;     vector&lt;vector&lt;int&gt; &gt;edges;  //二维邻接矩阵     vector&lt;T&gt; vexs; //顶点表  public:     ...     void Prim(int v);       //Prim算法求最小生成树     void Kruskal(vector&lt;EdgeType&lt;T&gt; &gt; &amp;tree);   //Kruskal算法构造最小生成树     int getMiniNum(Edge&lt;T&gt;* edges);     void getGraph(vector&lt;EdgeType&lt;T&gt; &gt; &amp;graph);  };     and here are errors in my CPP file:    template &lt;class T&gt; void MGraph&lt;T&gt;::Kruskal(vector&lt;EdgeType&lt;T&gt; &gt; &amp;tree) {     int i;     vector&lt;EdgeType&lt;T&gt; &gt; graph;     getGraph(graph);     tree.resize(vexnum-1);     ... } template&lt;class T&gt; void MGraph&lt;T&gt;::getGraph(vector&lt;EdgeType&lt;T&gt; &gt; &amp;graph) {     graph.resize(edgenum);     int min = 0;     int k = 0;     int i,j;     for(i = 0; i &lt; vexnum; i++)     {         for(j = 0; j &lt; i; j++)         {             if(edges[j][i] &lt; INFINITY &amp;&amp; i != j)             {                 char s1 = graph[k].head = getVexValue(j);                 char s2 = graph[k].tail = getVexValue(i);                 int p = graph[k].cost = edges[j][i];                 k++;             }         }     }     EdgeType&lt;T&gt; e;     for(i = 1; i &lt; edgenum; i++)     {         for(j = edgenum-1; j &gt;= i; j--)                                                                                                                                                                                                                                                                              {             if(graph[j].cost &lt; graph[j-1].cost)             {                 e = graph[j-1];                 graph[j-1] = graph[j];                 graph[j] = e;                 e = graph[j];             }         }     } }     C:\Windows\system32\cmd.exe /C "C:/TDM-GCC-64/bin/mingw32-make.exe -j4 SHELL=cmd.exe -e -f  Makefile" "----------Building project:[ test - Debug ]----------" mingw32-make.exe[1]: Entering directory 'D:/test/test/test' C:/TDM-GCC-64/bin/g++.exe  -c  "D:/test/test/test/main.cpp" -g -O0 -Wall  -o ./Debug/main.cpp.o -I. -I.  D:/test/test/test/MGraph.cpp: In instantiation of 'void MGraph&lt;T&gt;::Kruskal(std::vector&lt;EdgeType&lt;T&gt; &gt;&amp;) [with T = char]': D:/test/test/test/main.cpp:57:17:   required from here D:/test/test/test/MGraph.cpp:368:2: error: no matching function for call to 'EdgeType&lt;char&gt;::EdgeType()' tree.resize(vexnum-1); ^ D:/test/test/test/MGraph.cpp: In instantiation of 'void MGraph&lt;T&gt;::getGraph(std::vector&lt;EdgeType&lt;T&gt; &gt;&amp;) [with T = char]': D:/test/test/test/MGraph.cpp:367:16:   required from 'void MGraph&lt;T&gt;::Kruskal(std::vector&lt;EdgeType&lt;T&gt; &gt;&amp;) [with T = char]' D:/test/test/test/main.cpp:57:17:   required from here D:/test/test/test/MGraph.cpp:415:2: error: no matching function for call to 'EdgeType&lt;char&gt;::EdgeType()' graph.resize(edgenum); ^  D:/test/test/test/MGraph.cpp:432:14: error: no matching function for call to 'EdgeType&lt;char&gt;::EdgeType()' EdgeType&lt;T&gt; e; ^  mingw32-make.exe[1]: *** [Debug/main.cpp.o] Error 1 test.mk:93: recipe for target 'Debug/main.cpp.o' failed mingw32-make.exe[1]: Leaving directory 'D:/test/test/test' mingw32-make.exe: *** [All] Error 2 Makefile:4: recipe for target 'All' failed 7 errors, 29 warnings     I don't know how to fix this, would anyone please help me out here? Thanks a lot!
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.)
Suppress "In:" biblatex Some common problems with displaying routes created from street data, such as bus routes, include:   Routes may overlap themselves, such as when a route takes the same road in opposite directions Routes may overlap other routes that take the same street. Routes are often overly detailed, or "noisy", owing to their derivation from street data. Indicating a route's direction unambiguously without overloading it with arrows can be a challenge.   What are some techniques for dealing with these issues in order to create a practical and usable route map, such as this ? Do you know of any such public transport maps that were produced by automatic techniques rather than manual illustration/digitization?  Specifically I am using ArcGIS 10, but solutions involving other software are welcome as well.  One technique I have had some success with for dealing with 1) is using ArcMap's  with a negative offset -- assuming the lines are oriented in the direction of travel, this will offset the lines such that the right and left-hand sides are distinct and oriented as you would expect (at least for  countries, for left-hand traffic countries one would use a positive offset). However the result tends to be a bit wonky around turns, interchanges and and U-turns, and is inflexible when dealing with multiple routes.  Another possibility that I am not very familiar with but which seems promising is  -- however, I have not had much luck in finding examples of using representations for transportation maps and whether it might fit the bill. How to include graphics with spaces in their path? In the double-slit experiment of electrons (observed by photons), is it correct to say the collapse is caused by the momentum of the photons? I'm working off the article, . I think it's well-written, but I'm not convinced about this part:     So what is causing the change in the particle’s behaviour?      In the example given above, when electrons are fired at a fluorescent screen, when we bombard the electrons with photons the interaction changes the state of the system catastrophically as, despite lacking mass, photons do carry momentum.   Here the author strongly implicates the momentum of photons as being responsible for the collapse. But is that correct to say?  I have read that the  verified that obscuring which-way information restores wave-like behavior. So it feels to me it's more about some "outer" state (perhaps well-characterized as "information") that we don't yet understand that collapses the system, not per se the photon-electron interaction.  Or am I wrong, and in fact for example, the process of obscuring in the quantum eraser experiments somehow "undoes" the photon-electron interaction or restores the quantum state through another interaction? I have to do some manual reordering or rows in Excel and cut/paste is too hard to use. I'm looking for something that would enable me to use drag'n'drop or to add some buttons to move-up/down move-top/bottom. putting a tikzpicture inside a \caption{} I'm attempting to put a small tikzpicture inside a \caption{} belonging to a figure environment. The reason for doing this is fairly simple - to create an in-caption legend for a PGFplot, with consistency between the TikZ styles in the figure and in the caption. Previously I would have done this using dashes and the xcolor package, however, this is an awful hack. In this MWE:  \documentclass{article} \usepackage{tikz} \begin{document} \begin{figure} \caption{\raisebox{0.5ex}{ \begin{tikzpicture}\draw[dashed,color=red,thick] (0,0) -- (0.5,0);\end{tikzpicture}} Gas--Phase}  \end{figure} \end{document}   The expected output:    is generated, but I get ! Argument of \@caption has an extra }. and ! Paragraph ended before \@caption was complete. Within the larger context of the document that I'm writing, which includes chapters in external .tex files, compilation fails catastrophically (dozens of errors) with no output, so I can't just ignore the warnings in this instance. Any ideas? Do you capitalize both parts of a hyphenated word in a title?  "My Ex-Wife Hates Me"  or  "My Ex-wife Hates Me" How do I set a default host for nginx? Surfing the web anonymously What is the best, fastest, safest way to surf the web anonymously, and how much anonymity can you really achieve? If I pass PHP variables with . in their names via $_GET PHP auto-replaces them with _ characters. For example:  &lt;?php echo "url is ".$_SERVER['REQUEST_URI']."&lt;p&gt;"; echo "x.y is ".$_GET['x.y'].".&lt;p&gt;"; echo "x_y is ".$_GET['x_y'].".&lt;p&gt;";   ... outputs the following:  url is /SpShipTool/php/testGetUrl.php?x.y=a.b x.y is . x_y is a.b.   ... my question is this: is there any way I can get this to stop? Cannot for the life of me figure out what I've done to deserve this  PHP version I'm running with is 5.2.4-2ubuntu5.3. Is there a realistic way of implementing a multi-threaded model in PHP whether truly, or just simulating it. Some time back it was suggested that you could force the operating system to load another instance of the PHP executable and handle other simultaneous processes.  The problem with this is that when the PHP code finished executing the PHP instance remains in memory because there is no way to kill it from within PHP.  So if you are simulating several threads you can imagine whats going to happen.  So I am still looking for a way multi-threading can be done or simulated effectively from within PHP. Any ideas? I can't play Pokemon GO! What's wrong? How to set the default value of an exposed filter rather than -Any-? I have a view with exposed filters in Drupal 7 and I need to set the default value of a filter to current year. I also need to unset/remove the - Any - option from the select list. How do I answer "Where do you work?" What are the main purposes to ask someone 'Where do you work?' apart from to find out the type of place he or she works in?  I can answer:     I work in a shop.   I work in a hospital.   I work in an office.   But what other things can (or should) I use as a reply to this question?    Extra question:  sometimes I see     I work at a shop.    I work at a hospital.    I work at an office.   What's the difference between 'at' and 'in' in this case? What is the shortest way to compute the last 3 digits of $17^{256}$? What is the shortest way to compute the last 3 digits of $17^{256}$ ?  My solution: \begin{align} 17^{256} &amp;=289^{128} \\ &amp;=(290 - 1)^{128}\\ &amp;=\binom{128}{0}290^{128} -  ... +\binom{128}{126}290^2 - \binom{128}{127}290 + \binom{128}{128} \end{align}  Computed the last 3 terms whose last 3 digits gave the last 3 digits of $17^{256}$.  Is there any shorter method to do this(which requires much less computation) ? Rendered image is just grey Using Illustrator CS6 to create shape out of multiple paths I am very new to Illustrator, in fact I am only experimenting with it in an attempt to help my friend develop a logo for a new business venture. I managed to draw out the shell of the logo using the line tool and modifying the lines with the anchor tool to get the shape I wanted.  However, I would like to somehow take all of these paths and create one object, or symbol which I can then apply a drop shadow, fill and various other effects too. Currently when I try to do this I get unwanted effects...  I'd appreciate any help on the subject. Prove that there exists disjoint open subsets $U,V$ of $X$ such that $x \in U$ and $B \subseteq V$. Let $B$ be a compact subset of a metric space $X$. Let $x \in X \setminus B$. Prove that there exists disjoint open subsets $U,V$ of $X$ such that $x \in U$ and $B \subseteq V$.   Is this an existence proof? If yes, do I get to define $U,V$? Why is my variable unaltered after I modify it inside of a function? - Asynchronous code reference Can't do comparison on PageReference