I am having a problem that I was not able to re-produce with a small self-contained example. That is, I wrote such an example (appears below), but the small example compiles, while the actual code does not.  I have a function template defined in the base:  template&lt;class ExplicitSpace&gt; struct ExplicitState {     ...     template&lt;class Neighbor&gt;     std::vector&lt;Neighbor&gt; successors() const {...}     ... };   I have the following in the deriving type:  template &lt;typename CostType_&gt; struct GridMapState: ExplicitState&lt;GridMap&lt;CostType_&gt;&gt; {     using Base = ExplicitState&lt;GridMap&lt;CostType_&gt;&gt;;     using Base::Base; // inherit constructors     using Base::successors; // this is supposed to do the trick      ...     std::vector&lt;Neighbor&gt; successors() const {         // return static_cast&lt;const Base *&gt;(this)-&gt;template successors&lt;Neighbor&gt;();           // the above commented version compiles         return successors&lt;Neighbor&gt;(); // this does not compile     }     ... };   As the comment indicates, I can explicitly call successors() of the base, but I cannot rely on using Base::successors; to make it visible.  gcc 4.8.2. gives the following:  GridMapState.h: In member function ‘std::vector&lt;StateNeighbor&lt;GridMapState&lt;typename ExplicitState&lt;GridMap&lt;CostType_&gt; &gt;::CostType&gt; &gt; &gt; GridMapState&lt;CostType_&gt;::successors() const’: GridMapState.h:20:35: error: expected primary-expression before ‘&gt;’ token          return successors&lt;Neighbor&gt;();   Here is the small example that attempts to re-produce the problem, but it compiles just fine:  template &lt;typename U&gt; struct A {     template &lt;typename T&gt;     T f() {return T(0);} };  template &lt;typename V&gt; struct B : A&lt;int&gt; {     using MyT = int;     using Base = A&lt;int&gt;;     using Base::f;     MyT f() {return f&lt;MyT&gt;();} };  int main() {     B&lt;int&gt; b;     std::cout &lt;&lt; b.f() &lt;&lt; std::endl;     return 0; }
In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway?    I have the following code:  template &lt;typename T, typename Tail&gt; // Tail will be a UnionNode too. struct UnionNode : public Tail {     // ...     template&lt;typename U&gt; struct inUnion {         // Q: where to add typename/template here?         typedef Tail::inUnion&lt;U&gt; dummy;      };     template&lt; &gt; struct inUnion&lt;T&gt; {     }; }; template &lt;typename T&gt; // For the last node Tn. struct UnionNode&lt;T, void&gt; {     // ...     template&lt;typename U&gt; struct inUnion {         char fail[ -2 + (sizeof(U)%2) ]; // Cannot be instantiated for any U     };     template&lt; &gt; struct inUnion&lt;T&gt; {     }; };   The problem I have is in the typedef Tail::inUnion&lt;U&gt; dummy line. I'm fairly certain that inUnion is a dependent name, and VC++ is quite right in choking on it. I also know that I should be able to add template somewhere to tell the compiler that inUnion is a template-id. But where exactly? And should it then assume that inUnion is a class template, i.e. inUnion&lt;U&gt; names a type and not a function?
Deep learning model (LSTM) with temporal and non temporal attributes Can't find the reason why root directory usage is so large How to get rid of the smell from the fridge? What is the value of $\sum\limits_{i=1}^\infty\dfrac{1}{p_{p_i}}$ where $p_n$ is the nth prime (and so $p_{p_n}$ is the $k$th prime, where $k$ is the $n$th prime) ?  Thus $\frac{1}{3}+\frac{1}{5}+\frac{1}{11}+...=$ ??  How do I efficiently decide if $\sum_{i=1}^\infty\dfrac{1}{p_{p_i}}\gt1$ is true without using a computer ?  I assume this infinite sum is an irrational number. Has this already been proven ? Find a recurrence relation for the number of ways to arrange $n$ dominoes to fill a $2$ by $n$ checkerboard. I am having trouble with this question, please take a look at it:     Find a recurrence relation for the number of ways to arrange $n$ dominoes to fill a $2$ by $n$ checkerboard.   I have just started reading the topic and it is one of the starting problem. Please help. You can give me some hints, a complete answer is also appreciated.  Thanks Given  $N\geq30$ i.i.d. $X_n\approx\mathcal{N}(\mu_X,\sigma_X^2)$,  and $\mu_X \approx 0$, looking for:   accurate closed form distribution approximation of $Y_N=\prod\limits_{1}^{N}{X_n}$ asymptotic (?) approximation of same product    This is a special case $\mu_X \approx 0$ of a more . Sort files alphabetically before processing I use the command  find . -type f -exec sha256sum {} \; &gt; sha256SumOutput   to hash every file in a folder hierarchy. Unfortunately, sha256sum doesn't get the file names from find in alphabetical oder. How can this be fixed?  I'd like to have them ordered before they are hashed so they are hashed in alphabetical order (this has a reason). I have a database with millions of phone numbers with free-for-all formatting. Ie, the UI does not enforce any constraints and the users are typing in whatever they want.  What I'm looking for is a Java API that can make a best-effort to convert these into a consistent format. Ideally, the API would take the free text value and a country code and produce a valid international phone number or throw an exception.  For example, a phone number in the system might look like any of the following:  (555) 478-1123 555-478-1123     555.478.1123 5554781123   Given the country of US, the API would produce the value "+1 (555) 478-1123" for all these. The exact format does not matter, as long as it's consistent.  There are also numbers in the system without area codes, such as "478-1123". In that case, I would expect a NoAreaCodeException, or something similar.  There could also be data such as "abc", which should also throw exceptions.  Of course, there are countless variations of the examples I have posted, as well as the enormous complication of international phone numbers, which have quite complicated validation rules. This is why I would not consider rolling my own.  Has anyone seen such an API? What do you call someone who can't keep secrets? Some one who is not good at keeping secrets. In my native language it is called "chugalkhor" but it's a slang. So I can't translate it.  What do you call such a person who can't keep secrets because his instincts don't let him. Photoshop To CSS: How do you translate Fill to CSS References in externalized pgfplots I was writing on an document with a lot of pgfplots in it. Because of the memory limitation in LaTeX and in order to save some compiling time I tried out the externalize command. With most of the plots it perfectly worked out. But when I use the \ref command, namely \ref{&lt;legendname&gt;} the legend gets lost and instead there is a ??.  I think this question in a way is similar to  and . But no answer to these questions could solve my problem. Even the use of xr and zref packages showed no effect.  Am I just missing something?    MWE of the maindocument:  \documentclass{article} \usepackage{zref-user} \usepackage{xr-hyper} \usepackage{pgfplots} \usetikzlibrary{pgfplots.groupplots} \usepgfplotslibrary{external}  \tikzexternalize \externaldocument{part1}  \begin{document} \input{part1} \end{document}     With part1.tex looking like this:  \begin{tikzpicture}     \begin{groupplot}[       group style= {  columns=3,xlabels at=edge bottom,                 y descriptions at=edge left,                 horizontal sep=2cm,group name=plots},     width=0.4\textwidth,     xtick=data,     legend columns=3]     \nextgroupplot[xlabel=site 1,legend to name=grouplegend]     \addplot coordinates {(1,20)(2,23)(3,24.5)};     \addlegendentry {AaAaA,BbBbB,CcCcC}%     \nextgroupplot[xlabel=site 2]     \addplot coordinates {(1,14)(2,16)(3,17)};     \nextgroupplot[xlabel=site 3]     \addplot coordinates {(1,10)(2,11.5)(3,12.25)};     \end{groupplot}   % Legend     \node at (plots c2r1.north) [anchor=south] {\ref{grouplegend}}; \end{tikzpicture}     I'm writing with MikTeX 2.9 and the latest updates of the packages used. For compiling I used the command pdflatex -enable-write18 &lt;file name&gt;.  I hope the MWE is short enough ;) and some knows how to solve this problem. C++ iostream Corruption using stringstream Does an Animagus's animal form change along with their Patronus? In the two examples shown of an Animagus capable of casting a corporeal Patronus (Minerva McGonagall and James Potter) both had the same animal as their Patronus and as their Animagus animal.  Now, it is also shown that extreme circumstances can change one's Patronus. I think the only example of this was Tonks, which turned from a jackrabbit into a wolf in response for her love of Lupin.  If Tonks (or any other wizard who had their Patronus change) had been an animagus, would her animagus have changed as well? How can I get the page numbers only of a pattern in a pdf file, regardless if the pattern is multiline? Prove that $\lfloor\lfloor x/2 \rfloor / 2 \rfloor = \lfloor x/4 \rfloor$ Is there any possibility of setting up two factor authentication (2FA) for Stack Exchange OpenID authentication?  I could just use my (already 2FA-enabled) Google account for Stack Exchange, but I would prefer to continue use Stack Exchange OpenID.  After  (which, I appreciate, didn't affect Stack Exchange, as you use IIS and Schannel, not OpenSSL), there have been a lot of recommendations to change passwords and to enable 2FA where possible.  So, what are the chances of a text-messaging-based or Google-Authenticator-based 2FA for Stack Exchange? I try to launch Firefox over SSH, using  ssh -X user@hostname   and then  firefox -no-remote   but it's very very slow.  How can I fix this? Is it a connection problem? How to create batch file in Windows using "start" with a path and command with spaces I need to create a batch file which starts multiple console applications in a Windows .cmd file.  This can be done using the start command.  However, the command has a path in it.  I also need to pass paramaters which have spaces as well.  How to do this?  E.g. batch file  start "c:\path with spaces\app.exe" param1 "param with spaces" For regression problem, I have seen people use "coefficient of determination" (a.k.a R squared)  to perform model selection, e.g., finding the appropriate penalty coefficient for regularization.   However, it is also common to use "mean squared error" or "root mean squared error" as a measure of regression accuracy.  So what is the main difference between these two? Could they be used interchangeably for "regularization" and "regression" tasks?  And what are the main usage of each in practice, such as in machine learning, data mining tasks? Floats appearing in wrong places