Update (26th Aug 2009): It does now seem to be working and I've successfully ordered my copy. In fact it tried to order me 4 copies, apparently having remembered my previous failed attempts.

I recently bought a new Mac so I qualify to get Mac OS X 10.6 (Snow Leopard) super-cheap as part of Apple's Up-To-Date program. Unfortunately, the online up-to-date system doesn't seem to be working, for the UK at least. Here's my transcript of live chat with the Apple rep, where they state that indeed it's not working and they know it.

  • You are chatting with Danielle C, an Apple Expert

  • Hi, my name is Danielle C. Welcome to Apple!

  • Hello – I'm struggling to use the Snow Leopard Up to date program.

  • Good evening

  • You are trying to register for it online?

  • I click through, fill in details, it says my computer is qualifying, but then it says "There are no items in your basket"

  • yes – using website

  • I apologize for the inconvenience.

  • I'm clicking through from http://www.apple.com/uk/macosx/uptodate/index.html

  • Unfortunately there is a glitch in the site, you can still order via post or fax in your order form.

  • :-/

  • I've been trying for days.

  • Using different browsers, assuming the problem might be my fault.

  • The site is not working for most people trying to order it unfortunately.

  • You would have to fax or send in your order form.

  • How about putting something up on the page to say so, to save all those people's time?

  • I am very sorry about the inconvenience.

  • How do I email in an order?

  • You cannot email it in, it has to be Fax or Post.

  • I bet a lot of people will stump up the full amount, to get past the inconvenience.

  • Which might be why nobody's fixing it or even putting up a sign saying it's broken. But that's the cynic in me.

  • Do you know when it might be fixed? I'll wait if it's fairly soon.

  • Unfortunately I would not have that information.

  • Do you mind if I post this transcript on my blog?

  • Thanks for waiting. I'll be right with you.

  • Sure.

I was pleasantly surprised when I went to pay my most recent credit card bill. Not only was it relatively small for a change, but the BarclayCard website has been revamped, with that most unusual of results: a markedly better user experience!

They now show a coloured bar meter indicating your total credit limit (the whole length of the bar) with your last statement and current total outstanding clearly marked as coloured portions of it. It's a really great way to graphically show the balance. They've clearly paid attention to every aspect of user interaction, with the flow being very straightforward and very clearly guided at all times, but not onerous.

Perhaps the very best change is the return of the option to pay off your last statement in full. For the last year or so they had things set up so the options when paying were: minimum amount, whole balance (including new transactions since last statement) or custom amount. To pay off your last statement in full you had to manually read off the amount and type it into the custom field. This was very cheeky of them, clearly trying to steer the punters into taking less advantage of the free credit grace period (by paying more than their last statement amount) or paying less than their last statement amount and so accruing expensive interest. I'm glad to see this cynical move has been reversed.

