« first day (754 days earlier)      last day (4199 days later) » 

9:00 AM
yes...
 
will self destruct in 10, 9, 8 ...
 
means delete itself...
 
aw, no explosions? :(
 
You want to get a path to the current executable, then remove it from the filesystem.
 
delete_file(filename);
 
9:00 AM
yes...
 
That relates more to the OS you're using than the language.
 
@Potatoswatter sounds like he's on Windows, which makes it slightly trickier because the file will be locked
 
Didn't like "del tree" used to work on older Windows?
 
but yeah, that's really little to do with C++. You need to call the OS function to get the current executable's path, and then call the OS function to delete it. And in between you'll have to call some OS functions to work around the fact that the file will be locked as long as the process is running
 
@Potatoswatter yes, but after compare the dates...
 
9:03 AM
You could have it make another program that terminates the current process. Then deletes the executable. But you'd still have to find a way to delete the deleter program.
 
format C:
always works
 
But I see no reason why someone would want to do this aside from writing a virus that tries to wipe its footprints.
 
Indeed
Yesterday I read that COBOL supported self modifying code at one point
 
Just make a daemon that starts on login, and checks the current date every few seconds. If it's the beginning of the Mayan long cycle, delete the file (which should be kept in the Windows registry, to be flexible). There's no need to ever remove/uninstall the daemon. Let it crash if the registry entry is missing.
 
I think the only (intentionally) malicious code that I've ever written was one that did a binary search to find out the amount of remaining space that a drive had and fill it up to the last byte with a single file.
My roommate then ran a network scanner - got a list of all the computers on the network (it's a dorm) that were unlocked, and ran my program on all those shared folders...
hehe
 
9:08 AM
lol
 
*hidden file as well
 
@Mysticial there is only one file... the exe file only...
 
the only malicious code I ever wrote was an exploit to run calc.exe on the victim machine
 
I've also done all sorts of stuff like putting fake BSOD screensavers into someone's startup programs.
That was hilarious.
 
9:11 AM
as well as a "slow computer to a halt" program that allocated 100MB chunks of memory until one returned NULL. Then random accessed all of it to page the system to a halt.
*and put that into the victim's startup programs.
 
I've been tempted a few times to write a driver that BSOD's the system. I don't know, like set the IRQL to the wrong level for whatever you're doing.
 
I always stopped short of actually damaging files though...
Wasn't quite evil enough to do that...
 
me neither
just sometimes it's tempting
lol
 
The only malicious code I ever wrote was a server that allowed me to: move around the mouse of the host; type on behalf of the host; do text-to-speech on the host; open/close the optical drive tray; force the current window position to be that of the mouse (when done repeatedly, this one was awesome); other stuff I don't remember. I installed that on the global startup script that ran for everyone in school (don't ask how I got admin privileges; I was evil back then).
 
haha
Reminds of me of when I secretly plugged in my wireless mouse receiver into my roommate's computer.
 
9:15 AM
hahah
 
The text-to-speech bits proved so popular that some dudes started using it for doing silly chats.
 
lol
how's the doc reading Robot?
 
I think the worst one I've been hit with is when my roommate changed my Vista temperature sidebar to Celsius.
 
@TonyTheLion I'm going to start playing around with the code now.
 
OMG, that must have confused you
@R.MartinhoFernandes ohh sounds like fun.
 
9:18 AM
So it would read like 10 degrees. I thought it was Fahrenheit. So I went outside in a my heavy winter coat.
And I was like
WTF?!?!?
 
oh lol
 
I was like "fuck you, fuck you, fuck you" to him for the next week.
 
best prank EVAR.
 
TRWTF is the Fahrenheit scale.
 
The problem is that the weather in Chicago is really chaotic enough to have 50 degree swings every day.
So I totally fell for that prank...
 
You're late
 
I know, I should have clicked the link a few days ago
but meh
 
user1357851
I was wondering whether it is possible to kayak into Canada from Chicago
 
how's everybody doing this morning?
 
user1357851
its not terribly far
 
user1357851
9:24 AM
evening 4 me
 
user1357851
Is it wrong for me to hold a baby birdie like this: pbs.twimg.com/media/A4XOSG4CEAIHkH9.jpg:large
 
@LuchianGrigore regretting ever having made certain decisions in my programming career
 
Oh yeah, we've all been here
 
And working out the kinks in said decisions as we speak
 
9:29 AM
Well, I have
 
@R.MartinhoFernandes It's normal for human beings
 
I'm about to make a very big decision. That I hope I won't regret.
 
I don't know if I told you guys about the time I wrote void foo(std::string x = *new std::string())...
 
Not out of choice though.
 
In production code nonetheless
 
9:30 AM
But it looks like I've been had with my school.
 
In my case, my bad decision was attempting to do what my fellow programmers wouldn't touch with a ten-foot pole, all in the name of getting a potential client
 
@LuchianGrigore OH, gawd.
Yes, you have.
 
Stupid me, I said, "I can do it."
 
Well... it still haunts me
don't work there anymore, hope someone saw it and corrected it.
 
user1357851
why did you do it in production code?
 
9:31 AM
@Neil that doesn't sound right.
 
@Telkitty Because he sucked back then.
Well, he probably still sucks, but not that much.
 
user1357851
lol
 
user1357851
I would do it as a test
 
@LuchianGrigore Well in fact I should have listened to my more experienced programming colleagues
 
user1357851
9:32 AM
but not in production
 
I realized that it isn't that he couldn't do it, it was that he said he couldn't so he wouldn't have to deal with that hassle
 
@Mysticial so you quit your phd?
 
@R.MartinhoFernandes I think I said this before, but when it comes to C++, you can't not suck... you just suck less and less as time goes by, but you still suck...
 
@LuchianGrigore Yeah.
 
user1357851
suck is in the eye of beholder
 
9:33 AM
@bamboon Right now I'm 90% leaning towards it. After having a long discussion with my parents, it's clear that the conditional pass requirement for my Qual were intentionally set so high that it's impossible for me to satisfy.
 
user1357851
always space speed code beauty maintanence treat off
 
The reason why the school did that is quite obvious.
 
They want you out?
 
@Mysticial that's lame
 
9:34 AM
They would have to do some serious explaining if they failed a fellowship student. So instead, they're gonna push me out "voluntarily".
 
@R.MartinhoFernandes Or they want him to stay longer.
 
But they did it in a very sneaky way. It took me a few minutes to realize it, and a second opinion from my parents to confirm my suspicion.
 
user1357851
@Mysticial my parents are the opposite, they kept me making themselves and me believing I would be a failure ... sry to diappoint them I am not
 
@LuchianGrigore It's like temperature.. no such thing as hot and cold, only measurements of energy with respect to absolute zero. And for us programmers, there are only measurements of suckiness with respect to perfect to which no programmer can ever hope to achieve
 
@Mysticial screw them, get into a real company and change the world
 
9:35 AM
@Neil Because there can be only one, and that's me. Right?
 
I feel cheated. But if they were trying to do it without me realizing it, it didn't work.
I saw right through them.
 
@R.MartinhoFernandes *scratches back of head and avoiding eye contact* Yeah sure.. what you said.
 
user1357851
@bamboon once you work for a major corporation you can not change the world unless you are the ceo
 
*I suspected it. And my parents (who have many more years of dealing with people than I do) confirmed my suspicion.
 
@LuchianGrigore Hate to bother you, but can you look at something for me ?
 
user1357851
9:36 AM
you are just a screw in a huge machine
 
@Telkitty wrong, it's the engineers who change the world not the CEO
 
@WhozCraig at what?
 
user1357851
keep on telling yourself that
 
@Mysticial It all sounds incredibly asshole-ish.
 
@R.MartinhoFernandes Lemme explain the entire situation. So I can't really put the blame on them.
 
user1357851
9:38 AM
@bamboon if you can so can 500 other engineers in the same building
 
user1357851
world changed 500 times by 1 company
 
user1357851
and there are 100000 of those companies
 
@Telkitty hmm, yes? that's what teams are for
 
@LuchianGrigore It was a boundary condition with potential infinite recursion, this question
 
Basically, I'm one of only Ph.D students who failed the qual miserably both times. So technically, I would've been kicked out immediately. However, I'm also one of only two students in the department that won the NSF fellowship (which is fucking hard to get). To top that off, I still hold the Pi world records, and as well as the top answer on Stackoverflow.
 
9:39 AM
@LuchianGrigore I can't see any infinite case. Just needed a second pair of eyes. if you have the time. thx.
 
So if the school kicked out the simply way, they would have some explaining to do.
And some potential PR backlash from the NSF sponsors.
 
So, instead of dealing with the consequences, they are fucking with you. Yep, assholes.
 
@WhozCraig sorry man, that's tl for me to look at right now.
 
So instead of kicking me out directly. They're going to make me "voluntarily" leave.
By setting the conditional pass requirements so high that I can't possibly satisfy them.
 
user1357851
@WhozCraig trying to find the middle value?
 
9:41 AM
That way, they can say, "He left on his own will. We didn't kick him out."
 
user1357851
@Mysticial life goes on
 
@Mysticial Man that sucks
 
user1357851
@Mysticial so what if you fail, you probably ends up doing more interesting things
 
I do think there is something you can do about it though
 
@Telkitty That's what I'm thinking too. It's probably good for me.
 
9:42 AM
You can push back and threaten to get a lawyer and a good journalist if they don't at least give you another chance
 
To say the least, these last 3 years I've been in this corn field haven't been too good to my mental and physical health.
 
@Telkitty No. it was a boundary condition, return true if an array has any value in range [lwr,upr] as one of its elements. Looks like there isn't an infinite case, but I really should check for a zero-length source vector. its all good. thx.
 
though that's kind of asshole-ish and I probably wouldn't be able to do something like that
but it would probably work
 
@LuchianGrigore no worries man. I think its covered. have a stellar eve.
 
My brother got 2nd in his class when he graduated. My marks weren't nearly that good
My parents were always supportive but were careful never to make comparisons, but still it's kind of hard to just ignore certain expectations like that
 
user1357851
9:45 AM
I was one of the worst in the class back in primary school
 
user1357851
very good for my mental state nowadays
 
Now to tell (what I think is) their side of the story. My productivity had been steadily dropping ever since I joined the school.
 
user1357851
because you fail so much so young it makes you bounce back real fast
 
If I had to guess why, I'd say that it's a combination from being burned out from 20+ years of school + my steady deterioration of overall health.
So they do have a reason to get rid of me.
 
user1357851
@Mysticial go for a jog or a hike or something
 
user1357851
9:47 AM
or ocean swim
 
I'm in the middle of a corn field. There really is nothing here.
 
user1357851
you doing phd in the middle of a corn field?
 
@Mysticial It might feel that way, but you're just going through a mental breakdown
That sounds ugly, but those are fortunately temporary
 
@Mysticial Yes, but instead of doing just that, they're playing with you.
 
@Neil I am actually. Especially starting from about March.
 
user1357851
9:49 AM
@Mysticial can you take 3 months leave and do something else
 
user1357851
and go for an holiday
 
@Telkitty Not really. The conditions have been set. I can't change them.
 
@Mysticial I went through that at my university during the period in which I was having to juggle several demanding graduate classes and a thesis to write
Burns you out quick and makes you question if it is really worth it
 
So I'll be leaving with just Masters degree in May.
And I'll be terminating my NSF fellowship after that.
 
user1357851
I have a few friends who did not finish PHd
 
user1357851
9:51 AM
they are doing fine
 
user1357851
you call yourself Phd candidate
 
So right now, what I need to figure out a way to talk to my professor and the department.
 
@Telkitty You kidding? he can't put that on his resume
 
Let them know that with 90% probability, I'll be leaving in May.
 
user1357851
yes you can
 
9:52 AM
What you guys use as type of ID variable, usually? I mean "using int as type of i-counter in for-cycle is bad, use size_t instead" - that i understood perfectly. Is there any advices about type usage for other types of variables?
 
You can but you shouldn't
Not unless you can answer the question "Why did you quit college?" with a decent answer in your interview
 
user1357851
@Neil I am seriously my friends did not finish PHd, they put PHD candidate on their resume
 
user1357851
it is legit
 
user1357851
its on their linkedIn
 
But it's tricky because I need either Ph.D student status or NSF fellowship status to maintain my tuition waiver. So I can't pull the plug on both at the same time.
I need to play this right.
 
9:53 AM
@Telkitty I just mean that could be a tarnish as well as a help
 
user1357851
but for them they found good jobs before quit PHD
 
It would be less of a tarnish if you almost finished your bachelors since jobs which require bachelors aren't exactly requiring high levels of competency nowadays
Though someone asking for a phd would have a more difficult time hiring someone who almost finished phd and then dropped out
 
moaning
 
at least imho
 
user1357851
master is good enough unless you want to get into research or teach in universities
 
9:55 AM
One does not simply
Ask for a PHD
 
@Telkitty Right, in fact I would recommend he put down his masters degree and nothing more
 
(I thought you need to earn those, not just "ask" for it)
 
@sehe Apparently you can ask for one if you're hiring
 
user1357851
I suggest him looking for a job before he officially quit
 
My dad also make a good point that I'm currently at my most "productive" age of my life. (mid-20s)
 
9:56 AM
@Neil I sorta kinda understood, ta
 
user1357851
@Mysticial sounds you are burnt out
 
And that I should use it to something productive.
 
user1357851
totally need holiday
 
@Telkitty ? au contraire
 
@Telkitty I definitely do.
 
9:57 AM
@Mysticial Ignore that advice or it'll drive you up a wall
You can't force productivity.. it comes from loving what you do and becoming good at it as a consequence
 
@Neil What he means, is that he also favors that I leave the school and join a startup or something.
 
If you're burnt out, the last thing you need to hear is that you should be productive
 
@Mysticial makes sense. Keep in mind that the highly effective don't actually decline. Perhaps in terms of physical/mental energy, but not necessarily in terms of output and originality of work. That's just a myth based on averages.
 
@Neil That's not what he was talking about. What be means is that mid-20s is when a person is most likely to make the biggest things (achievements, ideas, etc.)
 
user1357851
@sehe not true
 
9:58 AM
And I shouldn't waste it being stuck in a school if it isn't gonna get anywhere.
 
@Telkitty Bwahahahaha. Get out. Your opinion is to simply refute mine without any arguments?
 
user1357851
@sehe some people are like cats ... rest and burst
 
user1357851
constantly 'productive' people reminds me of turtles
 
@Telkitty Anecdotal evidence is a fallacy. Some people are just dumb, also true
 
@Mysticial I've heard that before.. statistically if you've reached 30 and haven't written a book yet, you never will, for instance
 
user1357851
10:00 AM
@sehe MOST* people are dumb
 
@Telkitty I'm just defusing the 'pressure bomb' by pointing out many people have shown that you can grow, excel after your prime years
 
user1357851
@Neil how about you have written half a book before 30
 
yesterday, by sehe
@Cheersandhth.-Alf probably around 2200% of Americans are idiots: http://www.wolframalpha.com/input/?i=%28world+population%29%2F%28population+of+U‌​SA%29
 
@Telkitty Of course not
 
user1357851
10:02 AM
@Neil Must ... think ... Susan boyle
 
user1357851
@sehe people who do usually ready have the potential to start with
 
user1357851
just have not manifest it
 
@Mysticial But look at some of our scientists who have been breaking new ground till the very ends of their lives. Learning entire new domains well past their prime years, too. Just balancing the common sense a bit: statistics don't lie, but there is no need to personally conform to the statistics.
 
user1357851
not that they don't have the potential in their younger years
 
@Telkitty I don't know who that is (aside from what wikipedia has shown me about her)
 
10:03 AM
Note that I'm not saying you can 'laze out/chill' because, I firmly believe that you will not suddenly gain momentum you never had after your prime years. However, there's no reason think it is all down hill from now
 
@sehe I do know that they are just statistics, but I do have other things that I wanna do before it's too late.
 
@Mysticial Like?
 
I won't go down the whole list, but being closer to my grand parents is a big one.
 
In my experience, the best way to get true genius flowing is by programming something because you want to and because you have no one to impress
 
@Mysticial Hm. Geographically or relationally?
 
10:05 AM
both
 
@Neil Assuming programming is your thing....
 
they're all in their 90s.
 
@Mysticial Go for it. You could do this for some time. Think of the other 'works' you could do in the meantime. If there is such a thing. Otherwise, just find Buddha where it finds you
 
user1357851
@Neil not quite true because sometimes I create/make things to impress myself
 
user1357851
dunno but I find sometimes play with local wildlifes help
 
10:08 AM
@Mysticial I'm also of the firm conviction that one always has ample opportunity to make difference as a human - no need to be in papers, the news, university or land on the moon.
And, if you're on the right track and you keep an eye open for the right opportunity, you'll just seize it when it is there, because you basically know what you want
 
@sehe Oh that I'm good at... At least on SO.
:)
 
