Fraser Speirs Cocoa and Photos

Flickr View All » It's Always FridayiPhone Application DevelopmentPointObamaganda?CagedMy SaturdayFascinationIndoor Bagpipes
View Fraser Speirs's profile on LinkedIn  Add to Google

Posted
10 July 2008 @ 10am

Tagged
Business, Programming, Tech

10 Comments

Add:     

It’s Out!

The App Store is live, and you can go get Exposure right now. Of course, you won’t be able to run it until you have an iPhone or iPod touch upgraded to OS 2.0, but you’ll at least get to see the screenshots.

Here’s a quick screenshot of the killer feature: Near Me:


Posted
9 July 2008 @ 3pm

Tagged
Programming, Tech

8 Comments

Add:     

On Switching to Git

Yes, I switched all my source control to git. I don’t have a lot of insight to share so far, but I doubt I’m going to change back.

I work solo, only moving between a desktop and a laptop, so I’m not making huge use of the distributed capability. My previous writing on Git was occasionally mildly criticised for “ignoring” that aspect of Git. I’m not ignoring it, but I lack an understanding of how it really helps me. No, what’s great about Git so far is the power of the tools for everyday operations. I’ll mention the three that come to mind immediately:

git add -i

Interactive adding is a feature that, once tasted, I could never again live without. Clean-as-you-go is an important part of programming any large system which will inevitably have some crusty corners or old code that needs updated. Without the ability to selectively commit diff hunks, cleaning code as you go leaves you with the Tangled Working Copy Problem when you want to commit.

With Git, I work on a feature and feel free to tidy comments, whitespace and adopt the dot accessor as I go. Later, I can go through the file and pick out the feature hunks, commit those, then commit the rest of the tidying-up work.

git bisect

Bisect is an unbelievably useful tool. It helps you to isolate the commit that introduced a bug. You give it a known-good commit, a known-bad commit and it searches through the commits in between, repeatedly checking out versions for you which you then test and tell Git whether that commit was good or bad. I’ve isolated several bugs with this already. It’s fantastic.

git log

The tools that Git gives you to manipulate, search and output the commit logs are very powerful. There are too many options to discuss each here, but I find the ability to format the output with very fine control is particularly useful. With a little care in writing the first line of commit messages, I can use git log to produce a rough set of release notes (I don’t have the exact command line on this machine to copy and paste right now).

speed, etc.

Performance is a feature, and Git is blazingly fast (unless you want to check in very large files). I don’t know if it’s the new-toy effect, or that I’ve been working like crazy, or that interactive commit makes it easier, but I find that I’ve made many more commits than I usually do. This really helps for the odd time that one might, er, accidentally introduce a bug.

What’s Been Hard?

The first thing that was hard was pushing my converted SVN repositories to Github. Not that there was anything wrong with Github, but Git just wanted to eat all my RAM and then some more. This was with the FlickrExport repository of ~1000 commits. It turned out that Git was attempting to repack the repository before transmitting it. It appears that Git does this with no concern for the RAM requirements of doing so (sorry, Git fans, I don’t have a better explanation right now). In the end, I had to run git gc --window-memory=200m by hand to limit RAM usage, and then push it to Github.

With any change comes some unlearning. One of the biggest things is that you do everything in Git in one directory. If I had branches in Subversion, I was used to having them in different paths. In Git, you’re always in the same place. Sometimes, I forgot which branch I was working on. Fortunately, Jon Maddox posted some really useful bash-fu to put the current Git branch in the shell prompt. Problem solved.

I’m slowly getting used to git stash but, this morning, I sat down to my machine and, well, where was all the code I wrote last night? It seemed to be gone! Twenty minutes of poking around later, I remembered that I had done git stash the previous night in order to build a specific tag and had not un-stashed it. Again, problem solved but not without a little panic.

So, in summary, Git’s a great tool. It’s about way more than just being distributed, though. There’s a quieter evolution going on in the more mundane parts of SCM too.


Posted
8 July 2008 @ 8pm

Tagged
Programming

4 Comments

Add:     

Another 1.0.

Exposure 1.0 is done. I’d like to say “at long last”, but this one has been an incredible sprint. We only got the iPhone SDK on March 6th - 125 days ago. The sixth beta of the SDK came out on May 29th and that was only 41 days ago.