Because my broadband wasn't working I've been using internet tethering with my iPhone for my main internet connection for my computer. So when my iPhone demanded I update its software to cure its SMS vulnerability I thought hey why not go ahead! I figured it would download the update to the computer (via the iPhone's net connection) as per normal, then perform the update. No reason to suspect a problem. 

Unfortunately once it had got the whole 300MB package and tried to install it, it required access to some Apple server in order to finish the install, but the iPhone was half-updated and no longer providing internet connectivity. So I got stuck there, with an iPhone just showing a "connect to iTunes" graphic when switched on. I understand this is known as "recovery mode". And that's how it's been for a full day, but thankfully I now have broadband working and have managed to get it back up on its feet. That required a factory restore then update from backup then full sync though, and I'm yet to determine if all is truly well.

So the lesson here is – don't use your iPhone as the sole internet connection in order to update your iPhone!
For some reason, having switched it off when the previous occupants left, we now have to wait 2 weeks for BT to turn our broadband back on again. I know not why. They must literally have a system that includes a "wait two weeks for no good reason" step. As such I'm using my iPhone with internet tethering as my internet connection.

It works reasonably well, maxing out at about 50 kilobytes/s – which equates to about half a megabit, so stretching the term broadband quite thin but useable as long as you're not in a hurry. However I've noticed that O2 are pulling a fast one (pun intended) and rewriting JPEG and GIF images that you request via HTTP, re-encoding them at a much lower quality level, presumably in order to make your bandwidth go that much further.

I have a problem with this though as they've gone so far down the quality slope that the images are often no longer fit for purpose, with small text unreadable and photos suffering from JPEG artefacts so badly that there's only a muddy mess left. Here's a small screenshot from my blog sidebar, showing the knackered JPEG, which I have saved with very high quality JPEG compression so as not to introduce more artefacts. Of course when I review this post it'll get re-compressed by O2 again and look even more terrible (indeed the hyperlink text is near unreadable) but hopefully you won't have that problem unless you're also tethering.

O2CompressedJPEG

So this is a plea to O2, asking them to turn up the quality, if they must mess with the web at all.
I've been putting together a WordPress powered blog or two recently and diligently documenting the steps required, as ever. The documentation available from the WordPress site is pretty good, but sometimes it's over verbose, whilst frustratingly also stopping short of giving you exactly the details you need. So here's what works for me to upgrade an existing WordPress installation to a newer version. This is using the manual approach BTW rather than the built in auto-upgrade functionality, which asks for FTP details (of what I'm not sure, and it doesn't bother to elaborate) and therefore makes a mockery of the term 'auto'.

The official instructions that got me going initially are at http://codex.wordpress.org/Upgrading_WordPress FWIW, but I do precisely this on Mac OS X:
  • Download the zipped upgrade package and unzip it somewhere - e.g. to wordpress_upgrade directory for the sake of this example.
  • Backup existing installation in full – both the wordpress directory itself and the associated MySQL DB, just in case.
  • Merge the newly downloaded package over your existing install (assumed to be a directory named wordpress here) with the following incantation at the command line, which takes advantage of the fact that cp merges, whereas Finder copying just oafishly replaces:
  • > cp -r  wordpress_upgrade/ wordpress_original
  • Compare the new wp-config-sample.php with your existing wp-config.php (e.g. using FileMerge) to see if any new config items have been added. If so, manually add those into your wp-config.php file, or if easier rename the sample to wp-config.php and put back the DB connection and other relevant bits.
  • Load up the /admin page in your web browser and follow the instructions to complete the upgrade, which involves it upgrading any DB bits, etc.

Email apps generally have ‘Reply’ and ‘Reply to all’ as options for responding. But I crave an extra option: Reply to all as CCs. This would put the original sender on the To line and all of the original To recipients as CCs (except me obviously).

This contrasts with the usual reply all behaviour which puts all original To recipients on the To line, which is often not what I want, even though they were all on the To line of the original. Maybe I’m just strange.

Say you've got a Ramaze web application quite happily running at http://foo.com/ but you want to have the whole app running at http://foo.com/myapp/. It's not unusual to want to do this, for various reasons, and it's relatively easy to arrange by setting a single piece of Ramaze config.

The exact way to do this depends on the version of Ramaze you're using, as the options system changed between the 2009.03 and 2009.04 gem versions. Here's the syntax for Ramaze version 2009.03 and previous:

Ramaze::Global.prefix = '/myapp'

And here's the syntax for Ramaze 2009.04 and later, which requires setting the prefix for links (as before) and a routing rule for stripping it off incoming requests (since it no longer does it automatically):

app_prefix = '/myapp'

Ramaze.options.prefix = app_prefix

Ramaze::Route[ /^#{app_prefix}(.*)$/ ] = '%s'

The prefix will be automatically added onto the front of all URLs created by Ramaze's built-in URL and link creator methods (R, Rs and A from the link helper). It will also be stripped off the front of all incoming requests by the dispatcher (for Ramaze 2009.03) or by the routing rule (for later versions). So your own application code doesn't need to be aware that it's running with a prefix at all, unless you create absolute URLs via means other than the link helper methods. In that case you will need to use Ramaze::Global.prefix or Ramaze.options.prefix in your own link construction code to get them right.

One thing which might catch you out is forgetting to put the forward slash on the front of the prefix. If you set the prefix to 'myapp' it won't work – it has to be '/myapp'.

Update: Note that static files (those in your public directory) are not affected by any of the above changes. Furthermore, chances are that you refer to them with absolute paths from your HTML anyway – e.g. for images, CSS, JavaScript. So further thought will be required to handle these.

WWDC has begun and more information is trickling out about Mac OS X 10.6 "Snow Leopard". I like what I see, but one thing really stood out as intriguing: default gamma will be 2.2 rather than the traditional Mac setting of 1.8. It's one of the many items mentioned on this page: http://www.apple.com/macosx/refinements/enhancements-refinements.html. This is going to be important for photographers and graphic artists in particular.

What does it mean? Gamma refers to the way numerical colour representations are mapped to real colours on the screen – specifically how the luminance is mapped, i.e. how light they appear. Wikipedia explains gamma in full, complete with some neat sample images to show how different gamma settings affect the way an image looks. Windows PCs traditionally use system gamma setting of 2.2 whereas Macs go for 1.8, which means that the same image tends to look darker on the PC than on the Mac, assuming that the image doesn't contain colour profile information, which is the case for most images and videos on the web. Mac users create pictures to look just right on their monitor and are disappointed when the image looks dark and dingy on their PC using friends' machines. Conversely, the PC artist is surprised that the image they create looks bright and washed out on their friends' Macs. And neither of them generally have a clue that this is because of the different gamma settings of the systems!

It seems that Apple have decided to bite the bullet and get in line with the popular 2.2 standard to end this perennial confusion. This is a major step for Apple to take and I imagine they had to think long and hard over it, but it's probably for the best in the long term.
I've been working on an iPhone app that uses location data extensively. From poring through the raw data that comes from CLLocationManager I've learned a few interesting things. In particular it seems that CLLocation objects with negative (i.e. invalid) verticalAccuracy value were likely derived from non-GPS sources – e.g. triangulation from cell towers or SkyHook WiFi positioning. In my app I really need only the purest, most accurate data so I'm choosing to ignore non-GPS data and this is how I can tell it apart in order to do that.

It took a while for this realisation to dawn on me as I was seeing occasional poor data points mixed in with the good ones, and this seems to be because it occasionally slips in a non-GPS location in certain circumstances.
Objective-C can be a difficult mistress at the best of times, but I've been pulling my hair out over the useless exception traces it gives when my iPhone app falls over. For example:

2009-06-02 22:22:39.036 GPSDraw[31024:20b] *** -[CLLocation timeIntervalSinceReferenceDate]: unrecognized selector sent to instance 0x40add0
2009-06-02 22:22:39.038 GPSDraw[31024:20b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[CLLocation timeIntervalSinceReferenceDate]: unrecognized selector sent to instance 0x40add0'
2009-06-02 22:22:39.039 GPSDraw[31024:20b] Stack: (
    2532991147,
    2419396155,
    2533020330,
    2533013676,
    2533013874,
    2532962733,
    23499,
    22944,
    2520474771,
    2532494021,
    2532494456,
    827745792,
    827745989,
    816114848,
    816160924,
    11116,
    10970
)

Which is all very exciting, but how about telling me the line of my code that threw the exception? That's what any sane IDE would do, but XCode is different and prefers to give an unhelpful list of numbers instead. The stack that the debugger shows is always just some arbitrary point in the main run loop, with the only bit of my code in scope being main.

However I've stumbled across the crucial way to get the behaviour that should be enabled by default. Whilst debugging, select Run > Manage Breakpoints > Add Symbolic Breakpoint. Now enter "objc_exception_throw" without the quotes and it should actually break at the point in your code that the exception is thrown.