I have defined a singleton as below:  struct Conditions {     bool bMonolithic;     bool bKeepVersion;     bool bToc;      static Conditions&amp; initialize() {         if (instance == nullptr)             instance = new Conditions;         return *instance;     } private:      Conditions():bMonolithic(false), bKeepVersion(false), bToc(false) {}     static Conditions* instance; };   When I try to use it, I call the initialize() function:  Conditions&amp; kcondition = Conditions::initialize();   However, the compiler gives me this error:  error LNK2001: unresolved external symbol "private: static struct Conditions * Conditions::instance" (?instance@Conditions@@0PEAU1@EA)   What is the correct way to use the singleton?
Very simply put:  I have a class that consists mostly of static public members, so I can group similar functions together that still have to be called from other classes/functions.  Anyway, I have defined two static unsigned char variables in my class public scope, when I try to modify these values in the same class' constructor, I am getting an "unresolved external symbol" error at compilation.  class test  { public:     static unsigned char X;     static unsigned char Y;      ...      test(); };  test::test()  {     X = 1;     Y = 2; }   I'm new to C++ so go easy on me. Why can't I do this?
What level are spells cast at if a warlock multiclasses as another caster? Are non-citizens of the Capitol permitted to permanently immigrate? Reading  got me thinking about permitted citizenship.  Are citizens of other districts allowed to permanently move to, or become citizens of the Capitol?   My gut says, "No." The citizens of the other districts are being punished, so it makes little sense to allow them a true, legal escape from their punishments. Even victors are only given new homes in their own districts, keeping them there. Zero visitors? What happened to site analytics about a week ago? This is the views section of the site analytics visible to 25k users on one of my sites:    That's, uh, not correct.  Our site has had its usual activity level during this time.  I checked a couple other sites, and the pattern is consistent.  This looks like a problem in the analytics data that's coming in; did Google change their API?  Update: Same site a week later; note that in addition to the brief spike of accuracy, page views have dropped to (near-)zero for the whole period, unlike the earlier report.  (I know this question has been closed as a dupe, but I thought having the two screen shots together might help somebody.) Help with proof of $|x+y| \geq |x|-|y|$ Hi I want to try Ubuntu 20.04 without installing it due to some driver issues in my laptop. But I already have 2 OS ( Windows 10 and Ubuntu 20.04 [Dualboot] ), so will trying Ubuntu mess with the already installed Operating systems? And I know how to make live usb and booting from it but don't know how to exit it and then bring my laptop back to normal. Tried finding procedure on internet but reliable results are not found. Limit question on independent random variables (Exercise 4.2.4 from Grimmett and Stirzaker) Let $\{X_r | r \geq 1\}$ be independent and identically distributed with distribution function $F$ satisfying $F(y) &lt; 1$ for all $y$, and let $Y(y) = \min \{k | X_k &gt; y\}$. Show that $$ \lim_{y\rightarrow \infty} P(Y(y) \leq E[Y(y)]) = 1 - e^{-1}. $$  I managed to show that $E[Y(y)] = \alpha(y) = (1 - F(y))^{-1}$ and that $$ \lim_{y\rightarrow \infty} P(Y(y) \leq E[Y(y)]) = \lim_{y \rightarrow \infty} \left( \sum_{i = 1}^{\lfloor \alpha(y) \rfloor} {\lfloor \alpha(y) \rfloor \choose i} (-1)^{i+1} \alpha(y)^{-i} \right). $$ And the expression on the right, according to Mathematica, does indeed seem to converge to $1 - e^{-1}$. But how can I show that this is true? Can anyone give me a hint? Do "Best by: XX-XX-XX" foods have an expiration date? How long will foods that have "Best by: XX-XX-XX" on the product last past that date?  I have tried looking online, and all I can find is anecdotal evidence, which isn't very assuring for me since there seems to be no specific "x food will expire y weeks after its best by date".  Is there a rule of thumb or some guide out there that can tell me how long a "best by" food will last? Or is it safe to assume that they never expire, since it's not actually labelled on the product? Border on borderless pie chart, Illustrator CC I'm an Illustrator beginner, and I have just made pie chart. I removed the borders but I still end up with a 1 pixel wide border between the pieces of the pie whenever I export to PDF or AI. Please see the attached image (zoomed to make it easier to spot it).    The question is: How do I get rid of it? Are two (or N) resistors in series more precise than one big resistor? Let's say I have one 2 k&ohm; resistor with 5% tolerance. If I replace it with two 1 k&ohm; resistors with 5% tolerance, will resulting tolerance go up, down, or remain unchanged?  I'm bad with probabilities, and I'm not sure what exactly tolerance says about resistance and its distribution.  I am aware that in the 'worst case' it will be the same; I'm more interested in what will happen on average. Will the chance of getting a more precise value increase if I use a series of resistors (because deviations will cancel each other out)?  On 'intuitive level' I think that it will, but I have no idea how to do the math with probabilities and find out if I'm actually right. Let $f:S^{2n} \rightarrow S^{2n}$ be a continuous map. Show that          there exists $x \in S^{2n}$, such that $f(x) =x$ or $f(x) = -x$;   any continous map $g: \mathbb R P^{2n} \rightarrow \mathbb RP^{2n}$ has a fixed point;      I think 1 implies 2. So, how can I find an $x$ in 1?  Thanks for the help. Delay in 4-bit ripple carry adder? In pic below I have drawn a full adder and mentioned their delays, please help me to verify my answer. What's the fixed size of the suggested edit queue? We know that Stack Overflow has a suggested edit queue, visible to the users who have the  privilege. Someone said the queue has a fixed size.  What's the fixed size of the suggested edit queue?  Is it often that the queue gets filled up and users can no longer suggest edits? Why is Ubuntu Software Center dropping previously provided applications? Ubuntu Software used to provide Pinta, KolourPaint, Audacity, and others, but they are no longer available there. I have to use apt to install them.   Why has Ubuntu Software 3.20.5 stopped providing applications that it used to?  Ubuntu 16.04 Ubuntu Software Center 3.20.5  Thanks in advance for your help! In which scenario do I use a particular STL container? I've been reading up on STL containers in my book on C++, specifically the section on the STL and its containers. Now I do understand each and every one of them have their own specific properties, and I'm close to memorizing all of them... But what I do not yet grasp is in which scenario each of them is used.  What is the explanation? Example code is much prefered. Prove that $n! + k$ is a composite number Boxplot interpretation: is it correct that a boxplot is missing a whisker? I have a data set that has customerID and daily visits. This dataset records the number of times customers visited the site in a day.   customerID   TotalVisits  1            6  2            17  3            20  4            25   Just to explore the data further, I tried plotting the TotalVisits values in a box plot. The plot doesn't seem to have a lower whisker. q1=1 and there are no values between q1 and  q1-1.5(IQR). The plot has q1, q2 and q3. The minimum value and q1 are the same.   Is this why the boxplot doesn't have the lower whisker? Could you please help me with the interpretation? Is it correct to draw a boxplot without any whiskers?  [I am new to the site and I am not able to post the image.] What did my neural network just learn? What features does it care about and why? What do bookcases do for enchanting? Java equivalent to PHP's preg_replace_callback I'm in the process of moving an application from PHP to Java and there is heavy use of regular expressions in the code.  I've run across something in PHP that doesn't seem to have a java equivalent:  preg_replace_callback()   For every match in the regex, it calls a function that is passed the match text as a parameter.  As an example usage:  $articleText = preg_replace_callback("/\[thumb(\d+)\]/",'thumbReplace', $articleText); # ... function thumbReplace($matches) {    global $photos;    return "&lt;img src=\"thumbs/" . $photos[$matches[1]] . "\"&gt;"; }   What would be the ideal way to do this in Java? What do 'real', 'user' and 'sys' mean in the output of time(1)? $ time foo real        0m0.003s user        0m0.000s sys         0m0.004s $   What do 'real', 'user' and 'sys' mean in the output of time?  Which one is meaningful when benchmarking my app?