Cocoa tip: using custom outline view cells designed in IB

Cocoa, Development, Objective C No Comments

I only started learning Objective-C and Cocoa in mid-May, and for the first time I think I actually have a tip to contribute to the wider community. It’s about using custom cells in NSOutlineView, but those which you want to design inside Interface Builder rather than drawing manually.

If you’re an iOS developer, you’ll be wondering why this deserves a blog post – it’s easy to do in Cocoa Touch! Well, yes it is easy on iOS, because Apple have specifically allowed you to design table view cells in Interface Builder. When targetting Mac OS X though, it’s actually pretty awkward, and here’s why: in Cocoa Touch, the class which draws the cells in a table is UITableViewCell, which is a subclass of UIView – meaning you can drag one onto the canvas in Interface Builder and lay stuff out right there. In Cocoa, in contrast, the cell is simply represented by NSCell, which is not an NSView subclass. This means Interface Builder will not let you play with them, you draw them by implementing drawWithFrame:inView: instead. I think Apple realised the problem with this design in time for Cocoa Touch but obviously felt they couldn’t break the existing Cocoa interfaces. There are also many differences between the instantiation of NSCell versus UITableViewCell – there’s only one NSCell for all rows in a table / outline view, compared to a type-indexed pool in Cocoa Touch.

The problem boiled down to this: if the contents of your table / outline cell is non-trivial, or if you just don’t want to write a bunch of layout code, it’s a PITA to implement a custom look in NSOutlineView, such as the one in the picture, especially if you want custom controls embedded in it. For my current Cocoa app, I really wanted to design my cells (and I have 2 different styles for group levels and detail levels) in Interface Builder to save me hassle, including using Cocoa Bindings to hook up some dynamic fields within. Many internet searches later, and mostly the answer I found was that it couldn’t be done. Luckily, I’m too stubborn to take no for an answer, and eventually I figured out a way to do it. Details are after the jump, with an example project to show it in action.

Read the rest of this entry »

Share this post: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • N4G
  • StumbleUpon
  • del.icio.us
  • Mixx
  • Google
  • blogmarks
  • Slashdot
  • Reddit

Dude, there’s an Ogre on my mantelpiece!

OGRE, Personal 18 Comments

In a complete and total surprise, my cousin presented to me yesterday the result of a grand conspiracy in the Ogre community to commemorate my time as project lead – a specially designed, unique Ogre statuette! Thumbnails below, click for more detail…
Receiving the statue Sinbad holding the statue
Front of statue Back of the statue

I literally had no idea this was going on, or that my cousin had been asked to make the delivery that day (I thought we were just meeting for a social). I was completely taken aback and very touched that the people in the community would go to the trouble of doing something like this for me. :-o There’s a thread in the forums going into more detail on how they organised it, including the many, many different designs they mocked up and considered before voting for this one. I’m humbled and flattered.

My sincere thanks to everyone who was involved in organising this, and very well done for creating such an excellent statue and managing so successfully to keep me in the dark about it! You guys are just awesome.

Share this post: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • N4G
  • StumbleUpon
  • del.icio.us
  • Mixx
  • Google
  • blogmarks
  • Slashdot
  • Reddit

Arkham Horror: it’s all good fun until someone gets devoured

Games, Personal 4 Comments

It was my birthday this week, and from my wife I received Arkham Horror, a co-operative board game based on the classic role-playing game Call of Cthulhu – which in itself draws much of its content and vibe from the writings of H.P. Lovecraft. Set in 1920’s New England, in contrast to traditional western ‘horror stories’ (vampires, werewolves etc – all a bit pedestrian), Lovecraft’s world is filled with bizarre creatures and unknowable ‘Ancient Ones’ – slumbering horrors in the outer dimensions who threaten to wake and destroy the world, and the ‘Investigators’ the players control – which include doctors, archaeologists, flappers and gangsters – are trying to avert this outcome. If you have no idea what this is like, watch the first Hellboy, which draws a lot of inspiration from the same material, albeit with a more bombastic, humourous slant. Call of Cthulhu is a fascinating RPG to play simply because it’s so different to any other, and I was keen to play the board game interpretation to see what it was like.

The board game is set, like the RPG and most Lovecraft stories, in the fictitious town of Arkham, Massachusetts, where one randomly-chosen Ancient One is threatening to awake and break through to our world. Each Ancient One has slightly different effects on the game as it progresses and each is easier or more difficult to defeat if they eventually do break through (although if they do, chances of success are minimal). Dimensional gates are randomly opening in Arkham to strange other worlds, and it’s the players’ job to explore and close them, preferably sealing them permanently, in order to avert the final confrontation.

