Somewhere in a .h file:  namespace gpBenchAPI {  struct AbstractConsts {   public:     static const uint8_t STATUS_TAG_NOT_FOUND = 2;  }; //AbstractConsts }   Somewhere in another .h file:  class MyClass{ private:      void method();      QMap&lt;uint8_t, QString&gt; errorCodes; };   Somewhere in a .cpp file:     void MyClass::method(){        using namespace gpBenchAPI;        errorCodes.insert(AbstractConsts::STATUS_TAG_NOT_FOUND, "A-1");    }   This code is rising a linking error:    undefined reference to `gpBenchAPI::AbstractConsts::STATUS_TAG_NOT_FOUND'   but this code compiles and links:   switch (status) {     case AbstractConsts::STATUS_TAG_HUNTING:         return 0;   }   If I do :    errorCodes.insert(2, "A-1");   no problem. Why?  Added:  If, like in the suggested dupplicated question's answer, I initialize the const in a cpp file like this:  const uint8_t AbstractConsts::STATUS_TAG_NOT_FOUND = 2;   and remove the initialization from the .h file, the "switch" does not compile anymore:  The value of 'gpBenchAPI::AbstractConsts::STATUS_TAG_NOT_FOUND' is not usable in a constant expression      case AbstractConsts::STATUS_TAG_NOT_FOUND:                           ^
Can anyone explain why following code won't compile? At least on g++ 4.2.4.  And more interesting, why it will compile when I cast MEMBER to int?  #include &lt;vector&gt;  class Foo {   public:       static const int MEMBER = 1;   };  int main(){       vector&lt;int&gt; v;       v.push_back( Foo::MEMBER );       // undefined reference to `Foo::MEMBER'     v.push_back( (int) Foo::MEMBER ); // OK       return 0; }
I am using pgfplot to draw graphs in latex. Now this is the problem I am facing:  \begin{tikzpicture}[scale=1] \begin{axis}[ybar,grid=major,bar width=2pt,width=8cm, height=8cm,xmin=1,xmax=540,ymin=1,ymax=240] \addplot [draw=black,fill=green]  table [x=size, y=cluster, col sep=comma] {sim-0.4-0.6.csv}; \end{axis} \end{tikzpicture}   It generates the following graph:    Since, I have values mainly between 0-50 on x-axis, I want to zoom there. After that, values comes around 500. S0, there are no graph points between 50 - 450. How should I do that? PHP Codes are displaying in HTML How do I create a hinged door that opens and closes in Blender? If I knew how to do this, then it would help me also create moving control surfaces on model aircraft, such as the rudder and horizontal stabilizers. Polling the keyboard (detect a keypress) in python How can I poll the keyboard from a console python app?  Specifically, I would like to do something akin to this in the midst of a lot of other I/O activities (socket selects, serial port access, etc.):     while 1:       # doing amazing pythonic embedded stuff       # ...        # periodically do a non-blocking check to see if       # we are being told to do something else       x = keyboard.read(1000, timeout = 0)        if len(x):           # ok, some key got pressed           # do something   What is the correct pythonic way to do this on Windows?  Also, portability to Linux wouldn't be bad, though it's not required. Is it possible to experimentally show that observable universe is much larger than ~93B ly? How do I delete all my mail from my Gmail account? Web designer's link back to own website (rel="designer" / rel="nofollow") I found an argument online that the two fields are not isomorphic but I can't make sense of the argument. You find it .  These are the things I'm confused about when it comes to the argument.     It says that the field $\mathbb Q[x]/(x^2+1)$ contains a root of the polynomial $x^2+1$. I suppose this is the congruence class $[x]$? But this is not the same as the zero element of the field $\mathbb Q[x]/(x^2+1)$, right?   It says that every isomorfism takes $0$ to $0$. I interpret this as the zero-element in $\mathbb Q[x]/(x^2+1)$ (which I interpret to be $[0]$) is taken to the zero-element in $\mathbb Q[x]/(x^2+2)$ denoted $[0]_2$. But in the argument it says that this means that if $\mathbb Q[x]/(x^2+1)$ has a root of the polynomial, then also $\mathbb Q[x]/(x^2+2)$ must have a root of this same polynomial. Why is that?     Greatful for any help! On the first puzzle of the quest Under Saarthal (the one with the six pillars), I enter the correct combination, but the door still doesn't open, and arrows are still shot at me. I've reloaded the game a couple hundred times, I've left the room, and it still doesn't work. What do I do? Yesterday I started the upgrade from 12.10 to 13.04, but I interrupted it because it was taking too long. Now if I restart it, it doesn't proceed.  Is there any possibility to clean the mess it left when I interrupted it and make a clean restart of this update? We often get questions on bicycles.stackexchange about fitting wider or narrower tires to bicycles. We have a large number of these with answers suiting the specific bike or style of bicycle in question, but I have been unable to find one that provides a generic answer covering off all things that need to be considered. For most bicycles, the answer is the same regardless of the specific style and sizes of tires in question.   This is intended as a canonical question that we can point closed questions to. Mapping building to only one grid which contains more than half of its area using QGIS? I've heard that in the study of finite fields, and other concepts related to finite fields, mathematicians have found a sort of gap: there are various results and things that seem like they correspond to a field with one element, $\mathbf{F}_1$, even though there is no such field. Of course, there is an object which seems similar to a field with one element: the zero ring, $\mathbf{Z}_1$, defined as having one element, $0$, obeying the equations $$0 + 0 = 0 - 0 = 0 \cdot 0 = 1 = 0.$$ The zero ring seems to behave like a field in every respect, except for the fact that it fails to satisfy $0 \ne 1$. (But the importance of the axiom $0 \ne 1$ isn't clear to me.) However, in any case, there seems to be consensus that the zero ring is not the field with one element. People say that the zero ring &quot;does not behave like a finite field&quot; () or that it &quot;does not have the features that mathematicians need&quot; (). I'm not familiar enough with algebraic geometry to understand the properties that $\mathbf{F}_1$ is expected to have. Is there an elementary, undergraduate-level explanation of  why it seems like a field with one element &quot;ought to exist&quot; in the first place, what properties we expect it to have and why, and how the zero ring fails to satisfy these properties?  Or do I need to study algebraic geometry if I want to have an understanding of any of this? (A side question: do we have a good answer to the question of whether the single element of $\mathbf{F}_1$ ought to be $0$, $1$, both, or neither?) I'm having problems understanding the following situation. Suppose two 1-tonne cars are going with the same orientations but opposite senses, each 50 km/h with respect to the road. Then the total energy is   $$\begin{eqnarray}E=E_1+E_2&amp;=&amp;\frac{1\mathrm t\times(50\mathrm{km}/\mathrm h)^2}2+\frac{1\mathrm t\times(50\mathrm{km}/\mathrm h)^2}2\\&amp;=&amp;1\mathrm t\times(50\mathrm{km}/\mathrm h)^2\\&amp;=&amp;2500\frac{\mathrm t\times\mathrm{km}^2}{\mathrm h^2}.\end{eqnarray}$$  Now if we look at it from the point of view of one of the cars, then the total energy is   $$\begin{eqnarray}E=E_1+E_2&amp;=&amp;\frac{1\mathrm t\times(0\mathrm{km}/\mathrm h)^2}2+\frac{1\mathrm t\times(100\mathrm{km}/\mathrm h)^2}2\\&amp;=&amp;\frac{1\mathrm t\times(100\mathrm{km}/\mathrm h)^2}2\\&amp;=&amp;5000\frac{\mathrm t\times\mathrm{km}^2}{\mathrm h^2}.\end{eqnarray}.$$  I know that kinetic energy is supposed to change when I change the frame of reference. But I understand that then there must be some other kind of energy to make up for it so that the energy in the system stays unchanged. But I don't see any other kind of energy here. I only see two total energies of the same system that seem to be different. Could you explain this to me?  Please note that while I don't understand any physics, I do understand college level mathematics, so if necessary please use it. (I doubt anything more than high school maths should be needed here, but I want to say this just in case.) My Windows folder takes up too much space - how can I reduce it? In typical PCs the Size of Windows Folder is 6 to 8 GB but in my Case its 25GB. How can I delete the unwanted files from the Windows Folder (which, in turn, will optimize my C Drive size).  My system is Windows 7 with 60 GB in C Drive with 59 GB occupied. Talk to him is what I did Talk to him is what I did.  (this sentence is from )  "Talk" is a verb here that is not in the imperative mood. I suppose, it's in the infinitive form. But then how can it stand alone, without "to"?  What will be if we add "to" to "talk"?  To talk to him is what I did.  If we can do so, then what will difference be between the initial sentence and the new one with "to"?  Maybe, there are some omitted words, after inserting which the sentence will immediately become understandable? I mean, maybe, there is an ellipsis?  Thanks!  To make it clearer:  Upd.1: if we type "bare infinitive" in google, we can't find any sites that could explain the absence from "to" before "talk".  Upd.2: Why can we replace "to talk" with only "talk" in "To talk to him is what I did."  Upd.3: I have my own logic but I don't know whether it's right or not:  1) I think that without an ellipsis "Talk to him is what I did." is to look like "I did talk to him is what I did do."  2) Also I know that we can't use "to" before "read" in "What we must do is read the manual." because in the left part we don't have "to" before "do".  By this logic, we can't use "to" before "talk" in "Talk to him is what I did." because in "what I did do" we don't have "to" before "do".  Am I right or not? How to avoid ArrayIndexOutOfBoundsException or IndexOutOfBoundsException? How to map inherited entities in EF code-first When compiling a beamer presentation and using the following \author command  \author{Name \\ \texttt{my.email@domain.com}}   I get the following hyperref warning in my logfile  Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding): (hyperref)                removing `\\' on input line 15.   Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding): (hyperref)                removing `\new@ifnextchar' on input line 15.   I understand that this has to do with hyperref setting the PDF metadata, where the linebreak does’t make much sense and should be removed.  Trying to set  \hypersetup{pdfauthor={Name}}   does’t change the situation, seems like hyperref is still looking at the author command.  How do I get the desired display of author name with email and still keep hyperref happy? What's the -alhF flag in ls? What is the -alhF flag in ls? I can't find it in the .