WordPress 3.0

I upgraded this site to WordPress 3.0, which took less than a minute and was completely painless. I also upgraded the themes & plugins. Upgrading the Suffusion theme, which I’m using, messed up all of the options so things might have looked weird while I was fixing the theme options.

Catching up

I apologize for not blogging since WWDC. I’ve been busy catching up with work. There’s a lot of NDA stuff I can’t talk about, along with some secret stuff at work. I’ve also been busy with Removr. The game levels are playable & the menu screens work, but it still needs level maps & sound effects.

I’m still waiting to hear if my offer on that condo in San Leandro was accepted. I was supposed to find out yesterday, but the seller seems reluctant and is waiting to review additional offers. Keeping my fingers crossed.

links for 2010-06-17

I won a Palm Pre

I went to Palm’s party for developers at 111 Minna tonight and this is what I went home with. They really want people to start developing for WebOS, so I plan to take advantage of this.

I won this

The night before WWDC

I’m really excited about WWDC, which starts tomorrow. I’ll probably go to sleep early, so I can get up at 5AM to wait in line for the keynote. Today I went on the pilgrimage to the Apple Company store in Cupertino.

1 Infinite oop

Yesterday I met with a realtor and looked at several places in San Leandro. I found one that I really liked, which I’m still waiting to hear from.


I found a place I like

Unfortunately I’ve been sick with an upset stomach since I arrived here. To top it off, I chipped a tooth today. Hopefully I’ll be able to hold out until I get home so I won’t have to miss any part of WWDC.

Some iPads Can't Take the Heat

Via NYT > Technology:

Some Apple iPads are overheating in the sun, although its unclear if this is a widespread problem or confined to a small percentage of iPads.

This happened to me a few times when I was sitting outside in the sun with my iPad. It will suddenly shut down and show a temperature warning screen.

Quick and easy image caching for UITableViews

PicSlide uses a table that lets you choose a picture to play with. For each picture it shows a thumbnail. When the thumbnails are loaded from the application’s resources, you don’t have to be too concerned with image loading time.However, when I load those thumbnails from the web, as I do now with the Magic Panda, scrolling the table can become extremely slow.

Previously, I was loading the thumbnail directly from my table data source’s cellForRowAtIndexPath: method.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"tvCell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        [[NSBundle mainBundle] loadNibNamed:@"tvCell" owner:self options:nil];
        cell = tvCell;
        self.tvCell = nil;
    }
    NSString *url = [picUrls objectAtIndex: indexPath.row];
    UIImageView *img = (UIImageView*)[cell viewWithTag: 2];
    img.image = [UIImage imageWithData: [NSData dataWithContentsOfURL:[NSURL URLWithString: url]]];
}

If you don’t have too many rows, a NSMutableDictionary makes a quick & easy image cache. I simply added one method to implement image caching:

NSMutableDictonary *imageCache;

- (UIImage *)getCachedImage: (NSString*)url
{
    UIImage* theImage = [imageCache objectForKey:url];
    if ((nil != theImage) && [theImage isKindOfClass:[UIImage class]]) {
        return theImage;
    }
    else {
        theImage = [UIImage imageWithData: [NSData dataWithContentsOfURL:[NSURL URLWithString: url]]];
        [imageCache setObject:theImage forKey:url];
        return theImage;
    }
}

When I load my table, I now call getCachedImage rather than fetching the image directly.

    img.image = [self getCachedImage: url];

The result can be seen below: