13 Jun 2011, 1:57pm

leave a comment

Apple breaks own guidelines, “volume up” now a shutter button

Many apps, GPS Log included, wanted to implement a volume-up-as-shutter-button feature. I remember this especially pre-facetime, pre iPhone4, when there was just the rear-facing camera. A few apps did implement this early on and were accepted, then later this behaviour was frowned upon, and expressly prohibited in the user guidelines (phrased something like “thou shall not use buttons for anything but their intended use”).

In fact, I implemented this feature for GPS Log but had to disable it in the official releases due to this reason.

And now, Apple has implemented this across the board.

Well it’s a good change. The old shutter button can be really hard to press sometimes if you’re trying to frame a particularly difficult shot, so it makes perfect sense. Also for self-portraits using the main camera. And I guess it’s their garden, and they can do whatever they want inside! It certainly pays us not to forget this.

11 Jun 2011, 4:26pm

leave a comment

Cross Dressing URLs

When developing geospike.com (with my pretty small dev team) it always amuses me when I implement thing that to me are no-brainers, but that the big guys have not yet done.

Take this tweet (randomly selected) URL.
http://twitter.com/#!/Mr_Lexington/status/79427291343630337

Now have some fun with it:
http://twitter.com/#!/hello_kitty/status/79427291343630337
http://twitter.com/#!/you_suck/status/79427291343630337

The urls work! Of course you could make the URL quite obscene if you wanted to, I’ll leave this as an exercise for the reader. They don’t even redirect (meaning it’s entirely possible for such URLs to be indexed in Google!).

Or take this news.com.au story:

http://www.news.com.au/technology/alaska-publishes-palin-email/story-e6frfro0-1226073420363

and tweak the text a bit:
http://www.news.com.au/technology/sarah-palin-is-elected-president-of-the-united-states/story-e6frfro0-1226073420363

