Reading about virtual functions, I have come across the following concept: "C++ non virtual function calls are resolved at compile time with static binding, while virtual function calls are resolved at runtime with dynamic binding."  My questions are: 1)Would it have a large effect on performance then, if we had a large number of virtual function calls in our program, since they are evaluated at runtime? Or is it not that relevant in modern machines?  2)Is that number dependent on the stack?
In my class design, I use abstract classes and virtual functions extensively. I had a  feeling that virtual functions affects the performance. Is this true? But I think this performance difference is not noticeable and looks like I am doing premature optimization. Right?
How to test with Math.random in JavaScript? English equivalent for the Persian proverb "The mountain just gave birth to a mouse" I'm looking for an idiom or expression to describe a well-known person/ organization/ politician/ government  whose achievements in a given situation are smaller than what they had claimed or promised to be.  We Iranians have a proverb that literally means      The (roaring) mountain just gave birth to a mouse!    Its  etymology is like this:  Once a volcanic mountain started roaring, hissing, and bursting bubbles. The people were waiting to see what would happen after all those huge roarings and loud booms. Finally, the volcano activity stopped and the people saw just a tiny mouse came out of there! (rather than a monster that was expected to come). So they said mockingly:     "Heh! After all those huge roarings, the (big) mountain just gave birth to a (tiny) mouse!"    Notes:   The (roaring) mountain -symbol for an apparently big(=important) and strong person-here is figured like a woman who is screaming and shouting while is delivering her baby. We use this proverb for mocking an important person/organization/ government, etc ironically when they have used broad advertisements or have spent much money or resources over doing something noticeable, but the result/ achievement is less noticeable than it was claimed or promised to be.   Is there any equivalent for this Persian proverb?  I just found ; would it convey the same connotation? How many of Trelawney's prophecies have come true? Wall of Sand on Difficult Terrain Looking into  prompted this inquiry:  What happens when you move through a wall of sand on difficult terrain?  This involves the understanding that wall of sand changes the cost of moving 1 foot to 3 feet and that difficult terrain typically changes the cost of moving 1 foot to 2 feet. I haven't played Magic: the Gathering since the days of Onslaught and Mirrodin, and I would like to try to catch back up. Since all my cards are quite dated now, I may be more interested in formats other than the most up-to-date one.  Rather than ask what is currently legal in various formats (since that is likely too localized), I would rather pose the question of how can I tell which sets/cards are legal in each format. Let $A, B$ be subsets of a metric space $X$. If $A$ is compact and $B$ is closed, show that the distance between $A$ and $B$ is achieved.   Attempt at a proof:    Let $A$ be compact and $B$ be closed. Let $m=d(A,B)=\inf_{b\in B} d(A,B)$. Then, there are two possibilities: (a) $\exists b\in B$, $d(a,b)=m$. If this is the case, we're done. (b) $\forall b\in B$, $d(a,b)&gt;m$. In this case,     there exists a sequence $\{b_n\}\subseteq B:$ $d(a,b_n)\rightarrow m$ as $n\rightarrow\infty$ by definition of infinum. Then there exists a subsequence $\{b_{n_k}\}$: $d(b_{n_1},a)&gt;d(b_{n_2},a)&gt;...$ which is monotonic decreasing. Then note that $d(b_{n_k},a)&lt;d(b_{n_1},a)&lt;\infty$. So it's a bounded sequence. Now I want to show that it has a convergent subsequence that converges to $b\in B$ and then I want to do the same for $A$. And then finally to show that $d(a,b)=m$ in fact. Any clues to how to get there? ViewPager as a circular queue / wrapping Prove that $f'(0)$ exists and $f'(0) = b/(a - 1)$ Problem:   If $f(x)$ is continous at $x=0$, and $\lim\limits_{x\to 0} \dfrac{f(ax)-f(x)}{x}=b$, $a, b$ are constants and $|a|&gt;1$, prove that $f'(0)$ exists and $f'(0)=\dfrac{b}{a-1}$.   This approach is definitely wrong:    \begin{align} b&amp;=\lim_{x\to 0} \frac{f(ax)-f(x)}{x}\\ &amp;=\lim_{x\to 0} \frac{f(ax)-f(0)-(f(x)-f(0))}{x}\\ &amp;=af'(0)-f'(0)\\ &amp;=(a-1)f'(0) \end{align}  I will show you a case why this approach is wrong:     \[f(x)= \begin{cases} 1,&amp;x\neq0\\ 0,&amp;x=0 \end{cases}\]   $\lim_{x\to0}\dfrac{f(3x)-f(x)}{x}=\lim_{x\to0} \dfrac{1-1}{x}=0$   but $\lim_{x\to0}\dfrac{f(3x)}{x}=\infty$,$\lim_{x\to0}\dfrac{f(x)}{x}=\infty$   Does anyone know how to prove it? Thanks in advance! What is the difference between a relative phase and a global phase? In particular, what is a phase? I know that $re^{i\theta} = x + iy$ for any complex number $x + iy$ by Euler's formula. How do you calculate relative and global phase? My Granddaughter has lost/forgotten her ID and passwords for her iPad. When the iPad powers on, it goes straight to an iCloud password request and I cannot get past it.  I have installed iTunes on my laptop but it fails to connect to the server (error 310).  I installed iCloud control panel and tried a restore but that failed because of "Find my iPad" was active, which I cannot turn off because of the original password problem!  This is driving me crazy. I just want to reset everything now so that I can hand it back to her. Can anyone help? Python - email header decoding UTF-8 Problem with solving systems of linear congruence of two variables The problem I am given is finding a solution to the following pair of equations:  $3x + 4y$ $\equiv$ $5$ $mod$ $13$  $2x + 5y$ $\equiv$ $7$ $mod$ $13$  By reading the methodology here:   Since the modulos in my problem are also the same, I am able to use substitution, but this leaves fractions in my expressions.  I then used matrix multiplication as follows:  $\begin{bmatrix} 3 &amp; 4\\ 2 &amp; 5\end{bmatrix}$ $\begin{bmatrix}\ x\\ y\end{bmatrix}$ = $\begin{bmatrix}\ 5\\ 7\end{bmatrix}$   And solving this also gives me a matrix with fractions, so I am a bit lost on how to solve this problem.  Any help is appreciated. Thank you very much. Why is Minecraft giving an OpenGL error? I recently got Minecraft but not from the website, I paid for a code and everything seemed ok. When I tried to play the game a thing came up saying it crashed and then a message popped up saying The game crashed whilst initializing game     Error: java.lang.IllegalStateException: GLFW error 65542: WGL: The driver does not appear to support OpenGL. Who would get the longest road? Imagine the following setup. There are 3 (or more) players with an equally long road. What would happen if the longest road was broken? How is it decided who obtains the longest road from there on? What are the rules for calling the base class constructor? What are the C++ rules for calling the base class constructor from a derived class? For example, I know in Java, you must do it as the first line of the subclass constructor (and if you don't, an implicit call to a no-arg super constructor is assumed - giving you a compile error if that's missing). Reading through my textbook I came across the following problem and I am looking for some help solving it.  Prove that,  $$\binom{3n}{r}=\binom{3n-1}{r} + \binom{3n-1}{r-1}$$  In a previous problem I solved the following but I wasn't sure how to use it to prove the question above. Prove,  $$\binom{n}{r}=\binom{n}{n-r}$$  Solution:  left Side,  $$\binom{n}{r}=\frac{n!}{(n-r)!r!}$$  right side,  $$\binom{n}{n-r}=\frac{n!}{(n-(n-r))!(n-r)!} = \frac{n!}{(n-r)!r!}$$  Therefore completing the proof,  but how do I solve my first question? thanks! What determines how much experience I get from a hearthstone match in play mode? Sometimes I win handily and get a little experience, sometimes I squeak out a victory and get a lot.  How is experience earned? do I only get a limited number of at-will powers? Let $x$ and $y$ be integers not congruent to $0$ modulo $p$ where $p$ is a prime. Prove that if $p \equiv 3 \pmod{4}$ then $x^2+y^2 \not \equiv 0 \pmod{p}$.   I thought about proving this algebraically and by contradiction. So we say $x^2+y^2 = pz$ and have to show this is impossible. Question regarding the validity of the big bounce I have several questions regarding the "big bounce" theory. It appears to be popular among LQG researchers. My questions are as as follows.  1) How one reconciles it with the fact that it is now experimentally established that the universe is expanding in an accelerating manner?  2) The entropy of the universe should have been very very low (maybe zero) at the time of the big bang/ big bounce. What was the entropy "before" that event? Was it even lower? If it was lower then doesn't that mean entropy decreases indefinitely? On the other hand if we accept the entropy was higher then doesn't that violate the second law of thermodynamics?  3) What observational evidence can confirm pre-bounce physics? According to GR there are some points near the bang/bounce where one simply can't easily define time in a meaningful way. Even for a quantum gravity theory, is it possible for any theory to extrapolate itself "before" the "bounce"? If there are no observational consequences after the bounce shouldn't one apply Occam's razor?