I am able to invoke the private function of the derived class. Is this Ok?  #include &lt;iostream&gt; class A { public:     virtual ~A() {}      virtual void func()     {         std::cout &lt;&lt; " Printing from A" &lt;&lt; std::endl;     } };  class B : public A { private:     virtual void func()     {         std::cout&lt;&lt; " Printing from B"&lt;&lt;std::endl;     } };  main() {     B b;     A* a = &amp;b;      a-&gt;func();     // b.func(); Not possible as expected. }   Below is the output     Printing from B
Is there is any reason to make the permissions on an overridden C++ virtual function different from the base class?  Is there any danger in doing so?  For example:  class base {     public:         virtual int foo(double) = 0; }  class child : public base {     private:         virtual int foo(double); }   The  says that it is a bad idea, but doesn't say why.  I have seen this idiom in some code and I believe that the author was attempting to make the class final, based on an assumption that it is not possible to override a private member function.  However,  shows an example of overriding private functions.  Of course  recommends against doing so.  My concrete questions:   Is there any technical problem with using a different permission for virtual methods in derived classes vs base class? Is there any legitimate reason to do so?
List or IList What is the difference between would and will in the following examples?        How would you use this word in a sentence?     How will you use this word in a sentence? I have two integers, x and y so that x &lt; y. How many prime numbers are there between x and y (exclusive). Is there a formula or algorithm to compute? Example of vector space such that $cv = 0$ where $c \ne 0$ and $v \ne \vec{0}$ Is there an example of a vector space $V/F$ such that $0 \ne c \in F$, $\vec{0} \ne v \in V$, but $c \cdot v = 0 $?  I couldn't think of an example. I've set up the physics of a swinging wrecking ball and set the animation to run for 240 frames.  This was not long enough for the entire "swing" of the ball-and-chain.   I'm unable to reset the timeline, but I can set the end frame to (say) 1000 frames, but when I try to play the animation, the animation progress halts at frame 240 and I cannot get it to go any further.   There are no markers or keyframes in the timeline.  What should I do to "force reset" the animation-timeline, to allow changes to the length? Field extensions with(out) a common extension Let $K$ be a field having two field extensions $L\supseteq K$ and $M\supseteq K$. Does there exist a field $N$ along with embeddings $L\to N$ and $M\to N$, such that the diagram $$     \require{AMScd} \begin{CD}     K @&gt;&gt;&gt; L\\     @V  V V @VV  V\\     M @&gt;&gt;&gt; N     \end{CD} $$ is commutative? To put it less formally, do $L$ and $M$ have a common field extension $N$ (with $K$ lying in the intersection)?  If yes, consider this side question (but do leave an answer even if you can only answer the main question!): Does the above property of fields generalise to the following, stronger property? Let $p$ be either $0$ or a prime number. Does there exist a sequence of fields $$ \mathbb F_p = L_0\subseteq L_1\subseteq L_2\subseteq L_3\subseteq L_4\subseteq\cdots$$ (where I use the convention $\mathbb F_0 = \mathbb Q$) such that any field $K$ of characteristic $p$ has an extension field among the $L_\alpha$? This sequence should be understood as enumerated by ordinal numbers. In other words, what I need is a function that assigns to each ordinal number $\alpha$ a field $L_\alpha$ containing all $L_\beta$ with $\beta &lt; \alpha$. (Intuitively, I suspect that this might depend on the Axiom of Choice.)  If the second property holds, it shows that you can essentially only extend a field in one "direction." It also shows that the class (it is obviously not a set) $\mathbb M_p = \bigcup_\alpha L_\alpha$ is a field (class). We can define all the usual field operations (addition, multiplication, division) here since all pairs of elements lie in $L_\alpha$ for a sufficiently large $\alpha$. This "monster field" of characteristic $p$ then contains all other set fields of that characteristic. Monotone functions and non-vanishing of derivative Citations with no bibliography at the end How do you produce a document with citations (\citep, \citet) working properly in the paper but without a bibliography at the end?  I've come up with one solution that is bad because it breaks my makefile.  latex file.tex bibtex file # comment out \bibliography{} command latex file.tex   Similarly, is there a way to produce the bibliography with no accompanying text?  Again, I've come up with a solution: fill an otherwise blank .tex file with \nocite{} commands.  However, this is a pain because I have to keep two files synced by hand (and regular expressions to search for \citep{author1, author2} can be a huge pain when there are pagebreaks...). How to run BitTorrent Sync? I am in Ubuntu 12.04 (precise) 64bit and downloaded the btsync executable from  but running it doesn't seem to have any effect. Double-clicking the executable does nothing, and running ./btsync in the terminal also exits immediately without any output.  Has anyone successfully ran this under Ubuntu, and if so, is there any special configuration changes that need to be made to make it work? $p_1p_2...p_n +1$ is not square for $p_k = k$'th prime Understanding the Durbin Watson test Unintentional Lies and Misinformation Number of elements of a finite field I want to supply constant voltage to my LED's but the supply varies from 3.7V to 4.2V (Li-ion battery). I cannot use 3.3V voltage regulator as it will need at least 4.3V voltage at the input but my battery can supply only 4.2V max. so is there any other way I can supply regulated 3.3V to my LED.   RGB LED = 3.3V, 60mA Battery = 3.7V - 4.2V, 3000mA Number of LEDs = 24 The LED's are connected in parallel Some days ago I realized that  (as well as ) never throw an IOException when writing, flushing or closing.  Instead it sets an internal flag (trouble=true) when an error occurs. It's not possible to get the exact exception, but only if there was some exception ().  My question is: why would one want to have such behavior? Isn't that bad API design? Circle-Rectangle collision detection (intersection) How can I tell whether a circle and a rectangle intersect in 2D Euclidean space? (i.e. classic 2D geometry) How to prevent Windows from entering idle state? What happens to matter in a standard model with zero Higgs VEV? Suppose you reset the parameters of the standard model so that the Higgs field average value is zero in the vacuum, what would happen to standard matter?  If the fundamental fermions go from a finite to a zero rest mass, I'm pretty sure that the electrons would fly away from nuclei at the speed of light, leaving positively charged nuclei trying to get away from each other.  Looking at the solution for the Hydrogen atom, I don't see how it would be possible to have atoms with zero rest mass electrons.  What happens to protons and neutrons?  Since only a very small part of the mass of protons and neutrons is the rest mass of the quarks, and since they're flying around in there at relativistic speeds already, and since the nuclear force is so much stronger than the electrical force with an incredible aversion to naked color, would protons and neutrons remain bound assemblages of quarks and virtual gluons?  Would they get a little larger?  A little less massive?  What would happen to nuclei?  Would they stay together?  If the protons and neutrons hold together and their properties change only some, then I might expect the same of nuclei.  Different stable isotopes, different sizes, and different masses, but I would expect there would still be nuclei.  Also the W and Z particles go to zero rest mass.  What does that do to the electroweak interactions?  Does that affect normal stable matter (outside of nuclear decay modes)?  Is the weak force no longer weak?  What happens to the forces overall? How could a gap between array modifier created objects be closed? The classic example... $X \sim Po\left (\lambda\right ), Y \sim Po\left (\mu\right)$, X and Y are independent.  Show that the conditional distribution of X is binomially distributed. Or in other words, $P(X=k\mid X+Y = n) = P (\tilde{X} = k), \tilde{X} \sim B\left (n ,\frac{\lambda}{\lambda + \mu}\right )$.   I've so far managed to reach to this step, and have been stuck since. Just somehow gotta get a $\frac{1}{n!}$ in the denominator, that would then complete the proof..or at least I think..  $$P(X=k\mid X+Y=n) = \frac{\frac{\lambda^{k}\mu^{n-k}}{k!(n-k)!}}{P(X+Y = n)}=  \frac{\frac{\lambda^{k}\mu^{n-k}}{k!(n-k)!}}{\sum_{i=1}^{n} \frac{\lambda^{i}\mu^{n-i}}{i!(n-i)!}}$$  Thanks for the help!