The NDA is still in effect as I write this so..[REDACTED] etc., etc.. but I think it’s safe to say that I absolutely love programming for the iPhone. One might even go so far as to say it has restored a sense of childlike wonder to my life. For the first time, I have a mobile phone that I can make do (almost) anything I want it to do.

I can also tell you that I’ve seen and used some other iPhone applications and, well, prepare to be blown away on Friday. You’re going to see some incredible things, that much is certain.

At some point after Friday, I hope to write up a post-mortem on developing Exposure (and FlickrExport Touch, which I’m still working on). Oh, and did I mention that, in the middle of all this, I finally switched to Git, nearly a year since I first considered it?


Posted
3 June 2008 @ 7pm

Tagged
Business, Tech, Travel

Comments Off

Add:     

T-minus-twelve

I just noticed that it’s been nearly two months since I wrote here. It’s been a busy time and that time has mostly been spent pushing really hard on my efforts with the iPhone SDK. Neither are yet done, but yesterday I wrapped up phase one (the I-have-no-idea-what-I-am-doing phase) to get ready to leave for WWDC. I’m really excited about both applications. It’s no secret that one of them is a Flickr upload tool, but I like the other one much more.

Yesterday, I re-read an article I wrote back in October: iPhone Apps Have to Pay Their Way. It’s worth re-reading, in my not-so-humble opinion. Seven months on, I don’t think we’re really any closer to having a feel for how to price iPhone apps. It’s one of the big questions that every developer I talk to is weighing up.

So I’m leaving for San Francisco tomorrow and I’ll have a few days to spare before the festivities begin. I’m hoping to spend some quality time with my camera for what’s really the first time this year, then it all kicks off with pre-registration on the Sunday.

Drop me a comment, email or whatever if you want to make an effort to meet up. Email is probably best, since I can pick it up on the phone. I rarely use IM any more, but I’m turning it on for the next 10 days. My AIM name is fraserspeirs, just like on Twitter and Skype.


Posted
12 April 2008 @ 10pm

Tagged
Photos, Tech

7 Comments

Add:     

Keywording in Aperture

So, finally, I’ve drawn together my thoughts about keywording in Aperture. My problem with keywording has always been more about “how can I make it easy enough that I will actually do it?”, rather than “what should the keywords be?”. I’ll explain my personal taste for both, though.

I was inspired to look again at keywording because my father recently gave me a photo album assembled during the first few years of my life (roughly 1978-1983). It was more than a little awkward, though, when nobody could remember whether certain baby photos were my sister or myself. We ended up trying to fashion-date them from our parents’ clothes, which is always a little hit and miss.

It struck me then that we already rely on a lot of metadata that the cameras write into the image’s EXIF header for us. Even having the EXIF date for these images would have helped a lot with the genealogical forensics, but we can do so much better.

In Aperture, you have not only a hierarchical keyword structure, but also a list of arbitrary key-value pairs for every single image you shoot. This is insane power currently, I believe, hampered by what is a fairly weak interface to that power.

Anyway, again, I was looking for a way to lower the barrier to actually doing the keywording and I found it. The feature has existed in Aperture since 1.0 but the way it’s presented in the documentation really led me away from considering using it on a regular basis.

The feature is Aperture’s Keyword Controls in the control bar:

KeyowrdControls

I always read the documentation on this feature in a way that implied that setting up these Keyword Controls was tantamount to the construction of some kind of grand edifice which should stand for all time. I can’t explain why I thought of it that way, but I felt that creating a button set implied a permanence that I could never really get my head around.

It’s nonsense, of course. The main thing I’m here to tell you is that these button sets are throwaway items. You can make lots of them. You can have the same keyword in multiple different sets. You can make a set that you use for a day and then delete.

The magic — if that’s what it is — is that these button sets give keyboard shortcuts to your keywords. The first nine keywords in any set get the shortcuts Option-1 through Option-9, although the set of keywords can be arbitrarily large (I think). The second insight, that I think few people have noticed, is that you can cycle through these button groups using the shortcuts Comma and Period. This makes for really fast navigation through keyword groups.

A Working Example

