Singing card guts

July 29, 2008

Ever wonder what’s inside those insufferable singing cards? I sure have. Well, I got one a week or so ago from my coworkers, when they took me out to a good-bye lunch. (It plays Smash Mouth’s “All Star”, in case you were wondering, which I guess you probably weren’t.) A few strategic surgical cuts, and voila:

The internal guts of a singing card.

The internal guts of a singing card.

Nothing too surprising, I guess: a speaker, a lithium battery, and a little bit of circuitry with a simple switch at the top. The switch consists of a metal flange which presses against a contact beneath it, normally separated by a little plastic tab. When you open the card, the plastic tab gets pulled out from between the contacts, closing the circuit and activating the awful music.

Now to figure out what to do with a small speaker and a lithium battery.


Call for an ICFP Mars Server!

July 16, 2008

Hear ye, hear ye! I hereby call upon:

  1. The ICFP programming contest organizing committe (great job, by the way!) to release the source code for their Mars simulator (but NOT necessarily the maps that will be used to run the actual contest tournament), and
  2. someone TOTALLY AWESOME to take said source code and from it create a Mars Server where anyone can upload a rover controller (and maybe new maps as well), and the server will continuously run a tournament with continuously updating scores and leaderboards. This will have nothing at all to do with the real ICFP contest, of course, but it seems like the one thing most people are complaining about is the lack of feedback — this would be a fun way to get some great feedback that wouldn’t put any additional burden on the organizing committee.

Yes, I realize this poses various security risks and technical challenges. And yes, I realize I should just shut up and do it myself, except I don’t really have the requisite technical know-how to set up such a server. And yes, of course part of my motivation in suggesting this is that my team failed to actually make a submission.

But forget all of that. It would be FREAKING AWESOME.

Now, go forth and do my bidding carry out my suggestion? Pretty please?


ICFP programming contest reflections

July 15, 2008

This past weekend, I participated in the 11th ICFP Programming Contest, together with Christophe Poucet, Johan Tibell, Johan Liesen (all in Switzerland) and Cale Gibbard (in Ontario, Canada), coding in Haskell. The task this year was to write a controller for a Martian rover, which received data about the rover’s surroundings, and issued commands to the rover to guide it safely back to its “home base”. This was my first time participating (I wanted to participate last year but couldn’t/didn’t, for reasons I no longer recall), and I must say that I had a lot of fun! Here are a few of my recollections, experiences, and reactions, in no particular order…

I wasn’t super excited about it for the first 48 hours or so (Friday evening, Saturday, and Sunday morning)… too much networking, GUI construction, asynchronous communication, messy stuff that I don’t really enjoy. I felt obligated to my teammates, though, so I made myself generally useful doing some mathematical analysis, working on a few analytic geometry tools, and creating some test maps, while taking long breaks to go to a barbecue, sleep, spend time with my wife, and go to church. I definitely enjoyed myself, but just couldn’t find anything to be really excited about. On Sunday afternoon/evening, though, I found something to be excited about: I spent all evening writing a quadtree implementation and using it to keep a granularized representation of the discovered obstacles in the world. I got a few hours of sleep and then got up again at 4:30am to continue, implementing a way to take a quadtree and generate a graph representing the connections between the empty regions in the world. Cale arrived shortly after I started in the morning and implemented an A* search routine at the same time, as well as some code for simplifying the paths that were generated and some code to glue the quadtree and A* stuff together. By midday on Monday, we had basic path planning working: it was pretty sweet watching our rover get around big walls and solve rudimentary mazes. I got a huge kick out of writing some fairly complex “theoretical”-ish code, and have it actually work and produce a tangible improvement in our rover’s behavior. Maybe later on I will post some of the code.

One strange occurrence during the contest took place while I was out for a few hours — someone apparently took an IRC nick similar to mine (with an appended backtick), logged in claiming “connection troubles” to explain the backtick, and proceeded to have entire conversations with my teammates, who didn’t notice the switch since the impersonator was able to keep his replies generic. When confronted later (under a different nick, in the #icfp-contest channel) he said he did it “for the lulz” although that sounds rather implausible. I can only surmise he hoped to get some code or ideas he could use in his own contest entry. In the event, he didn’t end up gaining any information that would have been very useful, but regardless, I was surprised how angry I felt when I discovered that I had been impersonated. Identity and reputation are powerful assets, especially in an online community.

The sad ending to the story is that due to a combination of poor decisions, miscommunication, last-minute bugs, and network outages, we submitted our contest entry… nine seconds too late!! =( It was a rather disappointing end to an otherwise excellent experience. We have no one to blame but ourselves, of course… but I will always wonder how our submission would have done… (although we most definitely weren’t going to win).

Now, post-contest, I’m almost done digging out from under the pile of emails, rss items, and dirty dishes that piled up, unread and unwashed, over the weekend. =P But I’m already looking forward to next year’s contest, with a few lessons learned: (1) I would prefer working with a co-located team, or at least on a team with one other member in the same physical location as me. The remote thing worked ok, but I would have enjoyed more interaction and feedback. (2) Submit early and often! =( (3) I should have just jumped into the more theoretical algorithms stuff right away, instead of fiddling around for a couple days first! Next time I’ll try to think more critically about what my strengths are and how I can apply them — even if it means building something which might only be usable a little ways down the road. By the time I finish it, it will probably be usable!


Follow

Get every new post delivered to your Inbox.