I would like to have a function parameters of the template type of the variadic template class. How can the following code be well-formed?  template &lt;typename T&gt; struct Foo {   typedef T Base; };  template &lt;typename... Targs&gt; struct Bar {   void get(Targs::Base... args) {} /// Type of the typedef Base of Foo! };  int main() {   Bar&lt;Foo&lt;int&gt;, Foo&lt;double&gt;&gt; bar;    int i = 0;   double j = 0.0;   bar.get(i, j); }   Using GCC 4.9 C++11 or 5.3.
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?
Many introductory quantum mechanics textbooks include simple exercises on computing the de Broglie wavelength of macroscopic objects, often contrasting the results with that of a proton, etc.  For instance, this example, taken from a textbook:     Calculate the de Broglie wavelength for      (a) a proton of kinetic energy 70 MeV      (b) a 100 g bullet moving at 900 m/s   The pedagogical motivation behind these questions is obvious: when the de Broglie wavelength is small compared to the size of an object, the wave behaviour of the object is undetectable.  But what is the validity of the actual approach of applying the formula naively? Of course, a 100g bullet is not a fundamental object of 100g but a lattice of some $10^{23}$ atoms bound by the electromagnetic force. But is the naive answer close to the actual one (i.e. within an order of magnitude or two)? How does one even calculate the de Broglie wavelength for a many body system accurately? Why use swap when there is more than enough free space in RAM? Using swap space instead of RAM can drastically slow down a PC.  So why, when I have more than enough RAM available, does my Linux system (Arch) use the swap?  Checkout my conky output below:    Also, could this be the cause of speed and system-responsiveness issues I'm having?  Output of free -m :  $ free -m              total       used       free     shared    buffers     cached Mem:          1257       1004        252          0         51        778 -/+ buffers/cache:        174       1082 Swap:          502        144        357 Correct usage of "persons" (vs. "people") I had a little fight about persons vs. people.  Could you advise if both of the following are correct, if possible with reference to a dictionary?        A table for two people please.   A table for two persons please.      Besides that, how would you ask for a table in a restaurant?  I read  and , but they didn't really solve the question if both are correct.  I also found the last paragraph of , which suggests that (1) is "more correct", but doesn't say (2) is wrong. How can I make a program executable from everywhere What should I do if I want to be able to run a given program regardless of my current directory? Should I create a symbolic link to the program in the /bin folder? How to Merge columns in crystal report Should it be /about_us or /about-us?  From usability point of view, I personally think /about-us is much better for end-user yet Google and most other websites (and javascript frameworks) use underscore naming pattern. Is it just matter of style? Are there any compatibility issues with dashes? When using \textsc, LaTeX issues warning: Font shape `OT1/cmr/bx/sc' undefined Drawing function in tikzpicture access parent object in javascript I have  a  requirement where a future method need to be called from batch apex ,I came across various articles stating that a future method could not be called from the batch. Is there any alternate solutions for that? Restrict the access to suggested edit reviews on deleted posts on an answer deleted as rude/abusive is visible, even without logging in (and for users with less than 10k reputation). These users can't see the answer , via the , or a direct link to the .    This is a potential avenue for spammers, just like the suggested edit spam used to be, but is ; according to the :     In addition, in order to reduce the incentive for spammers to make spam edits that get rejected, suggested edit spam is hidden from logged-out users, so they can't show their clients public-facing pages with spam (so they won't get paid).   For this to work, the spammer would need two accounts, one to post the spam and a second one to suggest an edit. Even if the spam post is quickly nuked, the review link will be active forever. One could argue that logged-in users without 10k reputation shouldn't be able to see the suggested edits either; I'm partial to that. Finding rank-nullity of a given matices Can I create a shortcut to open a specific application on OS X? I want to create a keyboard shortcut to i.e. open Firefox while I am working in another application. I know I can use ⌘ CMD+T when I am in Firefox to open a new tab.   I haven't found a way to create that kind of shortcuts in System Preferences.  Any ideas? "Forgot" vs "Forget" Is the following correct, or is there more to it?  "I forgot his name" — I knew his name, but I forgot it.  "I forget his name" — I keep forgetting his name. Where using "forget" basically means that you tried to remember this information before as well, but you couldn't then either. I need to calculate the surface (m2) of external walls of all the buildings in a town. By external walls I mean all the walls of a building or parts of a wall which are not in contact with another building. I have a 2D shapefile of polygons with the cadastral footprint of the buildings, which includes information of the building’s height in the attribute table.  I don’t really know how can I do it… My idea is to convert the 2D file to 3D and use the 3D shapefile to distinguish the external walls from the shared walls (parts of a building that are shared with other buildings) of all buildings, and from there, calculate the total area but I’m not sure whether this can be done with ArcScene.  Anybody knows how could it be done and if there is an automate way to do it? A projection satisfying $\| Px \| \leq \|x\|$ for all $x$ is an orthogonal projection How to prove that if $V$ is a finite dimensional inner product space and $W$ a subspace of $V$, if $P$ is projection map ($P^2=P$) having $W$ as its range and is such that $\|Px\| \leq \|x\|$ for all $x \in V$, then $P$ is orthogonal projection of $V$ onto $W$. Need a comma before an adverb as last word in sentence? Check differentiability of multivariable functions I am trying to determine if the following functions are (totally)   differentiable at $(x,y)=(0,0)$.      $$f(x,y)=\sqrt{\vert xy \vert}$$      $$g(x,y)=e^{{{\vert x \vert}^3}y}$$   However I am not particularly sure where to start. The concept of the total derivative being the Jacobian matrix makes sense but I don't really understand how to work with functions that may not have a Jacobian matrix. Any help would be greatly appreciated! How does the kernel prevent a malicious program from reading all of physical RAM? If I write a program that tries to read memory at every possible address, and I run it on a "full" Unix, it will not be able to access all of the physical RAM.  But how does the operating system prevent it from doing so?  I am more familiar with small CPU architectures where any piece of assembly code can access everything. I don't understand how a program (the kernel) can detect such malicious operations. I have an ArrayList&lt;String&gt; that I'd like to return a copy of.  ArrayList has a clone method which has the following signature:  public Object clone()   After I call this method, how do I cast the returned Object back to ArrayList&lt;String&gt;?