Christmas Wish List

For any of you still looking for something to get me for Christmas, here are a few ideas:

Acura NSX


Someday I will have one of these!

Kepler Motion


This would look great next to my S!

Lotus Evora

Tesla Roadster


Actually, either would do

Mazda RX-7 3rd Gen


Another must-have vehicle!

Posted in Personal | Tagged , , , | Leave a comment

How to background load and cache UIImageViews images

It’s often the case that the apps I am working on are required to download quite a couple, or even a few dozen, images and display them in a UIImageView. In looking online I found a few different methods of loading image data for a UIImageView in the background, and a few examples of caching image data, but they were all overly complicated for my needs, and none that combined the two ideas.

So, I’m posting here my very simply extension of the UIImageView class that provides a way to load an image in the background. It also provides an extremely simply caching system, which works great if you are displaying a list of thumbnails but would need better memory management for a true cache.

You can download the [download id="6"] here.

The header file is pretty straight forward, it simply defines our additional methods for the UIImageView class.
// UIImageView+Cached.h
// Created by Lane Roathe
// Copyright 2009 Ideas From the Deep, llc. All rights reserved.

@interface UIImageView (Cached)

-(void)loadFromURL:(NSURL*)url afterDelay:(float)delay;


Note that both methods assume you already have a UIImageView to work with. While it would be fairly easy to add a method to create a UIImageView as part of the load, I chose not to because all of the places where I wanted to use this were defined in Interface Builder (IB) and hooked up to an instance variable. I do as little interface design in code as possible, even laying out all of my table cells in IB. For me it makes development a lot faster, and interface tweeks and updates not just simpler, but requiring fewer iterations.

loadFromURL: simply takes a URL to any supported image file and sets up for loading the image in the background. When the image finishes loading the UIImageView’s setImage: method will be called to update the view’s image.

loadFromURL:afterDelay: simply delays calling loadFromURL: for the amount of time (in seconds) given as the delay. I’ve used this in programs where I wanted to optimize other parts of the program to display first, but still put the image load call in the same code section (ie, typically in viewWillDisplay in my apps).
Now for the actual code, which is quite small for both a background loader and caching system.
// UIImageView+Cached.h
// Created by Lane Roathe
// Copyright 2009 Ideas From the Deep, llc. All rights reserved.

#import “UIImageView+Cached.h”

#pragma mark -
#pragma mark — Threaded & Cached image loading —

@implementation UIImageView (Cached)

Note here that I have hard-coded my cache for a maximum of 50 images. Typically cache systems are limited in the amount of RAM used instead of a count, but for this quick category it fit my needs. Again, if you are loading small images (like icons or thumbnails) then this will probably work fine for you as well, otherwise you probably want to Google for a real caching solution :)
#define MAX_CACHED_IMAGES 50 // max # of images we will cache before flushing cache and starting over

I used a static variable in the cache getter to simplify the code. I don’t really like this, but it does mean that I don’t have to worry about calling an init or doing any heavier extension of UIImageView so all in all while it’s not the best solution, it does what it needs quite well.

The method simply checks to see if we have already allocated a dictionary we can use to cache our image references, and if not allocate said dictionary. The method returns the dictionary reference.
// method to return a static cache reference (ie, no need for an init method)
static NSMutableDictionary* _cache = nil;

if( !_cache )
_cache = [NSMutableDictionary dictionaryWithCapacity:MAX_CACHED_IMAGES];

return _cache;


This is the meet and potatoes of the code here. The first thing it does is look to see if the requested image is in our cache. Note that it does this by the URL ‘string’ returned by the NSObject description method. This is about as simple a check as you can do, because it does not handle any cases where the image changes on the server, there are two identical images with different URL’s, two URL’s resolve to the same image (https and http for instance), etc.

If we don’t find the image in the cache, we setup an allocation pool because we are going to assume that we are not on the main thread, which is true if either of the public methods for this extension are called. We then use the standard NSData method to load the file from the URL and pass that to UIImage to translate that data into something the system can use (ie, the UIImage). After we load a new image, we first check to see if we have available room in our cache, and if not clear the cache out (again, very simple caching here!). Then in either case we can add the image to the cache.

