Suppose I am implementing a game of two-player chess. Here is a shortened version of my implementation for simplicity's sake, omitting any irrelevant details. I have a class Piece from which the various pieces are derived. In this example I am only including the King piece.   extern enum piece_t; extern enum color_t; class Piece { public:     Piece() {}     Piece(piece_t t, char r, color_t c)         : type(t), representation(r), color(white)         {}      char getRepresentation()         { return representation; } protected:     piece_t type;     color_t color;     char representation; };  class King : public Piece { public:     King() {}     King(color_t color) { Piece(K,'K',color); } };   In another class, Board I define a member to instantiate King  class Board { public:     Board() { king = King(white); }     friend ostream&amp; operator&lt;&lt;(ostream&amp;, const Board&amp;); private:     King king; };   Here is an example of main:  int main(void) {     Board game;     std::cout &lt;&lt; game;     return 0; }   The problem is that the default constructor is being called. I know this is happening because my king object is being initialized with garbage.  My intention is for king to be initialized in Board's constructor:  Board() { king = King(white); }  From here I want the constructor from King which takes a color_t argument to be called, which will thereby call the constructor from Piece like so:  King(color_t color) { Piece(K, 'K', color); }  This is not what is happening. The default constructor (of either King or Piece or both) is being called. Is king's default constructor called when it is declared in the private field of Board? If this is the case, how do I alter the code so that king calls the appropriate constructor?
What are the C++ rules for calling the base class constructor from a derived class? For example, I know in Java, you must do it as the first line of the subclass constructor (and if you don't, an implicit call to a no-arg super constructor is assumed - giving you a compile error if that's missing).
Is there any cryptographic algorithm immune to side channel attacks based on scan chain? In VLSI point of view. I have 2 hard disks, on first I have installed win xp. I boot into xp and run setup of win7 and installed it on second hard disk. Now the problem is that win7 bootloader is installed on first harddisk, so if I remove the first harddisk, I cannot boot into win7.   How I can move / install bootloader of win7 on second hard disk? VBox on 14.04, Kernel driver not installed (rc=-1908) On Installing Virtual box on Ubuntu 14.04, I got following message:     Kernel driver not installed (rc=-1908)      The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a >permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing      '/etc/init.d/vboxdrv setup'      as root. If it is available in your distribution, you should install the DKMS package >first. This package keeps track of Linux kernel changes and recompiles the vboxdrv >kernel module if necessary.   Then on following the   I entered these commands:  sudo apt-get install linux-headers-generic build-essential dkms sudo apt-get remove --purge virtualbox-dkms sudo apt-get install virtualbox-dkms   On Running the last command   sudo apt-get install virtualbox-dkms   I get an error:  Reading package lists... Done Building dependency tree        Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable  distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies: virtualbox-dkms : Depends: virtualbox (&gt;= 4.3.10-dfsg-1) E: Unable to correct problems, you have held broken packages.   Just for reference, I checked the version of the Virtual Box, I got 4.3.16 r95972  It worked using the solution  sudo apt-get install build-essential module-assistant sudo m-a prepare   Second as mentioned in the error reinstall kernal module.  sudo /etc/init.d/vboxdrv setup   More Details are from My (very simple) question to a friend was how do I prove the following using basic trig principles:  $\tan75^\circ = 2 + \sqrt{3}$  He gave this proof (via a text message!)  $1. \tan75^\circ$   $2. = \tan(60^\circ + (30/2)^\circ)$  $3. = (\tan60^\circ + \tan(30/2)^\circ) / (1 - \tan60^\circ \tan(30/2)^\circ) $  $4. \tan (30/2)^\circ = \dfrac{(1 - \cos30^\circ)}{ \sin30^\circ}$    Can this be explained more succinctly as I'm new to trigonometry and a little lost after (2.) ?    EDIT  Using the answers given I'm almost there:   $\tan75^\circ$    $\tan(45^\circ + 30^\circ)$   $\sin(45^\circ + 30^\circ) / \cos(45^\circ + 30^\circ)$   $(\sin30^\circ.\cos45^\circ + \sin45^\circ.\cos30^\circ) / (\cos30^\circ.\cos45^\circ - \sin45^\circ.\sin30^\circ)$    $\dfrac{(1/2\sqrt{2}) + (3/2\sqrt{2})}{(3/2\sqrt{2}) - (1/2\sqrt{2})}$   $\dfrac{(1 + \sqrt{3})}{(\sqrt{3}) - 1}$   multiply throughout by $(\sqrt{3}) + 1)$   Another alternative approach:   $\tan75^\circ$    $\tan(45^\circ + 30^\circ)$   $\dfrac{\tan45^\circ + \tan30^\circ}{1-\tan45^\circ.\tan30^\circ}$   $\dfrac{1 + 1/\sqrt{3}}{1-1/\sqrt{3}}$   at point 6 in above alternative Blank screen after installing nvidia restricted driver I've  and rebooted my machine and now I get a black or blank screen.   How can I fix this? Circular Dependencies? In , it is established that Thieves' Cant is more of an encoding system built on top of a language than a language in its own right. According to the Basic Rules,  is:  ...a secret mix of dialect, jargon and code allows you to hide messages in seemingly normal conversation. Only another creature that knows thieves' cant understands such messages. It takes four times longer to convey such a message than it does to speak the same idea plainly. In addition, you understand a set of secret signs and symbols used to convey short, simple messages, such as whether an area is dangerous or the territory of a thieves' guild, whether loot is nearby, or whether the people in an area are easy marks or will provide a safe house for thieves on the run. (PBR, p. 27)  Can two creatures communicate using Thieves' Cant if they do not have a basic spoken language in common, or if they are speaking different basic languages? E.g. if one creature knows Orcish, Goblin, and Thieves' Cant, and another creature knows Elvish, Giant, Common, and Thieves' Cant, can they communicate with each other by embedding Thieves' Cant into their own languages? Hypothetically speaking, I can see how this could be possible in our own world, if we assume that Thieves' Cant depends on nuances of body language, emphasis, and tempo, e.g., one might say to a non-Spanish speaker:  Tenemos quEEEEEEE ir (wink) a la tieeeeenda de (shuffle left foot) armas para (twirl hair and giggle) comprar una espada (wink twice) para mi herMANO (wag right pinky and nod).  The literal message itself (&quot;We need to go to the weapon store to buy a sword for my brother.&quot;) would just be a carrier - the real message might be hidden within the gestures and the accented and extended syllables. Perhaps the drawn-out &quot;E&quot; vowel means &quot;robbery planned&quot;, the wink means &quot;bank&quot;, shuffling the left foot means &quot;be there at sunset&quot;, etc., and these are things that you wouldn't necessarily need to know Spanish to extract. Is this how Thieves' Cant actually works, or does it require actual comprehension of the literal message transmitted before the &quot;secret&quot; message can be extracted from it? Make window always on top? Some applications do not have the functionality like Task Manager's &quot;Always on top&quot; feature.  Is there a way around this? No, not like this:    Hear me out!  As Stack Overflow grows, it becomes increasingly ridden with extremely newbie and mediocre questions. It's just natural. The team are fighting hard to keep the crap out, but there are many very basic questions that are okay on their own. They don't deserve to be kicked out* - they are just very, very, very basic and/or localized.   Too much basicness tires users who are interested in discussing more advanced topics.  As has been discussed many times over, the voting system is not suited to identify advanced questions due to what is known as the . A group of people will vote on what they understand, which puts truly expert questions at a natural disadvantage that a democratic voting system can't overcome.  Now, there is a small number of users on Stack Overflow who I, as a user, know share my basic values (like, teaching a man to fish rather than fishing for them); I also know they are experts in their fields. It is safe to assume that what these users regard an interesting question worthy of attention, is likely to be interesting to me as well.      The idea is to introduce an opt-in "follow" mechanism that allows followed users to share what they find interesting, with very little fuss and on a purely opt-in basis.   Allow every SO user to follow any other SO user with a certain minimum rep, say 3000.   To every user who is being followed (or every user), display a new link underneath every question, "Recommend".    Introduce a new filtered view somewhere, named "Recommended". The view will show me all questions that my followed users are recommending.   Whenever I browse a list of questions, highlight those questions that have been recommended by my followed users. (I haven't put much thought into how to implement this graphically - you get the drift.)      I'm not especially fond of social networking, and I think most of it doesn't have a place on SO. But I'm starting to think this specific thing could be the right way to go in order to tell apart expert content from the 10000th dreary "how do I upload a file" question.  This is an entirely opt-in feature - unless I actively follow some users, I will never notice this.   Maybe for a bit of ego-stroking, the profile page can show how many users follow you. Or even who. Everything else would simply be kept under wraps - no publication of follower data in the data dump, no follower leagues or anything like that.      * At least not under current SO rules. Maybe those rules need to be changed - but that is a different discussion. Collinearity diagnostics problematic only when the interaction term is included For distinct prime numbers $p_1,...,p_n$, what is the Galois group of $(x^2-p_1)\cdots(x^2-p_n)$ over $\mathbb{Q}$?     This problem appears to be quite common, however my understanding of Galois theory is quite poor, and I have no idea how to do this problem. Make Blender usable on high resolution screen The Blender UI elements are incredibly small by default on high resolution screens on Windows (15" UHD screen).  I found the Preferences -> System -> DPI setting which can be set up to 144.  This makes Blender usable, but still uncomfortable and difficult on the eyes.  Is there a way to make the UI elements even larger? My friend had hosted a Minecraft server before and brought it back up today with my help. He and anyone in his LAN can connect. However we have had a few people try to connect, including me, and when we try to connect it gives the message:  Failed to connect to the server Connection timed out: connect  What does this exactly mean? How do we fix this? Flow to get all site collections in a tenant Created a Flow by using the below REST call and stored the title and Urls in another list  /_api/web/lists/getbytitle('DO_NOT_DELETE_SPLIST_TENANTADMIN_ALL_ SITES_AGGREGATED_SITECOLLECTIONS')/items?$select=Title,SiteUrl   Here the problem is it is returning only 100 items but I have 360 site sollections.   Not sure what I am doing wrong Is it safe to use the command apt-get autoremove in this particular scenario? Ocean modifier and foam data export? It is there any way to export the foam data generated from ocean modifier to use it in other render engine, like LuxRender? The manual says that the foam data is stored as vertex color data, but there isn't a way to access the vertexColor data. I know that can be accessed from Cycles from attribute's node. LuxRender supports vertex color and I tried to bake the texture to vertexColor and an image but only get a plain black texture. How do you pass a function as a parameter in C? I want to create a function that performs a function passed by parameter on a set of data. How do you pass a function as a parameter in C? How do I assign a value to a whole array of integers? Is it possible to create individual power settings for each hard drive? I have a number of different drives that I use for different purposes but I only use two of them frequently. I would like for the others to enter sleep mode when not in use, but never my main two.  Is there any way to edit power saving settings for individual drives? Converting a system command to python for file search and delete