I'm trying to understand how method overrides work when the to-be-overridden method is called from a constructor.  (Using VS2012)  Given the test program:  #include &lt;string&gt; #include &lt;iostream&gt;  using namespace std;  struct Foo {     Foo()     {         cout &lt;&lt; "\tFoo::Foo()" &lt;&lt; endl;         Initialize();     }      virtual void Initialize()     {         cout &lt;&lt; "\tFoo::Initialize()" &lt;&lt; endl;     }  };  struct Bar : public Foo {     Bar()  {          cout &lt;&lt; "\tBar::Bar()" &lt;&lt; endl;      }       void Initialize() override     {         cout &lt;&lt; "\tBar::Initialize()" &lt;&lt; endl;     } };   int main(int argc, char *argv[]) {     cout &lt;&lt; "Creating Foo" &lt;&lt; endl;      Foo foo;      cout &lt;&lt; endl;      cout &lt;&lt; "Creating Bar" &lt;&lt; endl;      Bar bar;      std::getchar();      return 0; }   I get the following output:  Creating Foo         Foo::Foo()         Foo::Initialize()  Creating Bar         Foo::Foo()         Foo::Initialize()         Bar::Bar()   I would expect the second section to be:  Creating Bar     Foo::Foo()     Foo::Initialize()     Bar::Initialize()   &lt;---- Not called.     Bar::Bar()   I'd expect that, when the Foo ctor is called, and it calls ::Initialize(), that the override Bar::Initialize() is actually called.  Now, I can guess why this is happening: When Foo::Foo() is called, before the body of Bar::Bar() is executed, there's no guarantee that items needed by Bar::Initialize() have been allocated, much less initialized.  The Question  Can I override a method that is called by a base constructor, and have that override execute when instantiating a derived class? That is, is there any way to modify the above code so that Bar::Initialize() will be called?  The alternative I'm using at the moment is to remove the ::Initialize() from the Foo constructor, and do something like this:  Bar bar; bar.Initialize();   and modify Bar::Initialize() to  void Bar::Initialize() override { Foo::Initialize(); ///... bar-specific initialization here }   Is this the best or only way to do this?
Why the following example prints "0" and what must change for it to print "1" as I expected ?  #include &lt;iostream&gt; struct base {    virtual const int value() const {       return 0;    }    base() {       std::cout &lt;&lt; value() &lt;&lt; std::endl;    }    virtual ~base() {} };  struct derived : public base {    virtual const int value() const {       return 1;    } };  int main(void) {    derived example; }
I am very new to the TikZ package, and I need to draw some flow chars by using the following shapes.   However I couldn't figure out how to draw the 4th and and 6th ones below. It would be very nice (for completeness) to help with all of the shapes in the list below.      Your help will be greatly appreciated.  Note: I have visited  but it contains some other shapes. Do downvotes on Meta truly mean something different? It is often said that voting on Meta means something different than voting on regular sites. Upvotes mean "I agree", and downvotes mean "I disagree".  However, I submit that this is not the case. Downvoting of a question has one effect in particular: censorship.  Once a question reaches -8 votes, it disappears from the front page. It can still be found; it isn't deleted. But all it takes is a net 8 downvotes for a question to be more or less lost without a direct link.  You might say that a net 8 downvotes obviously means that the community doesn't agree or want that. Well... does it? Particularly on polarizing issues, a question can temporarily get -8 votes as different people come online and see it. Maybe certain people with a certain belief all see it at once and downvote it a lot.  The front page is how most people find stuff they want to talk about, vote on, or answer. Removal from the front page means that most people will not find it without being pointed directly to it. Once a question hits -8, it is unlikely to be upvoted again. Edits will be irrelevant, new answers won't matter. The question is basically exiled.  The problem is that, on polarized topics, fast mass downvoting can quash any idea that is not popular with the most active members. After all, the most active members are the ones who are most likely to be online and see it. If a bunch of MSO regulars see it and downvote it, it goes away. Someone who checks MSO maybe once a day is less likely to be able to catch the question before it is exiled. This gives undue power to members who are most active on MSO, simply because they have more free time to spend on MSO.  I think this is a significant problem for polarized topics. It becomes very difficult to adequately discuss something that a significant number of active members dislike, even if the community at large doesn't mind.  Consider . It currently stands at +9/-8. Initially, in the first few hours, the question was heavily downvoted and even closed. However, after a day, it was upvoted and reopened.  This shows that a question can initially have a negative response, but later get a positive one. And you can check; any edits I did to the question were relatively minor. The question posted as is was initially negative, but ultimately positive.   If that -8 happened to all come first, odds are good that the +9 and the reopen would never have happened. Those 9 people would never have had the chance to weigh in on the subject. And that's wrong.  It is wrong for someone's potential vote to not matter just because they don't visit MSO multiple times in a day. It is wrong for someone's potential vote to not matter just because they have a different sleep schedule from many of MSO's members.  The problem is one of timing. Heavy dislike from active members who quickly see the question and downvote it can kill a question before someone who might upvote it ever even sees it.  I suppose the best suggestion would be to either lower the -8 threshold (or remove it altogether) or keep it from kicking in until 1-2 days has passed. If the question isn't active, it'll already be off the front page. And if it is active, then enough people will have seen it to know if the threshold represents a real consensus or just the fast-acting few. I was running my OS off a USB stick fine and the wifi was working. I installed it to my SSD and setup again but not the WIFI adaptor isn't working.  I followed the first time  and it worked but since installing onto the SSD and doing the same its not working.  No wlan0 interface found Please check drivers, try lsusb to check USB device is present root@goldminer:~# lsusb Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 002: ID 0bda:0811 Realtek Semiconductor Corp.  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub   On the working device  root@coalminer:~# dkms status amdgpu, 18.10-572953, 4.13.16-hiveos, x86_64: installed amdgpu, 18.10-572953, 4.4.0-127-generic, x86_64: installed nvidia, 390.59, 4.13.16-hiveos, x86_64: installed nvidia, 390.59, 4.4.0-127-generic, x86_64: installed rtl8812au, 4.2.2, 4.13.16-hiveos, x86_64: installed rtl8812au, 4.2.2, 4.4.0-127-generic, x86_64: installed   On the SSD  root@goldminer:~# dkms status amdgpu, 18.10-572953, 4.13.16-hiveos, x86_64: installed amdgpu, 18.10-572953, 4.4.0-127-generic, x86_64: installed nvidia, 390.59, 4.13.16-hiveos, x86_64: installed nvidia, 390.59, 4.4.0-127-generic, x86_64: installed rtl8812au, 4.2.2, 4.13.16-hiveos, x86_64: installed (WARNING! Diff between built and installed module!) rtl8812au, 4.3.8.12175.20140902+dfsg: added rtl8812au, 5.2.9: added   Any advise? I think from trying to fix it ive been making it worse. where do I use Database. Methods? I'm writing up my dissertation and I'm really confused where to use "the". Examples:     In this experiment, (the?) heat transfer coefficient was calculated, allowing to estimate (the?)frost thickness.    And:     Firstly, (the?) air properties are defined.   And:     As (the?) crystals grow in radius, the amount of air in (the?) ice is reduced, due to (the?) ice becoming more packed.   None of the nouns mentioned above have been used for the first time, so I rule out the use of "a".   Would appreciate any help. Finding parenthesis via regular expression I am currently using Ubuntu 12.04 because the latest upgrade 14.04 is not working in my system. I need to install the latest Adobe Flash Player 17 plugin, but it only allows me to install up to version 11.02, so media files cannot be opened. It says that Adobe Flash Player 17 is not compatible with my system. Can a concentration spell be cast without actually concentrating on it for an "instant" effect? The book says:     Concentration. Some spells require you to maintain concentration in order to keep   their magic active. If you lose concentration, such a spell ends.   So what happens if, for example, you are already concentrating on a spell, and cast Witch Bolt without concentrating. Would you get the initial arc of blue energy, or would it not even go off?  I am asking if you can cast a spell that says concentration without concentrating for an immediate effect. This would be useful to avoid interrupting your existing concentration. In essence, if you are concentrating on thing A (doesn't have to be a spell since other things need concentration), can you cast a concentration spell getting an immediate effect without losing concentration on thing A?  Since the definition of concentration is to keep the spell active (meaning it is already active) I would think that you would get the initial effect (if it had one) without the need to concentrate on it. Why does the degree of freedom of SSR equals 1 in simple linear regression How do I prove that $x^p-x+a$ is irreducible in a field with $p$ elements when $a\neq 0$? Let $p$ be a prime. How do I prove that $x^p-x+a$ is irreducible in a field with $p$ elements when $a\neq 0$?   Right now I'm able to prove that it has no roots and that it is separable, but I have not a clue as to how to prove it is irreducible. Any ideas? Trig integral $\int ( \cos{x} + \sin{x}\cos{x}) \, dx $ Assume we have:  $$ \int (\cos{x} + \sin{x}\cos{x}) \, dx$$  Two ways to do it:  Use $$\sin{x}\cos{x} = \frac{ \sin{2x} }{2} $$ Then $$ \int \left(\cos{x} + \frac{\sin{2x}}{2} \right) \, dx = \sin{x} - \frac{ \cos{2x} }{ 4 } + C. $$ The other way, just see that $ u = \sin(x), du = \cos(x)dx $, $$ \int ( \cos{x} + \sin{x}\cos{x}) \, dx = \sin{x} + \frac{\sin^2{x}}{2} + C. $$  Now the part I don't see fully is, why aren't these results completely equal?  Taking the 2nd result, \begin{align} \sin{x} + \frac{\sin^2{x}}{2} &amp;= \sin{x} + \frac{1}{2} \, \left( \frac{1 - \cos{2x}}{2} \right) \\ &amp;= \sin{x} + \frac{1}{4} - \frac{\cos{2x}}{4}. \end{align}  So you have to absorb $\frac{1}{4}$ into $C$ for them to be equal.  Shouldn't they be equal straight away? Poincaré's theorem about groups I'm using Ubuntu GNOME 16.10 and was trying to install WPS Office. I tried to install using software centre But it wasn't installing without giving any error logs. Then I opened it with Gdebi installer. Here is what I saw.    I have already trying enabling multiverse repositories.  Edit: I have downloaded the amd64 package from the WPS official site, but even now installing through terminal I still get the missing dependencies error. Simple approximation of Inverse Incomplete gamma function Office 2016 Advanced Setup "I saw him crossing" vs. "I saw him cross" I saw him crossing the road.   I saw him cross the road.   Which one is correct and why? I have a string "1112224444' it is a telephone number. I want to format as 111-222-4444 before I store it in a file. It is on a datarecord and I would prefer to be able to do this without assigning a new variable.  I was thinking:  String.Format("{0:###-###-####}", i["MyPhone"].ToString() );   but that does not seem to do the trick.  ** UPDATE **  Ok. I went with this solution  Convert.ToInt64(i["Customer Phone"]).ToString("###-###-#### ####")   Now its gets messed up when the extension is less than 4 digits. It will fill in the numbers from the right. so  1112224444 333  becomes  11-221-244 3334   Any ideas? Pre-image of a measurable set A is always measurable? Let $f$ be a continuous function on a set $E$.  Is it always true that $f^{-1}(A)$ is always measurable if $A$ is measurable?  I say no.  We know that $\bar{\psi(x)}:=\frac{\phi(x)+x}{2}$ where $\phi$ is the Cantor (or Cantor-Lebesgue) function and $\bar{\psi}:[0,1] \rightarrow [0,1]$.  We know this function maps a measurable subset of $C$ (the Cantor set) into a non-measurable set $W$.  A few observations about $\bar{\psi(x)}$.  It is strictly increasing and continuous, so it has a continuous inverse $\bar{\psi(x)}^{-1}$.  Thus $\bar{\psi(x)}^{-1}(W)=c \subset C$; that is, $\bar{\psi(x)}^{-1}(W)$ is non-measurable, but c is.  Is this correct? I've occasionally noticed an OP who will edit their own question and destroy it completely, always leaving some kind of graffiti-like scrawl in its place.  This seems to happen on low-quality questions by low-rep users, and the moment of self destruction tends to occur after the question is closed or otherwise devolves into a communication breakdown between the poster and the community.  Here are some examples:        It seems like the poster usually does this in anger (1st and 3rd example), or else is just confused about how to delete their question (2nd example).  My question is about how this should be handled. In the past I wasn't sure, so I always flagged for mod attention. However I notice the solution on all of these was to just do a rollback (I did this myself on the 2nd example after nothing happened). Is this a good enough approach, or should a flag be used?  What about with particularly obnoxious users like in the third example, where the guy came back to do it again? How exactly does curved space-time describe the force of gravity? I understand that people explain (in layman's terms at least) that the presence of mass "warps" space-time geometry, and this causes gravity. I have also of course heard the analogy of a blanket or trampoline bending under an object, which causes other objects to come together, but I always thought this was a hopelessly circular explanation because the blanket only bends because of "real" gravity pulling the object down and then pulling the other objects down the sloped blanket. In other words, to me, it seems that curved space wouldn't have any actual effect on objects unless there's already another force present.   So how is curved space-time itself actually capable of exerting a force (without some source of a fourth-dimensional force)?  I apologize for my ignorance in advance, and a purely mathematical explanation will probably go over my head, but if it's required I'll do my best to understand.