Archive for 2011

Dashboard Widgets - Reach Challenges and Xbox Live Gamercard


A few months ago I finally gave in and bought a MacBook Air, and I haven’t looked back. At this point I’m using my Mac for most of my day-to-day computing, and I’m very happy with it. It’s certainly much friendlier to the predominantly Ruby-based web development I like to do. As a first dip of the toes into Mac programming, I decided to try to make a couple Dashboard Widgets. Dashboard is the Mac widget platform, sorta like Windows Sidebar only it came first and it’s a much better platform. Dashboard widgets are relatively full-featured, built on Webkit using HTML and JavaScript, and can be authored with the free DashCode IDE. I found working with Dashboard to be a little frustrating, and it’s clear that Apple isn’t investing much in that space anymore, but it’s still miles ahead of the excruciating experience of developing Windows Sidebar gadgets.

My first widget was an ultra-simple Xbox Live Gamertag widget, which was basically a straight port from the Windows version. Aside from the preferences, which are now on the “back side” of the widget instead of a fly-out panel, not much is different.

The second widget is a bit more complex - it shows the current challenges available in Halo: Reach. Every day (and week) there are new challenges players can meet in order to get credits to buy in-game armor. This widget helps keep that info a keypress away.

Anyway, if you have a Mac, please head on over to my Dashboard Widgets page and give them a shot!

Update: Since Bungie has discontinued their Reach site, I’ve removed the Reach gadget.

JSONView 0.7 works with Firefox 8+

Just slightly ahead of the release of Firefox 8, JSONView 0.7 has been approved on the Mozilla Add-ons site. Firefox 8 actually handles JSON documents in the browser for the first time, reducing the need for extensions like JSONView - now, a vanilla Firefox will display JSON as plain text instead of prompting a download of the document. Still, JSONView provides much more than what’s built in, and it will continue to be compatible with Firefox going forward (and it’s still compatible with older versions all the way back to version 3.0). If you’re on a modern version of Firefox you’ve probably already updated, and if not, you’ll get the new version when you upgrade.

After this update, I’ll be starting work on version 1.0, which should include some power user functionality that a few people have asked for, as well as some infrastructure changes that modernize how JSONView works with Firefox. Please fork the code on GitHub and contribute if you have something you want to add!

JSONView 0.6

Last week I released JSONView 0.6 to This is mostly a bugfix release, but I honestly don’t want to change much about such a simple addon. With over 60,000 daily users at this point, I feel that updates should be infrequent and unobtrusive. I do plan for some big new features for JSONView 1.0, but for now I’m mostly keeping the extension working with newer Firefoxes and fixing bugs that affect existing features. That said, one big change since the last version is that the source code is now on GitHub. I’m hoping this makes it easier for other developers to contribute, so please send pull requests! I’ll probably move the issues list over to GitHub as well at some point, but for now they’re still over at Google Code.

JSONView 0.6 fixed a couple of bugs around formatting text, especially when odd Unicode characters were present. Where previously JSONView would stop showing content after those characters, it now shows the Unicode escape sequence. Also, when there’s an error parsing a JSON document, the original document is displayed with its formatting intact, rather than squashed into a single line.

However, the most important bugfix is that disabling JSONView from the Addons page will un-do the “Include ‘application/json’ in the HTTP Accept header for requests” option. This is especially important since some popular websites handle content negotiation poorly and break when that option is on. Netflix was one high-profile example, but they’ve fixed their site now. I explained why this happens in detail in the issue report, and I won’t be removing the option because of it, but at least disabling the addon will fix the issue (of course, just unchecking the option will fix it too). I’ve added a warning to the option as well, just in case. Honestly I don’t think most people should need to turn that on, which is why it’s off by default.

The last big change is sort of halfway between a feature and a bugfix - copying and pasting from JSONView’s output will produce valid JSON. This includes all the quotes that JSONView omits for readability, and doesn’t include the “+/-” symbols used for collapsing objects and arrays. Hopefully this makes it easier to copy and paste bits of JSON out of Firefox and into your code or data without having to rewrite it.

Please update JSONView (if it hasn’t updated automatically by now) or download it if you haven’t tried it yet, and check out the code on GitHub if you find any bugs or have a feature you want to see.

XBList is broken due to changes

Recent changes to have broken XBList. This happens every time they change, but this time the changes are too major for a quick fix. The way XBList works hasn’t aged well, and this is going to require some major changes. That combined with the fact that I don’t have very much free time these days means that it’ll be a while before there’s a new version that works again. Sit tight, enjoy a game, and keep an eye on this blog for more news.

Updates to Windows Sidebar Gadgets

I’ve made some minor updates to my Windows Sidebar Gadgets - the Challenge gadget works again after 360Voice moved their API endpoints, TopProcess has gained a French translation and clearer text when used on systems with IE9 installed, and the Xbox Live Gamercard gadget has been resized to fit the new gamercard design. Please reinstall those gadgets if you’re using them. Note that I’ve tried them all out on a system with IE9 installed and they all work - there were some problems with the beta version of IE9 but those seem to have been resolved in the released version.

Fixing a Nerf Stampede that only shoots in certain orientations

My friend Mark got me one of the awesome Nerf Stampede dart guns for Christmas. It’s a fully automatic Nerf gun that takes clips of darts - perfect for the sort of inter-office foam wars that break out with alarming regularity these days.

Unfortunately, right out of the box there was a bit of a problem (aside from the fact that I had to locate 6 D batteries - who uses those anymore?) The gun would only fire in certain orientations - only if it was held sideways, or pointing down, or even upside down. It wasn’t consistent, either. Pulling the trigger wouldn’t do anything at all - no noise, no motion. I figured there was probably a switch that wasn’t getting pressed except when it was held in a certain way. I took the whole thing apart trying to figure out what was going on. There’s a lot of really fascinating little plastic parts and switches and linkages in there, and the mechanism for how it fires the darts is pretty ingenious, but there was nothing obviously wrong. Since there was nothing mechanically out of place, I broke out a multimeter and started testing electrical connections. That led directly to the battery compartment - there wasn’t any voltage on the terminals at all! Rotating the batteries around in space, there were certain orientations where a voltage would show up, but mostly it was dead. After popping out the batteries, I had a theory as to why.

For some reason, the little indentation for the battery contact is facing outwards, instead of inwards toward the battery. The battery has a similar protruding bit that’s actually sitting inside the contact instead of making a connection with it. The solution was pretty simple - a bit of copper wire bent and stuck in between the contact and the battery to make sure that there was a solid connection. You could probably get away with using a paperclip in there.

After that little fix, my Stampede always fires no matter how I’m holding it, and I have a reliable toy to battle opposing teams at work or just let my co-workers know that it’s time for the stand-up.

P.S.: If you want to build great software in a relaxed workplace and you can take the occasional Nerf dart in the back of the head, let me know.