I made a template class Block and wanted to cache some data for each instance type of Block. For this reason I created an inner class Cache which is storing and initialising the data often used by Block class instances. But the compiler (Visual Studio 2017, C++17) is not accepting the static member variable definition and the error message is not helping me. Whats wrong with my code and how I can accomplish my goal?  Errors: Error  C2061   syntax error: identifier 'Cache'  Warnings: Warning    C4346   'Cache': dependent name is not a type  template&lt;int D&gt; class Block { private:     class Cache     {     public:         int mData[D];     public:         Cache();     }; private:     static Cache mCache; public:     Block(); };  template&lt;int D&gt; Block&lt;D&gt;::Cache Block&lt;D&gt;::mCache; // Syntax error "Cache"!  template&lt;int D&gt; inline Block&lt;D&gt;::Block() {     // Use cache data.     cout &lt;&lt; Block&lt;D&gt;::mCache.mData[0] &lt;&lt; endl; }  template&lt;int D&gt; inline Block&lt;D&gt;::Cache::Cache() {     // Initialise cache data.     mData[0] = D; }
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?
Getting from Denver Amtrak to Fort Collins The eastbound Amtrak arrives Denver 6:38 PM (18:38).  How can I get to Fort Collins from there?   The  runs  from Denver International Airport to Fort Collins, but the airport is 40 km from the Amtrak station, so that's a major detour, that would mean taking bus FX from Market Street Station 7:18 PM, arriving at the airport at 8:27 PM, then the super shuttle 9:05 PM, arriving Fort Collins CSU at 10:55 PM; almost 4 hours after departing from Denver. Greyhound Lines appears to have a bus departing 12:45 AM, arriving 02:00 AM — although probably as quick as it gets, this is not exactly a comfortable time. RTD Denver has transportation to Longmont and  from Longmont to Fort Collins, but  appears to depart 7:05 PM — so I won't make it there when arriving by Amtrak.  A taxi would cost an estimated .   Is there any other way to get to Fort Collins when arriving by the eastbound Amtrak, any way that I've missed? How can I permanently enable cheating? I'm giving Deus Ex a quick playthrough as a refresher before jumping into Human Revolution. In the interest of expediency, I've decided to cheat. ^.^  Normally, cheats must be re-enabled for each level when playing the original DX. I've encountered instructions on several sites (word-for-word identical instructions, so clearly copy/pasted) for permanently enabling cheats, but they aren't working for me:     Because you will need to redo this for every level, you can open up 'user.ini' and add 'bCheatsEnabled True' in the [DeusEx.DeusExGameInfo] section of the file to allow cheats to be activated forever.   Not only is that not working for me, it doesn't even look right compared to the rest of the file (space instead of =). With increasing desperation, I've tried adding that line (both verbatim and switching to an equal sign) to every section of both User.ini and DeusEx.ini which looks even remotely plausible — even creating a [DeusEx.JCDentonMale] section, just in case.  Does anyone know how to get this working? I'm running DX:GOTY version 1.112fm from Steam on Windows 7. Which is the best workflow to follow when texturing and importing textures from Substance Painter? So, I'm planning to texture a model using Substance Painter and will render it using the Cycles Render Engine. I will be also using the Principle Shader, heavily, to achieve realistic renders. So, which workflow in Substance Painter so that the textures are accurately rendered in Blender? Specular-Glossy? Or should I go with Metalic-Roughness? The optical density of a medium is quantified by its refractive index $n$. Does it have any correlation with the mass/number density of the medium? In other words is an optically denser medium must have a greater mass density compared to an optically rarer medium? Estimating partial sums $\sum_{n = 1}^m \frac{1}{\sqrt{n}}$ Apostol's Calculus, exercise number I 4.7 13.     Prove that if $n \geq 1$, then   $$ 2(\sqrt{n+1} - \sqrt{n}) &lt; \frac{1}{\sqrt{n}} &lt; 2(\sqrt{n} - \sqrt{n-1}) $$   and use this to prove that if $m \geq 2$, then   $$ 2 \sqrt{m} - 2 &lt; \sum_{n = 1}^m \frac{1}{\sqrt{n}} &lt; 2\sqrt{m} - 1 $$   In particular, when $m = 10^6$ the sum lies between $1998$ and $1999$.   After establishing the trivial case, for $n=1$, I can't think of a way to perform the inductive step:  assuming $2(\sqrt{n+1} - \sqrt{n}) &lt; \frac{1}{\sqrt{n}} &lt; 2(\sqrt{n} - \sqrt{n-1})$ and using this, deducing the same for $n+1$ is true as well:  $2(\sqrt{n+2} - \sqrt{n+1}) &lt; \frac{1}{\sqrt{n+1}} &lt; 2(\sqrt{n+1} - \sqrt{n})$  Any help is very appreciated, thanks Auto incrementing field based on groups within feature class? I am needing to auto increment a field based on groups within a feature class. I have 8 plots within a given polygon and I need to assign them an ID from 1-8 for each set of plots within each polygon. The polygon would have its own unique ID number to be used to group the plots.  I assume it would be an alteration of this:  rec=0 def autoIncrement():  global rec  pStart = 1   pInterval = 1   if (rec == 0):    rec = pStart   else:    rec = rec + pInterval   return rec I want to prove that $xe^{-x}$ is bounded by some constant for all the $x \in [0, \infty)$. So I take derivative of this guy, and found that on $x \in [0, \infty)$, its derivative is positive from $[0, 1)$, $0$ at $x=1$, and negative from (1, in infinity). So  $xe^{-x}$ achieves its maximum in $[0, \infty)$ at $x=1$, which is $1/e$. However, to prove that it's bounded by $1/e$, I need to prove that as $x$ goes to infinity, $xe^{-x}$ converges to $0$. Because otherwise, if it went to some value below $(-1/e)$, $xe^{-x}$ would not be bounded by $1/e$. How can I prove that $xe^{-x}$ converges to $0$? I mean, as $x$ goes to infinity, $e^{-x}$ converges to zero, but at the same time, x diverges to infinity. How can I formally prove that the product term converges to $0$? Do I need to use the epsilon definition of convergence to prove it?  Could you just show me the formal proof of $xe^{-x}$ converges to $0$? Or is there's any other way to approach this question? My professor suggested that I should use the power series for $e^{-x}$...?   Your help is greatly appreciated! Thank you so much!  I hope you enjoy your Saturday! Prove :(P → Q) ∨ (Q → P) using natural deduction Allowed inference rules: ∨-I, ∨-E, ∧-I, ∧-E, →-I, →-E, ¬-I, ¬-E  I tried to prove a contradiction by assuming $¬ ((P → Q) ∨ (Q → P))$ but got stuck, or am I doing it in the wrong way?  Edit:  My proof attempt  $1.\qquad¬ ((P → Q) ∨ (Q → P))\qquad \qquad\qquad\qquad\qquad\qquad\qquad \qquad\qquad Assum$  $2.\qquad P → Q\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\quad\  Assum$  $3.\qquad(P → Q) ∨ (Q → P)\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\quad\; ∨-I(2)$  $4.\qquad(¬ ((P → Q) ∨ (Q → P))) ∧ ((P → Q) ∨ (Q → P))\qquad\qquad\qquad\; ∧-I(1,3)$  $5.\qquad  ¬ (P → Q)\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\quad\;\;\; ¬-I(2,4)$  $6.\qquad  Q → P\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad \qquad\qquad\qquad\quad\; Assum$  $7.\qquad  (P → Q) ∨ (Q → P)\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\quad\;\; ∨-I(6)$  $8.\qquad  (¬ ((P → Q) ∨ (Q → P))) ∧ ((P → Q) ∨ (Q → P))\qquad\qquad\qquad\;\; ∧-I(1,7)$  $9.\qquad  ¬ (Q → P)\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\; ¬-I(6,8)$  $10.\qquad ¬ (P → Q) ∧ ¬ (Q → P)\qquad\qquad\qquad\qquad\qquad\qquad\;\qquad\qquad\quad\;\;\, ∧-I(5,9)$  Stuck at this line, can't spot any contradiction to line 1 Is there a kind of microdata or markup that creates "results x of y" in search results How can I download an older version of Xcode? I am trying to download Xcode from the App Store, but it says that I have to have a newer version of macOS. But I don't have enough space on my computer to upgrade. Its like 8 gigs or something like that and if I only could download Xcode that was compatible with macOS Sierra that would be nice. Expected value as a function of quantiles? I was wondering where there is a general formula to relate the expected value of a continuous random variable as a function of the quantiles of the same r.v. The expected value of r.v. $X$ is defined as: $E(X) = \int x dF_X(x) $ and quantiles are defined as :  $Q^p_X = \{x : F_X(x) = p \} =F_X^{-1}(p) $ for $p\in(0,1)$.  Is there for instance a function function $G$ such that:  $E(X) = \int_{p\in(0,1)} G(Q^p_X) dp $ Which answer do I accept if I have multiple correct answers? What is migration and how does it work? File: \boot\bcd Status: 0xc00000e9 windows 8 I am having this error for quite a few months. When the problem occurs, my windows freezes at boot time with black screen. After few reset attempts, sometimes it shows the entitled error. after few attempts, the windows starts but everything become slow. If I again restart, it works well. But at a point windows never starts and I have to reinstall it. I have already reinstalled 3/4 times in the past 2/3 months. I checked for any HDD errors with EASEUS Partition Master Home Edition with surface test, chkdisk at boot time etc for my C drive and F drive but no errors found. Startup repair also fails to solve the problem.  Windows Boot Manager   Windows failed to start. A recent hardware or software change might be the cause.   To fix the problem:  &nbsp;&nbsp;1. Insert your Windows installation disc and restart your computer.  &nbsp;&nbsp;2. Choose your language settings, and then click "Next." &nbsp;&nbsp;3. Click "repair your computer."  If you don't have this disc, contact your system administrator or computer manufacturer for assistance.   &nbsp;&nbsp;File: \Boot\BCD  &nbsp;&nbsp;Status: 0xc00000e9  My laptop's info:  Model: Dell n5110 corei5 OS: Windows 8 PRO 64 bit Anti-virus:  Avast Home edition  Additional info: My Program Files, Program Files (x86) and Users directory is located at F drive and linked with symbolic link (mklink). Also I have changed these basic locations from regedit. I also use eclipse android intelx86 emulator, virtualbox and Genymotion emulator most often. Should you use a plural verb if you refer to a fraction? Regarding the sum $\sum_{p \ \text{prime}} \sin p$ I'm very confident that  $$\sum_{p \ \text{prime}} \sin p $$  diverges. Of course, it suffices to show that there are arbitrarily large primes which are not in the set $\bigcup_{n \geq 1} (\pi n - \epsilon, \pi n + \epsilon)$ for sufficiently small $\epsilon$. More strongly, it seems that $\sin p$ for prime $p$ is dense in $[-1,1]$.   This problem doesn't seem that hard though. Here's something that (to me) seems harder.      If $p_n$ is the nth prime, what is $$\limsup_{n \to +\infty} \sum_{p \ \text{prime} \leq p_n} \sin p?$$   What is $$\sup_{n \in \mathbb{N}} \sum_{p \ \text{prime} \leq p_n} \sin p? $$   Of course, we can ask analogous questions for $\inf$.   I'm happy with partial answers or ideas. For example, merely an upper bound. Huge confusion with Fermions and Bosons and how they relate to total spin of atom I am supremely confused when something has spin or when it does not. For example, atomic Hydrogen has 4 fermions, three quarks to make a proton, and 1 electron. There is an even number of fermions, and each fermion has a 1/2 spin. Since there are an even number of fermions, the total spin value is an integer. This spin number is the "intrinsic" spin number that cannot be changed, but its orientation "up" or "down" can be changed.  For atomic Hydrogen, it is a Boson because it has integer spin, however it also has a single electron. I read on physics forums, , that the spin of atom comes from the electrons and not its nucleus. I also read on here, , that the spin of atomic Hydrogen is 1/2! The answer says atomic Hydrogen has spin 1/2 because it ignores the nuclear spin.  This is one thing that is confusing me. Shouldn't atomic Hydrogen have an integer spin because of the nuclear component? So does atomic Hydrogen have spin and is affected by a magnetic field? Nuclear spins are affected by magnetic fields, but they aren't as affected as electrons according to the discussion on physics forums.  Why do we ignore nuclear spin sometimes? Also, can someone help me out here with all the possibilities?  Is there a Boson with an half integer spin value? (Surely, there must not be) However atomic Hydrogen is one of those cases! (It seems...) (Why don't we cancel out the nuclear spin with the electron spin?)  Say we have another atom that is a Boson, It has unpaired electrons in different orbitals, so what determines whether or not electrons fill in orbitals as spin up or down? Does spin down nuclear spin cancel out a electron up spin? Which is correct, "neither is" or "neither are"? How to call C++ function from C? How to obtain $f(x)$, if it is known that $f(f(x))=x^2+x$?