Finally the method calls the UIImageView’s setImage: method to update the view with the new image data. We don’t call it directly because again we are assuming that one of the public API’s were called, in which case we would not be on the main thread, and making any UI calls is therefore bad. Thus, we use the performSelectorOnMainThread: method to call setImage: so that it can be done safely.
// Loads an image from a URL, caching it for later loads
// This can be called directly, or via one of the threaded accessors
UIImage* newImage = [[self cache] objectForKey:url.description];
if( !newImage )
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSError *err = nil;
newImage = [[UIImage imageWithData: [NSData dataWithContentsOfURL:url options:0 error:&err]] retain];
if( newImage )
// check to see if we should flush existing cached items before adding this new item
if( [[self cache] count] >= MAX_CACHED_IMAGES )
[[self cache] removeAllObjects];

[[self cache] setValue:newImage forKey:url.description];

NSLog( @”UIImageView:LoadImage Failed: %@”, err );

[pool drain];


if( newImage )
[self performSelectorOnMainThread:@selector(setImage:) withObject:newImage waitUntilDone:NO];


And finally, the public methods. Each is very simple; loadFromURL: uses performSelectorInBackground: to call the cacheFromURL: method above on a different thread. This allows the main thread (which is running the UI and main loop of your app) to continue on uninterrupted. This slows down the loading a bit, but keeps the user interactions and interface updates nice and smooth, resulting in a better end user experience.

The loadFromURL:afterDelay: method simply uses the afterDelay version of performSelector: to call loadFromURL: after the specified delay. The only purpose here is to provide a way to organize downloads in a very simple, yet usable fashion.

For instance, let’s say I am going to present a list of home for sale, which requires downloading 20 images, and at the same time make 20 web page requests for descriptions of the homes, their prices, etc. We could wait for everything to load, but that is not good end user design (imo). Instead, I can request the UIImageView’s for those 20 homes update their images, but delay that load for 2-3 seconds. Then, I can grab the text data from the website (which typically comes down very fast), and present the view to the user. Thus the user can start reading about the properties and as images come in the view will automatically update the images the user sees.
// Methods to load and cache an image from a URL on a separate thread
-(void)loadFromURL:(NSURL *)url
[self performSelectorInBackground:@selector(cacheFromURL:) withObject:url];


-(void)loadFromURL:(NSURL*)url afterDelay:(float)delay
[self performSelector:@selector(loadFromURL:) withObject:url afterDelay:delay];


OK, that’s it. In case you missed it above, you can download the [download id="6"] here.

Hopefully this will prove helpful to someone :)
Update: Take a look at Michael Amorose’s additions to UIImageView’s if mine isn’t your cup of tea.

Posted in iOS | Tagged , , , , , , , | Leave a comment

It sure does snow in Kansas!

This week I am visiting my Grandmother in Kansas. Monday night I arrived at the farm just as the first snow was falling, and by Tuesday morning I couldn’t have left if I wanted to. Here are some pictures of what things looked like the first couple of days I was here!


Snow Barn


Kitty tracks on the snow


Back porch before the blizzard


Back porch after blizzard. Taken through screen because all of the windows were completely covered with either snow or frost!

Here is the Facebook photo album if interested.

