I have written a toy program that defines a templated function which takes as an argument a std::vector&lt;T&gt; and a std::vector&lt;T&gt;::size_type.  Here's the working code:  #include &lt;iostream&gt; #include &lt;vector&gt;  template &lt;typename T&gt; std::vector&lt;T&gt; foo(std::vector&lt;T&gt; v, typename std::vector&lt;T&gt;::size_type n) {     n = std::min(v.size(), n);     return std::vector&lt;T&gt;(v.begin(), v.begin()+n); }  int main() {     std::vector&lt;int&gt; v{1,2,3,4,5};     v = foo(v, 3);     for (auto i: v) std::cout &lt;&lt; i &lt;&lt; " "; std::cout &lt;&lt; "\n"; }   When I leave out the typename before std::vector&lt;T&gt;::size_type compilation fails after producing this error:  test.cc:5:54: error: ‘std::vector&lt;T, std::allocator&lt;_CharT&gt; &gt;::size_type’ is not a type  std::vector&lt;T&gt; foo(std::vector&lt;T&gt; v, std::vector&lt;T&gt;::size_type n) {                                                       ^   I wonder why that is? Can someone explain why that typename is needed here?
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?
How can I manually install a package on MiKTeX (Windows) I'm new to LaTeX, investigating using it for some work projects.  I'm using MiKTeX on Windows.  My employer's locked-down network blocks the application's automatic installation function.  I can take my laptop home and successfully install from there, but if I need a package in the middle of the day I'm stuck.  I am able to access the CTAN website and download the package files (.dtx or .ins?), but I don't know what do do with them.  How can I do a manual package installation? AMD GPU Material in "material preview mode" and "rendered mode", is entirely gray as background. Only outline is displayed I don't know why but now, when i go in material preview or rendered (in solid mode it works fine), my object is entirely gray, or invisible idk, because it has the same color of the background. I've been working for days on this project without having this issue, it suddenly showed up. I tried opening other old projects and suddenly they all do the same so i guess it is some blender program setting that applies for all the projects, but idk how it happened cuz i didn't change anything :/, anyone got any tips? How do I detect unsigned integer multiply overflow? Counterexample for $A,B\triangleleft G,G/A\cong B \Rightarrow G/B\cong A$ What is the fastest way to get from Courmayeur/Aosta to Milan? We will be crossing the Italian/French border through Mont Blanc via cable cars, which we heard through Rick Steve's article: .  We will be starting off in Chamonix and arriving in Courmayeur. What's the fastest (and relatively cost-effective) way to get to Milan from Courmayeur? Someone who gives unsolicited explanations in a condescending way In Windows I used command-line clipboard copy-and-paste utilities...      pclip.exe and gclip.exe     These were UnixUtils ports for Windows (but they only handled plain text). There were a couple of other native Windows utilities which could write/extract any format.    I've looked for something similar in Synaptic Package Manager, but I can't find anything.    Is there something there, that I've missed? ... or maybe this is available in Bash scripting?    The type of utility I'd like will be able to read/write via std-in/std-out or file-in/file-out, and handle Unicode, Rich Text Format, picture, etc. clipboard formats...    NB: I'm not after a clipboard manager. Is  purely conceptual or does it represent some real "thing"?  Said another way, is superposition thought to have some tangible physical manifestation or is it simply the lack of physical determinism, except as defined by a wave function?  It seems like my question might be semantic.  For example, it is said that   superposition is obeyed, like a law superposition can be observed, like a phenomena superposition describes behavior   I guess my question is, can superposition be measured like an electrical charge, or is it simply the lack of knowable position. I updated the image in my Gravatar but my old picture still shows up.  Is this a cache issue?  Do I need to log out and then log back in? Modus Operandi. Formulae for Maximum and Minimum of two numbers with a + b and $|a - b|$ I came across the following problem in my self-study of real analysis:     For any real numbers $a$ and $b$, show that $$\max \{a,b \} = \frac{1}{2}(a+b+|a-b|)$$ and $$\min\{a,b \} = \frac{1}{2}(a+b-|a-b|)$$   So $a \geq b$ iff $a-b \ge0$ and $b \ge a$ iff $b-a \ge 0$. At first glance, it seems like an average of distances. For the first case, go to the point $a+b$, add $|a-b|$ and divide by $2$. Similarly with the second case.   Would you just break it up in cases and verify the formulas? Or do you actually need to come up with the formulas? How can I change the language of the QGIS Interface? I want the QGIS interface in English, in order to share information with the GIS community. Using another language, when chatting with the GIS community, makes things more difficult. When I installed QGIS, it automatically set the language to French. It's very frustrating not having the opportunity to select my preferred language.   I am using Windows XP in French, but I want QGIS in English. Why does Worf want O'Brien to go to Minsk? I've just watched the last 20 minutes of an episode of Deep Space 9, and towards the end Worf is very insistent that O'Brien and his wife move to Minsk. Is there any in or out of universe reason for this? When clicking between "Week", "Month", "Quarter", "Year" and "All" on the users page, the name I have typed in to filter on disappears. I feel like it should stay there, so that I can type in my name, and see how I've done in a week/month/etc. Prove that there is no continuous functions $f:[0,1]\to R$, such that   $$ f(x)+f(x^2)=x. $$   My try. Assume that there is a continuous function with this property. Thus, for any $n\ge 1$ and all $x\in [0,1]$, \begin{align*} f(x)&amp;=x-f(x^2)=x-\big(x^2-f(x^4)\big)=x-x^2+\big(x^4-f(x^8)\big)=\cdots\\ &amp;=x-x^2+x^4-\cdots+(-1)^n\left(x^{2^n}-f\big(x^{2^{n+1}}\big)\right) \end{align*}  since $f(0)=0$ and $\displaystyle\lim_{n\to \infty}x^{2^{n+1}}=0$ for any $x\in(0,1)$,it follows by the continuity of $f$ that $\displaystyle\lim_{n\to \infty}f\big(x^{2^{n+1}}\big)=0$, hence $$f(x)=x-x^2+x^4-x^8+\cdots+(-1)^nx^{2^n}+\cdots$$ for any $x\in (0,1)$  Why do I have prove that there is exists such a continuous functions $f$? Maybe  my example is wrong? Why?  if my   method is wrong,then How prove this problem ? Thank you. Career Change in to Testing I've around 10+ years of experience in Banking operations including  reconciliations, sales, customer services, asset management, and financial transaction QA.  Coming to academics I've done my PG in commerce (costing, auditing, banking, and statistics) also a diploma in project management, ISTQB foundation, Prince 2 foundation and ITIL foundation.    Can any one advise me if the testing role is ideal for me and how to start with it. How would I prove there is no smallest positive rational number? what is the best method to prove this statement? Simplest Example of a Poset that is not a Lattice A partially ordered set $(X, \leq)$ is called a lattice if for every pair of elements $x,y \in X$ both the infimum and suprememum of the set $\{x,y\}$ exists. I'm trying to get an intuition for how a partially ordered set can fail to be a lattice. In $\mathbb{R}$, for example, once two elements are selected the completeness of the real numbers guarantees the existence of both the infimum and supremum. Now, if we restrict our attention to a nondegenerate interval $(a,b)$ it is clear that no two points in $(a,b)$ have either a suprememum or infimum in $(a,b)$.   Is this the right way to think of a poset that is not a lattice? Is there perhaps a more fundamental example that would yield further clarity? Calculate expected values using logistic regression coefficients The outcome of the logistic model is binary (0;1) - intervention that occurs in hospital (3838 interventions in 51096 cases). I am modeling the effect of age groups (60 to 74; 75 to 89 and 90+) and sex (female) on the outcome. My reference age group is male aged 18-59.  My logistic regression coefficients look like this:  intercept  -4.313 female      0.5117 age 60-74   0.4081 age 75-89   1.1761 age 90+     1.5612.   Corresponding odds ratios:  female      1.668 years60_74  1.504 years75_90  3.242 years90     4.764   Now I am trying to obtain a probability of an outcome = 1 for each case. What is the right way to do this? Prove : $$ \text{If } \; x-\lfloor x \rfloor + \frac{1}{x} - \left\lfloor \frac{1}{x} \right\rfloor = 1 \text{, then } x \text{ is irrational.}$$  I think the way to go here is to falsely assume that $x$ is rational, thus having $x=\frac mn$ with $m,n$ integers and go with that, we also know that $x$ with the celling belongs to the integers and that $\frac 1x$ with the celling gotta be a $0$. Still can't prove it. Thank in advance ! Number of ring homomorphisms from $\mathbb Z_{12}$ to $\mathbb Z_{28}$. Question:      Find the number of non trivial ring homomorphisms from $\mathbb Z_{12}$ to $\mathbb Z_{28}$. ($f$ is not necessarily unitary, i.e., $f(1)$ need not be $1$.)    Suppose $f$ is a ring homomorphism from $\mathbb Z_{12}$ to $\mathbb Z_{28}$.  Consider $f$ as a additive group homomorphism.  Let $k= |\ker f|$ and  $ t = |\operatorname{im}(f)|$. Then $k\mid 12$ and $t\mid 24$ and $kt=12$, by first isomorphism  theorem of groups.  There are two possibilities $k=3$, $t=4$   and $k=6$, $t=2$.  For the first case $f$ should map $1$ to an element of the subgroup generated by $7$ as there is a unique subgroup of $\mathbb Z_{28}$ of order $4$ generated by $7$. For the second case $1$ has to map to $14$, for the same reasoning.  So there are at most two ring homomorphisms from $\mathbb Z_{12}$ to $\mathbb Z_{28}$. Question is how to check the possible maps which are ring homomorphisms.  Thanks.