-
Crappy coding bites me again
I write a lot of code for ReceiptWallet as well as my day job doing contract work, so it goes without saying that I write some good code and some bad code. I like to think that I mostly write good code with a low bug count. I've been getting some really odd crash reports with ReceiptWallet and no one has actually sent a description of how they managed to crash it. I took a look today based on some guesses I had about how a customer was using the product and managed to track down the crash to one line of code; granted the crashes didn't point to the line of code and were all across the board, but when I commented out the line, the funky behavior stopped. Turns out it was a really stupid bug; I use Cocoa Bindings in ReceiptWallet which saves code and is, in general, pretty neat. Basically in the UI, I specify that a particular field is bound to a variable. Then in the code, I set the variable. The trick is that the variable has to be set using Key Value Coding (KVC) such as:
[self setValue:[sender stringValue] forKey:@"variableName];
However, I found in my code a line that looked like this:
variableName = [sender stringValue];
When I first looked at it and started thinking about it, I thought I hadn't retained the value and that the results were undefined when it exited the function, but after thinking about it all day, I realized my mistake, changed the code and presto, the crash was gone. What really threw me were crash reports like:
Thread 0 Crashed: 0 libobjc.A.dylib 0x94cc56e8 objc_msgSend + 24 1 com.apple.Foundation 0x95f4a180 -[NSComparisonPredicate evaluateWithObject:substitutionVariables:] + 240 2 com.apple.Foundation 0x95f4a081 -[NSPredicate evaluateWithObject:] + 49 3 com.apple.CoreData 0x90c4520a -[NSManagedObjectContext executeFetchRequest:error:] + 2266
and
Thread 0 Crashed: 0 libobjc.A.dylib 0x94cc56e8 objc_msgSend + 24 1 com.apple.AppKit 0x936c3732 -[NSApplication run] + 892 2 com.apple.AppKit 0x936909ba NSApplicationMain + 574
Now I can sleep better knowing that I fixed a long standing bug that may have solved a number of crashes that I couldn't explain.
-
Wire cleanup
Like any computer geek, I have a ton of stuff on my desk which leads to a ton of wires. Periodically, I attempt to figure out what to do with them. When I got my new desk, I put some wire runs under my desk to help with the clutter. That lasted a little bit, but I kept adding more stuff and it became a mess again. This week, I added another wire run, got some velcro ties and switched out a surge suppressor to one with 12 outlets! (I call it my vampire surge suppressor as I turn it off at night so that all the stuff that sucks power when not on won't suck power.) I seem to have a lot of power bricks on cords, but not many of the large transformers that seem to block outlets. This is handy as I come shove them up in the wire racks.
Here are some after pictures (I didn't take before pictures, but trust me, it was more of a mess!):
-
Tech reporter who doesn't know tech
There are a few tech reporters that are well known and well respected in the industry. David Pogue and Walt Mosberg to name the most famous. Both men write pretty good reviews and seem to be right on the money with what they say. So much so that their reviews can greatly influence a product's success in some circles. Today I read a review by Jonathan Blum about the Navigon 2100 and can't understand how he gave it a positive review. (I've seen a few other positive reviews of it and my conclusions below apply to all of them.) One of the following explains the review:
- He never actually used the device (it looks great on paper). I used one for about 5 minutes and was disgusted by it.
- He has very low standards for GPS devices (my old Garmin iQue 3600 performed better than this)
- He has never used a competing product from Garmin or TomTom
You might be saying that these are serious acquisitions, but has anyone actually used one of these devices? It is slow, cumbersome, and lacks decent points of interest.
Am I writing this because I'm a fan of Garmin having written positively about them in the past? No, I'm writing this because if you want a decent GPS unit, don't get the Navigon!
(Generally I like Garmin, but my biggest criticisms of the company are a) their dizzying array of similar units (they're competing against themselves and driving people away because consumers have no idea which one to choose) and b) their units are quite expensive.)
Disclaimer: I own stock in Garmin, but have no inside information about the company, don't know anyone at the company, and they don't pay me to write this stuff.
-
Gadget Drool Day
Yesterday I was in drooling all over my desk at some tech rumors and product announcements. First up was Garmin's announcement of the Forerunner 405. While I don't plan on running another marathon, I do plan on running to keep in shape. It's hard to justify purchasing it, but since it can work as a normal watch, maybe I need a new watch!
Second up on my list is the rumor that Apple will have a dockable laptop based on a patent application that was recently granted. Unfortunately the patent was filed a year and a half ago, so it coming to light now could be a mere coincidence. Apple patents everything, so who knows if this will become a product. I'm crossing my fingers that it will be, and I'll jump at purchasing it if it comes to be. Right now my MacBook Pro has 7 cables coming out of it that I have to unplug every time I want to move it which is a pain.
While not really a gadget or technology, LEGO released new sets for 2008 including Indiana Jones based sets (which don't really fit into my collection, but they're cool). They also have new City sets which will fit in perfectly in my collection. The problem is, plastic LEGOs aren't cheap!
I'll start saving my pennies now to buy all my gadgets.