> Luck is what happens when preparation meets opportunity [Attributed to Seneca]
 
user1357851
so is preparation the mama or opportunity the mama
 
^ you could bring the works of Seneca and perhaps a Bhagavad gita :)
(/@Mysticia)l
 
sigh...
anyways... 4AM here.
 
10:12 AM
@Telkitty there's no right answer to the wrong question
@Mysticial Number 1: don't stress about things you can't really change or even gauge. Do what makes you happy. Remember that hard work can make you happy, but it doesn't need to be hard academic work. Depends on what you really want, what drives you
 
@sehe Sometimes there is. You'd be amazed how many questions can be answered with "Fuck you"
6
 
user1357851
can we say then preparation is opportunistic then?
 
@R.MartinhoFernandes I might try that one day
 
@R.MartinhoFernandes Oh that's a good one.
 
@Telkitty You can say a lot. Be prepared to be ignored though
 
user1357851
10:15 AM
?
 
user1357851
surely if you want to ignore you you would already have
 
user1357851
afk
 
@Telkitty Well you know what I mean.. You're obviously not going to create a crappy program for yourself and call it genius
@sehe Assuming genius is your thing...
 
user1357851
@Neil depends how high your standard is
 
@Telkitty Maybe, but that's not true genius as I see it
 
user1357851
10:25 AM
because at the end of the day you can stay away from everyone but you can not stay away from yourself
 