OK, at least news.com.au 301 redirects to the real story, so Google won’t cache it. But still – is it good these URLs work at all? What valid reason is there for them to work? [and no, I won't accept "my sysadmin/developer is lazy" as a valid reason]

Had some fun?

Now try a geospike one:
http://geospike.com/divzero/spike/27435

tweak it a bit:
http://geospike.com/eat-poo/spike/27435

oh, it doesn’t work. geospike++. different case versions of the username *do* work (well they 301 redirect), as to any past usernames.

Dev’s note: I fixed this today (had you tried this a few hours ago, the geospike.com link would have worked too). I can certainly see why the twitter and news.com.au (and no doubt countless others) exhibit this behaviour. The reason they work is that the URL already has a unique ID that is used to look up the content, and the rest is purely dressing. I think the dressing is good. It makes the URL pretty, and in News.com.au’s case may help with SEO. I just think the dressing should be valid.

9 Jun 2011, 7:32pm

5 comments

Request: browser tabs should be default:mute

The other day I found myself with about 200 tabs in 5 windows opened. Travel searches (flights, visas, etc), development, questions, and some entertainment.

Then suddenly some music starts playing on my computer. Where is it coming from? Who knows‽ I had to go on a big hunt.

Since I rarely want the non-focused tab to be emitting any sounds whatsoever, I really think a default:mute policy would make a lot of sense here.

Or at least, some visual indication of which tab is emitting sounds, maybe by replacing the favicon.

9 Jun 2011, 7:15pm

3 comments

Fiendish iOS Code Signing ‘Invalid Binary’ Issue

When you’re building a project it’s common to have ‘debug’ and ‘release’ targets. This is true for iOS. In the past, it was common practice to clone the release environment into ‘Ad-Hoc’ and ‘App Store’ distribution targets setup with the relevant signing credentials (to avoid you switching these credentials every build). The danger here however is that there was a chance that what you were submitting was different to the release build (are all your #defines on, for example?) with care this risk was avoided, but it wasn’t a great situation.

Enter the more modern builds of XCode3. These let you archive builds, and also re-sign them for submission which was a great improvement. So you can build *once* for release, and run it with your dev credentials, then save it as an IPA for ad-hoc beta testing, and finally resign it the third time for appstore submission.

So I am on the verge of deleting my old distribution targets and relying purely on this functionality.

But there is one, nasty, nasty catch. If you have multiple developer accounts (common I guess for any iOS contractor), this process fall apart a little. The golden rule I discovered today after a lot of pain (my only feedback for each failed attempt was an email from Apple stating ‘Invalid Binary’), is:

You can only re-sign the build with a certificate/profile combination that is from the same development team as what it was originally signed with. I was creating the builds for dev with my own credentials, then re-signing them with my company ones, and this is what failed. XCode let me re-sign and upload the build, but then it would be automatically rejected (the ad-hoc builds would also fail).

So the solution is make sure your Debug/Release builds are signed with the developer credentials of the correct project development team. If you do this, then you can re-sign with distribution credentials no worries.

I haven’t investigated this situation in XCode4 yet, but if you are getting ‘Invalid Binary’ or ‘Entitlements not valid’ errors (for adhoc), then try this!

9 Jun 2011, 1:08pm

2 comments

Macbook exhaust fans spinning up at night? Check your screensaver!

I often leave my Mac running overnight, and I sleep in the same room.

I kept noticing something that annoyed me which was the fans would often start whirring at full pelt just as I was going to sleep. The strange thing is that my MacBook (especially the new one) rarely makes a sound during the day. After a while they would spin down.

Last night the penny dropped – it’s the screen saver. The fancy, 3D hardware using screensaver. The moment I woke up the computer, the fan RRP started to reduce. So I promptly set my ‘Display Sleep’ time to 1min, and went to sleep soundly. Before, it was set to 15min – so it would eventually spin down (hence my previous observation as well).

Moral of the story: if you want your computer to stay quit right when you need it to be, use the ‘Display Sleep’ feature without screensavers (as attractive as they may be).

8 Jun 2011, 12:22am

leave a comment

Preventing Google from indexing AJAX HTML fragments/partials.

So you’ve created a neat new site using AJAX. Your server code renders up partial HTML pages which you slap directly into the DOM. Problem is, somehow Google found these partials (even though they are only referenced in Javascript), and has indexed them. Furthermore, because they are not whole HTML pages (and not designed to be), there is no tag where you can place a robots <meta> tag to prevent them being indexed.

Enter the new X-Robots-Tag HTTP header. You can set this header to ‘noindex’ when you return the HTML fragment, so that if google somehow finds it, it still won’t cache it.

Details are here.

I applied this today to geospike.com, Google indexed a few of these <head>-less pages which is pretty terrible if the user clicks on them (they see unstyled crap), hopefully they will drop from the index shortly.

7 Jun 2011, 1:19pm

leave a comment

WWDC Keynote Link

Keynote is available here.

Her’es the HQ streaming link you can open with Quicktime so you’re not watching it in a browser…

http://qthttp.apple.com.edgesuite.net/11piubpwiqubf06/sl_vod.m3u8

7 Jun 2011, 12:22pm

leave a comment

iOS 5: Everything you’ve always needed, finally here

[For context, read the feature list first].

Don’t get me wrong, I’m very impressed with iOS5, and it’s a huge step forward. But I have to say with a lot of these features I was thinking finally.

I’m especially referring here to the whole ‘No PC’ option. iTunes has always been the weakest link with iOS – the need to tether your device to back it up, to update the OS, and to download apps & music with any sort of reliability.

This affected me as a developer in two ways. One is that people didn’t back up often (sometimes going months between backups), simply because they didn’t sync often. I developed geospike’s sync feature to help with this (and many other things). It also meant they didn’t update their OS often. To combat this, I support old OSs, in fact the latest version of GPS Log still supports iOS 3.0! Both of these were more exacerbated in one of my target audiences: travellers, since they are often away from their tethered computer.

Another thing I saw lots were people with basically “broken” iTunes setups. Perhaps it was on their old computer? Perhaps they are trying to shift. Unless you go from one mac to another with the migration assistant (which rocks), lets face it – this is a challenge.

Being able to sync wireless to iTunes is also awesome. Takes the effort out of syncing, so long as your device is plugged in and both are turned on, it will sync. That is really, really cool!

That Apps will now update automatically is gold. Actually people are *very* good at updating quickly already, it seems a great many people who update, update every week. So this will just make a good situation better. yey!

That you can download your entire backcatelogue of purchased items is another feature, I regard as a finally. I bought and paid for stuff. I can re-download them for free. Why should I have to go looking?

As for notification, Apple itself acknowledged this was pretty broken, and it’s nice to see them adopt the status bar notification log feature from Android, which reminds even the hardest-core Apple fan why it’s a good thing to have competition (remember: IE6!). I’m a huge fan of Android for precisely this reason (oh, and thanks for Wifi hotspots in iOS 4.3!).

Hope I don’t come across as negative here – how can I say… I love it so much that I expect a lot too.

The other new features are pretty impressive. Keeping everything magically in sync is a great idea, and yeah that’s definitely not something that should have been expected in the past.

One fun thing about iOS releases is seeing which features Apple has implemented that I had recently hacked in myself. I implemented a search bar in iOS 2.x just week before they were cool (and part of the standard basic UITableViewController). I implemented meta-data for saved photos, then iOS 4.2 came out. I guess with iCloud, a great many app developers will be able to sync their data without creating their own solution like I did. There are so many advantages for my customers of having this data go through geospike.com that I don’t really feel sad about that one. I wonder how ‘The Daily’ feels now that there is (what appears to be) a pretty kick-ass ‘newsstand’ feature. Hell with a feature like that, maybe Apple’s 30% cut is worth it for pubs! I’m actually thinking to check out a few subscriptions this way. I wonder if I should switch my paper Newsweek subscription to digital?

There’s certainly a lot of great stuff in iOS5! Some really great stuff. I’m just pointing out that being able to download all your purchases and sync without are thankfully with us at last ;-)

Tell you what it’s going to be nice to start dropping support for iOS < 4.2, and phase out support for old app versions too.

3 Jun 2011, 5:42pm

leave a comment

Class vs ID

If you’ve ever wondered what the differences are between ‘class’ and ‘id’ in HTML, this is a great explanation. Colourful too!

3 Jun 2011, 5:26pm

leave a comment

Setting a NSString #define in the config

So you have a define, e.g.:

#define BLAR = @”http://blar.com”

And you want to move it out of the source code and into the “Preprocessor Macros” section of the build config’s target info.

The correct line to add would be:
BLAR=@\”http://blar.com\”