fun

A little diversion into floating point (im)precision, part 1

Most mathematicians agree that e ** (πi) + 1 = 0. However, most floating point implementations disagree. How well can we settle this dispute? I'm keen to hear about different languages and implementations, and various methods to make the result as close to zero as possible. Be creative! ...

Most elegant, amusing or strange code one liners

As an example I offer this, which was used to clear the screen in COBOL. DISPLAY SPACES UPON CRT ...

What is your programming record in a single sitting?

How long (in hours) have you coded in a single sitting (one session)? ...

Computer Language puns and jokes

I'm looking for some funny jokes and puns that occur in computer languages. I'll post an oldie to kick things off... What are some others? update: Especially looking for code-related jokes... the ones that only make sense to programmers reading code. ...

What is the most brilliant regex you've ever used?

I'm constantly amazed by the power of the regex. What I'm looking for here is: Regexs that are more cleverly badass than ridiculously badass Regex replacements are acceptable as well if you've had some cool usage of them Refactored code to use a regex and make it more efficient Refactored a large regex with a smaller one Humorous rege...

Why do 'the others' think you can fix their computer?

Whenever I'm explaining what I do for a living (software developer, for example on a party and they had to ask), people tend to make a strange neuro-link: He does something with computers I do not understand --> I have a computer --> My computer is broken --> I do not understand why --> He should be able to FIX IT. When did I say I fix...

Where can you find fun/educational programming challenges?

I've searched around for different challenge sites, and most of them seem to be geared towards difficulty in problem solving logically, rather than trying to use your language of choice to do something you haven't used it for. Their center is around mathematics rather than function design. Some kind of point system for correctly solvin...

How do I write a sort worse than O(n!)

I wrote an O(n!) sort for my amusement that can't be trivially optimized to run faster without replacing it entirely. [And no, I didn't just randomize the items until they were sorted]. How might I write an even worse Big-O sort, without just adding extraneous junk that could be pulled out to reduce the time complexity? http://en.wi...

Hello world: what did your first ever computer program do ?

If you can remember that far back, what did the first computer program you ever wrote do (once you had finished debugging it)? ...

Best Language for an AJAX-driven "Reputation Index"

I'd like to produce a fun AJAX-driven "Reputation Index" taking from Cory Doctorow's book "Down an Out in the Magic Kingdom" where "Whuffie" is a measurement of reputation/currency. I'd like to allow people to create accounts, login, see other people and assign positive or negative amounts of "whuffie" to them. There would then be an "o...

Great programming quotes

There are a lot of great programming quotes out there. Which do you like? Today (Sept 12, 2008) I heard a new one from a friend, Lars-Gunnar, he said "Gud finns i Emacs" (in Swedish). This basically means "God is in Emacs". Still laughing about it here :) What he meant was that a function "gud is grand-unified-debugger" is in Emacs. A ...

Stack overflow code golf

To commemorate the public launch of Stack Overflow, what's the shortest code to cause a stack overflow? Any language welcome. ETA: Just to be clear on this question, seeing as I'm an occasional Scheme user: tail-call "recursion" is really iteration, and any solution which can be converted to an iterative solution relatively trivially by...

How would you explain binary to your grandmother?

I recently bought a shirt with this great quote on "There are 10 types of people in the world, those who can read binary, and those who can't." Now I find myself having to explain it to everybody! How would you explain this shirt to your grandmother, mother, kid, etc... ...

What are the best anti-code sites?

What are the best anti-code sites that people have found? What I mean by "anti-code" is websites, books, blogs, etc. that describe or explain bad code with the tongue-in-cheek goal of showing us what we should not do. (I made up the phase anti-code for lack of a better term.) These are the sites I'm familiar with: How to write unmaint...

What's your favorite "programmer" cartoon?

Personally I like this one: P.S. Do not hotlink the cartoon without the site's permission please. ...

Obfuscation Puzzle: Can you figure out what this Perl function does?

sub foo {[$#{$_[!$||$|]}*@{$_[!!$_^!$_]}[email protected]{$_[!$..!!$.]}[$_[@[email protected]+]% @{$_[$==~/(?=)//!$`]}..$#{$_[$??!!$?:!$?]},($)?!$):!!$))..$_[$--$-]%@{ $_[$]/$]]}-(!!$++!$+)]:@{$_[!!$^^^!$^^]}]} update: I thought the word "puzzle" would imply this, but: I know what it does - I wrote it. If the puzzle doesn't interest you, please don't waste any ti...

What fun things do you do to release stress at the office?

In our office, we've got a bunch of finger blasters: And nothing beats shooting the hell out of QA who are just located meters away. One of our developers can consistently get "head shots" within a 10 meter range .. List other fun things that you guys do! ...

What do you do during a build?

At the moment I'm working on a project that has a lot of downtime. It takes 10 minutes to load the development environment, builds can take half an hour, loading the application for debugging sometimes takes 15 minutes. I would like to know what sort of productive work (besides contributing to StackOverflow) people do during these times ...

Do you code just for fun?

Do you have projects you work on in your spare time, just for the fun of it? What do you do? What techniques/technologies do you use? Is this a reason for the project? Have you gained something? Has it become a real product you make money from? ...

What is your funniest end user story?

I was supporting a product I had written and got a call from a frantic user. She said that the screen was going crazy and asked me to rush over to her office to see what was going on. I double stepped up two floors and hurried into her office. As soon as I got in I saw the problem and moved the notebook off her keyboard :) What are some...