Each player draws or chooses an Investigator, each of which has particular traits and possessions which can help in the game. The board features a number of street regions, each surrounded by places of interest like the Miskatonic University, Arkham Asylum and the Black Cave. There are also a number of ‘other dimensions’, which the players must traverse through gates in order to eventually seal them. The players have to move around Arkham picking up clues, exploring gates that open, and avoiding or confronting monsters that emerge from the gates and wander around the town – all the while maintaining their Stamina (physical health, worn down in combat) and Sanity (mental health, worn down by ’seeing too much’ and using spells). There are two ’status tracks’ which rack up during the game to illustrate the growing threat in Arkham – the ‘doom track’ which is how close the Ancient One is to awaking, which notches up whenever a gate opens or sometimes through other special events, and a ‘terror track’ which represents how afraid the citizens of the town are, and causes some locations to become boarded up when it achieves a certain level (and ultimately, if the terror level reaches 10, the town is considered ‘overrun’ and there is no longer a limit to the number of monsters on the board).

We had our first game yesterday, and we were really impressed by the amount of variety in the game – there are so many variables in play: which of the 8 Ancient Ones is the main enemy, which of the 16 Investigators are being used, what items you have, where the gates open, and so forth. The rules are relatively complicated for a board game, but as pen-and-paper RPG veterans we didn’t really have any trouble following them, since they are much simplified compared to a traditional RPG. We knew it was going to take a while, particularly since it was our first game, and in fact from set up to completion it ran for a little over 4 hours with 4 investigators. By the end of the game we were much faster at it though, and I think we could have shaved an hour off that time, particularly as we were facing the weakest of the Ancient Ones (Yig).

It makes a change to play a co-operative board game too. If you play RPGs then this will not be a new experience, but it is nice to have a tabletop game which follows this model, and in fact it may be a ‘gateway drug’ to friends who perhaps think full RPGs are a little too daunting. Some people might not like the concept of there not being an individual ‘winner’ in the game, but rather that the players either win or lose as a group, but as a social game I think this works extremely well.

The game also accurately re-creates the Call of Cthulhu feeling of exponentially creeping doom, and of a desperate but almost certainly futile struggle against powers beyond human understanding. Things start off looking fairly manageable, but things begin to ratchet up pretty fast, as you realise the time it takes to close gates, and to gather the resources to seal them permanently – the only way to stall the increase of the doom track is to permanently seal gates, but you need to balance gathering the clues you need to do this, with positive action to actually do it. 80% into our first game, we thought we were doing pretty well as we started to make progress on the gates. But in the end, we realised we had left it too late to start tackling them in earnest and eventually Yig emerged and devoured us all. Oh noes! :)

Even though our first game ended in crushing failure and the doom of the world, we had a huge amount of fun. It’s probably an alien concept to some gamers to enjoy a game in which there is a pretty good chance that you’ll fail at the end – Call of Cthulhu the pen-and-paper RPG was ever thus, and yet it has a huge cult (no pun intended) following. In my opinion though, extracting fun from a doomed scenario is one of the greatest examples of gaming refinement – because it’s the playing that is important, not the winning. Modern gaming far too often concentrates on simply completion – finish the game, get this achievement, succeed!!! In reality, all that matters in a game is that you had fun while playing it. Arkham Horror, like CoC, achieves that in spades in spite of – or perhaps because – the end confrontation is not what you’re rushing towards, but what you’re trying to avoid, all the while running madly about with your fellow players just trying not to get eaten or go insane. It’s unique, and I love it.

Summary: highly recommended if you want to play a really interesting, very different social game with well-balanced friends. Just don’t invite the guy obsessed with winning, he’ll hate it ;)

Share this post: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • N4G
  • StumbleUpon
  • del.icio.us
  • Mixx
  • Google
  • blogmarks
  • Slashdot
  • Reddit

Hosting services: my recommendations

Internet, Tech, Web 11 Comments

After hearing on Twitter how an acquaintance’s new hosting provider went ‘mammaries skyward’ this week, much to their understandable annoyance, it occurred to me that I have some recommendations I can make on this subject. While I don’t host that many sites, I’ve been doing it for long enough and had experience of both personal and medium-traffic sites that I’ve experienced the highs and lows quite a few times already.

The Golden Rule: Support > Everything

When it comes to hosting, the most important thing to look for, beyond what all the statistics of how much space and bandwidth you get, beyond even quoted up-times, is the quality of the support service. The big question is: when things go wrong – and if you host long enough, eventually they will even in the best possible hosting environment – how quickly are problems resolved, and how responsive are the support engineers during the process. Literally nothing is more important than this, and unfortunately it’s the one thing that you’ll only really learn with experience, unless you’re hosting a site big enough that you can get a formal SLA. Assuming you’re not going big enough for that, the only way to judge this is by being with a provider for a while, or knowing someone who has been with them, or possibly looking at online review sites – although frankly these are often highly unreliable, polluted as they are with inaccuracies and omissions either because of ignorance (people who post glowing reviews after being with the site 2 weeks) and unfortunately by frequent shill reviews.

I’ll post a couple of hosts I’ve had good experience with over many years later in the post, through good times and bad.

Know Your Bandwidth

