Consider the following instructor , I had to initialize treeItem and status anyway , but in a overloaded function , I can introduce the id variable as well.  But it looks silly , I shouldn't be doing this in both of the functions , any suggestions ?  Contact () {     treeItem = NULL;     status = offline; }  Contact (const QString &amp; id) {     treeItem = NULL;     status = offline;      this-&gt;id = id; }
As a  developer I'm used to running through constructors:    class Test {     public Test() {         DoSomething();     }      public Test(int count) : this() {         DoSomethingWithCount(count);     }      public Test(int count, string name) : this(count) {         DoSomethingWithName(name);     } }   Is there a way to do this in C++?  I tried calling the Class name and using the 'this' keyword, but both fail.
I was just thinking that maybe if we have more Stack&nbsp;Exchange websites then each person would be a member of more different sites on average. Since the time a person can spend online on average is limited it means he will be spending less time on each website. But would this affect the quality of these websites? I'm not talking only about the quality answers given but also the number of answers given, the promptness. Won't these things go down?  I think that the rate of questions won't go down much because you need to know what you need to know. However, the average time a person spends browsing through these websites (and chances upon a question he can answer) would decrease. So are we creating too many different Stack&nbsp;Exchange sites? I keep on seeing a fair number of questions (such as ) which get marked as answered within 5-10 minutes of being posted. Sometimes the questions like this are insanely popular and actually see some proper discussion, however often I see questions have few views and only 1 answer. The trouble with these questions is that very few people have scrutinised the answer for correctness, or possibly a better solution. I always make a point of not accepting my answers until a day or so has passed — would it not be a good idea to put a short (1 hour or so) time limit on accepting answers on new questions with few views or votes, or perhaps just an additional confirmation dialog, something along the lines of:  Your question is new and not many people have had a chance to look at it yet.  Are you sure you don't want to wait to see if anyone else has a better suggestion? What happen if I install VirtualBox Guest Additions on a host? I have a bootable USB drive with Ubuntu installed.   This morning I Installed VirtualBox and booted my Ubuntu drive in a VM. I then installed the guest additions in Ubuntu.   My question/curiosity is, what would happen if I boot the drive again outside of the VirtualBox VM, using a physical computer?  Will my Ubuntu work normally or is something going to change? Find the highest order bit in C How can I run a script that starts before my login screen? I was calibrating my touch screen, and saw that the best tool around was xinput_calibrator. So I used it. It have two options (one of which did not work), so I am here for the second. It says I should execute this command "in a script that starts with your X session":  xinput set-int-prop "3M 3M USB Touchscreen - EX II" "Evdev Axis Calibration" 32 14410 2146 14574 2115  So I tried ~/.xinitrc, ~/.xsession and ~/.xsessionrc, all of which did not exist. So I created them and the exact content was this command. The first two files made my logins fail (after I login, I fall back to the login screen).  With the last file, the calibration was functional, but only after logging in...  I need that command to run before the login dialog shows up. I thought of adding this command to the end of /etc/X11/xinit/xinitrc with no result (nothing changed). Also, I tried to add it to the end of /etc/X11/Xsession.d/40x11-common_xsessionrc (after inspecting some of the files), but the result was exactly the same as adding it to ~/.xsessionrc.  How can I make this command run before the login screen shows (is this before the window manager starts, or before the X session starts)?  (I am running Kubuntu with the default window manager, if that matters)  UPDATE As I am using Kubuntu, my display manager is kdm. As the accepted answer suggests, I edited the file /etc/kde4/kdm/Xsetup, and as mentioned  I added the command before the command that is there by default. And it works like a charm :) Pgfplots with custom axis markers Assume you have a trigonometric function, say for simplicity sin(x). When plotting the function, how can one place the x-axis markers on 0, pi/2, pi, 3pi/2, 2pi, instead of the default numeric values that pgfplots uses? Files greater than 1 GB and older than 6 months I want to find files which are greater than 1 GB and older than 6 months in entire server. How to write a command for this? I'm trying to run multiple Nodejs applications on Nginx server running on CentOS 7. I noticed that when I run a Nodejs app on some ports I get an 502 Bad Gateway error in the browser so I checked the error logs:  [notice] 12806#0: signal process started [crit] 12807#0: *13 connect() to 127.0.0.1:7777 failed (13: Permission denied) while connecting to upstream, client: **.**.99.58, server: myapp.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:7777/", host: "myapp.com" [crit] 12807#0: *13 connect() to [::1]:7777 failed (13: Permission denied) while connecting to upstream, client: **.**.99.58, server: myapp.com, request: "GET / HTTP/1.1", upstream: "http://[::1]:7777/", host: "myapp.com"   when I change the app to listen to 8008 for example everything is working fine. I checked permissions and if the process is running as root and everything seems ok. I played with the timeouts as well but no result. Can anyone help? I want to be able to have LinkedList.contains() return true for a custom comparator.  Suppose that I have 1 LinkedList and 2 objects  LinkedList&lt;MyObject&gt; myList = new LinkedList&lt;MyObject&gt;();  MyObject a = new MyObject("HELLO"); MyObject b = new MyObject("HELLO");   Technicaly, both objects are identical in terms of comparison (MyObject implements Comparable)   ( a == b ) == true  however, when I do the following, myList does not return true for myList.contains(b)  myList.add(a) myList.contains(b) // == false   I think its because contains will check object reference and see that a and b are 2 distinct objects. Is there any way I can make it so I don't have to extend LinkedList to compare those objects? When is "EDIT"/"UPDATE" appropriate in a post? I often see questions edited into this form:     Lorem ipsum dolor sit amet blah blah blah paragraph paragraph original question.            UPDATE: The Lorem disappeared and left this message: "new information".   I find this format unaesthetic (since Stack Exchange posts are supposed to be useful in the long term and update boundaries are artifacts of the creation rather than the content) and feel that new information should, whenever possible, be incorporated into the original text “as if it had always been that way” if practical, and pointing out an update should be done mostly in comments.  Is this an appropriate writing style, and if so under what circumstances? If not, should it be removed or discouraged? Why didn't Iron Man make Vibranium armor in Iron Man 2? In the movie Iron Man 2, Tony Stark figured out how to synthesize Vibranium. Why didn't he use it to make a new Iron Man armor? Sometimes when you're downloading an image and the connection breaks mid stream, you are left with a half downloaded image. If you try to view it you get the upper part of the image and the bottom part is usually coloured grey or green or some other color.  In other words, it is corrupted.  Is there a way to check whether the image is damaged in that way or otherwise corrupted? Coming from Eclipse and having been used to duplicate lines all the time, it's pretty strange finding out that Xcode has no such function. Or does it?  I know it's possible to change the system wide keybindings but that's not what I'm after. Schengen visa application rejected because my US visa stamp expires in December. What are my options? I went to the Italian consulate in Washington, DC today and they would not accept my visa application because they said my US visa stamp cannot expire less than 3 months after the end of my trip to Italy. Here's my relevant visa and trip info:   US visa stamp expires on 16 Dec 2015 I-797 valid until 3 Mar 2017 Trip to Italy is from 15 Oct to 25 Oct 2015   Is it true that my visa stamp needs to be valid for 3 months after my trip, even though I can legally stay in the US until 2017? Does anyone have any suggestions for getting a Schengen visa in my situation? Book wherein humans were most dangerous/aggressive of numerous species I recall there were two warring alien empires, one of which was led by a race that could telepathically inflict pain on others, but when they tried to do it to humans, it would backfire. something about human's animal instincts being much closer to the surface than the other species.  Humans made the most aggressive and dangerous fighters, so both empires tried to reruit humanity, since the other races involved in the war were fairly monolithic and sided all with one empire or the other. Humanity was all splintered though.  The empire led by the telepathic race claimed that everyone in it was equal but in reality the telepathic race was in charge. How to Pivot Multiple Columns in SQL Server I've read many posts about using pivot to get the data in the format I want, but the more I read the more confused I get.  I have this data:    That I'm trying to get into a format similar to this:   For the most part, everything I try results in an SQL error, and the only successful attempt I've had didn't return the data in the format I'm looking for.  Any help would be appreciated. I'm trying to get past a Snorlax and I need a Poké Flute to wake him up—how do I get one? Beamer: Vertical alignment of multi-column ToC I would like to understand how Physicists think of space-time in the context of String Theory. I understand that there are $3$ large space dimensions, a time dimension, and $6$ or $7$ (or $22$) extra dimensions, and all these dimensions need to fit together in a way such that the extra dimensions are compactified (with a Calabi-Yau or $G_2$ structure).   My question, however is not about the possible $10$, $11$ or $26$ dimensional manifolds that may be possible, but about whether string theorists consider space-time as somehow quantized (or discrete), or rather as a continuous manifold, or are both options possible? In other words, can strings move continuously through space, or are there a discrete set of locations where strings can be, and does string theory rule out one of the options?  How about the same question in loop quantum gravity (LQG)? Should I think of the spin networks in LQG as describing a discrete space-time?  Thanks for your insight, or any references you may be able to provide! Prove that if $a+b+c$ divides $abc$, then $a+b+c$ must be composite.