I was playing at being James Duncan Davidson for the day and shooting the second day of the recent Scotland on Rails conference (Flickr Set). The day before the conference, I set up an empty project on my MacBook Air, which looked like this:

SoRProjectStructure

Everything in this structure is driven by the presence or absence of keywords. I made smart folders for each session, based on the keyword which was the speaker’s name. I chose to use the speaker’s name, rather than the number of the session or its title because the speaker’s name would be more useful as a Flickr tag in the future. Here’s the Query HUD for the keynote:

SessionSmartAlbum

It’s a little non-obvious to set these up because Aperture won’t show any keywords in the Query HUD until there’s an image in the project that bears that keyword. I believe this is new in Aperture 2 since, if I recall correctly, Aperture 1.x would show you every keyword in your database in every HUD. This is a generally good change, because it keeps the size of the HUD manageable. To work around this, I simply imported a dummy image and gave it every keyword that every Smart Album depended on, set up the albums and deleted the image. Once set, the keyword criteria stay set on the Smart Album even when all the images in the project are deleted.

The settings for the “+ No Keywords” album are also new in Aperture 2:

NoKeywordsSmartAlbum

This album is populated with all the images that have no keywords. When I import, this is where all the images start off. The first step is generally to decide whether they’re “general” images or specific to a particular session. I’ll Cmd-click or Shift-click to select all the general or specific images, apply the appropriate keyword and then deselect the images. In a few clicks, all my images are both keyworded and automatically sorted into their respective Smart Albums. That’s power.

There’s Always Flickr

The end result of this shoot was to get some good images onto Flickr. To that end, I created two more Smart Albums: one for images on Flickr and one for images that need uploaded. Here are the criteria for the ‘Flickr - Uploaded’ album:

FlickrSmartAlbum

The “Flickr-To Go” album is similar, except it states that the image should be rated 3* or greater and have an empty “Flickr ID” field. FlickrExport can fill in this field for you when it uploads an image (turn it on in preferences).

Other Ways to Use Keyword Controls

I make, use and delete a lot of keyword button sets. If I’m going on a trip, I’ll make a set with the names of places I expect to go. If I’m at an event, I’ll make a set with the people I expect to be shooting there. I have one for commonly-photographed family and another for friends. I have one for April’s friends. I have one for locations around Greenock and Glasgow.

You Know How to Keyword, Now What Do You Keyword?

You might know how to photograph, and have a great camera, but the enduring question is always what are you going to make pictures of? (Incidentally, that maxim is an incredible challenge. Keep it in mind, next time you get Gear Lust.) Similarly, these techniques are all great, but what are your keywords going to be?

Personally, I like to keep it simple: People, Places, Things and Events. I’m thinking that, in 20 years, I’m going to be much more interested in “who is this person?”, “where was this photo taken?”, “what is that?” and “why was I there?” than I will be in any particular note of the technique used. I mean, we have the EXIF data, so I can derive almost everything about the technique used from that information. Different kinds of photography will

I keyword places using a hierarchy like /Travel/{UK,Foreign/Continent}/Country{/Region}/City/Sub-location which produces such examples as:

  • /Travel/Foreign/USA/California/San Francisco/Golden Gate Bridge
  • /Travel/Foreign/USA/California/San Francisco/Yerba Buena Gardens
  • /Travel/Foreign/USA/California/Sacramento
  • /Travel/Foreign/Switzerland/Geneva/CERN
  • /Travel/Foreign/Greece/Athens/Acropolis
  • /Travel/UK/Scotland/Argyll/Isle of Mull/Craignure
  • /Travel/UK/Scotland/Glasgow/Byres Road

Names are much simpler: /People/{Family,Friends}/NameOfPerson. Events are keyworded thus: /Events/Event Type/Event Name/Participant Name. I find this keyword structure, along with my previously-blogged project organisation structure, helps me find anything I want to get back to with relative ease.


Posted
10 April 2008 @ 10pm

Tagged
Tech

6 Comments

Add:     

MacBook Air, one month on

Someone emailed recently asking for an update on life with the MacBook Air. What can I say? It’s completely fantastic. Every time I pick it up, put it in my bag and walk to work, I know I made a good choice.