Personally, I instantly rule out any host that claims ‘unlimited bandwith’. This is a crock – there is no such thing, and to claim there is just means the host is already lying to you before you even start – they have to pay for their bandwidth, so they can’t possibly allow everyone truly unlimited bandwidth and stay in business. If you really need unlimited bandwidth, i.e. you have a high-traffic site with lots of media files, then you will quickly bump into the way that these sites offer this ‘unlimited’ deal – via throttling. You may not have an absolute physical cap on your bandwidth, but if the tap is locked off to a slow dribble beyond a certain usage, it’s really worthless. In practice, ‘unlimited bandwidth’ is just a marketing point that they hope will draw in people who will only actually use a tiny amount of bandwidth, but will somehow favour them because the offer looks good. Don’t be one of those dumb guys.

Really you need to establish your bandwidth requirements and head for a host that can fulfil them for a reasonable price. For example, ogre3d.org uses between 125GB and 250GB per month, which is a reasonable amount, compared to my personal site here which only needs 5-10GB per month.

If you have ’spiky’ bandwidth, i.e. occasionally you need to be able to distribute large amounts of data, but it’s not a constant stream, it would be best to go for a lower monthly limit and host high-bandwidth items elsewhere. I often use Amazon S3 for this purpose which can be made to look like a sub-domain of your own site, and which charges for bandwidth at a very fine granularity so matches your demand closely – it’s more expensive than buying a monthly allowance if you use it a lot, but for on-demand spikes it works very well.

Shared, Dedicated or Virtual/Cloud?

I currently use two shared hosts and one dedicated host, to match the demands of each site. Personally, I’m still very skeptical about virtual private servers and cloud hosting, due to a bad experience I had a few years back when we tried running ogre3d.org on a VPS. We lasted not much more than a month before we moved the server to a dedicated machine because the VPS simply didn’t deliver on its promises – performance was unpredictable and to be honest you had the worst of both worlds – you had to admin your own server but you still didn’t have a 100% guarantee that no-one else would be screwing with something on the machine, or that the disk arrays wouldn’t be hammered by someone else (regardless of CPU assignment), or some other balancing issue. Virtualisation has evolved in the last few years so this may not be an accurate representation anymore, but personally I wouldn’t go for a VPS again any time soon, unless it was a machine I controlled entirely and partitioned myself into virtuals – at least with shared and dedicated servers you know exactly what you’re getting – either a low-maintenance but shared resource environment, or total control & power. VPS claims to offer a middle ground but in my experience it didn’t deliver.

So, who do I use?

For my shared hosting, I’ve been using Hosting Matters for about 10 years now. I went through a couple of other hosts before them and had terrible experiences, but since I switched to them I’ve been very happy. I can count the number of hours downtime (that I’ve been aware of) over those years on one hand, and whenever there’s an issue they’re incredibly fast to respond – they have both community forums and support tickets depending on the urgency. It’s also very reassuring to see the same names cropping up in the support responses over the years.

Their offerings are pretty standard, nothing that would make them jump off the page for anyone looking for a stellar feature list or super-cheap pricing. But they’re very reasonable, they’re honest about what they’re offering (like bandwidth), and as I said before, support > everything.

For dedicated hosting, since 2007 I’ve used Dedipower. They’re based in Reading, their support staff are all local and are on the end of a phone if you need them (no call centres). Having been through a UK dedicated server comparison twice in the last 3 years (once again just recently), Dedipower came out as the most competitive for the service they were willing to offer, and I’ve been happy with the support service. In once instance in fact, when I moved a sub-site off the server, they were quickly on the phone to me within 10 minutes to tell me it was ‘down’ – at which point I had to explain it was expected & apologise for not notifying them in advance. You really can’t complain about that.

I hope that’s useful to someone. In case I need to point this out, I’m not getting paid or receiving discounts to promote either of these hosts, they’re just the two I’ve been most happy with over the ~10 years I’ve been hosting sites. YMMV but they’ve worked well for me :)

Share this post: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • N4G
  • StumbleUpon
  • del.icio.us
  • Mixx
  • Google
  • blogmarks
  • Slashdot
  • Reddit

Why I won’t be updating Facebook anymore

Personal, Web 17 Comments

I’ve never really liked Facebook, as regular readers of the blog will be all too aware of, but I’ve been a user of it in the last couple of years, mostly at the cajoling of friends. During this same period of time I also started using Twitter, a service which I was also skeptical about initially. Previously, I’d always relied on my blog, forums and official sites to do my interacting, and I wasn’t sure I needed anything else.

What’s happened in the last couple of years is that Twitter has risen inexorably in my daily usage due to being genuinely useful as a networking aid, while Facebook has not fared that well at all. I tried posting updates to it from Twitter for a while via Selective Tweets, which led to a considerable blip in my Facebook usage (even though I wasn’t using the site) but honestly I can’t be bothered with it anymore. And not just because of the rubbish that sloshes around Facebook.

