Why does an overridden virtual function get called in the base class during construction?
C++ virtual function from constructor
Definition of e I'm very eager to know and understand the definition of $e$. Textbooks define $e$ as follows $$ e = \lim_{p\to\infty} \left[1+\frac1{p}\right]^p \approx 2.71828 $$ Is there an &quot;easy to understand&quot; proof of this? I'm really looking for a derivation of this which is very intuitive and easy to comprehend. By the way I'm watching . People are born and grow up and die of old age in a matter of 5 days. The elders (5 days old) train children and send the most promising one on a trek across the dessert to a monolith that is the cause of the rapid aging to hopefully disable it.   I saw it on a reel to reel in the mid 90's. It looks like it was made in the late 70's or 80's. The cast was small. A few men played the elders seated in a row of chairs and the young boy who had to set out to save them who matures into a man and finally an elderly man.  I've been trying to figure out the title for years. Expanding code in etoolbox's \ifblank I am trying to use the etoolbox \ifblank (and its cousin \notblank), but I want to expand any macros in its test statement.  For example:  \documentclass{article} \usepackage{etoolbox}  \begin{document}  \newtoggle{longformt} \newcommand{\longform}{\toggletrue{longformt}} \newcommand{\iflong}[2]{\iftoggle{longformt}{#1}{#2}}  \newcommand{\quoteifnotblank}[1]{%     \notblank{#1}{``#1''}{}% }  % Try commenting this line. \longform  This should be completely blank if the form is short: \quoteifnotblank{\iflong{Some long quoted text}{}}  \end{document}   The problem here is that \notblank sees its argument of \iflong{Some long quoted text}{} as a string, not as code to be expanded, so the quotes always appear.  How do I expand arguments before they are passed to \notblank? When is a clause not essential? I am having trouble figuring out when to use commas to set off &quot;nonessential&quot; information.  Sometimes it's obvious:  Bob, who is thirty years old, is an alcoholic.  But other times I'm not sure:  The day he quits drinking * he will start a llama farm He has his heart set on owning El Duderino ranch * in New Mexico.  In the first case, my ear says that there should be a comma at *, even though information before it seems essential to me.  In the second case, the stuff after * is not essential, and yet it seems a little much to use a comma. Even that last sentence I wrote confuses me.  &quot;In the second case&quot; seems essential but I used a comma.  Is this correct? Does it depend on personal style and the length of the clause?  Or perhaps I'm misinterpreting the meaning of &quot;essential&quot; in this context? Piping for loop output prevents local variable modification Need to understand why my Schengen visa was refused Show that $y_1$ and $y_2$ are not Linearly Independent Suppose that $y_1(x)$ and $y_2(x)$ are solutions of the differential equation $y''+py'+qy=0$ on $I$. How can I show that if $y_1$ and $y_2$ vanish at the same point then they are not linearly independent?   Here is my attempt to prove the problem. Since $y_1(x)$ and $y_2(x)$ are solutions of the differential equation $y''+py'+qy=0$ on $I$, it is enough for me to show that the Wronskian of $y_1$ and $y_2$ denoted by $W(y_1,y_2)$ is zero. Now since $y_1$ and $y_2$ vanish at the same point say $p$ we have $y_1(p)=0$ and also $y_2(p)=0$.   Solving for $W(y_1,y_2)(p)$ we have: $y_1(p)y_2'(p)-y_2(p)y_1'(p)=0$ since $y_1(p)=0$ and also $y_2(p)=0$.   Am I correct? Thanks Is my mobile AMD card being used? On , there are download options for only certain logos/icons. Shouldn't this include all the graduated sites logos/icons? I think it should. The current is maximum through those segments of a circuit that offer the least resistance. But how do electrons know beforehand that which path will resist their drift the least? How does "this" keyword work within a function? Prove: If $\gcd(a,b,c)=1$ then there exists $z$ such that $\gcd(az+b,c) = 1$ Evaluating $\int_{I^n} \left( \min_{1\le i \le n}x_i \right)^{\alpha}\,\, dx$ Let $\alpha \in \mathbb R$ and let's call $I:=[0,1]$. Evaluate   $$  \int_{I^n} \left( \min_{1\le i \le n}x_i \right)^{\alpha}\,\, dx.  $$   Well, the case $n=1$ is easy and the integral equals $\frac{1}{\alpha+1}$, for every $\mathbb R \ni \alpha \ne - 1$.  I've done also the case $n=2$ and, if I'm not wrong, it's $\displaystyle \frac{2}{(\alpha+1)(\alpha+2)}$.  My big problem is that I cannot understand how to deal with the general case. Any ideas?   Thanks in advance. Why doesn't my ~/.bash_profile work? I'm using Linux Mint. My login shell (cat /etc/passwd | grep myUserName) is bash.  After I start my graphical desktop environment and run a terminal emulator from it, I can see that .bash_profile is not sourced (environment vars that are exported in it are unset). But if I log in from a text console (ctrl+alt+F1) or manually run bash -l from the terminal emulator, .bash_profile works fine.  Am I wrong when I think that .bash_profile should be sourced when X starts and all export'ed vars should be available in the terminal, running from X?  P.S. Placing everything in .bashrc and sourcing it from .bash_profile is not good idea (): environment stuff should be sourced only once. Problem: James has a pile of n stones for some positive integer n ≥ 2. At each step, he   chooses one pile of stones and splits it into two smaller piles and writes the product   of the new pile sizes on the board. He repeats this process until every pile is exactly   one stone.      For example, if James has n = 12 stones, he could split that pile into a pile of size   4 and another pile of size 8. James would then write the number 4 · 8 = 32 on the   board. He then decides to split the pile of 4 stones into a pile with 1 stone and a   pile with 3 stones and writes 1 · 3 = 3 on the board. He continues this way until he   has 12 piles with one stone each.      Prove that no matter how James splits the piles (starting with a single pile of n   stones), the sum of the numbers on the blackboard at the end of the procedure is   always the same.   Hint: First figure out what the formula for the final sum will be. Then prove it using strong induction.  The formula I came up with is $n(n-1) / $2. It could be totally wrong...  My (Partial) Solution:  1) Base Case: (n=2) James has one pile of 2 stones. Suppose he takes the top-most stone and puts in one pile A, which now has size 1. He takes the remaining stone and places it into another pile B, which now has size 1. Then the product of the sizes is 1. The sum of all the products on his board is 1. Now, if he were to start again, and take the bottom stone first and put it in pile A, he has a pile of size 1, and then takes the top stone and puts it in pile B, he has a pile of size 1, and the product is 1, with sum of all products on the board is 1.   2) Inductive Hypothesis (Strong Induction): Suppose for some $k \geq 2$, $n$ stones can be split in $ 2 \leq n \leq k $ stones and $k-n$ stones.  3) Inductive Step:  Consider $n=k+1$. What do I do now? Number of non decreasing sequences of length $M$ How many non decreasing sequences are there of length $M$, provided the number in the sequences are allowed from $1,2,3,...,N$? How do you prove ${n \choose k}$ is maximum when $k$ is $ \lceil \tfrac n2 \rceil$ or $ \lfloor \tfrac n2\rfloor $? How to use dependency injection for Plugins/Blocks [\Drupal::formbuilder() and \Drupal::config()]? Time taken to hit a pattern of heads and tails in a series of coin-tosses Inspired by Peter Donnelly's talk at , in which he discusses how long it would take for a certain pattern to appear in a series of coin tosses, I created the following script in R. Given two patterns 'hth' and 'htt', it calculates how long it takes (i.e. how many coin tosses) on average before you hit one of these patterns.  coin &lt;- c('h','t')  hit &lt;- function(seq) {     miss &lt;- TRUE     fail &lt;- 3     trp  &lt;- sample(coin,3,replace=T)     while (miss) {         if (all(seq == trp)) {             miss &lt;- FALSE         }         else {             trp &lt;- c(trp[2],trp[3],sample(coin,1,T))             fail &lt;- fail + 1         }     }     return(fail) }  n &lt;- 5000 trials &lt;- data.frame("hth"=rep(NA,n),"htt"=rep(NA,n))  hth &lt;- c('h','t','h') htt &lt;- c('h','t','t')  set.seed(4321) for (i in 1:n) {     trials[i,] &lt;- c(hit(hth),hit(htt))     } summary(trials)   The summary statistics are as follows,        hth             htt          Min.   : 3.00   Min.   : 3.000    1st Qu.: 4.00   1st Qu.: 5.000    Median : 8.00   Median : 7.000    Mean   :10.08   Mean   : 8.014    3rd Qu.:13.00   3rd Qu.:10.000    Max.   :70.00   Max.   :42.000    In the talk it is explained that the average number of coin tosses would be different for the two patterns; as can be seen from my simulation. Despite watching the talk a few times I'm still not quite getting why this would be the case. I understand that 'hth' overlaps itself and intuitively I would think that you would hit 'hth' sooner than 'htt', but this is not the case. I would really appreciate it if someone could explain this to me. When I installed the latest update of Ubuntu, I was asked for the username but I do not remember what my username is. How do I find out what my username is?