San Francisco

It’s been two months since my last blog post and a lot has happened. I’m now living in San Francisco and working for Bionic Panda Games. I’ve spent the last two months getting settled in my new apartment, working at my new job, and exploring the city. I also released a new Mac application called Detective (more in another post coming soon).

I love San Francisco. My favorite thing about the city is the rich history and mix of old and new. I love seeing buildings from the early 1900s next to modern structures.

Living here has inspired me to take many more photos. I enjoy just walking around the city with my camera. I’ve been experimenting with using only a prime lens instead of the 18-200mm zoom lens for my walks. I found that I prefer the 35mm f/1.8 to the 50mm as a general purpose lens. I’ll probably continue to use that lens for my next photo walk.

Unfortunately Midnight hasn’t adjusted well to my new home. He spends most of the time hiding and has been refusing to eat. As a result he got very sick and has been at the vet for several days. Cody, on the other hand, seems happy here.

Here’s one of my favorite shots from one of my photo walks.

Spreading tree

A New Chapter

I’m finally moving to San Francisco. I have a new job there which starts in less than 2 weeks, and I found a great apartment while I was there for Macworld|iWorld Expo last week. I wanted to do this for a long time, but I had a hard time overcoming my inertia. My POD arrives tomorrow and I’m flying to San Francisco to stay on Monday Feb. 6.

Much as I love San Francisco & dislike Florida, I’m going to miss my good friends here. My condo is a very close-knit community and we’re like family here. We all look out for each other. I doubt if it’ll be like that where I’m moving, especially since it’s a rental community. On the other hand, I really look forward to being part of San Francisco’s exciting tech startup community, which doesn’t exist in Florida.

In other news, I’m getting ready to release a new application for Notion called Detective, which shows your new Twitter followers and unfollows in the menu bar. We’re still waiting for the final artwork, so I might not be able to submit it before I move.

Login items in the sandbox

Apple will soon require all Mac apps submitted to the app store to be sandboxed for heightened security, which means it needs to request permission for doing even basic things like accessing files or connecting to the internet. A lot of things like disk burning aren’t allowed at all in the sandbox, and some things like sending AppleEvents require temporary exemptions which will be phased out.

One common task that’s complicated by the sandbox is adding a login item. A good tutorial on creating login items is available at delite studio, although some changes to the code are needed. That code follows Apple’s earlier guideline of using LSRegisterURL to register your helper app. However, I found that it always fails with error -10819. According to an Apple engineer in Apple’s developer forum, you should not call LSRegisterURL in a sandboxed app.

Note that your application can’t add itself as a login item. You need to write a simple helper app that launches your main app and it must be included in the main application bundle in the relative path /Contents/Library/LoginItems/.

The method for adding & removing a login item turned out to be very simple:

- (void)addLoginItem {
    NSString *ref = @"com.madebynotion.myLoginHelper";
	if (!SMLoginItemSetEnabled((CFStringRef)ref, true)) {
		NSLog(@"SMLoginItemSetEnabled failed.");
	}
}

- (void)removeLoginItem {
    NSString *ref = @"com.madebynotion.myLoginHelper";
	if (!SMLoginItemSetEnabled((CFStringRef)ref, false)) {
		NSLog(@"SMLoginItemSetEnabled failed.");
	}
}

If you need to find out whether your login item is enabled, here’s a way to do it:

-(BOOL)appIsPresentInLoginItems
{
    NSString *bundleID = @"com.madebynotion.myLoginHelper";
    NSArray * jobDicts = nil;
    jobDicts = (NSArray *)SMCopyAllJobDictionaries( kSMDomainUserLaunchd );
    // Note: Sandbox issue when using SMJobCopyDictionary()

    if ( (jobDicts != nil) && [jobDicts count] > 0 ) {

        BOOL bOnDemand = NO;

        for ( NSDictionary * job in jobDicts ) {

            if ( [bundleID isEqualToString:[job objectForKey:@"Label"]] ) {
                bOnDemand = [[job objectForKey:@"OnDemand"] boolValue];
                break;
            }
        }

        CFRelease((CFDictionaryRef)jobDicts); jobDicts = nil;
        return bOnDemand;

    }
    return NO;
}

Although this method works and seems to be the preferred way to do it in the sandbox, it’s less optimal than the old non-sandbox method, since your login item won’t appear in the users & groups preference panel’s login items list and can only be turned on & off from your own application.

Favorite Albums of 2011

Here’s my annual list of my favorite albums.

  1. Wilco – The Whole Love
    This is their best album since “Yankee Hotel Foxtrot”.

  2. Fleet Foxes – Helplessness Blues
    Much more sophisticated than their first album, yet it still keeps their wonderful folk rock sound and beautiful vocal harmonies.

  3. Bon Iver – Bon Iver
    Just plain beautiful.

  4. The Decemberists – The King is Dead
  5. Radiohead – The King of Limbs
  6. Adele – 21
  7. St. Vincent – Strange Mercy
  8. Foster the People – Torches
    Some of the catchiest songs of the year.

  9. Blitzen Trapper – American Goldwing
  10. Tinariwen – Tassili
    I’m addicted to their music, which has an almost hypnotic trance-inducing effect. Their latest album enhances their Desert Blues sounds with some English lyrics and guest artists like Nels Cline, The Dirty Dozen Brass Band, and members of TV On The Radio.

Here’s a Spotify playlist with some of my favorite songs.

Sugar Rush 1.2.5 gets a new Christmas theme

Sugar Rush 1.2.5 and the new Christmas bonus pack is now available. The Christmas pack adds a new theme with new candies and high-scoring new bonus items. In addition, special bonus power items and premium items such as donuts will appear more frequently, making it easier than ever to get new high scores. Sugar Rush is still free. The Christmas pack is available as an in-app purchase for $0.99.

New Christmas theme.png

Links for 2011-9-16 through 2011-12-1

Links for 2011-9-16 through 2011-12-1:

Posted by Postilicious

iPhone 4S

Last weekend I finally got an iPhone 4S, when I became eligible for the upgrade. I got the 64GB model in white, because I was running out of space on my 32GB iPhone 4.

It’s noticeably a lot faster than an iPhone 4, especially when scrolling through a list of photos in apps like Instagram. The screen is brighter than the iPhone 4 and has a yellowish tint (although it isn’t too noticeable in this photo). After using it a few days, the yellow tint seems to be less visible.

iPhone 4 & 4S

The screen is easy to read outdoors. I was able to read a book on the screen in moderate sunlight without any difficulty.

The camera is a huge improvement. Note the much sharper details in the iPhone 4S photo below. The iPhone 4S won’t replace my D90, but I probably won’t carry a point & shoot camera any more.

Taken with iPhone 4
iPhone 4
Taken with iPhone 4S
iPhone 4S

Before I bought the 4S, I wasn’t really too interested in Siri, but after using it, I’m very impressed and found it to be fairly accurate at recognizing my commands. In all, the iPhone 4S is an impressive & worthwhile upgrade.