Blog posts
Min CakePHP blog er klar
Endel timer har det tatt, men nå er endelig den "nybakte" bloggen min ferdig. Har brukt Wordpress i rundt et år, men da jeg begynte å lukte på CakePHP for rundt en måned siden begynte tankene om å skrive min egen blogapplikasjon.
CakePHP: Error baking with bake.php
In the CakePHP (cake_1.1.13.4450.zip) I discovered an bug in bake.php. When trying to bake an model you get this error:
Fatal error: Cannot instantiate non-existent class: model in /Users/gersh/Sites/cakephp/cake/scripts/bake.php on line 435
When I checked the source I found that these lines was commented out:
Line 131: uses ('inflector', 'model'.DS.'model');
Line 132: require_once (CORE_PATH.'cake'.DS.'app_model.php');
Line 133: require_once (CORE_PATH.'cake'.DS.'app_controller.php');
After removing comments bake.php works just fine!
WorkTimer 2.04 - Fix start problem without internet connection

I have just made a new update on WorkTimer, which fixes a bug that prevented WorkTimer 2.03 from starting when there was no internet connection. The deal was that I in the previos update did a rather lazy check with no timeout. This caused Worktimer 2.03 to just stagnate when you network was down:
[NSDictionary dictionaryWithContentsOfURL: (NSURL *)internetURL];
The fix
It was easier then I tought, after just 2 min at the great Cocoabuilder.com a found this snipplet that creates a thread that do the internet checking by it self.
The main application thread is left untouched:
- (IBAction) checkVersion: (id) sender {
[NSThread detachNewThreadSelector: @selector(checkVersionInThread:)
toTarget: self withObject: sender];
}- (void) checkVersionInThread: (id) sender {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];NSDictionary *versionDict = [NSDictionary
dictionaryWithContentsOfURL: versionsURL];
if (versionDict != nil) {
// do stuff
} else {
NSLog(@“Unable to download version information.”);
}[pool release];
[NSThread exit];
}