I ran to some problems with c++11 alias templates. As you can see below, I want to create an alias to A::B from class C. Before instantiation is made the compiler (gcc 6.1) cannot assert that V has a member type B, therefore giving the error:  error: expected ‘;’ before ‘&lt;’ token   template&lt;typename ValueT&gt; using B = typename V::B&lt;ValueT&gt;;   Does not his go against the usual way templates are dealt with in C++, that is assuming that the template type provides all necessary functionalities until proven otherwise by an instantiation?  template&lt;typename T&gt; class A{     T a; public:     template &lt;typename ValueT&gt; class B {         ValueT b;     }; };  template &lt;typename V = A&lt;int&gt;&gt; class C { public:     template&lt;typename ValueT&gt; using B = typename V::B&lt;ValueT&gt;; };
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?
Why is the gravitational force always attractive? Why is the gravitational force always attractive? Is there another way to explain this without the curvature of space time?   PS: If the simple answer to this question is that mass makes space-time curve in a concave fashion, I can rephrase the question as why does mass make space-time always curve concavely? Need to give permissions to /tmp/cache and /tmp/templates_c but can't find them Why does the connection time out when connecting to a server? My friend had hosted a Minecraft server before and brought it back up today with my help. He and anyone in his LAN can connect. However we have had a few people try to connect, including me, and when we try to connect it gives the message:  Failed to connect to the server Connection timed out: connect  What does this exactly mean? How do we fix this? Java Equivalent to Python Dictionaries How do you hide back faces so that you only see faces when its normal is facing the camera? When exporting it for use in a game, the face is rendered in only the direction of its normal, so this would be useful to have something similar. To select a child node in jQuery one can use children() but also find().   For example:  $(this).children('.foo');  gives the same result as:  $(this).find('.foo');  Now, which option is fastest or preferred and why? Does a fighter's Action Surge trigger Extra Attack? Context  A player in my game will play a fighter with a greatsword. At 5th level he has Extra Attack and the option to use Action Surge. PHB p.72 states:     Action Surge. Starting at 2nd level, you can push yourself beyond your normal limits for a moment. On your turn, you can take one   additional action on top of your regular action and a possible bonus   action.      Once you use this feature, you must finish a short or long rest before   you can use it again. Starting at 17th level, you can use it twice   before a rest, but only once on the same turn.        Extra Attack. Beginning at 5th level, you can attack twice, instead of once,   whenever you take the Attack action on your turn.       The number of attacks increases to three when you reach 11th level in   this class and to four when you reach 20th level in this class.   Confusion  The questions and answers that I find on here deal with multi-classing or Two Weapon fighting specifically, which don't really give a clear yes or no on my question.  The way I read these two features is that when a fighter takes an Attack action, he gets the Extra Attack. After using Action Surge he gets the opportunity to take another Attack action, and with that another Extra Attack. This results in four attacks with the greatsword in one turn, which sounds amazing but also rather powerful. Is this correct, or am I missing something? If $A$ is a ring and $S=\{1,f,f^2,f^3,...\}$ a multiplicative set of $A$, prove that $\mathrm{Spec}(A_f)=\mathfrak{V}((f))^c$.   Notation: $A_f=S^{-1}A$ and $\mathfrak{V}((f))=\{P \in \mathrm{Spec}(A): P \supset (f)\}$  My attempt:   On one hand, if $P \in \mathrm{Spec}(A)$ and $P \cap S$ is empty then we identify $\mathrm{Spec}(A_f)=\mathrm{Spec}(S^{-1}A)=\{P \in \mathrm{Spec}(A): P\cap S= \emptyset\}$.  On the other hand, $\mathfrak{V}((f))^c=\{P \in \mathrm{Spec}(A): P \nsupseteq (f)\}$.   So the exercise is equivalent to prove: $$\{P \in \mathrm{Spec}(A): P\cap S =\emptyset\}=\{P \in \mathrm{Spec}(A): P \nsupseteq (f)\},$$ but I can't continue so I'd appreciate if somebody could help me.   Thanks in advance. I cannot find the Polygon Neighbors tool. I have searched for it as I usually do and I have also browsed the proximity toolset but it is not there. The other Tools, e.g. Buffer and Near are there and work fine. Here is a screenshot: GTA 5 Social club I used to play gta 5 online on my ps3 but it ended up breaking and I can't use it anymore I purchased the game for xbox 360 and started playing the game all over again and some of you know how hard that can be specially online.. So I was wondering if I could somehow transfer my old ps3 social club account to my xbox an use it on xbox from now on? Why did the texture I painted in texture paint mode disappear? Should the site prompt new users to include an @name in comments? How can I make realistic looking potions as handouts I'd like to give my group some realistic looking potions as handouts.  Does anyone have tips on how I could make these look awesome? It seems that Mac OS X 10.6.1 Snow Leopard has a tendency to leave some windows off-screen at times, especially when I disconnect an external monitor from my MacBook. How can I move the window back on-screen when it's not possible to grab the title bar and drag it back onto the screen?   recommends adjusting your screen resolution downward to have off-screen windows "snap back into view" and then adjust your screen resolution back to its original setting. In OS X 10.4 Tiger, I had a script that brought all off-screen windows back on-screen, but in my upgrades to Leopard and now Snow Leopard, I don't seem to have that script.  Any better solutions out there? Why is my Wi-Fi process using 3GB of memory? Is a differentiable function always continuous? Continuous Functions are not Always Differentiable. But can we safely say that if a function f(x) is differentiable within range $(a,b)$ then it is continuous in the interval $[a,b]$ . If so , what is the logic behind it ? Disclaimer Yes, I am fully aware that what I am asking about is totally stupid and that anyone who would wish to try such a thing in production code should be fired and/or shot.  I'm mainly looking to see if can be done. Now that that's out of the way, is there any way to access private class members in C++ from outside the class?  For example, is there any way to do this with pointer offsets? (Naive and otherwise non-production-ready techniques welcome) Update As noted in the comments, I asked this question because I wanted to write a blog post on over-encapsulation (and how it affects TDD).  I wanted to see if there was a way to say &quot;using private variables isn't a 100% reliable way to enforce encapsulation, even in C++.&quot;  At the end, I decided to focus more on how to solve the problem rather than why it's a problem, so I didn't feature some of the stuff brought up here as prominently as I had planned, but I still left a link. At any rate, if anyone's interested in how it came out, here it is:   (I suggest reading it before you decide that I'm crazy). Should questions having lots of downvotes be downvoted further? Is down-voting an already heavily down-voted/closed question kind of like kicking a dead horse? Is this bad practice? Blender resizing my image in half I have a problem. I'm trying to render an image and the resolution is 500x280. After I render the image and save it, for some reason the image gets resized to 250x140. I'm unsure why it happends. How can one securely generate an asymmetric key pair from a short passphrase? Background info: I am planning on making a filehost with which one can encrypt and upload files. To protect the data against any form of hacking, I'd like not to know the encryption key ($K$) used for a file, so the user will have to asymmetrically encrypt $K$ and send it as well. The reason for this double encryption is that you can still share (individual!) files with other accounts by encrypting $K$ with the public keys of those users, too.  My problem is: How can a user can get a public and private key without the server saving/knowing the private key and without the user having to remember a passphrase of 250 hex characters?  Question: Is there a way to derive a key pair from a password, like PBKDF-2 does for symmetric encryption? Suggestions on rearranging the cryptographic steps in an easier way are welcome, too.  Alternatively: It is also possible to encrypt the private key with a PBKDF-applied password and store it on the server, but I'd like to keep things 'simple'. ;)  Note: At this point I don't care if it requires RSA, ECC or an obscure cryptography scheme.