Facebook is ’sold’ on the idea that you can realistically make / be friends with people, or even keep in meaningful personal touch with people you do genuinely know, via short messages and photos on an online service. My personal opinion after trying to use it as such for a while, is that this is a massive crock of elephant dung. Relationships are built on meaningful contact, and Facebook provides – is only capable of providing – only meaningless, trivial contact. Of all the ways you can keep in touch with people, it’s about the very worst you could possibly use, IMHO. It’s convenient, sure, but convenience doesn’t make for good personal contact. Honestly, if you can’t be bothered to make the effort to meet someone in person or talk on the phone (and home video calls aren’t that hard in the 21st century), then really you’re not that bothered about keeping in genuine contact with them. It’s better just to be honest – you’re kinda interested in knowing what’s up in their life, but not interested enough to have coffee with them, or otherwise make any genuine time for them.

In this context, Facebook is a fallacy. The whole point of Facebook versus Twitter or any other public internet medium is that Facebook is ‘private’ (barring any changes in rules they might feel like making to make a buck on your data of course). But if you don’t care enough to speak to someone other than in Facebook, and vis-a-vis you’re not really that much of a friend, then why would you want them to know things you wouldn’t post publicly? This is behind many the Facebook fo-pahs that seem to crop up with increasing regularity. Twitter is honest about the level of interaction  you’re having with people. Facebook tries to make you think it’s more significant than it is.

Maybe you’re a highly gregarious person who genuinely has over 100 real friends that you’d share your private information with. Maybe you feel that personal relationships are upheld and maintained by Facebook messages. I don’t, and I’m going to stop pretending that it’s serving a useful purpose in my life. I have a small collection of friends and family with whom I exchange information by meeting and speaking to them – these are the only people I’d consider exchanging genuinely personal information with. There’s a second much larger collection of people whom I don’t meet personally but who I’m interested in keeping in contact with, and by and large they’re all on Twitter – which also does a far better job of delivering that information without bombarding me with all kinds of other nonsense. There’s really no useful middle ground for Facebook to fill, for me. And using Facebook as a supplement with people I already know? Frankly it’s far more entertaining to talk to them about their week’s exploits than read about them on Facebook – in fact Facebook can take the wind out of a good anecdote :)

Really, you should never post anything on the Internet that you wouldn’t mind being public, since Facebook hardly has an unblemished record for actual privacy (whether that’s via Facebook themselves, or friends or friends-of-friends). I think that a lot of people use Facebook like I use Twitter, except there’s far more scope for dangerous misunderstandings about what is appropriate to post. I think non-digital social protocols dealt with sensitive & private information much better, and that online services are best used only for non-private things. From now on, that’s what I’m going to do, and I’m not the only one.

Share this post: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • N4G
  • StumbleUpon
  • del.icio.us
  • Mixx
  • Google
  • blogmarks
  • Slashdot
  • Reddit

iPad – my first weekend

Personal, Tech 29 Comments

Apple’s new flagship product, the iPad, was only just released in countries outside the USA last Friday, and I was fortunate to get my hands on one on launch day. Like many Apple products, this one has divided people, with a lot of people decrying it as a device looking for a purpose, a device that falls between two stools (not as portable as a phone, not as functional as a laptop), a device that is stifled within Apple’s walled garden. Despite there already being a plethora of reviews out there on the internet, I thought I’d give my initial impressions of it after the first weekend.

First, some context

It would be illustrative first of all to set out my reasons for wanting to lay down some cash on a product such as this, in order to frame the context in which I’m evaluating it. Some potentially relevant facts:

  1. I don’t have an iPhone. I work from home, and I consider it extremely impolite to be constantly stabbing away at a phone while in a social gathering (you know who you are), therefore I can’t justify owning one. I have a far cheaper Nokia smartphone which does what I need just fine for the rare occasions when I need to check the internet on the go.
  2. I like Macs. This is an opinion which I’ve come to only in the last few years – despite studying user interface design as a module of my compsci degree, my interest in practical applications of the subject has only recently been piqued, and I’ve learned that Apple definitely groks these things better than most. I’ve also changed – I used to love taking apart my PCs, customising them to the nth degree, knowing every tweaked and tricked out element of it. Now, after 20 years, I find that kind of a bore and generally just want something that works, gets out of the way and lets me get on with what else I want to do, and I find Macs are good at that.
  3. I find touch interfaces very interesting. As an RSI sufferer for the last 7 or so years, I’ve become acutely aware of how terrible mice are as an ergonomic interface. Really, they’re awful – the wrist rotation, the fact your arm has to be right out to the side with most setups, these things are ergonomic suicide. At some point, unless you want chronic carpal tunnel syndrome, you’re going to have to switch to a track ball, a track pad, or one of those vastly overpriced vertically oriented mice. Personally, I try to use the keyboard for most things, which isn’t great but it’s better than the mouse, and a track pad on laptops as much as I can, which are much more natural. The prospect of a renaissance of user interfaces designed not to need a mouse, but to be entirely driven by touch, is something very appealing to me. It doesn’t work at all for sustained use when there are large, immovable vertical screens involved, and it doesn’t work that well when the device is too small – to me the pad form factor is the ideal for this approach.
  4. I watched Star Trek:TNG and lusted after their pads for years (even though they were just fake plastic slabs). Now it’s a reality! Who wouldn’t want that? ;)