It took a front loader to clear the driveway so I would be able to get out if I needed, although as of Friday night I had not even attempted it since we have plenty to eat in the house, and the electricity, heat and internet are all working. Grandma’s cat is not at all happy having to wade through snow to go to the bathroom! (Plus, I imagine it’s rather difficult to find any ground that isn’t frozen … probably has to go all the way to the barn, which in good weather is nothing but in snow deeper than the cat is high I noticed he didn’t even try (well, at least I didn’t see any cat tracks going out that way).

Posted in Personal | Tagged , , , , | Leave a comment

GolfHub finally out of review

Well, GolfHub finally got through the review process, took 20 days.

In case you are interested, here is a link.

Marketing Text:

Golfhub is designed by golfers to serve the needs of other golfers like you and is the easiest way to search, find, and book tee times on 100’s of golf courses throughout the United States – all at your finger tips! The easy to use interface allows golfers to quickly find teetimes and securely book a reservation right from your iPhone or iTouch.


  • Search for tee times by State, Area, and/or Specific course.
  • Search for available tee-times by date, time and number of players.
  • Course description, GPS directions and telephone numbers at your finger-tips.
  • Book your reservation with secure payment information directly from your device. No need to call the pro-shop.
  • A confirmation page will be emailed with course specific cancellation policies.
  • Mark your favorite or most played course for simply searches
  • View your history all of reserved tee-times.
  • Discounted Tee Times

One of the best things about golf is the chance it gives us to have fun, make friends and sharing a common love-of-the-game and the GolfHub app lets you take part faster and easier than ever!

Posted in Announcements | Tagged , , , | Leave a comment

*Warning* Do not install software included in Panasonic products!

A while back I purchased a Panasonic camera that can not only take pictures, but also record video. I chose the camera because of this combination, in combination with it’s optical zoom. Now, the camera works great and importing photos into iPhoto has always been a snap.

Unfortunately, only recently did I first try recording a movie and importing it. I say unfortunately because while the video recorded fine, when it came to importing I found that not only am I not able to import video despite the Panasonic advertising this capability for Mac OS X, but also the software included on Panasonic CD’s installs extremely invasive “pop-up” programs that behave just like trojan/virus software!

I really wish I had tried the video capabilities before the store’s return policy expired, as I would have immediately returned the damn thing.

The gory path to finding out I’ve been taken
After recording my first movie on the camera I attempted to import the movie into iMovie. Unlike all other cameras I’ve had (including several Nokia phones) iMovie would not import the movies when I connected the camera. In fact, it said there was no media available for import. Huh? iPhoto handles the pictures fine, what’s up with the movies?

OK, so maybe Panasonic is using a proprietary format I thought. Not what I was expecting, but if so there should be software on the CD that came with the camera that would allow me to import my movies. After searching for a few days (off and on of course, I didn’t search for several days straight!) the CD packaged with the camera was finally located and I proceeded to install the software that came on the CD on my Mac OS X system.

Now the astute among you have probably already picked up on the second warning sign. (The first, by the way, was that Panasonic did not provide a way for iMovie to import movies). For the rest of you, here it is:

  • Mac OS X Applications do NOT use installers!

Having used software for other cameras, this was the first that required an installer to put the application on my Mac and I was fairly annoyed about the requirement. Annoyance became outrage / disgust when I discovered the installed software:

  • a) is useless, in comparison to iPhoto a complete joke. Supposedly “native”, but looks, response and general feel were as good as a very (very) poor java application. If this is the best that Panasonic can deliver their company programmers need to be fired!
  • b) has no ability to import video from the camera. Yes, that’s right—a camera that advertised right on the box that it is “fully compatible with Mac OS X” has absolutely no way to import movies from the camera under Mac OS X. Hell, for all I know Panasonic doesn’t allow importing movies under Windows either!
  • c) is intrusive, acting like a trojan or virus, and can NOT be uninstalled! WTF?!?!?! Yes, that’s right … the software puts in all kinds of crap into your system, like this little gem: a system extension (I’m assuming since I can’t find the app in the Applications folder or in the process list) that puts a banner add on the top of ALL of your other windows! No closing it either, in fact since it’s a system extension you can’t even quit it! Panasonic: this is not how applications operate … this is how viri operate!

Item b is upsetting because I expected to be able to use this camera for taking photos and movies; but being unable import movies them makes the movie taking feature useless. It means I spent hundreds of dollars on a camera that I can’t use as expected.

Item c is unacceptable; installing virus-like software simply should not done, ever! I’m literally at a loss for words here … how the fu*k did Panasonic’s management OK this???

More Software Details
Panasonic’s software package is distributed under the label “ArcSoft”. Maybe this is a Panasonic label to distance the parent company from such crappy software (and that’s ignoring the whole virus install, and taking efforts to make the software uninstallable!) or maybe it’s a 3rd party software package they’ve licensed, but it doesn’t matter because the responsibility for Panasonic’s end-user experience is 100% the responsibility of Panasonic.

There were two programs: MediaImpression and Panorama Maker. Both programs are delivered as installers instead of Mac OS X standard applications. However, as far as I can tell there is no need for this because the applications themselves, while poor examples of commercial software, are completely self-contained and I could simply copy the application bundles to other computers where they would run just fine.

So, what’s the purpose of the installers then? Obviously, the only purpose is to install the virus-like software! Way to go Panasonic, your company is obviously run by stand-up guys who are truly concerned about their customers..NOT!

Since I have not been able to locate a means for getting rid of Panasonic’s virus/trojan software, I would be very appreciative if anyone can give me any help on removing this trash!

