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!):

Wires Under Desk - 1Wires Under Desk - 2

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.

Navigating with printed directions

Last night I had to pick up something for my wife. Unfortunately it wasn’t going to fit in her car which has built-in navigation, so I had to take my car. As I gave my Garmin iQue 3600 to my father and haven’t replaced it, I had to print out directions and follow printed directions. It seemed so archaic to have to do this, but I didn’t have a choice. I guess I’ll have to wait for a new car to have navigation again as I still can’t justify getting a portable GPS unit for the little driving I do in my car to places I’ve never been.

Watched my first movie rental on TiVo!

Awhile back, Amazon Unbox came to TiVo. I thought this was great as my wife and I are a bit too lazy to goto the store and rent a movie (even more so now that we have an 8 month old son). Well, nothing ever came of it as we never rented a movie. The other night, when there was nothing on TV because of the writer’s strike, I mentioned it again to my wife and she checked out Amazon, saw that Ocean’s Thirteen was available for rent for $0.99, so we set it up and started the download. It was quick and easy! Last night we got around to watching the movie and must say that the experience renting the movie was excellent. I think our threshold is probably $3.99 for movie rentals. The problem with Unbox is that the selection isn’t all that great for rentals. Maybe I’m just picky, but not a whole lot jumped out at me.

The rumors are circulating that Apple will have a rental setup for the iTunes Music Store soon which would be cool as we could watch stuff from our AppleTV. However, it will require an upgrade to the AppleTV’s software which will knock out my Squeezebox hack on it. We’ll just have to wait and see.

Flexible spending reimbursement is as easy as pie

Every year we have to fill out the paperwork to get our money back from my wife’s flexible spending plan. I don’t ask much of her in terms of accounting, so this has always been her task. She had to copy all the receipts and assemble them from a big mess of receipts. Well, this year, thanks to ReceiptWallet, that was different. I simply selected my “Medical” collection, selected all, hit print, and then filled out the paperwork. It took maybe 15 minutes to fill out and fax in the paperwork. A week later, we received a check for the full amount we requested with no problems. This paid for my copy of ReceiptWallet, just in the time it saved me to do this 🙂

Roomba isn’t saving us time

I hate to say it, but the Roomba isn’t saving us time. I love the Roomba and Scooba, but the promise of time savings just isn’t there. How can that be you ask? It is quite simple; my wife and I hate vacuuming and the cleaning crew we had wasn’t doing a good job, so the house wasn’t getting vacuumed regularly. While our house is usually “in order”, we had dog hair all over the place and the carpets didn’t get vacuumed as often as they should.

So now that the Roomba is handling the floors, our carpets look better, there is less dog hair on the tile and our house looks better, but it still isn’t saving us time!

New rate structure

I’ve been thinking about a new rate structure for clients. It would go something like this:

Amount of NoticeRate
4 monthsStandard
2 monthsStandard rate + 10%
1 monthStandard rate + 25%
1 weekStandard rate + 50%
1 dayStandard rate + 100%
< 1 dayStandard rate + 200%

Is push email really useful?

The holy grail of email seems to be push email where you instantly get your new email as it arrives. For years which my NotifyMail program, I basically had this as well on my desktop, but not on mobile devices. With IMAP idle, NotifyMail is obsolete for the desktop, but push email still seems the rage on handheld devices as everyone wants to be like RIM with the BlackBerry. I didn’t think much of this until last week when I saw someone say that the iPhone can’t be an enterprise device because it doesn’t have push email and you can only have it check email automatically every 15 minutes. To that, I respond, so what? Is email all that important that I have to get messages instantly? Of course not, if something is all that important, people can get me with SMS, IM, or can you believe it, the phone. Why does everyone think that push email (and for that matter constant connectivity) is the only way to work? I think that this causes too much stress and is not needed.

I’m sure people will argue with me that they must be in touch all the time and have to get email anywhere and everywhere, but I’d prefer not to have my life run by a little box.

TV without violence?

My wife and I realized awhile ago that most of the shows we were watching/recording on TiVo had to do with crime/murder such as CSI: Miami, NCIS, Without a Trace, etc. While the shows are quite engaging, they are violent. I wasn’t sleeping well and my wife suggested that our TV viewing habits could be the cause. So, we decided to change our makeup of shows to shows without violence. Unfortunately we picked a real crappy time to do this because of the writer’s strike. We’ve started watching “chick” shows are there simply aren’t that many comedies and other good shows on TV. While the “chick” shows (i.e. Grey’s Anatomy aren’t my cup of tea, I am sleeping much better. We’ve thrown a few of the crime shows into the mix, although not as often, and I’m still sleeping well.

I’m not sure why we were so attracted to violent shows, but our choice of shows is changing which is a good thing because as our son grows up (and we determine how much TV he’ll be allowed to watch), we don’t want him watching violent shows.