Merry Christmas! Have an XML parser :-)

So, after the entire Santa experience and after my kids left to be with their mother, I decided to pay a visit to the ghost of Source Code past. I dug up a little XML parser I wrote to accompany the Book of Sax. I was amazed that the code built and ran the first time (with several warnings that show how the Java language has changed in the past 10 years or so.) So, if you need a very small and pretty fast XML parser in Java, go to github and clone picoSax. If you go in and clean up all of the warnings, I’ll even send you a copy of the book!

Google Notebook: first impressions.

I’m typing this on my shiny new Google Notebook, which I found sitting on my front steps when I got back from a weekend in the mountains with my family. I filled out the form with Google on December 7th, and to be honest I’d kind of forgotten about doing it. So when I brought the box inside I checked it for leaking fluids or ticking noises. It had neither, but when I opened the outer box I was confronted with this:

(note: I tried to rotate this image using the image editor in WordPress, but for some reason the rotate button wasn’t working in Chrome)
I took some pictures of the box and the documentation, and I tried to get a picture of the screen as it booted up. To do this, I opened and closed the laptop a few times. Big mistake, because pretty soon I saw this:

So, before I’d even logged in, I had a bricked Google Notebook. Bummer. But, fortunately the recovery process was pretty painless. One 4GB thumb drive (and some tedious command line shennanigans) later, and I’m now working in the cloud.

Preserving good code for posterity.

I’ve recently had to learn a couple of new programming languages in a hurry. I’m a pretty fair programmer in half-a-dozen other languages, but starting from scratch is always difficult. Even though flow control and syntax might be similar to something you already know (“is it for each or foreach?”) there is definitely a “natural” way to do things in every language. Some of the worst coding train-wrecks I’ve seen (and I’ve seen some doozies) happen when a programmer attempts to do something complex in a language they barely understand. They might know a way to do it in another language and try to map that knowledge into the target language, but that rarely leads to a clean solution.

So, wanting to do my bit, I created a new website called Native Code to try to make this easier. My goal is to create a database of common low-level coding idioms (micro-patterns, if you like) and then have them expressed in as many programming languages as possible. And not just expressed, but expressed well. So, please feel free to add your own contributions, create your own idioms, and otherwise capture your coding know-how for the ages. Enjoy!

I’m a guest blogger!

Check it out, I’m on the Quintesocial blog:

http://www.meetbarb.com/2009/10/guest-blogger-scott-means.html

Core data model migration on the iPhone.

Doing something as simple as adding a new attribute to an entity in your Core Data model will break your application when it comes to opening older persistent data stores. Core Data has some support for automatic migration, documented in the “Introduction to Core Data Model Versioning and Data Migration Programming Guide” (whew!) in the Lightweight Migration section. Unfortunately, there are crucial steps that are not mentioned in this section. Kudos to Grouchal on Stack Overflow for giving us the rest of the story.

« Previous PageNext Page »