Perhaps importantly, going into this I wasn’t one of those people looking to replace another device with the iPad, but I did see it as an opportunity to use an iPad in use cases where I considered the other devices I could already use to be sub-optimal. I’ll cover those use cases later on when I discuss how things turned out in practice. So now, on to my evalution…

Physical characteristics

I’ll try not to cover too much ground that’s already been adequately covered elsewhere. You already know the iPad is fantastically well constructed, beautiful to look at, has a wonderfully bright and sharp screen (which is prone to finger prints) – we’ll take all that as read. In my opinion, it’s not that heavy, but if you had planned to hold it up in front of your face with one hand for a long time, yeah that’s going to get uncomfortable. Personally, I don’t do that – like when I’m reading a book of any size, I rest the iPad on my lap, either flat or just propping it up on edge with one hand, and that’s fine for several hours in my experience. Having said that, the sleek and smooth exterior means you can be afraid of dropping it – however I’m using it in a leather flip-case (I’ll cover that in a future post, it’s a good one), and in this configuration gripping it becomes a total non-issue.

The screen was sharper than I expected, it seems to have approximately the same pixel size as my MacBook Pro, since even though the resolution is lower, the screen is only 9 inches. The default brightness setting was a little dark for me so I tweaked it up to about 75%, which was perfect. It’s a glossy screen which you may have problems with outside, but inside in full daylight (we have many windows in our house) and using regular lighting at night, reflection has not been an issue.

As has been pointed out, there are no cameras. Personally, that’s not something I care about – I don’t use my mobile phone camera either and I have a far superior camera within 10 feet of me in my lounge if I need one. I can imagine a camera for video conferencing might be useful to some people, but I’ve had one in my MacBooks for 3 years and I’ve never used them, so really, this is not important to me.

Connectivity wise, we’re talking minimal – just a dock connector and Wifi. It would have been nice to have a USB slot or two and especially a SD card slot (although you can get an adapter for that), but anyone who’s bought an iPod before knows the Apple way – don’t try to do everything, just try to do the core things better than anyone else. So, did they manage that?

General User Experience

I’d sum it up on one word – ‘butter’. The fact is that the iPad comes with only a small piece of card of instructions (and bizarrely, a 300 page downloadable manual which I don’t think they expect anyone to read), and you don’t even need to read that. Seriously, a monkey could work this thing, and it wouldn’t even need any training. I consider myself a geek still, and some geeks seem to find user friendly experiences offensive, as if it undermines the skills they’ve acquired, but I’m not one of them, and I admire what’s going on here. It’s a very direct, tactile experience that rewards experimentation and exploration, and just says “hey, come play with me, I won’t bite”. This, frankly, is how systems should be designed.

The lack of multitasking (due to be added in OS4 later in the year) is much less of an issue than I expected. Apps remember where you were, and tend to launch fast so switching between, say, Safari and an email that you’re in the middle of writing, works just fine and feels no different to true multitasking. The only thing missing is if you have apps which need to actively do things when you switch – such as IM or voice messaging, or music players other than the built-in iPod features. But honestly, so far I’m not missing it, even though I can imagine it being useful in some cases.

Many have said this is a bigger iPod Touch. They’re right, but in the same way that a bay window is just a bigger porthole. If you think that doesn’t matter, maybe you wouldn’t mind replacing all the windows in your house with portholes. In my opinion, the size of this device is absolutely perfect – for the purposes use it for (see below).

So What’s It Good For?

