I am having some issues with virtual functions. I have the following two structures (simplified): struct Shape { public:    virtual std::vector&lt;unsigned int&gt; GetIndices()    {       // standard definition       return { 0, 1, 2 };    } };  struct Cube : public Shape { public:    std::vector&lt;unsigned int&gt; GetIndices()    {       return { 0, 1, 2, 2, 3, 0 };    } };  Then, there's a function that takes a Shape as the argument. It calls the GetIndices Function. It looks like this: void Add(Shape shape) {    // ...    std::vector&lt;unsigned int&gt; indices = shape.GetIndices(); }  When I call this function with a Cube as the Argument, somewhat like this: Cube cube1; Add(cube1);  shape.GetIndices(); in the Add() Function will return { 0, 1, 2 }, but I want it to return { 0, 1, 2, 2, 3, 0 }. What am I doing wrong?
Someone mentioned it in the IRC as the slicing problem.
I have an integrated webcam in my laptop. I know that it works and that ubuntu recognized it because at installation it asked if I wanted a photo taken for some kind of image associated with my account. When I look in system settings, I do not see any webcam in the hardware section. I would like to disable the webcam like you can do in Windows, but as I can't find it in my hardware section, how can I disable it? I cannot even unplug it as it is integrated into the monitor. Am I looking in the wrong place?? I am using 12.04 During the end credit scene of Spider-Man: Far from Home, we see that,      Nick Fury and Maria Hill are two Skrulls, Talos and (presumably) his wife.   And we also see that,      Nick Fury is in a spaceship like structure, presumably away from Earth.   So that begs the question,      How long has Talos been impersonating Nick Fury? Is it since the events of Captain Marvel or since Avengers: Endgame or sometime in between? Does a single photon's energy depend on frequency? (photoelectric effect) Continuous function on R which tends to infinity on open interval must have a minimum Suppose we have $f : \mathbb{R} \to \mathbb{R}$ continuous and $$\lim\limits_{x \to \pm \infty} f(x) = \infty.$$  Then must $f$ have a minimum on $\mathbb{R}$?  Intuitively it seems so, and it's easy to prove for some arbitrary closed interval in $\mathbb{R}$ with the Extreme Value Theorem, but how can we apply that to an open interval like $(-\infty, \infty)$? Regarding the recalc in question rep increase what happens due to the cap? When the recalc runs what happens regarding rep capping on particular days? Say I earned 200 solely from questions on one day, will I earn a further 200 when the recalc runs or will I earn zero?  On a similar note if I got no rep from a question upvote on a day will the recalc give me 10, 5 or 0 rep? How are character special files and block special files different from regular files in a Unix-like system? Why are they called “character special” and “block special” respectively? Decorate Tables You have $r$ red, $g$ green and $b$ blue balloons. To decorate a single table for the banquet you need exactly three balloons. Three balloons attached to some table shouldn't have the same color. What maximum number $t$ of tables can be decorated if we know number of balloons of each color?  I know the answer will at least be $\min(r,g,b)$. Also we need to add tables with $2$ reds, $2$ blues or $2$ greens. I cannot think of the formula for it Integral of $\sin(e^t)dt$ Let $f(x) = \int_x^{x+1} \sin(e^t)dt$. Show that $$ e^x|f(x)| &lt; 2 $$ and that $$ e^xf(x) = \cos(e^x) - e^{-1}\cos(e^{x+1}) + r(x) $$ where $|r(x)| &lt; Ce^{-x}$ for some constant $C$.  I can do the first part easily. Integration by parts gives us $$ f(x) = \frac{\cos e^x}{e^x} - \frac{\cos e^{x+1}}{e^{x+1}} - \int_{e^x}^{e^{x+1}} \frac{\cos u}{u^2}du, $$ so substituting $\cos u = 1$ and $\cos u = -1$ gives \begin{align*} \cos e^x - 1 + \frac{1}{e}\left(1- \cos e^{x+1}\right) &amp;\leq e^xf(x) \leq \cos e^x + 1 - \frac{1}{e}\left(\cos e^{x+1} + 1\right)\\ -2 &amp;&lt; e^xf(x) &lt; 2 \end{align*} So that $e^x|f(x)| &lt; 2$.  I get stuck on the second part, though. From integration by parts, I have $e^xf(x) = \cos e^x - e^{-1}\cos e^{x+1} - e^x\int_{e^x}^{e^{x+1}} \frac{\cos u}{u^2}du$, so it reduces to showing that $$ \left|\int_{e^x}^{e^{x+1}} \frac{\cos u}{u^2}du\right| &lt; Ce^{-2x} $$ for some constant $C$. However, I always end up with a constant for $Ce^{x}$ rather than for $C$. I want to make a Launcher that will do privileged (requires root) commands, but I don't want to see the terminal or have to type my password into the terminal. So I found the command, gksudo that allows me to enter my password so that I can escalate my privilege level. Now I want to couple this, so that I can change the partition priority using this command cgpt add -i 6 -P 0 -S 0 /dev/sda (this command is privileged) and have it automatically reboot from this one launcher.  I setup a Luncher like this:  Name: ChromeOS  Description:  Command: gksudo gnome-terminal -e "cgpt add -i 6 -P 0 -S 0 /dev/sda;reboot"  Comment:  But it does not work. Any tips? Let's say we have $x^2=25$ So we have two real roots ie $+5$ and $-5$.  But if we were to differentiate on both sides with respect to $x$ we'll have the equation $2x=0$ which gives us the only root as $x=0$.  So does differentiating on both sides of an equation alter it? If it does, then how do we conveniently do it in Integration by substitutions? If not then what exactly is going on here ? Android Phone SD Card Problem My Samsung Galaxy Admire phone is saying that an SD card isn't found when the SD card is inside the phone: it shows "Please insert SD Card".  What could be wrong? Clickable Table Footnote I'm trying to have some clickable footnotes within tables. I tried using \footnote{}, it does create a link but there's no footnote text associated with it. \footnotemark[number] along with \footnotetext[]{} does create a fotenote but then there's no hyperlink. (I would like to make it clear that I'm trying to have footnotes at the bottom of the page and not footnotes within the table.)  Here's a small code snippet:  \documentclass{report}  \usepackage{hyperref} \begin{document}  \begin{table}[h!]     \centering     \begin{tabular}{|r|r|r|}         \hline         A\footnote{Test!} &amp; B\footnotemark[4] &amp; C\footnotemark[5]\\         \hline         123 &amp; Tim &amp; Jane\\         \hline         456 &amp; Tom &amp; Jung\\         \hline     \end{tabular}     \caption{A table} \end{table}  This is a clickable footnote\footnote{You clicked me!}.  \footnotetext[4]{This is B} \footnotetext[5]{This is C}  \end{document} Plot $|z - i| + |z + i| = 16$ on the complex plane sum numbers in different lines in shell i have 8000 lines similar to this   &lt;Flow flowId="1" timeFirstTxPacket="+0.0ns" timeFirstRxPacket="+924100.0ns" timeLastTxPacket="+199984927558.0ns" timeLastRxPacket="+199675473275.0ns" delaySum="+2287566662167.0ns" jitterSum="+65280162191.0ns" lastDelay="+3511349483.0ns" txBytes="161956" rxBytes="116536" txPackets="3125" rxPackets="2251" lostPackets="640" timesForwarded="0"&gt;   and what i need to do is summing rxPackets in each line together and txPackets too   i mean total sum of them in 8000 lines  thanks in advance  &lt;Flow flowId="1" timeFirstTxPacket="+0.0ns" timeFirstRxPacket="+924100.0ns" timeLastTxPacket="+199984927558.0ns" timeLastRxPacket="+199675473275.0ns" delaySum="+2287566662167.0ns" jitterSum="+65280162191.0ns" lastDelay="+3511349483.0ns" txBytes="161956" rxBytes="116536" txPackets="3125" rxPackets="2251" lostPackets="640" timesForwarded="0"&gt;  &lt;Flow flowId="2" timeFirstTxPacket="+3000000.0ns" timeFirstRxPacket="+3254190.0ns" timeLastTxPacket="+199988489445.0ns" timeLastRxPacket="+199631899307.0ns" delaySum="+12081144328484.0ns" jitterSum="+105606015634.0ns" lastDelay="+9407845452.0ns" txBytes="251896" rxBytes="124840" txPackets="4867" rxPackets="2413" lostPackets="1757" timesForwarded="0"&gt;  &lt;Flow flowId="3" timeFirstTxPacket="+4000000.0ns" timeFirstRxPacket="+4254098.0ns" timeLastTxPacket="+199971756470.0ns" timeLastRxPacket="+198959480315.0ns" delaySum="+5150205600987.0ns" jitterSum="+74009967633.0ns" lastDelay="+9862217799.0ns" txBytes="163044" rxBytes="90532" txPackets="3150" rxPackets="1751" lostPackets="1013" timesForwarded="0"&gt; Dynamically Determine Calling Context? We have various ways of invoking apex. Triggers, Inbound Webservices, @InvocableMethod,@RemoteAction and what not. Often we call some or other utility methods from these execution contexts. I have some generic utility method,that should behave differently from the context it is called?  I know about Trigger.isExecuting but it only tells if its running in trigger context or not.  I have a utility method that creates lead from Webservices, VF button click and via Lightning . Whenever we create a lead I want some special operations to be done via the source it was originated.(Its not just updating a simple field leadSource, I have some methods that creates some childs and update other records of other type) . I can achieve this by passing an extra parameter to utility method to tell about source, but i have then to edit hundred of other class that uses this utility method. If i could dynamically find out via which context this piece of code is running,then i would have to change only one class to satisfy my requirement.    Is there something in APEX that tells in what context the apex method was called? Async call generates " Error: Can't wait without a "fiber", even with _wrapAsync Why does String.split need pipe delimiter to be escaped? Admob SMART_BANNER size Maximum table size for a MySQL database What is the maximum size for a MySQL table? Is it 2 million at 50GB? 5 million at 80GB?  At the higher end of the size scale, do I need to think about compressing the data? Or perhaps splitting the table if it grew too big? Is a NVIDIA GeForce with Optimus Technology supported by Ubuntu? I am considering buying a Dell XPS 15 laptop. The laptop has a Nvidia 420m card which should work with Linux but I keep reading that the Nvidia Optimus technology isn't supported on Linux. I am not really interested in switching from Nvidia to Intel to save power but need to know that the Nvidia card will in fact work if I installed Ubuntu.  If anyone has experience using a Nvidia card with Optimus technology or even better the exact laptop in question (Dell XPS 15 with 1GB NVIDIA® GeForce®  GT 420M) it would be great.  A major problem holding people back from adopting Linux is this sort of hardware issue. I am a long term Ubuntu user and supporter who can't afford to make a mistake with a purchase like this. I don't want to spend £500+ to find I have no graphics acceleration because Windows 7 is not an option.