Django TestCase Comedy

Here's a little snippet that'll entertain the vast throngs of people who are interested in both Rock Paper Scissors strategy and Django unit testing.

def test_desperate_futility_of_avalanche(self):
        for futile_attempt in range(100):
            Round.objects.create(game=self.normal_game,
                                 initiator_choice=self.rock,
                                 opponent_choice=self.rock)
        self.failUnlessEqual(self.normal_game.result(), UNRESOLVED)

For the uninitiated:

A Simple Stack Overflow-Style Badge Framework for PHP

badgesI'm pretty infatuated with Stack Overflow's badge system, so I decided to cook up a generic framework for adding one to my crossword site. Herein I will present my work in progress for the consumption of my dear readers.

The storage of these badge-awarding rules seemed interesting to me. It'd have to be flexible enough to take data from any part of the site related to a user, and not be a hassle to add new badges or check a user's list of acquired badges. I haven't put the caching in yet, which would form the basis for making awarded badges permanent, instead of calculated on the fly, but it's still pretty fun to work with.

Continue reading "A Simple Stack Overflow-Style Badge Framework for PHP"

On Writing a Simple Google Wave TODO List

Screen shotGoogle Wave has been accused of being a way to make people feel like how older people feel when they use the internet. I definitely found this to be true during my first couple of weeks using the platform. The volume of stimuli received even in a three-person wave can be pretty overwhelming.

I figured that I'd need to write a little Wave gadget before I actually grokked the platform. I figured that a to-do list would be somewhat useful and fairly simple to code up. I built this thing up one day on my lunch break.

Here's a link to the gadget for your consumption.  I've started a public wave for feature requests and discussion and such.
Continue reading "On Writing a Simple Google Wave TODO List"