I used the MBA recently when I was shooting the second day of Scotland on Rails. Aperture 2.1 performed flawlessly on it: downloading cards was perfectly fast and moving through the UI was fine. I turned off preview generation on import, and that kept everything moving nicely.

I’ve been building software on it, surfing the web and RSS, doing email, light Aperture work, several apps open at once, no real problem.

There’s really nothing more I can add that Daivid Pogue hasn’t already said:

every now and then, a couple of messages come in that really irk me. These messages tell me how wrong I am about something I reviewed, which is fine — but they come from people who have *never even tried the product.*

It was that way with the iPhone, in the time after it was announced but before it was available. “This will be the biggest flop since the Cube,” went the critics. “No removable battery? Nobody will touch this thing.” Etc.

The blogs were full of this stuff.

As it turns out, they were massively, humiliatingly wrong. Four million iPhones were sold in the first 200 days. Its sales surpassed Treos, Windows Mobile phones — everybody but BlackBerry.

So what’s the lesson here? Simple enough: those vocal pre-release blogger-bashers are terrible predictors of a product’s success or failure.

All of this brings us to the MacBook Air. When it came to public pre-opinion, I knew I had another iPhone on my hands. Here it was, another Apple product with a stunning and sexy design, gorgeous software — and several missing standard features. (In the Air’s case, those features included a removable battery, an Ethernet jack, a FireWire jack and a built-in DVD drive.)

So confident was I that the spec-peepers would dump on this machine, I actually tried to pre-empt them in my review. I tried to explain that looks, size, shape, fit and finish actually matter, actually affect the pleasure you get from a machine. “But for anyone who shares Apple’s admiration for elegance,” I wrote, “the tradeoff is worth it. This laptop’s cool aluminum skin and smooth edges make it ridiculously satisfying to hold, carry, open and close. You can’t take your eyes or your hands off it.”

Needless to say, my tactic didn’t work. The feature counters blew right past my attempts to describe the differentness of this machine and dumped on it. “This will be the biggest flop since the Cube! No removable battery? Nobody will touch this thing!” Etc.

I have no idea what the Air’s sales are like, so I can’t yet say that the blogger-bashers were wrong again. I do know, however, that the Air has precisely the same effect on people (who actually *see it*) as the iPhone did: they’re awestruck. They want to hold it, to touch it

I don’t think I have ever agreed more fully with anything I’ve read on the internet. Exactly my experience.


Posted
26 March 2008 @ 12pm

Tagged
Tech

3 Comments

Add:     

McBarCamp, anyone?

So I had this crazy idea to host a BarCamp-style event in Scotland around Mac/iPhone development. A few bits and pieces clicked together, so I’ve put up a Google Docs survey to gather information about the level of interest in such an event.

To expand a little on the content of the form, the event would likely be in Greenock (Greenock is 30 minutes by train from Glasgow) or possibly Glasgow. There will be wifi. It would have to be after WWDC so that we can talk about the iPhone SDK without NDA paranoia. It might be one or two days depending on what people want. No spectators, only participants.

Let me know what you think. Feel free to comment or ask questions here, but please do go and complete the survey so that all the hard data is in one place.


Posted
21 March 2008 @ 8am

Tagged
Uncategorized

Comments Off

Add:     

Media Strategies for a MacBook Air

I recently had some correspondence with Blake Burris, who is himself considering the MacBook Air. Blake was asking about how I’m managing my iTunes and photo libraries on the Air’s limited disk space.

Here’s the substance of what I said, in the hope that it will be useful to others:

I’m a two-machine guy now. I have been for a while, but I’ve always looked on each machine as being equal, but for different purposes. With the Air, I’m moving more towards the Mac Pro being home base, and the Air being something I take with me but don’t depend on. In that sense it’s more like the iPhone: a portable copy of the data, with everything synced up back home.

My photo libraries haven’t fitted on a laptop drive for some time, so that hasn’t been a particular issue. All I use my laptop for is downloading photos into Aperture whilst travelling, which then get moved back to the Mac Pro when I get home. I don’t keep photos on the laptop at all: if I want to show pictures, I’ll pull up a Flickr slideshow.

I have always managed my iTunes on the laptop, though, and my home base/portable version model is slightly different here. I look at iTunes as a mixture of static and dynamic media. All the stuff you paid for (music, movies, TV) is static content that you, in principle, want to keep forever. Podcasts are dynamic content which likely get deleted after one or two listens and which you can always get back for free.

