I've encountered a weird problem. My code works perfectly in Release build, but fails to compile in Debug. Quite the opposite to the problems one usually have. :)  in *.h file I have a constant:  class OBDenrChrg : public OBChargeModel { public:   bool ComputeCharges(OBMol &amp;mol); // blah-blah-blah private:   static const float c = 0.05; };   in *.cpp file I use this constant:  bool OBDenrChrg::ComputeCharges(OBMol &amp;mol) { // blah-blah-blah   Eigen::VectorXf a0 = L*EN*c;   Eigen::SparseMatrix&lt;float&gt; A = L*HRD*c + I; // blah-blah-blah }   The built is controlled by cmake. The Release target builds and works well. The Debug says:  CMakeFiles/plugin_charges.dir/charges/denr.o:  In function `OpenBabel::OBDenrChrg::ComputeCharges(OpenBabel::OBMol&amp;)': /home/titov/openbabel-2.3.2/src/charges/denr.cpp:181: undefined reference to `OpenBabel::OBDenrChrg::c' /home/titov/openbabel-2.3.2/src/charges/denr.cpp:182: undefined reference to `OpenBabel::OBDenrChrg::c'   I have no #ifdef DEBUG or similar switches in these files.   Any ideas on how to fix the problem and what may cause it?  Edit:  Thanks everyone for the help.  The problem was in the abscence of c's definition, since declaration of a static member inside of class' definition does not define the static member. What a mess...
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; }
Recursively replace string in files I want to replace the backslash in the string page_path\example_filename.txt with a forward slash.  I also want to be able to run this on a large file system and have it recursively search all directories.  I found someone on the web who said to use grep, xargs, and sed but I wasn't able to get it to work. I've been trying different variations on delimiters and escape characters, but didn't get it.  Here is the command I was trying to run: grep -lr -e 'page_path\\' * | xargs sed -i 's/page_path\/page_path//g'  Thanks in advance. Where to put my code: plugin or functions.php? The title says it all. I'd like to know how I can install software - an example is the Chromium web browser. Graph theory: Tree holds two sub-tree with an amount of vertices Could a Homorphus Charm Change a Werewolf Back Into a Human Before the Moon Cycle Ends? ‘Nice loud howl, Harry – exactly – and then, if you’ll believe it, I pounced – like this – slammed [the werewolf] to the floor – thus – with one hand, I managed to hold him down – with my other, I put my wand to his throat – I then screwed up my remaining strength and performed the immensely complex Homorphus Charm – he let out a piteous moan – go on, Harry – higher than that – good – the fur vanished – the fangs shrank – and he turned back into a man. Simple, yet effective – and another village will remember me forever as the hero who delivered them from the monthly terror of werewolf attacks.’   Gilderoy Lockhart - Chamber of Secrets - chapter 10 - The Rogue Bludger   Yeah, yeah. I know: consider the source! We all know Gilderoy Lockhart is a fake and a fraud in that he took credit for other heroic wizards' work. However, it occurred to me that in order to sell his books, he would have had to have written accurate and real spells and charms and potions, etc, into the books, or else everyone would have known right away that he was a turkey.   So is it possible there's an actual Homorphus Charm that will change a werewolf back into a human before the werewolf's moon cycle is over? If so, why on earth would they not have used it on Remus Lupin (for Lupin's safety) or Fenrir Greyback (for the community's safety)? threeparttablex table notes for tabu tabulars with less than \textwidth After 4 years of being a Mac user, there is only one thing that I still miss from the Windows world, and that is being able to switch with a single keystroke between all open windows in the computer.  What is the best app or utility, free or not, for accomplishing that?  I've used , but I never was completely satisfied with it. It's a bit slow and the switcher UI is not very pretty.  Do you know any alternative?    EDIT (2016): This question keeps getting views and upvotes after 6 years. When I asked this question in 2010 I was still transitioning from being a Windows user. Eventually, I got used to Mac OS X UI and nowadays I don't use any third party utility for managing app windows, just Mission Control and the native keyboard shortcuts. So, although this question is no longer relevant for me I hope it is useful to new Mac users making the switch (Including this comment). Determine the number of functions $f: \{1,2,3....,1999\}\to \{2000,2001,2002,2003\}$satisfying the condition that $f(1)+f(2)+...f(1999)$ is odd. Problems:Determine the number of functions $$f: \{1,2,3....,1999\}\to \{2000,2001,2002,2003\}$$ satisfying the condition that $f(1)+f(2)+...f(1999)$ is odd.   My Attempt: Each integer in domain has $4$ choices and therefore the total number of functions is $f$ is $4^{1999}.$ Since there are an equal number of functions that yield odd or even result, we can directly write that the number of functions satisfying the above condition to be $2*4^{1998}.$ I am unsure about this last claim and would like to prove it (if it is true.)Also is the answer to this problem correct?  Edit $1$: I tried to proceed further in the following manner:   For a given mapping $f$ let the number of integers assigned to $2000,2001,2002$ amd $2003$ be $p,q,r$ and $s$ respectively, where $p,q,r,s\in \mathbb{Z}^+$. Therefore the sum in question can be written as $f(1)+f(2)+...+f(1999)=2000p+2001q+2002r+2003s.$ Clearly the sum will be odd iff $q+s$  is odd. Also note that $p+q+r+s=1999\Rightarrow p+r$ is even. On the other hand if we let $q+s$ as even then $p+r$ must be even. Now the number of values of $p,q,r$ and $s$ for which the above two lemmas hold is the same and therefore if we let $f$ to be the function which maps elements form $\{1,2,3,...,1999\}$ to $\{2000,2001,2002,2003\}$ such that $q+s$ is even and $g$ to be the function  hich maps elements form $\{1,2,3,...,1999\}$ to $\{2000,2001,2002,2003\}$ such that $p+q$ is even we will get a bijection.(Maybe!) What happens with excess items if my bag is full, and what should I do to avoid losing items? There's a default limit of 350 items in the bag (even though you can expand it through the shop). I am currently level 6 and have already ~250 items in my bag. I haven't done any battles yet, as all the gyms in my area are too strong for my pokémon at the moment. So I have a lot of Pokéballs, Heals and Revives that I don't need right now.  What happens once my bag is full? Will additional items go into a temporary overflow bag? Will I just lose them? Will they replace older items?  I'm afraid I will lose the valuable items gained through a level-up. Should I throw away items to avoid that? If so, what should I throw out first? Heals and Revives, as I don't need them right now? Or will they become too valuable later on and I should rather throw out some Pokéballs as those are the most common items to receive from a Pokéstop?  TL;DR: What happens with items that exceed my bag size limit and what is the best strategy to avoid losing valuable items? App drawer icon gone from Cyanogenmod dock I have a Samsung Galaxy S2, running the latest CM10.1.  I lost the app drawer icon on my Dock; I must have deleted it. The app drawer icon lets you go to the app list, and the widget list.  How do I get the app drawer icon back? The icon looks like a circle with 6 dots inside it. 101 positive integers placed on a circle A Pigeonhole Principle problem:     101 positive integers are placed on a circle whose sum is 300. Prove   that it is possible to choose from these numbers some consecutive   numbers whose sum is equal to 200.   (I don't know if the word 'consecutive' is appropriate in this case ,I mean that these numbers follow each other on that circle) How do I hide posts matching my ignored tags? Where and how do I go about hiding the posts that match any of the tags on my ignored list? Let $a,b,c $ are non-negative real numbers, and $a+b+c=3$.  How to prove inequality $$ ab^2+bc^2+ca^2\le 4.\tag{*} $$    In other words, if $a,b,c$ are non-negative real numbers, then how to prove inequality $$ 27(ab^2+bc^2+ca^2)\le 4(a+b+c)^3.\tag {**} $$ $\color{gray}{\mbox{(Without using "universal" Lagrange multipliers method).}}$  Thanks! Reduce Spacing In $$ In math, one often needs to put a letter inside the symbols &lt;&gt;, e.g. to denote a cyclic group &lt;x&gt; generated by some element x. However, plain text displays the symbols &lt; and &gt; as an upside down exclamation point and an upside down question mark, respectively, while math type displays a large space like so:  &lt; x &gt;    Is there some way to reduce this spacing? Elsevier actions following US sanctions on Iran I'm a bit annoyed with the typesetting of citations that biblatex deems "ambiguous". In the following example, I have two papers with the same first author, but a different second author in two different years. When citing in the main text, the second author is included before "et al", since biblatex deems these references to be ambiguous. However, the references were published in different years, so I cannot see why these are ambiguous. Is it possible to get these citations referenced using only the first author?  MWE  \documentclass{article}  \usepackage{filecontents} \usepackage[hyperref,style=authoryear,natbib=true,maxbibnames=10,maxcitenames=2,useeditor=false,url=false,useprefix,giveninits=false]{biblatex} \addbibresource{ref.bib}  \begin{filecontents}{jobname.bib} @book{author_book, title = {Book's title}, author = {Author, Some and Better, Some and Cetter, Some}, location = {The City}, publisher = {Publisher}, date = {2005}, } @book{author_book2, title = {Book's title}, author = {Author, Some and Getter, Some and Cetter, Some}, location = {The City}, publisher = {Publisher}, date = {2006}, } \end{filecontents}  \bibliography{jobname} % \bibliography{ref}  \begin{document} Hello world \citet{author_book} \citet{author_book2} \printbibliography \end{document} I have heard rumors that you can compile documents online, and more specifically that Google has a free online compiler, but I have never been able to find any. Is there a way to compile documents online, so that I can write and compile documents even if I don't have a TeX distribution installed on my computer? Was Hogwarts named such because of a connection to warthogs? Was Hogwarts named 'Hogwarts' because of a connection to warthogs?  Or was it named for hogs and warts separately, or something else entirely? How to clone all remote branches in Git? I have a master and a development branch, both pushed to . I've cloned, pulled, and fetched, but I remain unable to get anything other than the master branch back.  I'm sure I'm missing something obvious, but I have read the manual and I'm getting no joy at all. Two sidebars in Beamer for two presentations in one tex file