-
I did it!
Today I ran and finished the Rock 'N' Roll Marathon. I knew in my heart that by training for it, I could run a marathon, but I proved it to myself (and to my family). Luckily I had my whole family cheering me on. I managed to do, what I consider, a reasonable time of 4:14:54, but my goal was to just finish.
There were times on the course where I was hurting pretty bad, but I just kept telling myself I had to finish. My Garmin Forerunner 305 kept me up-to-date and performed flawlessly, unlike one of the guys next to me at the starting line that was quite annoyed when his unit didn't turn on. I slowed down considerably in the last half of the race, but finished with a pace of about what I normally did on long runs. All the gory details are over on MotionBased, but please don't laugh! I managed to cross the finish line on my own power and wasn't carted off in an ambulance. Overall, it was a good day. I'm sure I'll be hurting for a few more days. I think the jury is still out on if I'm going to put myself through this torture next year.
-
Sucks to be a non-partisan voter
When of the disadvantages of being a non-partisan voter near a primary election is that both parties spam you with crap. I'm getting phone calls (luckily they go straight to voicemail) and printed material from both Republicans and Democrats. I'd love to call both parties and tell them that I really don't care. I said to my wife yesterday that for $5000, they can have my vote. Yes, I know buying my vote is illegal. However, with these candidates for whatever office they're running for, I frankly don't care. I'm so disinterested in politics, I'd be happy with Mickey Mouse for governor/secretary of state/senator/whatever. Only a few more days until this election is over.
-
Stupid Bug
The other day as I was tracking down a bug, I almost kicked myself when I saw the problem. The code was something like:
int i = 0; int count = [array count]; for (i = 0; i < count; i++) { if ([[array objectAtIndex:i] intValue] == 3) { [array removeObjectAtIndex:i]; } }
The problem with this code, if you're a Cocoa programmer, should be obvious. If any of the elements are equal to 3, then when you get to the last or near the last element, there are no objects left in the array and it blows up. The proper way to do this, of course is:
int i = 0; int count = [array count]; for (i = count - 1; i >= 0; i++) { if ([[array objectAtIndex:i] intValue] == 3) { [array removeObjectAtIndex:i]; } }
By counting down instead of counting up, the problem is solved. What annoys me about this code I wrote is that I've done something similar many times. You'd think I'd learn by now.
-
The end of 2 good years
It's time for me to sell my PowerBook G4. It has been a good machine for the last 2 years, but as technology changes, I need to keep up as my customers and users have already done so. Like all the machines I have owned, I use them a lot, but don't abuse them. My PowerBook has been my main machine for the last 2 years and it has served me well. We'll see if anyone is interested in it. There are still a few reasons to own a PowerBook as opposed to a MacBook or MacBook Pro (PCMCIA slot, runs Photoshop, Word, etc. faster as those applications aren't designed for Intel, yet, and it can still run Classic which the new Intel machines can't). I'm not a great salesman as I can't honestly say that I'd purchase this machine over a new MacBook, but that's just me and I don't need to run non-Intel native applications all that often.