fun

Another way to use continue keyword in C++

Recently we found a "good way" to comment out lines of code by using continue: for(int i=0; i<MAX_NUM; i++){ .... .... //--> about 30 lines of code continue; ....//--> there is about 30 lines of code after continue .... } I scratch my head by asking why the previous developer put the continue keyword inside the intensive loo...

How and when to properly use *this pointer and argument matching?

When I go thru the code written by collegue, in certain place, they use: this->doSomething(); //-->case A doSomething(); //-->case B In fact I'm not sure about the great usage of *this pointer...:( Another question with argument matching: obj.doOperation(); //-->case C (&obj)->doOperation(); //-->case D In fact both cases are per...

Funniest technical explanation?

Every so often I get asked for an explanation for some programming-related bit of jargon. Sometimes, if I know the person who's asking will get the joke, I make up the answer. For example, today the word "blitting" crept into an email thread and one of the S&M folk replied, Not too sure what "blitting" is; a technical term perhaps ...

Code Golf: Playing Tetris

The basics: Consider the following tetrominoes and empty playing field: 0123456789 I O Z T L S J [ ] [ ] # ## ## ### # ## # [ ] # ## ## # # ## # ...

How can I automatically start playing music upon entering of Konami code when visiting website?

Could someone help me create some javascript to perform the following behavior. Upon the entering of Konami Code while at a website (see:: http://files.www.gethifi.com/posts/konami/index.html for example), I want an mp3 to start playing in the background. I want to do this without any external library, such as jQuery. Thanks in advanc...

Interview Question - How to programmatically screw in a lightbulb

Below is an interview question I've been pondering using to test an interviewee's critical thinking and creativity skills. Leave the interviewee alone for 5-10 minutes and have him/her answer the following question: How would you programmatically screw in a lightbulb? Answers I would be hoping to see would be similar to: bool FixLigh...

How long does it usually takes before you finally post your problem stackoverflow?

Recently I realized that most of my coding problems are solved either by digging stackoverflow archive or simply asking question here. Still, I spend lots of time fooling myself I will manage to find the solution without any help. It usually results in really high frustration level and the whole thing ends at stackoverflow anyway. So ...

1 Million 1337 Questions on StackOverflow!

This is off topic, so it will be closed and downrated, however, I had to let everyone know about the momentous 1 Million and 1337 questions that have been asked on SO. Everyone should take a moment to reflect. ...

Is there any "evil" badge...

...for those touching the 666 in reputation? ...

BBC Radio 1 Developer Soundboard

At BBC Radio 1 we've built a customisable soundboard for our DJs, e.g. Tim Westwood. So we're rolling out a soundboard targeted at developers: http://www.bbc.co.uk/radio1/soundboards/developers So far we've got a really great "Deployment bomb" that we hit whenever we release a new feature on the site, but there are loads of other sounds...

Algorithm to calculate the number fortnightly occurring events in a given calendar month.

I'm looking for the cleverest algorithm for determining the number of fortnightly occurring events in a given calendar month, within a specific series. i.e. Given the series is 'Every 2nd Thursday from 7 October 2010' the "events" are falling on (7 Oct 2010, 21 Oct, 4 Nov, 18 Nov, 2 Dec, 16 Dec, 30 Dec, ...) So what I am after is a fun...

Is there programming language which can tolerate runtime errors?

Is there a programming language which can consume the following input: m = 1; n = 2/0; print(n); print(m); and successfully print "1" on the screen? Maturity of that language and quality of implementation doesn't matter much. EDIT: Don't take question explanation literally. I'm not interested in division by 0. I try to find a langua...