simple virtual inheritance & pure virtual method program CORRECTION :  I edited two line from:  1) "class circle : public shape" to "class circle : public virtual shape"  2)"class square : public shape" to "class square : public virtual  shape"  And yes , i am trying to have only one instance of Shape class for the shapes class , while  defining  the method draw differently inside Circle class and Square class    I am trying to do a simple inheritance program , but it gave me the following error:  *error C2250: 'shapes' : ambiguous inheritance of 'void shape::draw(void)' *IntelliSense: override of virtual function "shape::draw" is ambiguous    -->this code resembles the solution of the diamond problem. I don't get why i see this error.  Here is the code:      #include&lt;iostream&gt;     using namespace std;     class shape     {     public:         shape()         {             cout &lt;&lt; "shape created" &lt;&lt; endl;         }         virtual void  draw()=0;       };         class circle : public virtual shape     {     public:         circle()         {             cout &lt;&lt; "circle created" &lt;&lt; endl;         }         virtual void  draw()         {             cout &lt;&lt; "this is a circle" &lt;&lt; endl;         }     };         class square : public virtual  shape     {     public:         square()         {             cout &lt;&lt; "square created" &lt;&lt; endl;         }         virtual void  draw()         {             cout &lt;&lt; "this is a square" &lt;&lt; endl;         }     };         class shapes : public  circle, public  square     {     public:         shapes()         {             cout &lt;&lt; "shapes created" &lt;&lt; endl;         }     };         void main()     {         shapes e;         cout &lt;&lt; "-------------" &lt;&lt; endl;         system("pause");     }
In C++, what is a virtual base class? I want to know what a "virtual base class" is and what it means.  Let me show an example:  class Foo { public:     void DoSomething() { /* ... */ } };  class Bar : public virtual Foo { public:     void DoSpecific() { /* ... */ } };
I am reading a paper and have questions about the details of the procedure described. I have read other papers by the same team but they don't explain too much about that procedure anyway. I think it might be common, but my supervisor doesn't know it too.  I am stuck and I want to get out of it. As a student working on my master thesis, can I email the contact author for the manuscript cold out, or should I ask someone to contact him for me? I would ask my supervisor but I don't want it to imply that I'm avoid taking initiatives when I could do it on my own. A question on limsup Two layers, same coordinate system, wont show up I have vector two sets of vector layers that won't show up together. One set shows up together and the other set together etc but they are of the same area.  The layers I was given did not have a defined spatial reference which I manually projected as the same as the data frame I specified so all layers now have same CRS...yet not showing up together. I have noticed they appear to have different extents... What should I do? What's going on with "compact implies sequentially compact"? I've seen both counterexamples and proofs to &quot;compact implies sequentially compact&quot;, and I'm not sure what's going on. Apparently there are compact spaces which are not sequentially compact; quick googling and wikipedia checks will turn up examples floating around; they tend to be variants of $[0,1]^{[0,1]}$ with the product topology.  Here's a demonstration(?):  $[0,1]^{[0,1]}$ is compact by Tychonoff's theorem.  So, we demonstrate failure of sequential compactness. Choose a unique binary representation for each $x\in [0,1]$. For each $n\in\mathbb{N}$, let $f_n : [0,1]\to[0,1]$ (an element of $[0,1]^{[0,1]}$) be the function which maps each $x$ to its $n$-th place digit in its binary expansion. Let $f_{n_k}$ be a subsequence of this sequence. Let $x'\in [0,1]$ be such that the $n_{2m}$-th digit is $0$ and the $n_{2m+1}$-th digit is $1$, for all $m\in\mathbb{N}$. Then $f_{n_k} (x')$ does not converge (it alternates between $0$ and $1$), and hence $f_{n_k}$ cannot converge. Thus we have found a sequence in $[0,1]^{[0,1]}$ without any convergent subsequence and so it is not sequentially compact.  (Aside: this is apparently based off of an example in Steen's Counterexamples in Topology, according to  ) Nevertheless, there's also some proofs(?) floating around that compactness of a space implies sequential compactness, along these lines (this proof(?) is of the contrapositive):  Suppose $X$ is not sequentially compact. By definition, this means there is some sequence $(x_n)$ over $X$ with no convergent subsequence. If any $x\in X$ had for each of its neighborhood $U$ infinitely many $n$ for which $x_n \in U$, then we could define a convergent subsequence of $(x_n)$, contradicting our assumption.  (Presumably this is done by choosing for each neighborhood a sufficiently-large-indexed term in that neighborhood.) Thus, for each $x \in X$ we can select an open set $U_x$ such that $x\in U_x$ but with $x_n \in U_x$ for only finitely many $n$. The collection $\mathcal{U}=\{U_x : x\in X\}$ is clearly an open cover of $X$. If $\mathcal{U}$ had a finite subcover $\{U_1, \dots, U_k\}$ then the union $U_1 \cup \cdots \cup U_k$ would contain all of $X$ but only contain $x_n$ for finitely many $n$, which is impossible. Thus $X$ is not compact, since we have found an open cover without a finite subcover.  (Aside: this proof is essentially the same as the proof appearing in Rudin's Principles of Mathematical Analysis for Thm 2.37 that infinite subsets of compact spaces have limit points.) So, what's going on here?  It can't be that what both the counterexample and the proof are telling us is correct.  Is there some subtle (or more embarassingly for me -- glaring) flaw in the proof? Only Fixed and Random Options are Working in Illustrator CC 2015 Callipraphy Brushes App updated but still the same. Only fixed and random options are working in Calligraphy Brushes. I have searched but can't find a solution. Let $a_1,\dots ,a_n \in \mathbb{R}^n$ with $a_i = (a_{i1}, \dots , a_{in})$.  Show that when $\mid a_{jj}\mid \gt \sum_{i \neq j} \mid a_{ij} \mid \; \forall \; j\in \{1,\dots ,n\}$, then $a_1,\dots ,a_n$ are linearly independent.  I want to show that the matrix \begin{matrix} a_{11} &amp; a_{21} &amp; \cdots &amp; a_{n1} \\ a_{12} &amp; a_{22} &amp; \cdots &amp; a_{n2} \\ \vdots &amp; &amp; \ddots &amp; \\ a_{1n} &amp; a_{2n} &amp; \cdots &amp; a_{nn} \end{matrix} can be transformed into an upper triangular matrix with all entries in the main diagonal $\neq 0$.  For the cases $n=1$ and $n=2$ this is easy. However, I fail to show this for the general case; the problem being that the tranformations mess up the coefficients such that I can't use the assumption on the $a_{jj}$'s anymore.  I'm pretty sure that this has already been solved somewhere on here, but I don't know how to search for it. Word for a temporary project name In software development, and I imagine in many other fields, we often make up temporary nicknames for new projects or features. These are not meant to be the real names for the end product and are often funny, playful, or sarcastic in nature. These are also not intended to be "codenames" that hide the nature of the project or feature. Is there a word for such nicknames? How to know if my servers should use jumbo frames (MTU) Why is you subjective? (Catchy title, eh?)  I am asking the following on the photo.SE site:     How do you change from portrait to landscape in Lightroom   DANGER! DANGER! This appears to be subjective and is likely to be closed.  If I ask the following radically different question:     How do I change from portrait to landscape in Lightroom   ... there is no problem.  So, like the title says: Why is "you" subjective?  (And  where Jeff spills the regex) How to determine an object's class? If class B and class C extend class A and I have an object of type B or C, how can I determine of which type it is an instance? How do I debug when the system freezes or when it crashes back to login? I am fairly new to Ubuntu and I was wonder what a good way is to debug when something crashes?   For example: I installed 11.04 and the default media player banshee makes my laptop crash after a few minutes of playing music. Since the system completely freezes and there is not error message it's hard to find out what is wrong.  Second problem I have is that sometimes the system crashes to login. I am suspecting it to be a Chromium or Flash but I am not 100% sure.  So anybody got some tips on how to debug stuff like this? When asking about , people sometimes refer to the strict aliasing rule. What are they talking about? Reading console input in MonoDevelop Downloading large files reliably in PHP Prove the map has a fixed point Assume $K$ is a compact metric space with metric $\rho$ and $A$ is a map from $K$ to $K$ such that $\rho (Ax,Ay) &lt; \rho(x,y)$ for $x\neq y$. Prove A have a unique fixed point in $K$.  The uniqueness is easy. My problem is to show that there a exist fixed point. $K$ is compact, so every sequence has convergent subsequence. Construct a sequence ${x_n}$ by $x_{n+1}=Ax_{n}$,$\{x_n\}$ has a convergent subsequence $\{ x_{n_k}\}$, but how to show there is a fixed point using $\rho (Ax,Ay) &lt; \rho(x,y)$? Moderator flag notifications should reach mobile I spend a great deal of time surfing SE sites from my phone during commutes and other down times. The global inbox is quite effective at reaching me even for chat pings. Quite frankly the mobile site is very well done!  However as a community moderator, there is a whole class of information not getting through. There are no notifications for moderator flags! I can switch to the full site and see these but that is inconvenient for browsing, so I only end up checking for flags periodically.  Ideally the moderator tools should all be available in mobile templates, but as a stand-by it's reasonable to switch to the full view to handle flags, but flags would get addressed in a much more timely manner if I knew about them. As it stands I often come and go from the site without even knowing there are outstanding flags.  A simple flag counter added to the header next to the notification counter and linked to the tools page (which automatically opens the full version anyway right now) would fix this. I would like to remove selected commit log entries from a linear commit tree, so that the entries do not show in the commit log.  My commit tree looks something like:  R--A--B--C--D--E--HEAD   I would like to remove the B and C entries so that they do not show in the commit log, but changes from A to D should be preserved. Maybe by introducing a single commit, so that B and C become BC and the tree looks like.  R--A--BC--D--E--HEAD   Or, ideally, after A comes D directly. D' representing changes from A to B, B to C and C to D.  R--A--D'--E--HEAD   Is this possible? if yes, how?  This is a fairly new project so has no branches as of now, hence no merges as well. Matrices - Conditions for $AB+BA=0$ The Problem Let $A$ be the matrix $\bigl(\begin{smallmatrix}a&amp;b\\c&amp;d\end{smallmatrix} \bigr)$, where no one of $a,b,c,d$ is $0$. Let $B$ be a $2\times 2$ matrix such that $AB+BA=\bigl(\begin{smallmatrix} 0&amp;0\\ 0&amp;0 \end{smallmatrix} \bigr)$. Show that either   $a+d=0$, in which case the general solution for $B$ depends on 2 parameters, or $ad-bc=0$, in which case the general solution for $B$ depends on one parameter.   (this is question 22 of the last matrix exercise of Further Pure Mathematics by Bostock et al.)  Comments Writing $B=\bigl(\begin{smallmatrix} e&amp;f\\ g&amp;h \end{smallmatrix} \bigr)$ and multiplying out I get that    $(a+d)(f+g)+(b+c)(e+h)=0$ $ae+bg+cf+dh=0$   but I am unable to get the required restrictions on $a,b,c,d$. Is there a quick way of doing the problem that doesn't require manual computation? I thought of considering invertible and non-invertible cases but couldn't get anywhere. Help would be much appreciated. Polygon intersection using turf js I have given this code for intersection: function intersectPolyByPolyFC(poly,fcPoly){         var fgp=[];//variable for feature group         var bbPoly=turf.bboxPolygon(turf.bbox(poly));//polygon representation of the bounding box of a reference polygon         for(var i=0;i&lt;fcPoly.features.length;i++){//loop through the feature collection of polygons             var bb=turf.bboxPolygon(turf.bbox(fcPoly.features[i]));//variable bb represents each polygon for feature collection             if(turf.intersect(bbPoly,bb)){//condition to check if the two bounding boxes intersect                 var int= turf.intersect(poly,fcPoly.features[i]);                 if(int){                     int.properties=fcPoly.features[i].properties;                     fgp.push(int);                 }             }         }         return turf.featureCollection(fgp);     }  and the function definition I have given as var bufline=turf.buffer(line,0.05,{units:&quot;kilometers&quot;}); var intBUOWL= intersectPolyByPolyFC(bufline, lyrBUOWL.toGeoJSON()); L.geoJSON(intBUOWL,{style:{color:'red',weight:5}}).addTo(mymap);  When I am drawing a line over a polygon for intersection I am getting this error Uncaught TypeError: Cannot read property 'map' of undefined     at Object.t.collect (turf.min.js:1)     at summarizePointsByLine (buffer.html:440)     at NewClass.&lt;anonymous&gt; (buffer.html:155)     at NewClass.fire (Events.js:190)     at NewClass._fireCreatedEvent (leaflet.draw.js:8)     at NewClass._fireCreatedEvent (leaflet.draw.js:8)     at NewClass.completeShape (leaflet.draw.js:8)     at HTMLAnchorElement.handler (DomEvent.js:92)  How can I resolve this error? Are data members allocated in the same memory space as their objects in C++?