(This question is only a duplicate of the other question if you already know the answer!)  (Please note my follow-up question: )  I get a compiler error at the indicated line when I try to compile templated C++ code with this structure:  template &lt;int N&gt; struct A {     template &lt;int i&gt;     void f() {}; };  template &lt;int N&gt; struct B {     A&lt;N&gt; a;      B(A&lt;N&gt;&amp; a) : a(a) {}      void test() {         a.f&lt;1&gt;();  // does not compile     } };  int main() {     A&lt;2&gt; a;     a.f&lt;1&gt;();   // works fine     B&lt;2&gt; b(a);     b.test(); }   g++ says:  test2.cpp: In member function ‘void B&lt;N&gt;::test()’: test2.cpp:14: error: expected primary-expression before ‘)’ token test2.cpp: In member function ‘void B&lt;N&gt;::test() [with int N = 2]’: test2.cpp:22:   instantiated from here test2.cpp:14: error: invalid operands of types ‘&lt;unresolved overloaded function type&gt;’ and ‘int’ to binary ‘operator&lt;’   clang++ says:  test2.cpp:14:16: error: expected expression         a.f&lt;1&gt;();  // does not compile            ^ 1 error generated.   The same expression works in the context of main(), but not within the test() method of the templated class B, which has an instance of A as a private variable. I am pretty clueless why this doesn't work.
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?
If $f(x)=x-\int^{\frac{\pi}{2}}_0f(x)\sin(x)dx$ find the explicit function for $f(x)$ in its simplest form Create a virtual file that is actually a command Is there any way to create a virtual file, such that reading from the file actually reads from the stdout of a command; writing to the file is acually writing to the stdin of a command?  So far I have kludged this with an inotifywait on a file, which calls a command when the file is modified, taking it's input from the file and writing back to it.  I don't like that the inotifywait has to be constantly restarted though (and I have to ensure that it is always running). I only use this file perhaps twice a week. Running the minimal example  \documentclass{article} \usepackage{filecontents} \begin{filecontents*}{\jobname.bib} @ARTICLE{example,   author  = {Other, Anthony Norman},   title   = {Some things I did},   year    = {2014},   journal = {J.~Irrep. Res.},   volume  = {1},   number  = {1},   pages   = {1-10} } \end{filecontents*} \usepackage[backend=biber]{biblatex} \addbibresource{\jobname.bib} \begin{document} Hello\cite{example}. \printbibliography \end{document}   I get the warning There were undefined references.  I have read  and know that I need to run:   LaTeX Biber LaTeX   However, my editor is only set up to run BibTeX. How do I go about setting up my editor/IDE to be able to run Biber, and how do I run the LaTeX/Biber/LaTeX cycle?  Answers (sorted alphabetically by editor name)                    Answer guidelines   Each answer should be for one editor. If the editor is cross-platform, if possible give a single answer with notes covering the minor platform variations. Please edit the question to include new answers in the 'link list' Each answer should be 'stand alone', i.e. don't say 'It's almost the same as editor Y but ...' for the editor part Instructions for 'build tools' such as arara or latexmk are welcome but should explain how to set up the editor in question as not all editors allow simple addition of arbitrary tools Deploy Community Builder audience page assignments with ant migration tool? What is the Python equivalent of static variables inside a function? What is the idiomatic Python equivalent of this C/C++ code?  void foo() {     static int counter = 0;     counter++;     printf("counter is %d\n", counter); }   specifically, how does one implement the static member at the function level, as opposed to the class level? And does placing the function into a class change anything? Calling future method from batch class? How can I install the latest Netbeans? In Ubuntu Software Center the Netbeans version is netbeans 7.0.1+dfsg1-5ubuntu2 but Netbeans 8.1 is available in the Netbeans website. How do I add a .sty file to my MacTeX/TeXShop installation? I've searched online, but I have not found any clear instructions how to permanently add .sty files to my TeXShop installation. I'm using a Mac with OSX (TeXShop is a mac only program).  What is the best way of doing this? The one comprehensive set of instructions I found .   I've got as far as extracting the files (running LaTeX on the .ins and . dtx files) but after that I don't know what to do. I also don't understand how to update the index of my distribution, and whether there are particular OSX specifics (the instructions are for Windows). Prove that for every $a, b\in R\setminus\{0\}$ is correct this inequality:  $$\frac{|a+b|}{1+|a+b|}&lt;\frac{|a|}{1+|a|}+\frac{|b|}{1+|b|}.$$ Show that $3p^2=q^2$ implies $3|p$ and $3|q$ This is a problem from "" (specifically, exercise set 2 #9), which is one of my math texts. Please note that this isn't homework, but I would still appreciate hints rather than a complete answer.  The problem reads as follows:     If 3p2 = q2, where $p,q \in \mathbb{Z}$, show that 3 is a common divisor of p and q.   I am able to show that 3 divides q, simply by rearranging for p2 and showing that  $$p^2 \in \mathbb{Z} \Rightarrow q^2/3 \in \mathbb{Z} \Rightarrow 3|q$$  However, I'm not sure how to show that 3 divides p.    Edit:  Moron left a comment below in which I was prompted to apply the solution to this question as a proof of $\sqrt{3}$'s irrationality. Here's what I came up with...  [incorrect solution...]  ...is this correct?  Edit:  The correct solution is provided in the comments below by Bill Dubuque. I have a simple query:  select * from countries   with the following results:  country_name ------------ Albania Andorra Antigua .....   I would like to return the results in one row, so like this:  Albania, Andorra, Antigua, ...   Of course, I can write a PL/SQL function to do the job (I already did in Oracle 10g), but is there a nicer, preferably non-Oracle-specific solution (or may be a built-in function) for this task?  I would generally use it to avoid multiple rows in a sub-query, so if a person has more then one citizenship, I do not want her/him to be a duplicate in the list.  My question is based on the similar question on .  UPDATE: My function looks like this:  CREATE OR REPLACE FUNCTION APPEND_FIELD (sqlstr in varchar2, sep in varchar2 ) return varchar2 is ret varchar2(4000) := ''; TYPE cur_typ IS REF CURSOR; rec cur_typ; field varchar2(4000); begin      OPEN rec FOR sqlstr;      LOOP          FETCH rec INTO field;          EXIT WHEN rec%NOTFOUND;          ret := ret || field || sep;      END LOOP;      if length(ret) = 0 then           RETURN '';      else           RETURN substr(ret,1,length(ret)-length(sep));      end if; end; Connected set in $\mathbb{S}^1$ Let $A$ be a connected set in $\mathbb{S}^1$. Show that $A^c$ is also connected.  My idea: suppose $A^c$ is not connected. Then, there exist $U,V \subset \mathbb{S}^1$ open and disjoint such that $U \cup V =A^c  $. Therefore $\mathbb{S}^1 = A \cup U \cup V$. If I had that $A\cup U$ was open I could arrive at  contradiction, since $\mathbb{S}^1$ is connected, but I can't say that... How do I reset the Windows XP Administrator password? I have forgotten the Administrator password of my Windows XP installation and locked out. Is there a way to reset it? I do have physical access to the PC. Why do we say "try and" [verb] instead of "try to" [verb]? (E.g., "Try and call me tomorrow.") Importing DWG into QGIS project? I have a lot of DWG files like basemap, and water and wastewater network.  How do I import these files into my QGIS project? how to avoid number repeation by using random class in c#? Show an exponential function has a valid density. Given:  Let $X$ be exponential with parameter $\lambda$, that is   $$ f_X(x) = \begin{cases} \lambda e^{-\lambda x} &amp; \text{if }x&gt; 0, \\ 0 &amp;\text{for }x\leq 0. \end{cases} $$  where $\lambda&gt;0$ is called the rate of the distribution.  Question:  Show that this is a valid probability density function (pdf).  Attempt:  Need to show that  $$ f(x) = \int^{\infty}_{-\infty} \lambda e^{-\lambda x}\,  dx=1\\\\ $$ Thus, \begin{eqnarray*} f(x)&amp;=&amp;\int^0_{-\infty} \lambda e^{-\lambda x} \, dx+\int^\infty_0 \lambda e^{-\lambda x} \,  dx\\[8pt] &amp;=&amp;0+\int^\infty_0 \lambda e^{-\lambda x} \, dx \\[8pt] &amp;=&amp;\lambda\int^\infty_0 e^{-\lambda x} \, dx \\[8pt] &amp;=&amp;1 \end{eqnarray*}  The problem is that my professor just told me that I skip a step right before I derive $1$. Any insight?  EDIT:  Given the great feedback, here is the answer:  \begin{eqnarray*} f(x)&amp;=&amp;\int^{\infty}_{-\infty} \lambda e^{-\lambda x} dx=1\\\\ f(x)&amp;=&amp;\int^{\infty}_{-\infty} f_X(x)dx\\ &amp;=&amp;\int^{0}_{-\infty} 0\,\,\, dx+\int^{\infty}_{0} \lambda e^{-\lambda x} dx\\ &amp;=&amp;0+\int^{\infty}_{0} \lambda e^{-\lambda x} dx\\ &amp;=&amp;\int^{\infty}_{0} \lambda e^{-\lambda x} dx\\ &amp;=&amp;\int^{\infty}_{0} e^{-\lambda x} \Big(\lambda \,\,\,dx\Big)\\ &amp;=&amp;\int^\infty_0e^{-u} du\\ &amp;=&amp;-e^{-u}\Big|^{\infty}_0\\ &amp;=&amp;1-\lim _{x \to \infty} e^{-u}\\ &amp;=&amp;1\\ \end{eqnarray*} How to copy all files of a certain type into a folder from command prompt? I want to copy all files of a certain type (like .docx, .pdf, etc) on my PC into a folder. How can I do that? Recovering broken or deleted NTFS partitions About two weeks ago I had a problem with my PC that my brother wrote a question about at .  I still haven't solved the problem, so my PC is unusable now.  Now I think that it would be simpler to re-install both Win7 &amp; Ubuntu than repair them, but there're some data on their partitions. I want to recover this data.  These partitions are not mountable for some reason. I don't know why.  sudo fdisk -l about the problematic partitions:     Device    Boot      Start         End      Blocks   Id  System /dev/sda1            2048     147912703    73955328   83 Linux /dev/sdb2            206848   174079999    86936576    7  HPFS/NTFS/exFAT   And in GParted:      And the error of the mount command:  Failed to mount '/dev/sdb2': Invalid argument The device '/dev/sdb2' doesn't seem to have a valid NTFS. Maybe the wrong device is used? Or the whole disk instead of a partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?   And the exact same message for /dev/sda1  How can I recover my data from those HDDs?  EDIT     I have tried to specify the type of the drive:  $ sudo mount -t ext4 /dev/sda1 /olddisk mount: wrong fs type, bad option, bad superblock on /dev/sda1,        missing codepage or helper program, or other error        In some cases useful info is found in syslog - try        dmesg | tail  or so $ sudo mount -t ntfs /dev/sdb2 /olddisk NTFS signature is missing. Failed to mount '/dev/sdb2': Invalid argument The device '/dev/sdb2' doesn't seem to have a valid NTFS. Maybe the wrong device is used? Or the whole disk instead of a partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?   EDIT     sudo ntfsfix /dev/sdb2 returns:  Mounting volume... NTFS signature is missing. FAILED Attempting to correct errors... NTFS signature is missing. FAILED Failed to startup volume: Invalid argument NTFS signature is missing. Trying the alternate boot sector Unrecoverable error Volume is corrupt. You should run chkdsk. Dim screen past the minimum on Ubuntu My laptop's screen is far too bright at night, even if I set it to minimum brightness. I know that it is capable of being dimmer, because Windows will dim it further if I leave it idle. However, I can't figure out how to dim it lower to minimum on Ubuntu. Is there a way?  I've looked at  question, but it's talking about Windows.