These are the primary things the iPad is being used for in our house:

  1. Checking mail, web, news, social networks at home in a casual setting. When we’re doing things at home, watching TV, playing non-PC games, having guests around, or just between other things, it’s often useful to quickly check email or look something up on the web. Getting the laptop out takes too much time and it’s too bulky if you have friends around, and a phone is often too cramped, particularly if you want to show the contents to others or you want to type more comfortably. The iPad has instantly become the way my wife and I do all these things when we’re not at the PC anyway, and it works really well. Websites display legibly with no scrolling around, typing is fast (slower than a real keyboard but much faster than a phone). Most importantly, it doesn’t feel like a ‘work’ device and fits into a casual / social setting perfectly. My preferred way to check the detail of the day’s news after breakfast is now on the iPad via the Reuter’s app. YouTube works great on it too, I can catch up with my subscriptions very comfortably this way. As for the lack of Flash – in almost 3 days, I haven’t noticed, and I don’t think my wife even knows that Flash is not available. Maybe it’ll be an issue some time, but not so far.
  2. Touch gaming. I’ve specifically added ‘touch’ there because people trying to play normal games with traditional controls (using virtual joysticks etc) are completely barking up the wrong tree. Games on the iPad, like the iPhone, work best when they’re designed with a touch interface in mind, or at least adapt well to it (e.g. Plants vs Zombies). Flight Control and Harbormaster are good examples of this, where there’s just no way you could implement a game like this efficiently with anything other than touch controls, and they click in 2 seconds flat. To be honest, my wife has the most experience of the games so far, but the fact that it’s hard to get her off them is a fairly solid endorsement of the gaming capabilities of the device ;)
  3. Documentation. I don’t think I’d use a device like this for casual reading. A paperback is more rugged, cheap, and appropriate in the majority of cases than even dedicated devices like the Kindle, IMO. However, I do think e-readers are perfect for reference documentation, the kind of stuff you need to access randomly, search and dip into at a moment’s notice, often over several volumes, and for that I’m using GoodReader. Of course, if you’d be using that documentation at a PC anyway, you don’t need an e-reader. However, if you’re not at a PC, and you need access to this kind of information, then e-readers suddenly become useful. Because I have a minority usage for this, a dedicated e-reader has never been a worthwhile purchase for me, but as one feature in a multi-function device – that’s useful. In particular, I run a D&D campaign one night a week, and thus far have always needed a big stack of books next to me, which is a pain for space when we have a full crowd in. I’ve tried using laptops before, but they suck – they take up too much room and if you have them in a comfortable position in front of you they’re just too distracting. The iPad is the perfect size, and replaces several physical tomes with fully bookmarked, searchable texts, and it can sit to the side of me, available but not obtrusive, large enough to read but not too large to dominate the space. It’s by far the most practical device I’ve ever come across for this purpose, and I can’t help but think others will find places where it’s useful too.
  4. Photos. This might seem odd to call out as its own bullet point, but actually I think this is significant. Since we transitioned to digital photos, it’s made sharing them with family more awkward. Sure, you can use Facebook, but firstly – shockingly – many friends / family members don’t use Facebook (and no, I’m not going to pressure them to use it), and secondly it’s actually nice to show photos to people in person, and, you know, talk about them. Interact. Face to face. Radical stuff I know, but Facebook doesn’t solve that problem. In the past we’ve taken a laptop to other people’s houses, but that just feels clunky and geeky. And we don’t want to get them all printed, because that’s just a massive waste. And digital photo frames of any decent size are too expensive to justify. Enter the iPad – which can double as a photo frame and is very good at being a medium to share photos in person, just because its form factor works well – it’s easy to pass around or look at from multiple directions (rather than everyone crowding around a laptop screen). It’s a digital photo viewer that works in a multi-person environment, and the display is still large enough to do them justice.
  5. Sketching. It may not be a match for my wife’s Wacom tablet, but as a casual sketching tool (via SketchBook Pro) it works quite well. Obviously the touch interface is a no-brainer for this – it’s missing things like pressure sensitivity and angle detection like the Wacom kit does, but even so it’s far more natural than drawing with a mouse, and considerably cheaper to try out than buying a full featured tablet.

The important thing is that none of these things could be done as well with devices of another form factor, IMO. You could do them, but you’d be compromising something – such as screen space, comfort, instant accessibility. I think a pad form factor hits a sweet spot for these things, and that Apple’s implementation is confident and slick. In the end, that’s all I really wanted.

Conclusion

My personal opinion is that there definitely is room for a device of this form factor in the lives of many people. You can argue that iPad version 2 will have more features, or that an Android tablet (whenever they arrive in a product form) will do better later on and will have more apps because of the open architecture, but  I think the phrase ‘a bird in the hand is worth 2 in the bush’ is relevant here. In technology, there’s always going to be something better in the future, that’s a universal constant at any point in time, for any product. Right now, the iPad pushes exactly the buttons I wanted it to push – that doesn’t mean there isn’t potential for more, but what it does do, it does extremely well. And more importantly, it does it right now, not at some theoretical point in the future. That has value to me.

Perhaps the best illustration is that the iPad has been in pretty much constant use since purchase, barring when it’s on charge, and so far the split has been 70/30 in favour of my wife, whose review comments are simple: “It’s cool”. I concur.

Share this post: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • N4G
  • StumbleUpon
  • del.icio.us
  • Mixx
  • Google
  • blogmarks
  • Slashdot
  • Reddit

OS X Localisation: incremental genstrings and UTF-8 files

Development, OS X No Comments

I came across a couple of interesting issues when I came to do the first pass of writing the text for the user-visible strings I’d been setting up for a Cocoa app I’m writing (painfully slowly as I learn the nuances of the environment), and I thought I’d share them. Full details are after the jump, since I’ve embedded a large script in the post.

The basic principle for text localisation on OS X is that, like most systems, you externalise your user-visible strings in string tables and reference them by keyed aliases in code – in this case using NSLocalizedString. Apple provide a tool called ‘genstrings’ which extracts all these into a template strings file called Localizable.strings which you can then populate per language – localised files are kept in folders called en.lproj, fr.lproj etc and helpfully they’re picked up by default like this.  So far, so good.

