Someone will lose some hair over this /* create memory leaks if compiled on April, 1st */ #define free(x) if(strncmp(__DATE__, "Apr 1", 6) != 0) free(x) The random ones are just pure evil.
Things to commit just before leaving your job
41–50 of 165 posts
Re: Things to commit just before leaving your job
#42Something I wrote to amuse the junior front end developers here: document.write('Error: Script not found.'); var node = document.currentScript; if (node.parentNode) { node.parentNode.removeChild(node); } Pop that in a JS file called something like jQuery.min.js and add it to an HTML page with the usual . It'll run when the page loads, add the line of text to the page, and then it'll remove it's own tag so there's no…
Re: Things to commit just before leaving your job
#43But also a great war story for the person who discovers it later.
"So it was my 5th sleepless night. The thing would work 99% of the time. I triple checked every single line of code and it was still formatting the hard drive from time to time. Then I discovered:
#define if(x) if ((x) && (rand() "
Re: Things to commit just before leaving your job
#44It is always a funny joke to say "commit this when you leave a job". But I always wondered if there are people that actually do this. Although it could be funny and give a sense of revenge for some wrong (perceived or real) that the person leaving might have suffered, I don't think this would be a good idea. Contracts usually include liability for gross negligence or wilful misconduct. Does anybody have a record of t…
However, I threatened to use this for the company I quit in 2010 and the threat was enough. We were negotiating and they thought a share of 100-0 in favor of the employer was ok. The law was 100 in favor of the employee. After threat we ended up at 50-50.
Re: Things to commit just before leaving your job
#45I had a professor back in the university that changes all the variable names to beer names while at a job. It ended up not being a problem for the company as he was consistent with the names.
Was hilarious :-|
Re: Things to commit just before leaving your job
#46Re: Things to commit just before leaving your job
#47It is always a funny joke to say "commit this when you leave a job". But I always wondered if there are people that actually do this. Although it could be funny and give a sense of revenge for some wrong (perceived or real) that the person leaving might have suffered, I don't think this would be a good idea. Contracts usually include liability for gross negligence or wilful misconduct. Does anybody have a record of t…
Re: Things to commit just before leaving your job
#48Earlier quoted context omitted.
> Omitting volatile can lead to nasty concurrency bugs (e.g. if the optimizer optimizes spin locks away). In the worst case, such bugs are extremely hard to reproduce (and thus debug) but lead to deadlocks and/or crashes in case they do occur. In C and C++, volatile is not intended and must not be used for synchronisation primitives, it is not a memory fence (so it does not force cache coherency and does not prevent…
Thanks for clearing that up. I worked with threading a lot in C# hence my misconception that it could be used for spinlocks in C/C++ too.
Re: Things to commit just before leaving your job
#49The tech world is big in some ways, but also equally small in others. A select few might find this funny, but others will not appreciate their day (or longer) spent debugging your practical joke...and on the chance you actually get something like this onto production, well now it won't just be your developer buddies you got off side.
Re: Things to commit just before leaving your job
#50Earlier quoted context omitted.
Will you explain what this would do?
Of course :) Basically this removes the volatile keyword from your code and replaces it with... nothing. If a variable is declared volatile, it disables compiler optimizations and signals the compiler that this variable can be modified at any time (e.g. by hardware or other threads). Omitting volatile can lead to nasty concurrency bugs (e.g. if the optimizer optimizes spin locks away). In the worst case, such bugs ar…