Again, it doesn’t matter whether or not Panasonic wrote this software or licensed it, they put it on their CD under their name, and their printed instructions direct you to install the software in order to use the camera, so the end result is that Panasonic put this crap on my machine.

My Options?
So far the only way to import movies from this camera involves purchasing a 3rd party software solution. Unfortunately, the only program I can find seems extremely suspect! It’s “website” is suspiciously similar to the ArcSoft site, and it has multiple products which appear to be there only for the purpose of bogus search results, because only the titles change … the product descriptions and screen images do not! In fact, they look a lot like the ArcSoft software screens. Furthermore, there a several bogus “articles” about how to get video from Panasonic cameras into Mac OS X, all of which recommend this software. And all those articles are on websites which have a nearly identical look to the website which sells the software the article recommends … and those websites also have no other content, except for lists of free software that do not compete with anything the “recommended” software’s site sells.

All this goes to my pretty much being guaranteed not to purchase; not only am I reluctant to be forced into purchasing software to perform functionality that was advertised as being included in the product I originally purchased, but even under ideal conditions a website setup like that screams “virus infection, credit card information stolen, sell and/or spam my email”, or some other undesirable result if you initiate a purchase and/or contact of any kind. After Panasonic has already installed trojan / virus software on my computer, I think it goes without saying that this site rates at least 99 out of 100 on a scale of likely to end up not being in my best interests!

So, any one have a way to import video from a recent model Panasonic camera? (My specific model is a Lumix DMC-ZS3)

The software included on Panasonic CD’s installs extremely invasive “pop-up” programs that are installed in a manner designed to make them as difficult to remove (uninstall) as possible. That’s virus behavior, not application behavior, shame on you Panasonic!

Unfortunately, I must advise, in the strongest possible terms, to avoid purchasing any Panasonic cameras until they remove the trojan / virus installation(s) and provide software that is truly usable in performing the actions Panasonic advertises as being included with their cameras. This is really too bad, because the camera itself is great; movies shot in a moving car at high speed on very rough terrain came out great, it even handled 1.2+ G braking/turning. And the digital zoom is great, especially because it’s combined with a very nice wide angle lens. A great combination of hardware that gets trashed by the software side.

Say, Panasonic hardware people, you really need to talk to the guys on the software side, as well as upper management, because those software people (replace people with your favorite cuss word, I did) are ruining your excellent work!

Posted in Help, Rants | Tagged , , , , , , , , , , | Leave a comment

First photos of updates to S2000

Well, I updated the S2000 again, only this time it wasn’t for performance, rather it was on appearance. :wow: There is still a few things I want to get done, but for the time being I’m “finished” mucking with it. Time to get to the track and step on the gas :)


S2000 Engine Bay post cleanup

The engine bay came out really clean! I also had the front hood customized & re-painted along with the front fender and both front side fenders (as all three had various dents, scratches and other unsightliness).

S2000 Hood

I see very few after market hoods that I like, and good fitment seems to be a mostly miss in all cases. Instead, I had mine customized, which ended up costing about what a good custom hood plus paint job (don’t like the CF look) would have cost.

S2000 gauges

I had a pillar pod setup on my first install, and really hated it; blocked too much of my view (esp. during an autocross!) and advertised “boosted” too loudly. So, a bunch of custom work later and I have something that looks very much like it could be stock. I like.

Posted in S2000 | Tagged , , , , , | Leave a comment

My Mobile Golf on App Store

A couple of weeks ago My Mobile Golf was released on the iTunes App Store. It allows you to book tee times on your iPhone or iTouch. We worked hard to make the interface as clean as possible, and to allow booking a tee time with the minimum number of clicks/screens.

Check it out on iTunes

Marketing text follows :)

My Mobile Golf is the easiest way to search, find, and book tee times on 100s of golf courses throughout the United States – all at your finger tips! The easy to use interface allows golfers to quickly find teetimes and securely book a reservation right from your iPhone or iTouch. All with no need to call the pro-shop!

-Search for tee times by State, Area, and/or Specific course.
-Search for available tee-times by date, time and number of players.
-Course description, GPS directions and telephone numbers at your finger-tips.
-Book your reservation with secure payment information directly from your device. No need to call the pro-shop.
-A confirmation page will be emailed with course specific cancellation policies.
-Mark your favorite or most played course for simply searches
-View you history all of reserved tee-times.
-Discounted rates

Posted in Announcements | Tagged , | Leave a comment