Read the rest of this entry »

Share this post: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • N4G
  • StumbleUpon
  • del.icio.us
  • Mixx
  • Google
  • blogmarks
  • Slashdot
  • Reddit

Taking a bite of the Apple

Development, OS X, Personal 13 Comments

Giving up the leadership of OGRE was a sad moment for me, but in hindsight it has also been rather liberating. For 10 years I’d spent most of my energy on OGRE or on projects that were related to OGRE. There was an implicit understanding both from the community and from myself that everything I embarked on would in some way tie into OGRE – and indeed my business has always been based on a constant balancing act between how I can make a living while also promoting and advancing OGRE. I’d tended to major on the latter rather than the former most of the time as it happens, because I had an emotional attachment to the project and a feeling of responsibility and custodianship that I took very seriously. So when I finally admitted to myself that my back couldn’t take the ongoing demands of being an open source leader as well as making a living, the big question was: what next?

Over the years I’ve learned a couple of things about choosing what projects to work on – follow your gut, and work on things you’d do even if there was no money in it. Yes, you need to do a business case and convince yourself that there’s a viable market for what you have in mind, but all that’s irrelevant if you don’t feel strongly about what you’re doing, because it’s passion and enthusiasm that will get you through the difficult times. So I sat down and gave some thought to what really excited me these days, what I liked using and what technical directions piqued my interest. I still find 3D and games fascinating, but they’re far from my only interests.

So, I realised that one area that I’ve been dying to get my teeth into properly for ages but had never found the time before, was coding specifically for Mac OS X. In 3 years I’ve gone from a total newcomer to the platform, to a staunch advocate of it. However until now I’d never really had time to play with developing on it, beyond porting cross-platform C++ code and providing / using intermediate libraries. One thing I learned in those 3 years as a user was how much better applications designed for OS X felt to use compared to those that were just ported via a common UI layer (like wxWidgets / Qt), and I’m convinced now that while cross-platform infrastructural code is great, user experiences are far better when designed with the specific platform in mind – increasingly that means OS and physical device now of course. Sure, cross-platform UIs save the developer time, but the result is often a watered-down experience – early on I liked OS X applications that felt like Windows, or ran the same on both platforms – now I  do not. Such carbon-copying applications were helpful while I was unfamiliar with the platform, but now it’s just glaring to me how basic their compatibility with the OS typically is, and how the UI styles clash with the expected standards.

So, I decided I wanted to learn how to target OS X specifically, and had a couple of ideas for projects I could do with it, which meant learning Objective-C. At first, I hated it and tried to escape via more familiar technologies like Objective-C++ and PyObjC. Ultimately I found shortcomings and limitations of those routes and returned to Objective-C, and the more I used it, the more my animosity toward it diminished. In the end I realised the problem was that I needed to adapt to the environment, rather than try to adapt it to my previously learned styles and behaviours. Sure, missing elements like namespaces might still nag me, but on balance the blend of static and dynamic language elements works very well for the intended use. And besides, I really didn’t want to be ‘that guy’ – the programmer that having decided one language / tech is ‘the best’, then tries to apply it everywhere, regardless of suitability; I like to think I’m a bit more flexible & multicultural than that.

I’ve also learned that Cocoa is a very, very smart system. Mad as a bison if you’re used to other systems beforehand, but persevere with it and resist the urge to hide it under some vanilla layer that you’re already familiar with, and you discover it’s really very powerful. Not to mention the Core Animation and Core Graphics frameworks are a lot of fun.

It’s funny, I’ve spent so many years concerning myself with providing compatibility across multiple OS’s, multiple GPUs, multiple render APIs, and multiple drivers, it’s a genuine joy to actually forget all that for a while, and concentrate on an end goal with a finite number of permutations for a change – and not to shy away from using platform-specific features.

While I’m still very much an advocate of open systems, I look at things slightly differently now – that data & protocols should be open, and that we should all re-use & collaborate on common, preferably open source infrastructure (like OGRE), but that the ‘last mile’ to the user is the least suitable for generalisation, because the more specific you can make that interface to what the user expects on their OS & device, the better that experience will be. And at the end of the day to the user, that experience is the application, and thus all that really matters – and I feel that Apple gets that, in a way that very few others do.

So, I’m having a great time learning to be an Apple developer so far, I’m going to see where this takes me for a while. My gut says it feels right, and I’ve learned to listen to my gut :) I love the platform, it’s a total change of pace and technology, it’s something I’ve had an interest in for a while, and the Mac has quite a thriving community of quality independent app developers that I can try to join – what’s not to like?

Share this post: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • N4G
  • StumbleUpon
  • del.icio.us
  • Mixx
  • Google
  • blogmarks
  • Slashdot
  • Reddit

Windows 7 switcharoo

Tech, Windows 3 Comments

