NO Idea, why the base string get return instead of Derived, is that becasue vector copied only base object from the dervied object? #include &lt;vector&gt; #include &lt;iostream&gt; using namespace std; class Base { protected:     int m_value{};   public:     Base(int value)         : m_value{ value }     {     }       virtual const char* getName() const { return &quot;Base&quot;; }     int getValue() const { return m_value; } };   class Derived: public Base { public:     Derived(int value)         : Base{ value }     {     }       virtual const char* getName() const { return &quot;Derived&quot;; } };  int main() {     std::vector&lt;Base&gt; v{};     v.push_back(Base{ 5 });     v.push_back(Derived{ 6 });                for (const auto&amp; element : v)         std::cout &lt;&lt; &quot;I am a &quot; &lt;&lt; element.getName() &lt;&lt; &quot; with value &quot; &lt;&lt; element.getValue() &lt;&lt; '\n';       return 0; }  why in second output Base is get return from the getName() methods? Is that because of vector is not a pointer type or reference? I am a Base with value 5 I am a Base with value 6 ----&gt; why it prints the Base?
Someone mentioned it in the IRC as the slicing problem.
What is this agglomeration of pink cells I found attached to a stone? What test can I use to compare slopes from two or more regression models? I am new and struggling with java and I need assistance with code. Value keeps resetting to default I´m posting this because I have some active questions in SO and I´m leaving for the weekend and wont have internet until monday or tuesday.  SO is a very active site and I hate no to answer/thank/comment people who are kind enough to answer my questions.  I think an "away" indicator like an out of office reply would be a really nice feature to add for "politeness" sake. The positive integer solutions for $2^a+3^b=5^c$ What are the positive integer solutions to  the equation     $$2^a + 3^b = 5^c$$    Of course $(1,\space 1, \space 1)$ is a solution. What happens if both players have the ability to pump their creature an unlimited number of times? Say that both players each had 2 , 2 , and a . (Or any other way to get unlimited mana, and a Nantuko Shade).  Player 1 attacks with his , and player 2 blocks with his . Before damage is assigned, each has chances to pump up their  as much as they want. They can't just declare them to be "infinite," but each can always one-up the other player. What happens?  It seems there would be a loop of events, but would one player eventually be forced to break the loop as per rule 714.3? Is it considered the same game state after each player pumps their creature a bunch as it was before?  This was discussed at length on the Draw3Cards Magic Q&amp;A site (which is no longer available), but no conclusion was reached. Some felt that the game would simply be a draw, others felt that the active player would be forced to make a different decision to break the loop. Others felt that you would just have to call a judge and see what he decides. The shop is five minutes away.     According to the dictionary, away is an adverb. An adverb modifies a verb. In the above example, what word does away modify? Why is away not an adjective?       The shop is five meters tall.     tall is an adjective in the second example. It modifies five meters (does it?). So why is away an adverb? Astrophotography picture with too much noise. How do I correct this in postprocessing? This is the Milky Way above Kakadu National Park, Australia, and my first try at astrophotography.    Thirty second exposure, f/4.0 at 17mm with ISO 12800 (!!) which in hindsight probably was way too high and resulted in a lot of noise. I also used Picasa to increase contrast, but I probably went a bit overboard there as well.  , I am looking for input on how to better postprocess this picture to reduce noise. Reading order for Dragonlance? Why is vim frozen? Monitor cell value and copy it to another cell What's the difference between correlation and simple linear regression? In particular, I am referring to the Pearson product-moment correlation coefficient. I've recently come across several statements to the effect "there are questions science can't answer", mostly from proponents of  and , but also from  and  as well.   However it seemed to me that there was an inherent contradiction in statements of the type "Science doesn't have all the answers" or "Science can't answer all questions". This is hinged on what is meant by "answering a question". It seems to me that to answer any significant question is to provide 2 things:    An accurate and objective explanation of the current state of affairs, in terms of relationships, causes and effects.  Based on that explanation, a method for making decisions if one is faced with future scenarios similar to or related to the current state of affairs, and for predicting future states of affairs with a certain amount probability, i.e the explanation is useful for future purposes.   But then if a field of inquiry is able to provide accurate, objective and useful information regarding a question, doesn't that field simply become part of science?   As examples:    If some school of mysticism is demonstrated to truly improve the happiness and well being of it's practitioners, then wouldn't that school's mystical teachings simply be incorporated into mainstream psychology and psychotherapy?  Similarly, if a political ideology is proven to provide better economic conditions and less crime, less pollution, etc...then this ideology's principles would become an accepted part of social sciences?     To put it more simply: Science has all the answers, because science IS anything that can provide objective and useful answers to a question.  Am I not talking about the demarcation problem per-se (at I least I think I am not), because even disciplines which are agreed upon as failing various demarcation criteria (such as astrology or intelligent design) are still trying (and failing) to be scientific in the sense I mentioned above. If they did start to provide answers, science would have to take them into account. Moreover, various philosophical schools of ethics are trying to be scientific in their explanatory framework, they are just not able to provide verifiable and falsifiable statements to prove their precepts (and probably would do so if possible).   My questions then are:    Per those who claim that science can't answer all questions, what type of question are they talking about? Do they have a demarcation criteria for such questions? (I'm not asking for examples, there are already plenty in the links I posted above).  If a field starts providing objective, accurate answers, doesn't it just become a subfield of science?   Is there a second demarcation problem between "carckpot" pseudosciences (such as astrology or numerology) which are providing the wrong answers and legitimate fields of inquiry (such as political theory or ethics) which are trying to provide answers but so far have failed to provide verifiable and falsifiable statements or accurate predictions? How do you copy the contents of an array to a std::vector in C++ without looping? I have used the code shown below to draw a static CMOS inverter. I have tried to use the TikZ library calc to calculate the point at which drains of the PMOS and the NMOS devices meet; and the mid-point of the line which connects the gates of the two devices. Apparently calc gets the y coordinates of the points right. However, calc seems to get the x coordinates of the points wrong. What could I be doing wrong?  Here is the TikZ code:  \documentclass{standalone} \usepackage[americaninductors]{circuitikz} \usetikzlibrary{calc} \begin{document} \begin{circuitikz} \draw % Draw MOSFETs: (0,0) node [pigfete,yscale=-1,anchor=S] (M1) {} (M1.D) node[nigfete,anchor=D] (M2) {} (M1.G)--(M2.G) % The line connecting the gates of the MOSFETs. ; % Draw the power rails: \draw ($(M1.S)-(2.0,0)$) -- (M1.S) -- ($(M1.S)+(1.2,0)$); \draw ($(M2.S)-(2.0,0)$) -- (M2.S) -- ($(M2.S)+(1.2,0)$); % Input and output nodes: \node (I) at ($0.5*(M2.G)+0.5*(M1.G)$) {}; % The mid-point between the gates. \node (O) at (M1.D) {}; % The point at which the drains of the MOSFETs are conneted. % The Input and output lines. \draw ($(I)-(.8,0)$) -- (I); \draw (O) -- ($(O)+(0.8,0)$); \end{circuitikz} \end{document}   Here is the figure that I get: Note that that input and the output lines are not connected to the rest of the circuit. Can we attribute the problem of the lines not being connected, to the rest of the circuit, to the way I am using calc? Could someone please tell me what the symbol ringed in red represents?     I know it has ON Switch pointing to it, but the symbol has other lables in different parts of the document. If an astronaut had stationed in International Space Station for the duration of mission, 17 years, would he be older? Today the NASA International Space Station started the 100000 orbit after 17 years in the space. I just wonder if there were a team of astronauts which were in the Lab for all the duration of last 17 years, how much older they would be due to the combination of Einstein's especial theory of relativity and general theory of relativity?   Here is the link to NASA's youtube video. I'm hoping there's something in the same conceptual space as the old VB6 IsNumeric() function? I'm new to field extensions and I can neither see why or how to prove this statement.  If I'm not mistaken, to construct a splitting field, you construct rupture fields one after the other, using that the $8$ element field is the splitting field of $X^8-X$ over $\mathbb F_2$, since $2$ is the only prime divisor of 8.  Over $\mathbb F_2$ $X^8-X$ has two roots : $0$ and $1$. Therefore $X^8-X=X(X-1)(1+X+...+X^6)$. The last factor, call it $P$, has no roots. So let $\alpha$ be a root in some extension $\mathbb F_2(\alpha)$ of $\mathbb F_2$.  We now have $P=(X-\alpha)(X^5+\alpha X^4+...+\alpha^4X+\alpha^5)$.  I suspect $\alpha$ might not be the way to go and if so, my second plan would be to reduce $P$. I don't know how to do this but assuming it to be done, hence having $P=P_1...P_n$, I could start using $P_1$'s rupture field, and then my best guess is that if $\mathbb F_2[X]/(P_1)$ is not sufficient, I re-reduce $P$ over this new field and consider the rupture field of one of the factors, and so on.  Now assuming I wasn't given the statement itself, is it elementary to construct the $8$ element field using $\mathbb F_2$ ? Writing test code for wrapper class I created a controller which looks like this  public with sharing class EventRegistrationController {      // A CONTROLLER FUNCTION     // FUNCTION RETURNS A LIST OF cSession      public List&lt;cSession&gt; getSessions() {            //DO STUFF       }     //A PUBLIC CLASS WITHIN CONTROLLER    @TestVisible public class cSession      {         public Session__c con {get; set;}         public Boolean selected {get; set;}          //This is the contructor method.          public cSession(Session__c c) {              con = c;             selected = false;         }     }  }   I need to write a test code for the controller, how can I create a list of cSession and call getSession function?