I have 3 classes: Employee, Manager, Clerk.   Manager and Clerk are derived classes from the base class Employee.  There is one question being asked in my school work that I can't find a way to work it out:     Write a program that creates an array of 3 Employee objects named empArray.      Create objects for each of the array elements as follows:         For empArray[0], create an Employee object.   For empArray[1], create a Manager object.   For empArray[2], create a Clerk object.      Code I've tried:  Employee empArray[3];  empArray[0] = Employee{ "Employee A", 1000.01}; empArray[1] = Manager{ "Manager A", 1200.02, 300.30 }; empArray[2] = Clerk{ "Clerk A", 1200.22, 3 };   But by doing this, I can't have access to each derived class's methods afterwards.  The sample code of the classes:  class Employee { private:     string name;     double basicSalary;  public:     Employee(string aName, double aSalary)         :name(aName),basicSalary(aSalary){}  };  class Manager : public Employee { private:     double travelClaims;  public:     Manager(string aName, double aSalary, double aClaims)         :Employee(aName, aSalary),travelClaims(aClaims){}     //+some manager methods };  class Clerk : public Employee { private:     int overtimeHours;  public:     Clerk(string aName, double aSalary, int aHour)         :Employee(aName, aSalary),overtimeHours(aHour){}     //+some clerk methods };   I'm expecting by declaring only the instances of base class, and still able to access to the methods of the derived classes in my main program.
Someone mentioned it in the IRC as the slicing problem.
Expressing hourly temporal recurrence What is the most idiomatic way to put into words a situation where a recurring event happens every hour at a certain minute. For example, consider that some event takes place at the tenth minute of each hour: 0:10AM, 1:10AM, 2:10AM, ...  My first ideas were "every hour at the tenth minute" or "every hour at minute 10". Are these options idiomatic and if not, what would be an idiomatic way of expressing this matter? How distorted does the Andromeda Galaxy appear to us due to the speed of light? The Andromeda Galaxy appears to us at an angle to the galactic disk, i.e. we are not in the Andromeda Galaxy disc's plane, nor are we near the direction that the galaxy's pole points. Therefore, due to the geometry and distances involved, it would seem to me that we are seeing the 'far edge' a few thousand years later than we are seeing the 'near edge'. How far can a galaxy spin during that those few thousand years, and therefore how distorted are we seeing Andromeda? Can we infer how Andromeda or other large spiral galaxies seen at an angle would look if light were to travel instantly?  Might this phenomenon account for some of the unusual spin properties measured in galaxies, which is attributed to dark matter? Why separate Stack Exchange accounts? I understand the reason why Stack Exchange has different sites to separate  from  or . I understand too why the reputation is associated on each site.   Why do I have to create a new  for each web site? I know that when I create a new account, it is automatically associated to my other accounts. But, is there a reason why, when I originally create a user on the first site, I can't go on another site with this user? Is my model any good, based on the diagnostic metric ($R^2$/ AUC/ accuracy/ RMSE etc.) value? I've fitted my model and am trying to understand whether it's any good. I've calculated the recommended metrics to assess it ($R^2$/ AUC / accuracy / prediction error / etc) but do not know how to interpret them. In short, how do I tell if my model is any good based on the metric? Is an $R^2$ of 0.6 (for example) sufficient to let me proceed to draw inferences or base scientific/business decisions?     This question is intentionally broad, to cover a wide variety of situations that members frequently encounter; such questions could be closed as duplicates of this one. Edits to broaden the scope beyond the metrics mentioned here are welcome, as are additional answers - particularly those that offer insight about other classes of metrics. Can I secretly kill every guard in a town? Is it possible to kill all of the guards in a town?  Ideally, I'd like to do this secretly so the entire town doesn't see my deeds and put a bounty on my head.  Edit: I was questing in Markarth and was told by a guard to back off and stop being nosy. I didn't and when I went to the Shrine of Talos I was set upon by a bunch of guards.  Now I have a huge bounty and I had to sneak/kill my way out of the city.  Every time I killed a group of guards the bounty was reduced by $1000, but I still have a $30,000 bounty.  I haven't even been through 1/3 of the city yet and know there has to be a lot of quests, so what do I do?  The only solution seems to kill every single guard (and inhabitant). That is,     why is $\varphi(AB)=\varphi(A)\varphi(B)$, if $A$ and $B$ are two coprime positive integers?   It's not just a technical trouble—I can't see why this should be, intuitively: I bellyfeel that its multiplicativity should be an approximation at most. And why the minimum value for $\varphi (n)$ should be $ \frac{4n}{15} $ completely passes me by. Connect to SQL Server with Windows Authentication in a different domain Does Calculate Value (Model Only Tool) work correctly in tools run in Batch? Am I correct that if my model has a model-only tool (Calculate Value), and then I run the model as a batched process, it will not run the Calculate Value expression?   I wrote a model to upload, define, project (and clip) XY data from excel files. I had thought to use iterate tables, but it wasn't working. (I assume due to having to choose which worksheet within xlxs). So I thought to do a batch, but this seems to leave that annoying $ that arc appends to table names (and is an invalid character in most tools...)  My guess is that the Calculate value that removes my $ is not being run in the batch. Ideas? Confirmations? How to open pdf file in Windows Phone 8? I am planning to visit London for 6 days from the US. I have given my biometrics and when I was preparing to mail my documents to the UK visa processing center in the US, I used this link from the UK government website to cross-check the documents to be sent to the processing center.     (Guide to supporting documents).  Something that really surprised me was in Section 4 (documents that should NOT be sent along with the package) was hotel bookings and flights bookings.     Section 4: documents you should not send unless specifically requested      This page provides guidance on the types of documents that are not required to consider your application.         hotel bookings   flight bookings      Typically I have always been asked to provide my travel plans, accommodation plans and proof of them. This is the first time that travel plans and accommodation plans are not asked to be sent. What might be the reason behind it? This really confuses me. Any help in clearing my confusion would be greatly welcome. Design simulates perfectly but won't work on FPGA How to install mods for the new Minecraft launcher I've recently changed to the new Minecraft launcher, and I have noticed a change in the .minecraft folder layout. I can no longer install mods just by copying it over into the versions/1.6.1 jar file, as this file refreshes every time it is launched.  For those who don't know what I am talking about, here is the new layout:    I am specifically trying to install Optifine, which does work with 1.6.1. Where do I drag in the mod files now? I can't seem to find a jar file that is suited to it, except in the version folder, but as I stated above, this refreshes every time.  After copying a recent version and renaming it in the version folder, I get this error in the development console:   Unexpected exception refreshing version list java.lang.IllegalArgumentException: Version '1.6.1' is already tracked     at net.minecraft.launcher.updater.VersionList.addVersion(VersionList.java:91)     at net.minecraft.launcher.updater.LocalVersionList.refreshVersions(LocalVersionList.java:44)     at net.minecraft.launcher.updater.VersionManager.refreshVersions(VersionManager.java:47)     at net.minecraft.launcher.Launcher$2.run(Launcher.java:164)     at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)     at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)     at java.util.concurrent.FutureTask.run(Unknown Source)     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)     at java.lang.Thread.run(Unknown Source) I have a set of Photoshop files which consist of a base image with a series of layers with colored overlays. The overlays are labeled using the layer names.  My task is to get these overlays as SVG paths, somehow preserving the labels. (If I can preserve the fill colors as well, that would be cool, but we can define arbitrary fill colors if needed.)  So far we have tried exporting the layers as Illustrator paths, and then exporting to SVG from Illustrator. This gets us reasonable SVG paths, but (a) we lose the labels, and (b) if a layer has more than one discrete section in its overlay, it is separated into several paths.  Is there a way to get these layers into SVG while retaining the labels? Or should we do our Export > Illustrator > SVG  route on a layer-by-layer basis?  We're working with CS5, if that's important.  ETA to answerers: We've long since finished this project and delivered the job, so I can't accept an answer, but feel free to pitch in your potential solutions for others. Spacing issue for newenvironment wrapper of equation environment If I create a custom environment based on the equation environment, I get a spacing issue: the next line of text after my environment closes doesn't start on the left margin.  Example code:  \documentclass{article} \begin{document} \newenvironment{myenv}{\begin{equation}}{\end{equation}} \noindent $| \leftarrow$ this is the left margin. \begin{myenv} e ^{i \pi} + 1 = 0 \end{myenv} $| \leftarrow$ this isn't the left margin. \end{document}   Output:    Removing the newline after \end{myenv} solves the spacing problem, but the resulting code is not readable.  Of course, in this example I could just use the equation environment itself. My real issue involves a more complex custom environment that suffers from the same problem, and which also includes an equation environment within it. Uniform convergence of $f_n(z)=nz^n$ in the set $|z|<\frac{1}{2}$ Complex towers: $i^{i^{i^{...}}}$ Is it possible to run some code when an assembly is loaded, without doing anything specific in the loading code? What I am looking for is like a static constructor on a type.  Eg:  Assembly A does not know about Assembly B, but B does know about A. Assembly A needs to know certain things about B if B is loaded. When Assembly B is loaded by the runtime (referenced, or explicit), I want a piece of code (static method or attribute) to be executed that calls a method in Assembly A.  The root cause of this problem is unknown types being encountered when serializing a type in A that contains types from B not known at compile time as interfaces are used. UITableView cells strangely disappearing I can't play Pokemon GO! What's wrong? What is the difference between "What are you?" and "Who are you?"? I am often asked "Who are you?" and "What are you?", but I don't know the difference between these two questions.  Please explain it to me.