user1357851
so the one can truly makes yourself happy is you*
 
0
Q: Constructor and Destructor of a singleton object called twice

bikram990I'm facing a problem in singleton object in c++. Here is the explanation: Problem info: I have a 4 shared libraries (say libA.so, libB.so, libC.so, libD.so) and 2 executable binary files each using one another shared library( say libE.so) which deals with files. The purpose of libE.so is to wri...

 
LOL I've visited SO for 666 days. Creepy...
 
1
Q: Meaning of ^ variables in C++

Oliver Weichhold Possible Duplicate: What does the caret mean in C++/CLI? I've just returned to C++ for a game related project for Windows 8/RT after many years of absence in favor of C#. Working with the generated Game Project Skeleton I've stumbled upon method signatures like the one below. Could a...

Can this be reopened? (rationale in comments)
 
@Telkitty Reminds me of a ted talk I saw which talked about how optimists when something positive happens think, "Right on.. props to me" while pessimists will think, "Well that time I was just lucky.. "
Hence pessimists are forever doomed to second guess themselves and never reward themselves for a job well done that would otherwise give positive reinforcement to the brain to encourage that behavior
 
10:34 AM
Thanks guys.
 
user1357851
Dunno I am surrounded by negative people I think
 
user1357851
who kept on telling me what I can not do
 
user1357851
do just went on & did the things I was told I was not able to do
 
user1357851
doh how they were wrong
 
user1357851
the funny thing is that after a while I lost my own confidence
 
user1357851
10:36 AM
until 20 years of such experience
 
user1357851
I slowly re-gained my confidence
 
user1357851
because negative people kept on getting things wrong
 
what people don't seem to understand is that outlook on a situation affects your ability to make said situations
being positive generally has positive effects, which is not without a certain irony
 
10:51 AM
How does one can apply std::bind to __stdcall function? I can't find an valid answer, all related to std::bind
 
If you can't find the answer, post a question yourself?
 
@Ivan0x32 use a lambda
 

« first day (754 days earlier)      last day (4199 days later) »