Spring is usually a time of change, and I finally got a gap in my schedule where I could wipe my primary Windows machine and install Windows 7 (64-bit). It’s had XP on it for years – my experience with Vista on secondary test machines quashed any desire to ‘upgrade’ my primary work environment, and despite owning Windows 7 for some months a number of things have stopped me installing it, from lack of driver support for my office wifi-connected all-in-one printer / scanner, to work commitments where I couldn’t afford to take the time out to reinstall and set up several complex environments.

So, as someone who hated Vista, what are my impressions? It’s actually pretty good. It’s not perfect, but it’s definitely better than what came before, which is exactly what I expect from an upgrade (and exactly what Vista didn’t deliver). Things I like:

  • Taskbar – clearly inspired by the OS X Dock, but adds some features of its own too like the jump lists and window previews. I’d prefer if clicking the button when there are multiple windows open switched to the last one you had been using, instead of forcing you to pick one, but on the whole it works well.
  • Windows Update gets out of my face – Vista’s Windows Update was a dog, while it was kicking in it sucked resources like a bastard and threw off any performance testing I was doing, sometimes for long periods (made worse perhaps by the fact that I didn’t use Vista that much). The new one seems much lighter.
  • Responsive – they say they’ve improved the parallelism in many systems, and it certainly feels like it. The same machine feels faster on Windows 7, compared to feeling slower in Vista.
  • Libraries – these are like customising your sidebar in OS X’s finder, but add more features like grouping and collection searching. Nice.
  • Devices & Printers – when I looked at this view and saw that it came up with photos of my exact mouse, printer etc, without any specific drivers etc installed apart from the base system, I thought that was pretty cool. It’s actually a useful view in practice too, but the pictures made me grin, because I’m shallow. But then, if you don’t smile at least once when you use an OS for the first time, something is wrong on the usability side.

There are some stupid things though:

  • UAC remains dumb – it still text-matches filenames like ‘patch.exe’ and arbitrarily decides that they need to be admin-level. Sure you can tack a manifest onto it to tell it not to, but for Christ sakes, talk about a blunt instrument.
  • Startup items – Why is changing what apps load at login still so esoteric? It hasn’t changed since Windows 95, and they’ve hidden the Startup menu by default now (and services are even harder to find). Just not user-friendly at all – compare to OS X where Login Items is very simple for anyone to use.
  • Network Drive Login Scope is obscure - This is new in Windows 7 – if you connect to a NAS or other network drive, enter your login and click the ‘Remember’ checkbox, it only actually remembers until you log out, not permanently as in previous versions. To change this is very obtuse and user-unfriendly – you have to open Credentials Manager, delete the existing credential (because editing the scope is not possible for no particular reason), and re-create it with the same details (again, scope is not an explicit option so you just have to go on faith here). By doing this the scope becomes ‘Enterprise’ rather than ‘Session’ (which is obscure in itself) and the result is that your credentials will be remembered across logout / reboots like in XP / Vista. It took me some forum browsing to figure this out, and it’s just not an intuitive design. Adding a ’scope’ combo to the remember option that says ‘Until logout’ or ‘Forever’ would solve it, but no, that would just be too simple & intuitive.
  • Aero Shake is just silly

But, the bottom line is that on balance it’s pleasant to use despite a few oddities, and I’m happy with Windows 7 as my main Windows OS now in a way I never was with Vista. I still find OS X more pleasant to use, but this is the closest Windows has ever come to it, and it adds a few ideas of its own too, that importantly actually work & add value – compared to Vista that mostly imitated and whose additions just fell flat (Flip3D, I’m looking at you). So, a good OS, and the first one from MS since 2001 that I don’t regret spending money on.

Share this post: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • N4G
  • StumbleUpon
  • del.icio.us
  • Mixx
  • Google
  • blogmarks
  • Slashdot
  • Reddit

Monsieur, you are really spoiling us

Games, OGRE, OS X 4 Comments

Yesterday saw a triple-whammy of sugary Apple gaming goodness:

  1. Steam for Mac was released, meaning all the games you own on Steam that are ported to the Mac can also be played there, free.
  2. Torchlight was a day-1 release on the service, meaning Ogre (and therefore code written by me) was among the very first on the service.
  3. Portal became free (for Mac and PC)

Wow. A great day for Mac gaming. I noticed that World Of Goo was up on day 1 too, and since I’d bought it on Steam I could play it right away on my MBP too. Yummy.

Curiously, considering it’s based on Ogre, I don’t actually own Torchlight on Steam – I had a free Windows-only copy from Runic, I bought a physical (Windows-only) copy for my shelf, and I bought copies for both my wife and Diablo-obsessed brother in law on Steam but I never got a copy there myself, so I haven’t tried it on the Mac yet. I need to ask my wife to log in on the MBP so I can try it! :)

Share this post: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • N4G
  • StumbleUpon
  • del.icio.us
  • Mixx
  • Google
  • blogmarks
  • Slashdot
  • Reddit