For example: class Teacher{  // ... }   class Student{    string name;    Teacher math_teacher; // or use: std::share_ptr&lt;Teacher&gt; math_teacher;  }  Different students may have the same math teacher and I think they should share the same theacher. But I don't know whether smart points are better than objects? And when do class members use smart pointers or objects? Thanks!
What is a smart pointer and when should I use one?
One of the big new features for Windows is the fact that multiple "virtual" desktops are now natively supported, allowing you to organise collections of windows together and separate groups of tasks.  This is good.  You can move windows between desktops by clicking the "tasks" button and then right clicking an application window and selecting "Move to..."  This is a bit clunky and not quite so good.  I have two monitors and often like to have a film playing on my second monitor, either in a web browser or media player, while I have a browser and some other applications on the main screen. Doing this isn't a problem in my current setup, it just works.   With the advent of virtual desktops I was wanting to put the browser on one virtual desktop and another app on another virtual desktop and still be able to watch the video when I switch desktops, effectively having it visible on both virtual desktops. Using the default Film &amp; TV app to play a video and then moving to another desktop simply results in your video stopping without any warning.   This is not good.  What I was hoping was that either the two monitors would have their own virtual desktop or their would be some "pin to all desktops" option similar to the "sticky window" feature that I have seen in many Linux based window managers.  Is there some way to achieve this? How to reconnect a logically disconnected USB device? Searching by user id in Android app only shows questions, no answers I have a Samsung Galaxy S3. Android version 4.3  I downloaded the official StackExchange app today. I am not able to view post related to android tag from my profile. I tried refreshing also  Snap     Edit:  However i am able to see one post for the relevant from the drop down list    Edit 2:  I tried what Steven V suggested. However it's the same.    I tried for a different user its the same. hyperlink name with biblatex authoryear (biblatex 1.4b) I'm new here so I'm not sure if this is the right way to express my question:  I'm using the excellent biblatex package with the author-year style and want the links in my citations to include the name of the author as well as the parentheses. The answer presented at  did exactly what I wanted but it seems the solution is broken with the newest biblatex version 1.4b. Can anyone help me by adapting the code to the newest biblatex version? Why does gulp.src not like being passed an array of complete paths to files? Permutations with repeating digits My question is this : how many distinct two digit numbers can be produced from numbers $4, 3, 3, 1$? When applying the formula $$\frac{4!}{(4-2)!2!}$$ you come up with $6$, yet when doing the problem manually, I come up with $7$ numbers, namely $41, 43, 14, 13, 33, 31, 34$. Can anybody explain this discrepancy?  Thanks. How to run a command when a directory's contents are updated? There is a directory A whose contents are changed frequently by other people.  I have made a personal directory B where I keep all the files that have ever been in A.  Currently, I just occasionally run rsync to get the files to be backed up from A to B. However, I fear the possibility that some files will get added in A, and then removed from A before I get the chance to copy them over to B.  What is the best way to prevent this from occurring? Ideally, I'd like to have my current backup script run every time the contents of A get changed. EJB 3.1 Dependency Injection Failed Why is my profile messed up on a single site and how can I revert it? I was just asking a question on Gardening SE and suddenly my user name there is a25bedc5-3d09-41b8-82fb-ea6c353d75aand my picture is replaced by a Gravatar. My location is also left blank.  Here's a   Curiously, my profiles on all other sites are fine.  I don't have a separate login for SE, I log in using my Google account. Nobody other than me has access to my Google account. I use two step authentication and I can see on "recent devices" in Google that no one but me has accessed my Google account. I only access SE from home, and nobody other than me has used my devices.   I tried to edit my Gardening SE profile back to the way I want it to be and I got the following message:     Oops! There was a problem updating your profile:   Display name may only be changed once every 30 days; you may change again on Jun 20 at 10:49   I'm assuming this is because I changed the "about me" on all SE sites two days ago.  I never edit my profiles individually. I always apply changes to all sites, using the same profile on all sites.  I have certainly not made such strange (or any) edits to my profile on Gardening SE.  Why did this happen, and how can I get my proper user name and picture back on Gardening SE? Do I really have to wait for a whole month? I want to use the site, and I want them to recognize me as the user they know. I don't want to wait a whole month.  Update: The Gardening SE moderator Niall C. helped me out, and he offered the following potentially relevant information:     I changed your display name on Gardening &amp; Landscaping back to "Fiksdal". Your profile history shows that your profile image (from your headshot on imgur.com to a gravatar), email, about me also changed at the same time as your display name on May 21. It also shows that I changed your profile image to a different gravatar when I changed your display name just now... weird! – Niall C. 1 hour ago Was "book" to "beek" as "foot" is to "feet"? "Foot" is a curious word in English because it is pluralized in an unusual way; the "oo" in the word is changed to "ee".  Did this once use to be a standard way of pluralizing things in English (or a language that contributed to English), which would mean that the plural of "book" was "beek" instead of "books"?  Or, is "feet" just a one-off? How to Create Bootable Windows 10 image in Debian? Pseudocode but originally developed for Windows 7 iso file but applied for Windows 8 in the thread  but it does not work with Windows 10 iso  # https://rwmj.wordpress.com/2010/11/04/customizing-a-windows-7-install-iso/ # https://unix.stackexchange.com/a/312477/16920 $ dd if=../en_windows_10_x64_dvd.iso \     of=boot.img bs=2048 count=8 skip=734  $ mkisofs -o ../new-win.iso -b boot.img -no-emul-boot -c BOOT.CAT \     -iso-level 2 -udf \     -J -l -D -N -joliet-long -relaxed-filenames .   Unsuccessful output when run on Windows 10 image  dd if=/home/masi/Downloads/en_windows_10_multiple_editions_version_1511_x64_dvd.iso of=/home/masi/Downloads/boot.img bs=2048 count=8 skip=734 8+0 records in 8+0 records out 16384 bytes (16 kB) copied, 0.000392973 s, 41.7 MB/s    Some of the following fields have changed for the iso file used in dd   bs=2048 count=8  skip=734   How can you study which field values you can use for Windows 10 iso?  OS: Debian 8.5 64 bit Hardware: Asus Zenbook UX303UA Linux kernel: 4.6 of backports Related threads: ,  Motivation: I need Windows 10 to use Canon P-150 duplex scanner, but when I started my Windows, I got Error 0xC0000428 because Windows update has again broken things there and I use Windows otherwise so rarely; and I have no spare Windows left to make bootable media Why is it “a defeated Napoleon, not “the defeated Napoleon” who rode off the battlefield and into exile? I noticed an infinite article; ‘a’ was used before ‘defeated Napoleon’ in the following sentence of Jeffery Archer’s novel, "Fales Impression" :  “General Sir Harry Wentworth sat at the right hand of the Iron Duke that night, and was commanding his left flank when a defeated Napoleon rode off the battlefield and into exile."  I’m curious to know why it should be “a defeated Napoleon,” not “the defeated Napoleon” or simply “defeated Napoleon.” Isn’t it only one Napoleon who was defeated the battle and exiled (to St. Helena). It looks like as though there were many (defeated) Napoleons who were exiled.  It’s always headache for me to handle articles as we Japanese (I think Chinese too) don’t have article as the basic part of speeches in our language system. I’ve studied it on English grammar text books at school, but have never reached full understanding of the usage of articles, because we don’t have that practice. Is there any special knack to master how to use articles? How could Fred and George have figured the exact password to the Marauder's map? Cruise ship in the Schengen area: Do the days spent at sea count toward the limit for short visits? I am planning on spending 90 days in Schengen zone countries.  I will be taking a cruise between Lisbon and Barcelona.  Do the days at sea count against the 90 days allowed for staying in the Schengen zone? Distribution of the digits of Pi Output from ls has newlines but displays on a single line. Why? Configuring, compiling and installing a custom Linux kernel How do I install .run files? Can I use my Schengen visa for multiple purposes I was issued a Schengen visa for 90 days validity with multiple entry. Initially I planned for tourism to France and Switzerland and accordingly I have written the purpose as tourism only and I will be travelling as well for a week and coming back to India. First I am using for tourism for one week and travelling back to India.  Now, I also need to travel again to Schengen area to the same countries for business purpose for one week again. Can I use the same visa or do I need to get a new one? Is there a way to install a newer version than in the repository?  Ubuntu installs vagrant 1.4.3 at the moment, but I need at least 1.5