Sunday, December 21, 2014
Countdown
40 still holds a certain psychological significance. Maybe it's a halfway point: 80 should be easily obtainable these days, barring any of the nastier health issues. I can probably look forward to still being active in another 40 years — if not still actively employed. (I really should re-start paying into that pension.)
Nevertheless, I feel a certain amount of pressure to achieve something in the next twelve months. The last year has been a bit of a bust. Professionally I've only managed to reaffirm that I'm not really suited to working with anyone (or that I have a monumentally low threshold for fuckwits). I've hardly written anything, which isn't a great loss because no one is reading anything I've written previously. I haven't worked on any of my own projects either, deciding instead to spend my dwindling spare time working on apps for other people.
I think it's time for some ridiculously optimistic new years resolutions.
Sunday, January 12, 2014
Raspberry Pi iBeacons
I finally got around to playing with iBeacons on the Raspberry Pi today, following this tutorial from The Register. I chose a cheap (£12) Bluetooth LE USB dongle from Amazon, which Raspbian (from NOOBS v1.3.4) found without any problems. Configuration wasn't quite so effortless. I found that the following was a better order of steps once the BlueZ stack had been compiled and installed:
sudo hciconfig hci0 up # to ensure that the device was running
sudo hciconfig hci0 noleadv # unadvertise
sudo hciconfig hci0 leadv 3 # readvertise, but as not-connectable
sudo hcitool -i hci0 cmd ... # etc. etc.
I wrote a quick Python script to automate starting and stopping the beacon. (I'm still only starting to learn Python, so be gentle.)
On the iOS side, it appears to be necessary to set the (poorly-named) .notifyEntryStateOnDisplay property of the CLBeaconRegion instance you're monitoring to YES in order to get beacon entry and exit notifications while the app is active (as apposed to only when the device is sleeping or the app is in the background).
At the moment I have to walk to the far side of my flat in order to get an 'exiting beacon region' message, so I'm going to have to have a play about with the signal strength property. Or get a larger flat.
Saturday, January 11, 2014
Scarce
Reading John Robb's excellent Punk Rock: An Oral History, what struck me from the beginning were the reoccurring tales of the difficulty early fans had in finding information about their new favourite bands, let alone getting hold of their records. Allegiances were formed on the strength of single paragraph reviews in the music press; overnight cross-country pilgrimages were made to see the bands play; the photocopied fanzine was the organ of record. (This was at the grassroots level. The Sex Pistols of course were the brainchild of an arch media manipulator. You had to work hard to avoid hearing about them.)
All of which William Gibson describes far more eloquently in his essay "1977" in Punk: An Aesthetic. He describes the shock of the new upon first seeing a stack of UK fanzines brought back to Toronto. "Today we know what new things look like before we encounter them physically. Usually we know what they'll look like before they even exist." He identifies grunge as the last of the pre-digital counterculture movements, the last to start its slow burn to popularity away from the gaze of a public always hungry for something new.
Even though I grew up in the pre-internet world, I find it hard to image what it would be like to experience such scarcity when nowadays even the most niche form of entertainment is, from its very earliest days, its very inception, only ever a Google away. Rather than fighting to have their voices heard across the great open expanse of culture, these day new experiences struggle to be heard above the cacophonous din of a million competing entertainments. Will the next significant movement benefit by the increase exposure the internet allows? or instead be drowned in a sea of noise?
Friday, January 10, 2014
NIB-Based Xcode iOS Template
I once failed one of those coding test job interviews things because of the changes made while I wasn't looking to Xcode templates. In my defence I hadn't actually needed to create a new project in a while and we'd just moved to a new version of Xcode and so on. The challenge itself wasn't too hard — just grab an XML file from a server, parse it, and then display the results in a table — but by the time I'd beaten the empty project into a shape I recognised most of the time had already slipped away. Ce la vie.
More recently, Xcode has moved to having all new templates use Storyboards by default. Often, this isn't what you want. While there are ways of reverting to the NIB-based templates available in Xcode 4, they aren't quite as simple as all that. Which is why I made this basic NIB-based template, which you can grab from GitHub here. Full installation instructions ("drop it into a folder") are included.
This template isn't a direct clone of the old-style ones, since by default it creates the application window and root view controller in code rather than loading them from a main NIB. What it does do is to create a NIB (or two NIBs, in the case of universal apps) for the root UIViewController subclass. I think this is close enough to the old behaviour for the usual use case of needing a quick test bed for trying something out — for any more substantial projects you're going to want to take the time to configure them by hand anyway. The template inherits (as far as Xcode templates implement inheritance) from Xcode's default iOS template, which means that projects created from it in the future will benefit from whatever (hopefully sane) changes Apple make there.
I was helped to throw this together by this StackOverflow post, and this description of the template format which it linked to.
Friday, October 04, 2013
Coffee
App Store pricing is back in the news again. These lines from Florian Kugler, quoted by Vinny Coyne, caught my attention.
We’re in the business of creating products which offer very little value to people. It’s our choice if that’s what we want to pursue.
No. A million times no. This may be merely splitting semantic hairs, but the idea that the product you create offers little value to your customer is not only wrongheaded but cancerously so. If someone goes to the trouble of downloading and using your product then it must have value for them. The problem is that they perceive it as having little value, in a way taking it for granted. I have lost track of the number of people I work with — people who make their living designing, pitching and managing the production of app — acting shocked and outraged when they discover developers charging for apps. These are people who know how much work goes into the creation of an app, both in terms of time and money. And yet they still treat the final result of all this work as being worthless. The problem of app value is one of perception, and it's a problem which the developer community needs to address.
Sunday, April 21, 2013
UIButton states
UIButton allows you to set difference appearance properties (fore- and background images, title text and colour, and so on) to be displayed according to what state the button is currently in. What to my eternal shame I hadn't realised until the other day is that these states (selected, highlighted and disabled) are not mutually exclusive. This is mentioned in passing in the documentation for the UIControlState enum, but doesn't appear to be emphasised anywhere else. I blame the property-setting UI in Interface Builder for my confusion. It only allows configuration of the four main states, and not for combinations of states.
![]() |
| Misleading. |
Combinations of states? Yes. So if you every wanted to set different disabled images for when the button is selected or unselected, you have to do the configuring in code, passing an ORed bitmask of states (such as UIControlStateSelected|UIControlStateDisabled ) to the relevant setter method.
Friday, January 04, 2013
2DO
Since I failed so completely with last year's Big List of Things to Do without suffering any negative repercussions, I thought I'd try again this year with an even longer list. Here we go:
- Publish the other couple of short stories which I've got almost edited.
- Start, finish and publish a novella (the one provisionally entitled "This is not a Game").
- Learn to juggle.
- Produce a work of interactive fiction (and in the process develop the game engine and tools to allow me to create more).
- Finish my re-write and iPadification of "Plaques".
- Write the script for a graphic novel (possibly just a short) and commission someone to draw it for me.
- Learn to snowboard.
- Write up the scripts for the couple of animated shorts I have ideas for (and maybe look at finding someone to make them).
- Learn to sail a boat.
- Find a form of storytelling which will actually attract readers/viewers (or whatever that particular media's consumers are called).
- Get the battery in my watch fixed.
- Consider what it means to be a creator trying to create in the current over-saturated, content-bloated environment.
- Design and 3D-print something.
- Enter as many writing competitions as I can find.
Plenty of suitably vague stuff there. I must surely be able to achieve at least one of them, eh?
Monday, December 31, 2012
Recap
In January I scribbled out a short list of writing-related things I'd like to achieve. As the last moments of 2012 trickle away, let's take a look back and see how badly I failed.
- (Self) Publish two volumes of short stories — Well, I got halfway there, even if at two stories it's only just a collection. I've got another couple of stories almost edited, so I'll see if I can't completely tick this one off next year.
- Commission a graphic novel — Didn't even come close. The script still needs writing. In typical programmer geek fashion, I think I'm going to have to code myself the ultimate storyboarding iPad app first, before I can settle down to writing the actual story.
- Complete a full-length script — I'm not sure I even started a script this year.
- Complete the novel(la) I've been planning — Yeah... Nope. Didn't happen.
So there you have it. Twelve months later and I'm no closer to achieving my writing goals. Time to start work on another list, I think.
Monday, December 17, 2012
π
I've had a Raspberry Pi for a few months now, and to be honest I still don't know what to make of — or indeed with — it. Here are a jumble of my current thoughts.
Running RISCOS is fun. Way back in the distant past when I was at school, the computing lab was populated exclusively with Archimedeses. Compared to the home computers of the day — the Atari STs and Commodore Amigas — these were nice fast machines with a lovely hi-colour GUI. Real Rolls Royce machines. Seeing RISCOS boot in a few seconds on the Pi gives me a real buzz. It's also cool to see it connecting to the internet, given that we didn't have any of that nonsense back when I was in school. It's just a shame that the default web browser doesn't support JavaScript, rendering most of the modern net unfortunately broken.
I wish I could find more to do with RISCOS. But then it's always seems to be the same with me when running a new OS for fun. Without actually needing to get work done with it I'm usually at a loss. I guess if I wanted to risk nostalgia overload I could spend more time running the Hatari ST emulator on it. I'm looking forward to giving BBC Basic a whirl. It would be nice to think that this classic language, on which a good number of the UK's bedroom coders cut their teeth, could step in to fill the Pi's remit of inspiring and empowering the next generation of programmers.
DexOS looks like a fun low-level OS. I haven't got it running yet, but I will one of these weekends. The same goes for Plan 9, which doesn't seem to like my mouse at all. And I'm really looking forward for the day when Android is usable on it, especially if someone figures out how to let it host its own development environment.
Rasbian, the Pi's de facto operating system, however, is slow. Almost unusably so, in my opinion. Maybe this is in part due to running it from an SD Card, but since this is the main configuration for the majority of people you'd think it would've been optimised. Applications are slow to launch and web pages trickle down. Sure, the Pi is "only" a 700Mhz CPU with less than 128Mb of RAM, but I can't be the only person who remembers Linux performing far better than this on much older hardware. Yes, considering you get a complete Linux distribution for free, I really shouldn't be complaining. But the aim of the Pi project is to get kids coding, and I'm not sure whether such a frustrating environment is the best place for that.
The thing with the hardware from the home computer boom of the early 80s — the hardware and the time which the Pi is seeking to hark back to — was the constraints it imposed. Constraints foster creativity, and most of the fun learning to program in those days was in finding the limits of the hardware and pushing against them. You typically only had a choice of a couple of languages (if you had any choice at all, otherwise it was just the built-in BASIC) in which to explore your environment. Learning everything about the machine was possible, and once you had a lot of the fun was in teaching it to perform new tricks. (This kind of limitation, I think, was also partly why the iPhone quickly became popular with hobbyist coders.)
The Raspberry Pi finds itself in an unfortunate position. The hardware, while undoubtedly cheap and mostly capable, is underpowered by the standards of the day. It can run Linux, but not nearly as well as you could on a standard x86 desktop system. The same goes for the available languages and programming environments. Ultimately, the Pi fails to be unique in the way which the home computer systems it tries to ape were.
Sunday, November 04, 2012
First
The Endless Sleep is available from Amazon here. It's a Kindle exclusive for the moment (until early next year, at least), meaning that it's available to borrow for free to Kindle-owning Amazon Prime customers. I'm doing this for the readers (and feedback) rather than the money, so I'm hoping this is a gamble which will pay off. I'm finding it almost impossible to get motivated to write at the moment, so I'm hoping that this will provide some form of a shot in the arm. Maybe a few 2-star reviews along the lines of "Not quite the worse thing I've ever read". A boy can dream.
I really have to thank my editor, Julia McKay. She can be contacted here and I'm sure can help you like she helped me. Together we fixed a lot of problems. All the remaining ones are due to my own intractable stupidity.