I use my iPhone primarily for video and podcasts and don’t keep music on it at all. I have all my static media on the Mac Pro and the Air’s iTunes library is purely for downloading Podcasts and syncing to the iPhone. I did this because I figured that I wouldn’t want to be away for a couple of days and not be able to move new podcasts to the iPhone. I can wait for the other stuff, although I could equally move a video onto the iPhone from the MacBook Air if I needed to whilst away from home.

To get video onto the iPhone, I connect it to the Mac Pro. The iPhone is set to “manually manage music and videos”, and I can then just drag over what I want. It is slightly annoying to give up the auto-syncing of the ‘newest unwatched’ TV shows, but it’s not a major pain.

If I do want to take my entire library with me, I use my old 80GB 5G iPod. The beauty of this is that you can play music and movies off an iPod on the MacBook Air screen, although I think I have noticed that doing so does not update the “New/Not New” status of TV shows in the iPhone’s internal database. If I ever need to get an audio file off the iPod, well, PodWorks is never far away.


Posted
19 March 2008 @ 12pm

Tagged
Uncategorized

Comments Off

Add:     

John Redwood MP: Parliament Finally Detaches From Reality

The economics get more depressing every day. The government handling, even more so. As John Redwood MP comments:

Large sums of money were made available to the banks to ease them through the persistent credit crunch and liquidity crisis. The US were tidying up the loose ends of the rescue of America’s fifth largest investment bank. The dollar and the pound were in freefall, bank shares crashed, and the Chinese market fell as the authorities there threatened higher interest rates to combat inflation.

Inside Parliament the government had decided the whole day could be given over to debating climate change again.


Posted
18 March 2008 @ 9pm

Tagged
Tech

7 Comments

Add:     

MacBook Air Out of the Box

My wife told me that a “small package” was waiting for me at home. That could mean only one thing: the MacBook Air that I ordered on February 28th. I’ve purchased Revision-A Apple products before, but I’ve never, ever had to wait so long to receive one as I’ve waited for this machine.

I got home to find a small, squarish box which was clearly not big enough to contain a laptop of any size. The attached packing slip detailed five items, one of which was the Air, but only four items were in the box. The TNT driver had loaded two boxes at the depot and only delivered one, but the one he kept was the laptop itself! I was about to be really disappointed when my neighbour came over with a box that looked about the right size. Fortunately, the driver had realised his mistake and backtracked to drop off the second box after Carolyn had left. Relief!

My Order

So, what did I get? One custom configured MacBook Air: 1.8GHz with an 80GB hard drive. I also ordered the Ethernet adapter, since I use ethernet a fair bit at work, a second power brick and AppleCare.

Out of the Box

There’s no denying that Apple made the MacBook Air box a lovely thing to open. It’s more like the iPhone box than any previous Mac laptop box. As factory-installed, the Air’s 80GB drive had 17.5GB of material on it, including a full iLife install. For me, that was a bit more than I wanted to devote to the system, so I decided to try a Remote Disc reinstall.

Remote Disc Installation

I thought it was important to try this new technique at least once before actual data was at stake, so I decided to reinstall the Air over USB Ethernet from my Mac Pro. I had been led to expect disastrously long installation times for this, but I was pleasantly surprised. Here’s the timing:

  • 1830: Power on
  • 1831 (+0h1m): Finds Mac Pro remote install disc
  • 1834 (+0h4m): Installer booted
  • 1843: Clicked ‘Install’ on a nothing-but-required-printer-drivers (HP) installation.
  • 1902 (+0h32m): Green Tick shows up in Installer.

This was with a direct cable connection over the USB Ethernet adapter into a Mac Pro. I’m sure it would be significantly slower over wireless, particularly since I don’t have an 802.11n network.Post-installation, I’ve used 9.39GB of the 80GB disk, a saving of nearly 10GB or exactly 10% of the nominal disk capacity.

App Installation over Wireless

