Why I find Objective C a hard language to learn

Lots of methods get an NSIndexPath as the argument, and all the sample code that I’ve seen gets the current row out of the indexPath object using [indexPath row]. Sometimes they get the section number using [indexPath section]. Ok, that seems simple enough. Now look at the documentation for this class, which is what you see if you use the XCode research assistant to show you the documents:

NSIndexPath Class Reference.

I cannot for the life of me see any way to extract the information that you get the current row using “row” out of that document. It’s not there. No, instead you have to figure out that UIKit has added some methods to NSIndexPath, and find ‘row” and “section” in a different document called “NSIndexPath UIKit Additions”. Isn’t that intuitive?

Well, that sucked

I know you’re tired of all those “good workout” blog posts, so I thought I’d have a lousy one just to keep it interesting.

I was intending to go out into the bay for another 5 miler and hopefully still have some energy left for a few miles on the creek. But I wasn’t counting on two things – one is that the thunderstorm that blew through yesterday is being trailed by a very strong wind (the airport is reporting winds gusting from 15 to 26 mph) and the other is that my right shoulder started to hurt after about a mile.

The waves weren’t so bad while they were coming right at me, but the wind was cold. And after passing “One Mile Point”, the wind started to swing to the one side and so did the waves. Because of my shoulder, I was wondering if I should turn around, but also wondering how I could turn around since that would involve going broadside to the waves at least momentarily. The shifting winds sort of made the decision for me – I was going to be broadside whether I turned or not. So I turned.

On the way back, I got good surf, but unfortunately my sore shoulder was preventing me from enjoying it. And the soreness got worse as I went on.

Oh well, maybe tomorrow.

I don’t need this.

Last night was the third Sunday in four where my UPS has woken me up with beeping. Each time, it seems to suddenly decide that while the load is unchanged, and the charge percentage is unchanged, the projected lifetime in the event of a power loss has suddenly changed from 100 minutes to 0 minutes. This is more than likely an indication that the batteries are failing, and it’s time to replace them. The UPS does some sort of self test once a week, and evidently this one does these tests at 1:30am on Sundays. There doesn’t seem to be any way to turn off these tests or reschedule them.

I spent a hell of a lot on this UPS, wanting one with a lot of capacity and which had replaceable batteries, because my previous one hadn’t let me know that the batteries were getting old until our power went out one day and the charge hadn’t lasted long enough to get down to the computer room to shut down my servers. I can’t remember what I paid for it, but the current equivalent model retails for around $600, so it was probably up in that range. Replacement batteries seem to be around $50 with $20 shipping, and plus then I’d have three small lead acid batteries to dispose of somehow.

On the other hand, I’ve migrated a lot of the things I wanted a Linux server for from my home to my colo box. I’m starting to question if I even need a 24×7 server in the home. Maybe rather than spending all that money on a UPS, I should just move the last remaining things (the mail server and the personal web pages) to the colo box and shut down my home server. It’s a shame to trash a $600 UPS for want for $60 in batteries, but maybe I can eBay it.

I did not need that.

Last night, my UPS started beeping in the middle of the night. This happened once before recently, and that time I just pushed the button on the front to see if it would reset the problem, but it turned the power completely off. That time, after my linux box booted, the two external USB backup drives came up really slow, which caused the hourly rsync backups to take more than an hour, which caused all sorts of hilarity. So this time I decided to shut everything down gracefully before I reset. And yet, this morning I got up to find that four hourly backups are still running.

I killed all the backups, unmounted the usb drives, ran fsck (which didn’t do anything because it said they were clean), powered them off, powered them on, made sure it said they were “high speed” rather than “full speed”, and mounted them. And yet when I did an ls on each one, it hung for over a minute, and then had a message in the log about resetting the USB controller, and then it was fine. I’ve started an hourly backup, and it’s taken 15 minutes or more already and it’s still on the first drive. That’s not good. I wish I knew what was going wrong there.

My first order of business is probably to order new batteries for the UPS. Each time it starts beeping in the middle of the night, munin tells me that the “charge percent” has stayed at 100%, but the runtime in minutes has dropped to zero. Very odd.

It’s definitely the hardware!

I booted my laptop with the install DVD, started up the Airport, and fired up Network Utility. I used Network Utility to continuously ping my Linux box, and put it down. Then Vicki and I went out to dinner. When I came back, it was still happily pinging, but as soon as I picked it up it the Airport died. I guess that proves once and for all that it’s not Parallels or something else in my installation.

You know, it would be a real shame if it was so broken that they had to give me one of the new glass screen MBPs, wouldn’t it?