The Air installer discs shipped with 10.5.1, so I had some updating to do. Once that was over, the next step was to install the three packages I can’t download: iLife (just iPhoto), Remote Desktop and Office 2008. The process of using Remote Disc was flawless, once I figured out that I had to enable the “DVD or CD Sharing” service in Sharing preferences on the Mac Pro. I had sort of assumed that would be permanently enabled, having just done a remote OS installation.

Here are some timings over my bog-standard Netgear 802.11b/g wireless:

  • iLife (iPhoto only, ~500MB): 5 minutes from ‘Install’ button to green tick.
  • Remote Desktop 3 (70MB): 1 minute.
  • Aperture 2 (220MB): 3 minutes.
  • iWork (full install, ~750MB): 7 minutes whilst also running the big software update in the background.
  • Office 2008 (Word, Excel, English proofing tools, Office fonts: 815MB): 6 minutes.

So now, with my core apps loaded but no data, I’m using 12.7GB of disk. I skipped Photoshop CS3 for now, but might add it later if I find I miss it.

It’s also worth noting that, whilst configuring the install, the performance of Installer.app is indistinguishable from a local disc except for a slight UI pause when loading what I guess are the preflight scripts from the package. Cutely, if you press the Eject key on the MacBook Air, it unmounts the Remote Disc.

As far as I can see, Remote Disc is a perfectly adequate technology for the purpose of installing software. It is barely distinguishable from a built-in laptop DVD drive. Partly, I suspect, that’s due to the Mac Pro’s faster optical drive. I find it difficult to believe that many Air purchasers are going to have a need to reinstall such large packages so often that Remote Disc will be an intolerable solution for them. I can’t see a USB Superdrive in my immediate future, despite its pleasing aesthetics. I can, however, see myself getting a spare USB Ethernet adapter for my bag.

Hardware Impressions

It’s light. Really light. But then that’s the part you probably knew already. People have also mentioned the rigidity of the case. I totally agree: it feels more like an iPhone or iPod than a MacBook Pro.

The first two times I tried to boot the MacBook Air, I thought it was dead because it made none of the whizzing-clunking sounds that the MacBook Pro DVD drives make on startup, and the hard drive is silent.

The trackpad is extremely large indeed - far larger than that on the outgoing 17″ MacBook Pro - but the trackpad button is very skinny and isn’t clicky enough for my taste.

I have not been the greatest fan of glossy displays in the past, but the MacBook Air’s screen seems to be a significant improvement on that fitted to early generations of the MacBook. Those first glossy screens had a terribly narrow angle of view in which the colour remained consistent. Slight movements of your head would produce wild and dramatic colour shifts, to the point where it was almost useless for any application that required even mild correctness about colour and shade.

Let’s hear it for LED backlighting. I was initially sceptical about exactly how much better LEDs were for backlights, but I’m a total convert. It’s brighter and whiter than the MacBook Pro’s fluorescent backlight, and it also seems to have a greater range of adjustments. The darkest setting is darker than the Pro’s and the brightest setting is much, much brighter.

Having just hammered the hard drive continuously for two and a half hours, the fans are blowing pretty hard right now. The machine is warm underneath at the back-left corner where the hard drive lives, but the top case is evenly cool to the touch all around. Much cooler than the hard drive area on my MacBook Pro, on which I’ve done nothing but type this post. In the time it took me to write this paragraph, the fans have faded almost to idle.

Multi-Touch and Aperture

The multi-touch trackpad is nice, but I’ll need to try and remember it’s there. I haven’t seen many people comment on this, so I’ll note that pinch-to-zoom and the “wiki wiki wiki like your favourite DJ” gestures do work in Aperture, thusly:

  • Pinch: works in the browser to scale the thumbnails up and down. Does not work in the viewer or in fullscreen to switch between fit-to-screen and 100%, sadly.
  • Three-finger-swipe: works everywhere the left/right arrows work to move forward and backward through photos.
  • Two-finger-rotate: doesn’t work anywhere. It would be lovely, though, if it could be used to control the Straighten adjustment!

So that’s the story of setting up the MacBook Air. Another very, very well-done experience from Apple. Anything else you want to know?

[Update: The Late-Breaking News About Aperture 2 document details all the multi-touch gestures you can use with Aperture 2.  Also, it turns out that you actually can use the rotate gesture for the Straighten adjustment - you just have to add it to the set of adjustments first. Sweet!] 


← Before After →