<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[Tales From An Unchecked Mind]]></title>
  <link href="http://ikennd.ac//atom.xml" rel="self"/>
  <link href="http://ikennd.ac//"/>
  <updated>2012-02-19T00:53:59+01:00</updated>
  <id>http://ikennd.ac//</id>
  <author>
    <name><![CDATA[Daniel Kennett]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Weekend Project: Aperture Export Plugin for 500px.com]]></title>
    <link href="http://ikennd.ac//blog/2012/02/weekend-project-aperture-export-plugin-for-500px-dot-com/"/>
    <updated>2012-02-19T00:35:00+01:00</updated>
    <id>http://ikennd.ac//blog/2012/02/weekend-project-aperture-export-plugin-for-500px-dot-com</id>
    <content type="html"><![CDATA[<p><a href="http://500px.com/">500px.com</a> is a pretty awesome new(ish) photo site. I really prefer its layout and display of photos over Flickr, in part because it simply displays the photos <em>bigger</em>, and the photos are the most important thing!</p>

<p>They&#8217;ve been saying for a while now that an official Aperture Export plugin is coming, and there seems to be a <a href="http://support.500px.com/customer/portal/questions/182491-5-px-upload-plugin-for-apple-aperture">lot</a> of <a href="http://support.500px.com/customer/portal/questions/153420-aperture-plugin-">demand</a>. Well, I got bored of them taking their sweet-ass time and threw together my own.</p>

<p>It requires Mac OS X 10.7 (Lion) and Aperture 3.x, and do bear in mind that I made this in less than 48 hours, so it may be buggy and it&#8217;s certainly light on features. But, it gets my photos directly from Aperture into 500px, so I&#8217;m happy!</p>

<p><img class="center" src="http://ikennd.ac/pictures/500pxAperturePlugin.png"></p>

<p>You can find out more and download the plugin from <a href="https://github.com/iKenndac/500px-Aperture-Uploader">GitHub</a>. Enjoy!</p>

<p>Oh, and if anyone loves this plugin so much that they want to get me a gift, well, <a href="https://500px.com/gift">gifting me</a> a year&#8217;s worth of awesome would certainly be appreciated!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Keeping My Feet On The Ground]]></title>
    <link href="http://ikennd.ac//blog/2012/02/keeping-my-feet-on-the-ground/"/>
    <updated>2012-02-08T22:30:00+01:00</updated>
    <id>http://ikennd.ac//blog/2012/02/keeping-my-feet-on-the-ground</id>
    <content type="html"><![CDATA[<p>A few weeks ago, my friend came to visit me from the UK. He&#8217;s quite the photography enthusiast, and while he was here he fell in love with my <a href="http://www.the-digital-picture.com/Reviews/Canon-EF-24-105mm-f-4-L-IS-USM-Lens-Review.aspx">Canon EF 24-105mm f/4 L</a> lens. By the time we left for our road trip to the UK, he&#8217;d already ordered a similar lens and very kindly <em>gave</em> his Canon EF-S 17-85mm lens to my fiancé since his new one would be replacing it.</p>

<p>Two days after we arrive in the UK, the lens my friend gave us stuck at 17mm and wouldn&#8217;t budge. I felt super-bad about this, even though it turned out it was a <a href="http://thydzik.com/canon-efs-17-85mm-is-stucklocked-zoom-repairdisassembly/">common problem</a> with this lens.</p>

<p>Still feeling bad about breaking my friend&#8217;s lens, I dived right into the tutorial and tried to fix it! Lenses are incredibly intricate, and my first attempt wasn&#8217;t so successful - I&#8217;d fixed the zoom sticking, but now the focus didn&#8217;t work!</p>

<p><a href="http://www.flickr.com/photos/ikenndac/6842988461/"><img class="center" src="http://farm8.staticflickr.com/7007/6842988461_411242e2c0_z.jpg"></a></p>

<h3>Take Two</h3>

<p>Tonight, I tried to fix it again, and was successful! The lens&#8217; zoom is a smooth as ever and the focus works too. I was ecstatic, and I looked down to see my dog staring at me with glee, raising his paw as if to say &#8220;HIGH FIVE bro, you tha man!&#8221;</p>

<p>A couple of seconds later I realised he was <em>actually</em> trying to say &#8220;Damnit I&#8217;m hungry - give me food!&#8221; Still pleased with my dexterity and skill, I went to the kitchen to distribute food for him and ended up with, well, a less than optimal result.</p>

<p><a href="http://www.flickr.com/photos/ikenndac/6843149991/"><img class="center" src="http://farm8.staticflickr.com/7008/6843149991_8a4b1dc61a_z.jpg"></a></p>

<p>I guess there&#8217;s no brain surgery in my future after all.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Me Time]]></title>
    <link href="http://ikennd.ac//blog/2012/02/me-time/"/>
    <updated>2012-02-01T19:52:00+01:00</updated>
    <id>http://ikennd.ac//blog/2012/02/me-time</id>
    <content type="html"><![CDATA[<p>Recently I&#8217;ve fallen into a common routine - I&#8217;ll arrive home from work between six and seven in the evening, slump down on the sofa for a rest, eat dinner, then faff around on the computer for a bit. Next thing I know, it&#8217;s 11pm and bed time.</p>

<p>This routine is lovely and lazy, but isn&#8217;t really helping me get stuff done - I have a ton of side projects, I want to play my guitar, I want to occasionally spend time listening to music as a primary activity (rather than in the background while I&#8217;m doing something else), etc etc.</p>

<p>It&#8217;s also been very easy to fall into the trap of thinking I simply don&#8217;t have time to do all these things - I mean, I get home, eat dinner, spend a small amount of time on the computer and now it&#8217;s bed time!</p>

<h2>Be Selfish!</h2>

<p>Recently, I&#8217;ve been trialling having an enforced &#8220;me time&#8221; - one hour per weekday, in the evening, where I&#8217;ll stop what I&#8217;m doing (within reason!) and go and do one of the above things.</p>

<p><img class="center" src="http://ikennd.ac/pictures/metime.png"></p>

<p>So far, it&#8217;s working out really well. I&#8217;m fortunate to live in an apartment large enough to have a room available for filling with the kind of toys required for this - so far it&#8217;s decked out with a model railway, a fairly decent audio system and a small guitar rack with an amp. Best of all, it&#8217;s right at the opposite end of the apartment to the living room and above the entrance hall to the building, meaning I can make a racket without bothering my fiancé or anyone else.</p>

<p><a href="http://www.flickr.com/photos/ikenndac/6802318621/"><img class="center" src="http://farm8.staticflickr.com/7010/6802318621_628d4f59e3_z.jpg" title="View Toy Room on Flickr.com" ></a></p>

<p>Now I&#8217;ve settled into the routine - I&#8217;ve been doing this for a couple of weeks now - I&#8217;m actually finding that I&#8217;m enjoying my evenings way more and I still have plenty of time to do the things I&#8217;d normally do anyway - I can eat dinner, faff around on the computer a bit, play World of Warcraft with my fiancé and still have an hour for Me Time. My fiancé heartily approves because it means she can watch her crappy girl TV without me complaining about it.</p>

<p>So, if you&#8217;re finding you don&#8217;t have time to do the things you&#8217;d like to do in your spare time - I&#8217;d thoroughly recommend giving an hour of forced &#8220;me time&#8221; a try - it doesn&#8217;t even have to be every day!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Nerd Week: On Roleplaying]]></title>
    <link href="http://ikennd.ac//blog/2011/12/nerd-week-on-roleplaying/"/>
    <updated>2011-12-30T10:08:00+01:00</updated>
    <id>http://ikennd.ac//blog/2011/12/nerd-week-on-roleplaying</id>
    <content type="html"><![CDATA[<p>I was fortunate enough to be able to have the week between Christmas and New Year off work, and I dedicated the entire week to nerdly persuits. I sense a new tradition coming on! One of the things I did this week was start playing Dungeons and Dragons, which sparked off a thought about how I play games.</p>

<p>There are two reasons why I play games. Only two, and almost by definition they&#8217;re mutually exclusive:</p>

<ol>
<li>Because the game is a fun, normally multiplayer, pick-up-and go action/platformer.</li>
<li>Because the game has an involving storyline I can engross myself in.</li>
</ol>


<p>Part of my personality is that I get way too attached to characters in a good story, especially in films and TV shows. Up? Cried. Twice. At the <em>start</em>. That episode of Bones when Brennan and Booth finally tell each other how they feel, but decide to keep apart because they work together? Floods of tears.</p>

<p>This invariably moves over to video games, when the story is good. Unfortunately, video game writing is, as a rule, pretty bad - I have a pile of games that I&#8217;ve started playing and left after a couple of hours as the storyline simply hasn&#8217;t drawn me in at all. A couple of notable exceptions in my mind are Blizzard and Rockstar.</p>

<p><strong> Major Spoilers for the endings of Red Dead Redemption and World of Warcraft: Cataclysm Ahead! </strong> You can safely skip these if you don&#8217;t want the stories of these games spoiled without missing the main point of this post.</p>

<p>The key, in games, is to get the buildup right. Red Dead Redemption does this very well - the entire storyline is about the main character chasing down an outlaw for the Feds in order to be reunited with his family. In the mission where you finally corner the outlaw and are closing in, the music slowly ramps up in intensity as you ascend the hill towards him. When he&#8217;s finally down, you&#8217;re free - the Feds let you go, and you spend the next few minutes riding your horse through a sunset-lit forest towards your family as <a href="http://open.spotify.com/track/6HCmZJxM2H28xtgCxp4q09">a perfect song</a> plays in the background. It&#8217;s such a wonderful moment, and since I got far too attached to this guy I was once again in floods of tears as I get reunited with my family and play through a few missions getting back into the swing of normal life.</p>

<p>Then? The Feds betray you. A bit cliché, to be honest, but I guess it&#8217;s time to take them down too. Then? BAM. You&#8217;re dead. I was so shocked by this that I missed half of the cutscene afterwards, scrabbling around on Google to confirm that the main character just got killed. I mean, they <a href="http://tvtropes.org/pmwiki/pmwiki.php/Main/PlotArmor">never</a> kill off the main character!</p>

<p>When the game finally ends, I feel kinda hollow. I&#8217;ve spent so long with this character, reuniting him with his family, and it was all for nothing? Should I feel betrayed by Rockstar for doing this? I dunno, but it&#8217;s damn good storytelling.</p>

<p>Blizzard are another company who can tell an excellent story, and in the case of World of Warcraft, the story is even <em>optional</em>. The buildup to <em>Cataclysm</em>&#8217;s ending has been literally a year in the making, and a great example of the optional story. If you don&#8217;t care about story, you get:</p>

<ul>
<li>Dragon burns down your capital city, tears up the world, kills your friends.</li>
<li>Dragon spends a year or so taunting you while you take down his cronies.</li>
<li>You finally kill Dragon. Hooray!</li>
</ul>


<p>&#8230; and the whole thing is thoroughly enjoyable. If you <em>do</em> care about story, though, there&#8217;s a huge, deep, subplot involving the dragon forming a cult to infiltrate the upper powers of the land, twisting them to his will.</p>

<p><strong> End Spoilers! </strong></p>

<h3>You Play World of Warcraft?!</h3>

<p>The interesting thing about enjoying the story in video games is that a lot of people see them as children&#8217;s toys or nerd obsessions. It&#8217;s completely normal to sit and read about adventures in a fantasy world in a book, but from a <em>game</em>? I actually find that older generations can understand it better than younger generations who grew up in schools where computers were using by &#8220;the nerdy kids&#8221; while they ran around kicking balls around feeling all masculine.</p>

<p>This mentality is even present in my place of work, which is kinda surprising since I work at a tech company with a <em>very</em> high level of tech-savvy people. We were eating lunch one day when I was discussing Dungeons and Dragons with a friend. I&#8217;ve never played it, but I&#8217;d love to try, and my friend was the same. Someone else on the table whom I&#8217;d never met before cried &#8220;Dungeons and Dragons?! Oh my God, you guys are such <em>nerds</em>! Next you&#8217;ll be telling me that you play World of Warcraft!&#8221;. The rest of the table simply sat there staring at him in stunned silence, partly because it&#8217;s the first time we&#8217;d heard the word &#8220;nerd&#8221; used as an insult from one of our own, and partly because they all played either Dungeons and Dragons, World of Warcraft, something else similar, or all three.</p>

<h3>The Inevitable Happens</h3>

<p><img class="right" src="http://ikennd.ac/pictures/dd_starter.jpg" title="D&D Startr Set" >I am <em>completely</em> invested in the story of the Warcraft universe and the characters within. I hate Garrosh for killing Cairne. I&#8217;m angry at Varian for acting like a complete asshole while his son grows out of him and looks destined to become a greater king than he&#8217;ll ever be. I was absolutely devastated with what happened to the Dragon Aspects after we killed Deathwing.</p>

<p>This passion for storytelling and <em>living</em> the story through games is what&#8217;s drawing me to Dungeons and Dragons. I was joking around yesterday and started making up a story about a dragon called Sid who was lonely and wanted to make friends with the local villagers, only to be chased out of town after he hiccupped and accidentally burned a family&#8217;s house down. After I&#8217;d finished telling the stupid story (Sid brought the hungry villagers some sheep he&#8217;d been keeping in his cave and won their friendship), I carried on thinking about the world this dragon might live in, the people in there, the geography of the place and so on.</p>

<p>I&#8217;d like to think this would make me a good Dungeon Master in D&amp;D - the idea of leading others through a world and stories I help create sounds very appealing. So, the other day I picked up a D&amp;D Starter Kit and started playing through it.</p>

<p>A few friends are also interesting in playing, so hopefully this will amount to something good!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Tales From an Unchecked Mind]]></title>
    <link href="http://ikennd.ac//blog/2011/11/tales-from-an-unchecked-mind/"/>
    <updated>2011-11-07T23:11:00+01:00</updated>
    <id>http://ikennd.ac//blog/2011/11/tales-from-an-unchecked-mind</id>
    <content type="html"><![CDATA[<p>I&#8217;ve been getting bored of my old domain, <a href="http://danielkennett.org/">danielkennett.org</a>, for a while. It&#8217;s long and boring, and is pretty much the only thing online that uses my real name. I don&#8217;t <em>mind</em> my real name being common online, but since I&#8217;m iKenndac on more or less every service I&#8217;m a member of, having my website be different seemed a bit weird.</p>

<p>A couple of weeks ago, I registered a nifty new domain: <a href="http://ikennd.ac/">ikennd.ac</a>. It&#8217;s perfect - short, sweet, and to the point. The problem is, though, that my blog had a big &#8220;danielkennett.org&#8221; logo on the top of it, and no other title or strapline. Replacing it with an &#8220;ikennd.ac&#8221; logo seems silly since I&#8217;ll be keeping the danielkennett.org domain alive for linking, and I was stumped.</p>

<p>That is, until today. A superb conversation popped up on Spotify&#8217;s internal IRC from Tobi, one of the designers, a slightly trimmed version of which I present here (I&#8217;m dan):</p>

<ul>
<li><strong>tobi:</strong> RIGHT</li>
<li><strong>tobi:</strong> Time for weird theory</li>
<li><strong>tobi:</strong> WHAT IF</li>
<li><strong>tobi:</strong> &#8220;broken&#8221; was spelled &#8220;borken&#8221; from the beginning</li>
<li><strong>dan:</strong> ?!</li>
<li><strong>tobi:</strong> Then to enforce that something was broken, they broke the word</li>
<li><strong>tobi:</strong> IE, they spelled &#8220;borken&#8221; -> &#8220;broken&#8221;</li>
<li><strong>dan:</strong> But if it was spelled that way from the beginning, it wouldn&#8217;t be broken</li>
<li><strong>dan:</strong> &#8220;borken&#8221; would be correct</li>
<li><strong>tobi:</strong> yes, borken would be correct</li>
<li><strong>tobi:</strong> NOWADAYS &#8220;broken&#8221; is correct</li>
<li><strong>tobi:</strong> and borken is broken</li>
<li><strong>tobi:</strong> but it may be turning back!</li>
<li><strong>dan:</strong> And then hundreds of years later, people like you would be all &#8220;WHAT IF they spelled it &#8216;broken&#8217; to break the word?!?!&#8221;</li>
<li><strong>tobi:</strong> Exactly</li>
<li><strong>dan:</strong> I should make a book of Tobi&#8217;s &#8220;theories&#8221;</li>
<li><strong>tobi:</strong> dan: Best book ever</li>
<li><strong>dan:</strong> Call it &#8220;Tales of an unchecked mind&#8221;</li>
<li><strong>dan:</strong> HOLY SHIT</li>
<li><strong>dan:</strong> http://www.google.com/search?&amp;q=%22tales+of+an+unchecked+mind%22</li>
<li><strong>dan:</strong> DIBS</li>
<li><strong>tobi:</strong> dan: hahaha</li>
<li><strong>dan:</strong> I can&#8217;t believe I came up with a unique title of something that sounds somewhat good</li>
<li><strong>dan:</strong> That&#8217;s totally being my blog&#8217;s title :-P</li>
<li><strong>tobi:</strong> :-D</li>
<li><strong>tobi:</strong> dan: butbutbutbut I should use that!</li>
<li><strong>dan:</strong> Too late</li>
<li><strong>tobi:</strong> you don&#8217;t have weird enough theories</li>
<li><strong>dan:</strong> COPYRIGHT</li>
<li><strong>dan:</strong> &copy;</li>
</ul>


<p>In it, I spontaneously came up with the phrase &#8220;Tales of an unchecked mind&#8221;, which is both a cheesy tagline and <em>perfect</em> for a blog, but more importantly at the time of writing had <strong>ZERO</strong> results on Google when the exact phrase was entered!</p>

<p><img class="center" src="http://ikennd.ac/pictures/toaum.png" title="Tales of an unchecked mind with zero results on Google" ></p>

<p>I changed it slightly to &#8220;Tales From An Unchecked Mind&#8221; and am now using it as the title for my blog. I&#8217;ve been wanting to make my blog more personal for a while now, including more writing about non-tech stuff along with an <a href="http://about.me/">about.me</a>-style page with my bio on it, and I think the new title will fit well.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Where The Hell Is My Self-Driving Car?]]></title>
    <link href="http://ikennd.ac//blog/2011/10/where-the-hell-is-my-self-driving-car/"/>
    <updated>2011-10-19T18:42:00+02:00</updated>
    <id>http://ikennd.ac//blog/2011/10/where-the-hell-is-my-self-driving-car</id>
    <content type="html"><![CDATA[<p>We&#8217;ve been promised self-driving cars for years. Hell, even <em>flying</em> cars! Where are they? Nowhere, that&#8217;s where!</p>

<p>Well, I&#8217;ve decided to take this into my own hands. In my <a href="http://ikennd.ac/blog/2011/10/arduino-dioder-part-three/">previous post</a> I mentioned that I&#8217;ve got a &#8220;more ambitious&#8221; Arduino project in the works, and today it arrived:</p>

<p><img class="center" src="http://ikennd.ac/pictures/rc/dualhunter_box.jpg" title="DualHunter Box" ></p>

<p>It turns out that interfacing with an RC is dead-simple - both the servo and the speed controller use the servo electronic interface, which the Arduino has libraries for.</p>

<p>Over time, I want to be able to solve the following challenge:</p>

<blockquote><p>Here&#8217;s a GPS coordinate: (x, y). Get there.</p></blockquote>

<p>The constraints of the challenge will be along the lines of:</p>

<ul>
<li>The environment will be a fairly open area with large obstacles (fields with trees, etc).</li>
<li>The car won&#8217;t have to worry about staying on roads.</li>
<li>The car should take a reactionary approach to navigation and <em>not</em> do a grid-search of the area.</li>
<li>The car should be able to go at a reasonable speed (> 10km/h or so).</li>
<li>The car should recognise potential dead-ends and stop in time.</li>
<li>The car should recognise when a fatal problem (like ending up upside-down) has occured and give up.</li>
</ul>


<p>Given those constraints, the car will need at least the following sensors:</p>

<ul>
<li>GPS</li>
<li>Gyroscope</li>
<li>Long-ish range distance (sonar or otherwise)</li>
<li>Long-ish range wireless for diagnostics and emergency-stops</li>
</ul>


<p>Thankfully, all of those are available for the Arduino. A friend of mine immediately started talking about advanced algorithms and video analysis when I mentioned this idea, but I hope to keep it much simpler than that, and given the environment the car will be in I hope to be able to pull off <em>something</em> with this project.</p>

<p>This will be a long-term project, especially since winter is rapidly approaching and if it&#8217;s anything like last year&#8217;s we&#8217;ll be knee-deep in snow in less than a month. Still, I&#8217;ll build the car soon and at least get it moving a bit under Arduino control.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Nerd++: Controlling Dioder RGB LED Strips with Arduino, Pt. 3 - Hardware Tidyup]]></title>
    <link href="http://ikennd.ac//blog/2011/10/arduino-dioder-part-three/"/>
    <updated>2011-10-15T18:56:45+02:00</updated>
    <id>http://ikennd.ac//blog/2011/10/arduino-dioder-part-three</id>
    <content type="html"><![CDATA[<p>A month or so ago, I <a href="http://ikennd.ac/blog/2011/09/arduino-dioder-part-one/">wrote a post</a>
detailing how I put together an Arduino Mega 2560, a couple of chips and
a pile of wires to allow me to control the colour of a set of IKEA
Dioder RGB LED strips in software, then a <a href="http://ikennd.ac/blog/2011/09/arduino-dioder-part-two/">follow-up post</a> on
how to emulate Philips&#8217; Ambilight technology to create a pleasing
ambient light effect behind your computer&#8217;s display.</p>

<p>Today, we&#8217;ll be tidying up the hardware side of the project from the
current sprawling mess of wires:</p>

<p><a href="http://www.flickr.com/photos/24169642@N06/6144802102"><img class="center" src="http://farm7.static.flickr.com/6090/6144802102_4c073bef12_z.jpg" title="View Arduino wiring for controlling Dioder LED strips on Flickr.com" ></a></p>

<p>To a neat little box:</p>

<p><a href="http://www.flickr.com/photos/24169642@N06/6245986547"><img class="center" src="http://farm7.static.flickr.com/6167/6245986547_e3f0d3dacc_z.jpg" title="View Arduino Dioder Shield In Box on Flickr.com" ></a></p>

<h3>Creating an Arduino Shield for DIODER LED Strips</h3>

<p>An Arduino shield is a circuit board that connects to an Arduino and
contains a certain number of electrical components that perform a
certain task — you can buy pre-made shields to give your Arduino an
ethernet port, a display, and so on. We&#8217;re going to make a shield that
stacks on top of the Arduino Mega 2560 and you can connect the LED
strips to.</p>

<p>On top of the things you already have, you&#8217;ll need the following (Links
to Swedish store):</p>

<ul>
<li>Soldering Equipment. If you haven&#8217;t soldered electronics before, get
a <a href="http://www.kpsec.freeuk.com/stripbd.htm">strip board</a> and some
spare components like resistors to practice with first.</li>
<li>Assorted lengths of wire.
[<a href="http://www.youtube.com/watch?v=mFxc1cAGlYU">Link</a>] [<a href="http://www.lawicel-shop.se/shop/custom/prod.aspx?productid=432167&amp;groupid=55653&amp;sortafter=0&amp;sortafterchild=0&amp;refcode=f">Real Link</a>]</li>
<li>1x Box for Arduino.
[<a href="http://www.lawicel-shop.se/shop/custom/prod.aspx?productid=680253&amp;groupid=63894&amp;sortafter=0&amp;sortafterchild=0&amp;refcode=f">Link</a>]</li>
<li>1x Proto-Shield for Arduino that includes stacking components.
[<a href="http://www.lawicel-shop.se/shop/custom/prod.aspx?productid=820488&amp;groupid=8841&amp;sortafter=0&amp;sortafterchild=0&amp;refcode=f">Link</a>]</li>
<li>16x Right-Angled Strip Headers
[<a href="http://www.lawicel-shop.se/shop/custom/prod.aspx?productid=801883&amp;groupid=8852&amp;sortafter=0&amp;sortafterchild=0&amp;refcode=f">Link</a>]</li>
</ul>


<p>Rather than step you through creating the board, I&#8217;ll simply leave you
with the circuit diagram to implement and some photos of my finished
board.</p>

<p><img class="center" src="http://ikennd.ac/pictures/for_posts/2011/09/ArduinoDioderWiring.png" title="Arduino + Dioder Wiring" ></p>

<p><a href="http://www.flickr.com/photos/24169642@N06/6245984929"><img class="center" src="http://farm7.static.flickr.com/6179/6245984929_3832d9711b_z.jpg" title="View Arduino Dioder Shield Top on Flickr.com" ></a></p>

<p><a href="http://www.flickr.com/photos/24169642@N06/6245984219"><img class="center" src="http://farm7.static.flickr.com/6217/6245984219_7524ef81f3_z.jpg" title="View Arduino Dioder Shield Three Quarter on Flickr.com" ></a></p>

<p>A few notes:</p>

<ul>
<li>You&#8217;ll notice that the circuit diagram is a bit different to the one
originally presented in the first part of this series. This is to
make creating a circuit board easier, and I&#8217;ve gone back and updated
both the <a href="http://ikennd.ac/blog/2011/09/arduino-dioder-part-one/">original post</a>
and the <a href="https://github.com/iKenndac/Arduino-Dioder-Playground">code on GitHub</a> for
this new layout.</li>
<li>You can probably make your board look way neater than mine!</li>
<li>The connector pins for the LEDs are right-angled because there&#8217;s not
enough space in the box for vertical pins and the LED connectors.
Angle the two sets of pins that aren&#8217;t hanging off the board upwards
slightly to make connection easier.</li>
<li>You can download a PDF of the diagram
<a href="http://ikennd.ac/pictures/ArduinoDioderWiring.pdf">here</a>.</li>
</ul>


<p>Once you&#8217;re completed the board, it will stack on top of the Arduino
Mega just fine. Cop a bit out of the box to allow the Dioder cables
through, and you&#8217;re set!</p>

<p><a href="http://www.flickr.com/photos/24169642@N06/6245985891"><img class="center" src="http://farm7.static.flickr.com/6170/6245985891_1c71e68f58_z.jpg" title="View Arduino Dioder Shield Mounted on Flickr.com" ></a></p>

<p><a href="http://www.flickr.com/photos/24169642@N06/6245986547"><img class="center" src="http://farm7.static.flickr.com/6167/6245986547_e3f0d3dacc_z.jpg" title="View Arduino Dioder Shield In Box on Flickr.com" ></a></p>

<h3>Moving Forward</h3>

<p>As before, let me know <a href="http://twitter.com/iKenndac">on Twitter</a> if
you&#8217;d like to share and thoughts or idea about this project. Now we have
a nice, neat box, in a couple of weeks I&#8217;ll post the final part of this
series — a System Preference pane with accompanying service to let the
lights respond to various system events, falling back to the ambient
lighting when nothing else is happening. After that, I&#8217;ll take a bit of
a break before starting the next, more ambitious, Arduino project.</p>

<p>Have fun!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Nerd++: Controlling Dioder RGB LED Strips with Arduino, Pt. 2 - Some Sort of Ambient Lighting]]></title>
    <link href="http://ikennd.ac//blog/2011/09/arduino-dioder-part-two/"/>
    <updated>2011-09-25T18:24:38+02:00</updated>
    <id>http://ikennd.ac//blog/2011/09/arduino-dioder-part-two</id>
    <content type="html"><![CDATA[<p><img class="right" src="http://ikennd.ac/pictures/for_posts/2011/09/DioderFacebookReaction.png" title="Dioder Facebook Reaction" ></p>

<p>A couple of weeks ago, I <a href="http://ikennd.ac/blog/2011/09/arduino-dioder-part-one/">wrote a post</a>
detailing the process of combining a set of colour-changing IKEA LED
strips, an Arduino, a few simple electronic components and a lot of
nerdiness into a project that allowed you to control the colour of the
LEDs though a simple application running on your computer.</p>

<p>Over the coming weeks and months, I&#8217;ll be presenting cool things you can
do with this project here on my blog. However, I <em>was</em>planning on
working up to this post, but since lots of people were enthusiastic
about this particular part (as can be seen from the screenshot of my
Facebook stream to the right), I jumped ahead a bit.</p>

<p>Now, Philips have a very similar system in a lot of their TVs, and as a
colleague at work who called me &#8220;Mr. Patent Infringer&#8221; pointed out, they
probably have a buttload of patents covering their technology.</p>

<p>So, please allow me to present…</p>

<h2>An Ambient Lighting Solution Similar To But Legally Distinct From Philips® Ambilight®</h2>

<p>So, what&#8217;s the challenge here? Well, actually, the core challenge is
pretty damn simple:</p>

<ol>
<li>Sample the screen.</li>
<li>Push an appropriate colour based on the edges of the screen image to
the lights.</li>
</ol>


<p>Philips&#8217; hardware also does a fuckton of image processing to smoothly
animate between colours and even provides an &#8220;aggressiveness&#8221; setting to
control how sensitive the LEDs are to colour change. I&#8217;ll be leaving
this as an exercise to the reader for now.</p>

<p>As always, all the code is available at the <a href="https://github.com/iKenndac/Arduino-Dioder-Playground">project&#8217;s home on GitHub</a>.</p>

<h3>First Attempt: Who let *him* near a computer?</h3>

<p>So, I&#8217;m not going to lie — my first attempt at this, was, well, lame.
For a start, I learned that if you leak a screen&#8217;s worth of pixel data
every time the screen refreshes (that&#8217;s 2560 x 1440 x 4 bytes = just
over 14Mb per frame at up to 60Hz), things go very bad very quickly.
Once that was fixed, my technique was:</p>

<ol>
<li>Register for screen update callbacks using
<code>CGRegisterScreenRefreshCallback()</code>.</li>
<li>Every time I got one of those, render the entire screen image into a
new buffer.</li>
<li>Loop through <em>all</em>of the pixels in the top, bottom, left and right
1/4 rectangles of the image buffer.</li>
<li>Average the RGB values therein.</li>
<li>Push those to the Arduino.</li>
</ol>


<p>As you might imagine, that method is rather inefficient. In fact, it&#8217;s
downright idiotic, and took nearly 60% of my CPU <em>all the time.</em></p>

<p>As the implementation matured, various optimisations of course took
place — only an idiot would allocate a new buffer each time the image
changes, for instance. In addition, the
<code>CGRegisterScreenRefreshCallback()</code> callback looks like this:</p>

<p><code>void screenDidUpdate(CGRectCount count, const CGRect *rectArray, void
*userParameter);</code></p>

<p>Which provides a lovely rect array telling you which parts of the screen
image changed, which is perfect since we only care about parts of the
image.</p>

<h3>Final Attempt: Passable, I guess</h3>

<p>As I attempted to improve the efficiency of the project, I tried only
sampling every fourth pixel, scaling the image down, etc, since we
obviously don&#8217;t need every single pixel sampled to get a single average
colour that&#8217;s good enough for the lights. However, the very act of
rendering the screenshot into a pixel buffer was by far the most
intensive part of the whole thing. I was publicly fishing for help on
Twitter when @uliwitness reminded me that Core Image exists.</p>

<p>A few minutes later, I&#8217;d replaced 90% of my code with a call to a Core
Image Filter called CIAreaAverage, which calculates the average colour
of a given image. Since Core Image is badass and much better than me,
this actually causes all the work to be kept on the graphics card and
caused CPU usage to tumble.</p>

<p><img class="center" src="http://ikennd.ac/pictures/for_posts/2011/09/DioderScreenColoursApp.png" title="Dioder Screen Colours Screenshot" ></p>

<p>The final project for this post contains two methods of calculating
colours:</p>

<p><strong>Pick A Pixel:</strong> Literally pick a single pixel near each edge of the
screen and use that. Not very clever.</p>

<p><strong>Average RGB:</strong> Use Core Image to calculate the average colour of the
edge rectangles of the scree as discussed above.</p>

<p>I was also planning on doing an Average Hue method too, since I was
expecting Average RGB to give brown every time (possibly a side-effect
of always getting shades of brown when mixing colours in art at school).
However, Average RGB works just fine so I never implemented it.</p>

<h3>Project Status</h3>

<p>As of now (<a href="https://github.com/iKenndac/Arduino-Dioder-Playground/commit/b3a1b17c038458d498d551a18d120435daf9f778">commit b3a1b17c038458d498d551a18d120435daf9f778</a>),
the project has undergone a few improvements since <a href="http://ikennd.ac/blog/2011/09/arduino-dioder-part-one/">Part 1</a> of
this series:</p>

<ul>
<li>Removed AMSerialPort for my own DKSerialPort class. AMSerialPort was
buggy and didn&#8217;t work with connection speeds over 9600 baud.
DKSerialPort is also a lot smaller.</li>
<li>Created a class called ArduinoDioderCommunicationController, which
abstracts away all the work of communicating with the Arduino
running the included sketch. This allows future projects in this
series (and you, of course) to drop in the class and just push
colours without caring about how it all works.</li>
</ul>


<p>Of course, I have to include a video of this project in action. The
colour changing is a little crappy since I don&#8217;t do any smoothing, and
unfortunately my camera picked up an odd flickering which isn&#8217;t visible
by the naked eye, but you get the idea:</p>

<p style="text-align: center;"><iframe width="853" height="480" src="http://www.youtube.com/embed/USB_BF2bPTE" frameborder="0" allowfullscreen></iframe></p>


<h3>Moving Forward</h3>

<p>As before, let me know <a href="http://twitter.com/iKenndac">on Twitter</a> if
you&#8217;d like to share and thoughts or idea about this project. In a week
or two I&#8217;ll put up another post discussing some more code to make the
LED strips respond to system events and so on.</p>

<p>I hope this is enough to get you started, though. Have fun!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Nerd++: Controlling Dioder RGB LED Strips with Arduino, Pt. 1 - Getting Started]]></title>
    <link href="http://ikennd.ac//blog/2011/09/arduino-dioder-part-one/"/>
    <updated>2011-09-13T20:48:22+02:00</updated>
    <id>http://ikennd.ac//blog/2011/09/arduino-dioder-part-one</id>
    <content type="html"><![CDATA[<p><img class="center" src="http://ikennd.ac/pictures/for_posts/2011/09/ArduinoHeader.jpg" title="Arduino Breadboard" ></p>

<p>A few weeks ago, it came to my attention that IKEA do a set of
colour-changeable LED strips. I&#8217;ve been looking for a decent way of
providing some lighting behind my computer to reduce eye-strain for a
long time, and these seemed perfect:</p>

<p><a href="http://www.flickr.com/photos/24169642@N06/6144250241" title="View Dioder Strips attached to the back of my iMac on Flickr.com"><img class="center" src="http://farm7.static.flickr.com/6066/6144250241_e2bd439ac8_z.jpg"></a></p>

<p>I was very pleased with them, but no self-respecting nerd would stop
here. <em>Especially</em> one who&#8217;s seen Philips&#8217; Ambilight technology in
action!</p>

<p>Over a series of blog posts, I&#8217;ll be explaining how I built a simple
controller for IKEA Dioder lights using an <a href="http://arduino.cc/en/Main/ArduinoBoardMega2560">Arduino Mega2560 unit</a>, then moving on to
explore various ways to utilise this control in software for fun and
awesomeness.</p>

<p>In this post, I&#8217;ll be building an Arduino layout that controls the
Dioder LED strips, programming it to listen to messages on its serial
port and set the LED strips&#8217; colours accordingly, then making a simple
Cocoa application in Xcode that sends messages to the unit to match the
strips to colour wells in a window on-screen.</p>

<p><strong>Note:</strong> If you see a paragraph starting with <strong>Tangent:</strong>, you can
skip it without losing information on how to build this project.</p>

<h3>I care not for your long and boring descriptions! Just give me the code and wiring diagrams!</h3>

<p>You can grab the code over at the project&#8217;s home<a href="http://www.github.com/iKenndac/Arduino-Dioder-Playground">on GitHub</a>, which
includes both Arduino sketches for uploading to the device and Xcode
projects for controlling it. The Arduino sketches require the <a href="http://arduino.cc/en/Main/Software">Arduino software</a> and the Xcode projects
were written on Mac OS X 10.7.</p>

<p>You can download a PDF wiring diagram
<a href="http://ikennd.ac/pictures/ArduinoDioderWiring.pdf">here</a>.</p>

<p>Enjoy!</p>

<p><a href="http://www.flickr.com/photos/24169642@N06/6144253033" title="View Arduino wiring for controlling Dioder LED strips on Flickr.com"><img class="center" src="http://farm7.static.flickr.com/6090/6144802102_4c073bef12_z.jpg"></a></p>

<h3>Part 1: Creating the Arduino-based hardware layout</h3>

<p>IKEA sell Dioder lights in a number of configurations — I went with the
set that includes four multicolour strips, a control box and a power
adapter (Store links:
<a href="http://www.ikea.com/se/sv/catalog/products/40192361">Sweden</a>/<a href="http://www.ikea.com/gb/en/catalog/products/00202324">UK</a>/<a href="http://www.ikea.com/us/en/catalog/products/50192365">USA</a>).
The control box and power adapter won&#8217;t be used once they&#8217;re connected
to the Arduino, though.</p>

<p>The Dioder LED strips have 12VDC on a common anode, with three return
paths for the red, green and blue channels.</p>

<p>Ingredients (links to Swedish stores):</p>

<ul>
<li>1 x Arduino Mega2560
[<a href="http://www.lawicel-shop.se/shop/custom/prod.aspx?productid=690919&amp;groupid=63894&amp;sortafter=0&amp;sortafterchild=0&amp;refcode=f">Link</a>]</li>
<li>1 x 12v AC-DC Adapter
[<a href="http://www.lawicel-shop.se/shop/custom/prod.aspx?productid=801708&amp;groupid=0&amp;sortafter=0&amp;sortafterchild=0&amp;refcode=p">Link</a>]</li>
<li>1 x A-B USB Cable
[<a href="http://www.lawicel-shop.se/shop/custom/prod.aspx?productid=47306&amp;groupid=8852&amp;sortafter=0&amp;sortafterchild=0&amp;refcode=f">Link</a>]</li>
<li>~40 x Male-Male Jump Cables (I got four packs of ten)
[<a href="http://www.lawicel-shop.se/shop/custom/prod.aspx?productid=564449&amp;groupid=64668&amp;sortafter=0&amp;sortafterchild=0&amp;refcode=f">Link</a>]</li>
<li>2 x ULN2003 DIP-profile chips
[<a href="http://www.electrokit.se/ic-linjara-uln2003a-dip-16-7-darlington-drivare_40350032">Link</a>]</li>
<li>1x Breadboard with at least 20 lanes
[<a href="http://www.lawicel-shop.se/shop/custom/prod.aspx?productid=610020&amp;groupid=64668&amp;sortafter=0&amp;sortafterchild=0&amp;refcode=f">Link</a>]</li>
</ul>


<p>The layout here is fairly simple — power the Arduino with the 12V power
adapter, then tap into that for the anode on each LED strip.
<a href="http://en.wikipedia.org/wiki/PWM">PWM</a> pins 2-13 (0 and 1 collide with
serial communication, which we&#8217;ll be using on this project) on the
Arduino are connected to the ULN2003 chips, which act as relays for the
red, green and blue cathodes from the LED strips. Finally, the ground
pins on the ULN2003s are connected to the Arduino&#8217;s ground to complete
the circuit.</p>

<p>Below are photos of the completed unit as well as a diagram of the
wiring. You may notice that the wiring in the photos isn&#8217;t quite the
same as in the wiring diagrams — that&#8217;s because I miswired the project
when I took photos of it. All code and future projects are based on the
wiring diagram.</p>

<p><a href="http://www.flickr.com/photos/24169642@N06/6144253033" title="View Arduino wiring for controlling Dioder LED strips on Flickr.com"><img class="center" src="http://farm7.static.flickr.com/6176/6144253033_1e41e7feb9_z.jpg"></a></p>

<p><a href="http://www.flickr.com/photos/24169642@N06/6144804622" title="View Dioder Pins on Flickr.com"><img class="center" src="http://farm7.static.flickr.com/6172/6144804622_28970d3dd4_z.jpg"></a></p>

<p><img class="center" src="http://ikennd.ac/pictures/for_posts/2011/09/ArduinoDioderWiring.png" title="Arduino + Dioder Wiring" ></p>

<p>You can download a PDF of the diagram
<a href="http://ikennd.ac/pictures/ArduinoDioderWiring.pdf">here</a>.</p>

<h3>Part 2: Programming the Arduino</h3>

<p>Rather than stepping through the process of listening to the serial port
and controlling the PWM pins, I&#8217;m going to jump straight to what I
implemented for the Arduino to listen to messages on its serial port and
set the PWM output values accordingly. However, if you haven&#8217;t
programmed Arduino before, I strongly recommend visiting the <a href="http://arduino.cc/en/Reference/HomePage">Arduino reference guides</a> and looking
at the sample projects included with the Arduino software to learn how
it all works — it&#8217;s a lot of fun!</p>

<p>The protocol I implemented is very simple — two constant header bytes,
12 &#8220;body&#8221; bytes (one for each red, green and blue pin over four separate
LED strips) and a checksum byte (a bitwise XOR of all the body bytes).</p>

<p><img class="center" src="http://ikennd.ac/pictures/for_posts/2011/09/ArduinoDioderProtocol.png" title="Arduino + Dioder Protocol" ></p>

<p><em>A message setting all connected LED strips to white/GBR(255,255,255)</em></p>

<p><strong>Tangent:</strong> Originally, I&#8217;d implemented the protocol without headers or
checksums — the Arduino would listen to the serial port and push each 12
bytes it got to the PWM pins. However, this was such a dumb idea — if
you accidentally sent the wrong length of data or some other app sent
data to it (which happened more than once), you&#8217;d never be able to get
it back in sync! You can find the Arduino sketch that listens for that
&#8220;protocol&#8221; in the sample code repository linked below at <em>Arduino
Projects/FourChannelRGBDumbListener/FourChannelRGBDumbListener.pde</em>.
Don&#8217;t use it, though — it&#8217;s dumb!</p>

<p>You can grab the finished Arduino sketch over at the project&#8217;s <a href="http://www.github.com/iKenndac/Arduino-Dioder-Playground">home on GitHub</a>, at
<em>Arduino Projects/FourChannelRGBSmartListener/FourChannelRGBSmartListener.pde</em>.</p>

<h3>Part 3: Creating a Cocoa application to send messages to the Arduino</h3>

<p>By now, you should have an Arduino successfully controlling your Dioder
LED strips. You can test this by connecting it all together (make sure
you connect the 12V adapter to the Arduino or the LED strips won&#8217;t be
powered) and switching on the Arduino — the Arduino sketch I wrote will
switch all four strips to white until told otherwise over the serial
port.</p>

<p>My Dioder LED strips are attached to the back of my iMac as shown in the
photo at the start of this post, so I made this very simple application
— choose the Arduino&#8217;s serial port from the menu, then change the colour
of the colour wells — the corresponding LED strip will change colour to
match!</p>

<p><img class="center" src="http://ikennd.ac/pictures/for_posts/2011/09/DioderColourWells.png" title="Dioder Colour Wells Application" ></p>

<p>The full Xcode project can be found over at the project&#8217;s <a href="http://www.github.com/iKenndac/Arduino-Dioder-Playground">home on GitHub</a>, at
<em>Xcode Projects/Dioder Colour Wells/Dioder Colour Wells.xcodeproj</em>. Just
to show how cool this looks in real life, I recorded a video to show it
off:</p>

<p style="text-align: center;"><iframe width="853" height="480" src="http://www.youtube.com/embed/9xdL4xVEc24" frameborder="0" allowfullscreen></iframe></p>


<h3>Moving Forward</h3>

<p>Hopefully you&#8217;ve got a few cool ideas on what to do next — let me know
<a href="http://twitter.com/iKenndac">on Twitter</a> if you&#8217;d like to share! In a
week or two I&#8217;ll put up another post discussing some more advanced code
to make the LED strips respond to system events and so on. A little bit
further down the line, we&#8217;ll start to get to the juicy stuff like live
image processing for having the LEDs react to what&#8217;s on screen.</p>

<p>I hope this is enough to get you started, though. Have fun!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[...I live in fucking SWEDEN!]]></title>
    <link href="http://ikennd.ac//blog/2011/08/i-live-in-fucking-sweden/"/>
    <updated>2011-08-20T22:07:52+02:00</updated>
    <id>http://ikennd.ac//blog/2011/08/i-live-in-fucking-sweden</id>
    <content type="html"><![CDATA[<h3>The Past</h3>

<p>One year ago yesterday, my fiancé and I pulled up outside an apartment a
few kilometres south of Stockholm at 11am. We&#8217;d just spent the last four
days driving through equally driving rain from the UK through France,
Belgium, Germany, Denmark and Sweden. We&#8217;d camped each night in the
rain. We were wet, our tent was wet, our stuff was wet.</p>

<p>We breathed a sigh of relief. We were happy to finally arrive, even
through our journey had been gruelling but a lot of fun. We&#8217;d stopped by
the Nürburgring and the world&#8217;s largest model railway on the way, both
of which were amazing. We took a 15 minute break before hauling all of
our stuff up three flights of stairs into our apartment.</p>

<p>We&#8217;d just moved to <em>Sweden.</em> We were both nervous and excited about the
time ahead, comforting ourselves with the fact that we could &#8220;just move
back to England&#8221; if it didn&#8217;t work out.</p>

<h3>The Present</h3>

<p>One year later, and we&#8217;ve just moved into another flat — one with no
maximum term, which we&#8217;re happy about since we can stay here for decades
if we want to. Both my fiancé and I have jobs at Spotify, which we&#8217;re
both enjoying more than we thought a day job could be enjoyed.</p>

<p>Living in Sweden is completely normal now. We get up and go to work,
then come home again. Drive to the supermarket to do our shopping. Have
LAN parties with our friends. Living in the UK seems like a distant
dream — not a good one, at times.</p>

<p>Occasionally I&#8217;ll be doing something thoroughly <em>normal</em>and the enormity
of the last year will smack me in the face. Last time it happened, I was
driving, in my Volvo, to IKEA. A completely normal, <em>British</em> thing to
do. As I was driving, I noticed that the forest was nothing but pine
trees, which I thought was odd. Then, I remembered. &#8220;The forest is
nothing but pine trees because I live in fucking <em>Sweden!</em>&#8221; A smile
spread uncontrollably across my face as I remembered the year and a half
long buildup to moving, then one day packing as much stuff into the car
as we could and starting the trip across Europe.</p>

<p>I still can&#8217;t decide if what we did was &#8220;big&#8221; or not — I&#8217;ve met quite a
few people who travel between countries a lot, so if you ask them what
we did is no big deal. Then again, I remember talking to some of our
friends in the UK before we left and trying to convey to their
confused-looking faces why on <em>earth</em> we&#8217;d move away from the town where
we&#8217;d grown up, much less the country we live in — if you ask them, what
we did would probably be an enormous thing.</p>

<h3>The Future</h3>

<p>After all the uncertainty and worry that it&#8217;d be a disaster, we&#8217;ve only
been here for twelve months and I think we&#8217;re here to stay. Between my
fiancé and I, we have around 48 years of collective experience of living
in the UK and, well, we both were kind of expecting to miss the UK at
least a <em>bit</em>. Personally, I miss a few of my friends but otherwise
wouldn&#8217;t care if I never set foot in the country again. My fiancé is the
same, albeit also having a tightly-knit family in the UK. Sweden is by
no means perfect, but we seem to get on with the Swedish way of living
much more than the UK way.</p>

<p>It doesn&#8217;t hurt, of course, that Sweden is <em>beautiful</em>. Of course, the
UK is beautiful in places too, but the following snapshots were taken
within 30km of the capital city. Try that around London!</p>

<p><a href="http://www.flickr.com/photos/24169642@N06/5286442950" title="View 'Christmas Spirit' on Flickr.com"><img class="center" src="http://farm6.static.flickr.com/5049/5286442950_e06b10c73a_z.jpg"></a></p>

<p><a href="http://www.flickr.com/photos/24169642@N06/5226442167" title="View 'Hiking The Dog' on Flickr.com"><img class="center" src="http://farm6.static.flickr.com/5205/5226442167_56c7a7db48_z.jpg"></a></p>

<p><a href="http://www.flickr.com/photos/24169642@N06/5151788559" title="View 'Lake Flaten at Sunset pt. 2' on Flickr.com"><img class="center" src="http://farm2.static.flickr.com/1355/5151788559_d8c4c5101b_z.jpg"></a></p>

<p><a href="http://www.flickr.com/photos/24169642@N06/5051541218" title="View 'Stairway to Heaven' on Flickr.com"><img class="center" src="http://farm5.static.flickr.com/4111/5051541218_fbe3365de2_z.jpg"></a></p>

<p><a href="http://www.flickr.com/photos/24169642@N06/5089330347" title="View 'Klara Kyrka's Autumn Dress' on Flickr.com"><img class="center" src="http://farm5.static.flickr.com/4147/5089330347_d0cc414738_z.jpg"></a></p>

<p><a href="http://www.flickr.com/photos/24169642@N06/5316965465" title="View 'A Very Swedish Road' on Flickr.com"><img class="center" src="http://farm6.static.flickr.com/5249/5316965465_68d5e3c380_z.jpg"></a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[It's so small!]]></title>
    <link href="http://ikennd.ac//blog/2011/07/its-so-small/"/>
    <updated>2011-07-02T15:10:18+02:00</updated>
    <id>http://ikennd.ac//blog/2011/07/its-so-small</id>
    <content type="html"><![CDATA[<p><em>That&#8217;s what she said!</em></p>

<p>I&#8217;ve always known that Stockholm is small compared to London. I mean,
the population of Greater London is more than 80% of the population of
the <em>entire</em> of Sweden. However, I didn&#8217;t really realise <em>how</em> small it
is until I compared these two pictures I took. Obviously they&#8217;re not
idea (visibility is greater in the Stockholm photo), but the London
urban sprawl does on for as far as the eye can see!</p>

<p><a href="http://www.flickr.com/photos/ikenndac/5893916410/" title="Stockholm from the Sky by iKenndac, on Flickr"><img class="center" src="http://farm7.static.flickr.com/6053/5893916410_df61a2a00e_z.jpg"></a></p>

<p><a href="http://www.flickr.com/photos/ikenndac/5893916776/" title="London from the Sky by iKenndac, on Flickr"><img class="center" src="http://farm7.static.flickr.com/6028/5893916776_e48859c22f_z.jpg"></a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Reeder for Mac 1.0 Released]]></title>
    <link href="http://ikennd.ac//blog/2011/06/reeder-for-mac-1-0-released/"/>
    <updated>2011-06-16T13:10:06+02:00</updated>
    <id>http://ikennd.ac//blog/2011/06/reeder-for-mac-1-0-released</id>
    <content type="html"><![CDATA[<p>A while ago, I posed <a href="http://ikennd.ac/blog/2010/12/analysing-a-touch-to-desktop-ui-port-using-fitts-law-reeder/">an article</a>
discussing Reeder&#8217;s UI, and how it doesn&#8217;t really fit in with a desktop
environment. That post got a lot of attention, and some people got
really angry with me and misquoted me and sent hysterical emails and so
on.</p>

<p>I still stand by the points made in that post, and the people mentioned
above seemed to think that I hated the whole app - which is untrue. I
still don&#8217;t really like many parts of the UI, but it&#8217;s still a beautiful
reading experience provided you memorise what all the unlabelled buttons
do.</p>

<p>Go <a href="http://reederapp.com/mac/">buy it</a> — I did!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[iPhoneTracker: Interesting Observations Of My Data]]></title>
    <link href="http://ikennd.ac//blog/2011/04/iphonetracker-interesting-observations-of-my-data/"/>
    <updated>2011-04-20T20:56:51+02:00</updated>
    <id>http://ikennd.ac//blog/2011/04/iphonetracker-interesting-observations-of-my-data</id>
    <content type="html"><![CDATA[<p><a href="http://petewarden.github.com/iPhoneTracker/">iPhoneTracker</a> came out
today, and it&#8217;s a bit shocking to find out my location is being stored
on my device. Indeed, my data goes back until the day I bought by phone
in July 2010.</p>

<p>For a moment, I was very unnerved. I don&#8217;t like the idea of my location
being stored in that much detail for so long. However, after actually
<em>looking</em> at my data (I know, right?) I&#8217;m not so outraged, but it&#8217;s
still pretty bad!</p>

<h3>My conclusions based on cursory observation</h3>

<ul>
<li>The data is recording the locations of the cell towers, not yours.</li>
<li>If you don&#8217;t have a data connection, locations aren&#8217;t calculated.</li>
<li>Cell information isn&#8217;t saved and locations calculated once you have
data again.</li>
</ul>


<h3>A theory on wildly inaccurate results</h3>

<p>Figure 2, below, shows locations in Sweden I&#8217;ve never been anywhere near
in my life - mainly the ones down the west coast and southeast coast
away from the big clumps.</p>

<p>I once visited a hotel with free WiFi. My iPad, only having WiFi to base
its location on, put my position smack on a Travelodge hundreds of mies
away. Turns out the base station used was moved from that Travelodge and
the location never updated.</p>

<p>I wonder if the same happens here? It doesn&#8217;t seem implausible that cell
towers are moved around without having their location updated in the
relevant database.</p>

<h3>My opinion</h3>

<p>Location data is an <em>incredibly</em> personal thing. Coupled with a
timestamp, you can infer all sorts of things about a person, and there
have been several projects that can predict the location of a person
based on historical location information like this. That they seem to be
collecting cell tower data as opposed to your own location makes this
less bad, but Apple <em>really</em> need to make it <em>crystal</em> clear to users
that they&#8217;re storing this information in cleartext all the time they&#8217;re
using their phones.</p>

<p>I&#8217;m not against the collection of this data at all. I understand that
this sort of data is recorded all the time, either on the handset in
question or by the networks themselves. My beef is that this data is
being saved, seemingly permanently, <strong>unencrypted</strong> and in plain view
for anyone to see, <strong>without telling me.</strong> It may well be buried in the
license agreement nobody reads through, but that&#8217;s not really an excuse.</p>

<h3>Interesting parts of my location history</h3>

<p><img class="center" src="http://ikennd.ac/pictures/for_posts/2011/04/iPhoneLocationDataGermany.png" title="iPhone Data: Germany" ></p>

<p><strong>Figure 1:</strong> Driving through Germany. We stayed overnight down near
Belgium, then drove through Germany the next day before arriving near
Hamburg for another overnight stop. I had Data Roaming switched on for a
while at our stopovers, and occasionally switched it on throughout the
drive to check Twitter.</p>

<p><img class="center" src="http://ikennd.ac/pictures/for_posts/2011/04/iPhoneDataSweden.png" title="iPhone Data: Sweden" ></p>

<p><strong>Figure 2:</strong> Driving through Sweden. My data is on permanently in Sweden,
of course, so the are a lot more cell towers here. There&#8217;s a very
interesting hole in the data towards the South, which isn&#8217;t a one-time
thing — this data was collected over three separate trips through the
country: one in August 2010, the other two in March 2011.</p>

<p><img class="center" src="http://ikennd.ac/pictures/for_posts/2011/04/iPhoneDataFerry.png" title="iPhone Data: Ferry" ></p>

<p><strong>Figure 3:</strong> Sailing past England. This data is from two separate trips,
both in March 2011, on a ferry from Denmark to the UK. The ferry sailed
along the British coast before heading over the North Sea to Denmark.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Born in the Wrong Country]]></title>
    <link href="http://ikennd.ac//blog/2011/03/born-in-the-wrong-country/"/>
    <updated>2011-03-15T00:39:17+01:00</updated>
    <id>http://ikennd.ac//blog/2011/03/born-in-the-wrong-country</id>
    <content type="html"><![CDATA[<p>When we were driving through Sweden to catch the ferry to England the
other day, my fiancé and I were discussing what we&#8217;d think it&#8217;d be like
returning to the country we grew up in after living away from it for six
months. She was worried that she&#8217;d feel at home and not want to leave
again. I doubted I&#8217;d feel that way, but wasn&#8217;t sure.</p>

<p>Boy, was I born in the wrong country. I&#8217;ve been here less than 48 hours
and I&#8217;m already counting the minutes before I can go home again.</p>

<p>This is the hardest thing in the world to describe, but England is…
dull. Not boring, but the colour palette seems to be muted. I thought I
was imagining things, but after chatting with a friend of mine back in
Sweden today, it seems I&#8217;m not alone. We share similar theories —
perhaps the significantly higher traffic levels make everything near the
roads dirty, or the higher pollution levels coupled with higher rainfall
covers everything in dirt, but there&#8217;s a definite difference.</p>

<p>I miss the clear air. The modern communications infrastructure. Being
able to drive somewhere without joining a queue of traffic. The
inability for <em>anyone</em> in Sweden to comprehend why on Earth I&#8217;d move
there without a Swedish girlfriend or family member forcing me. Hell,
even the damn traffic lights.</p>

<p>I miss home.</p>

<p>I don&#8217;t, however, miss the mosquitoes that&#8217;ll be waiting when it gets
warmer. Little fuckers.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[We're Not Retreating; We're Advancing in a Different Direction]]></title>
    <link href="http://ikennd.ac//blog/2011/01/were-not-retreating-were-advancing-in-a-different-direction/"/>
    <updated>2011-01-25T20:46:27+01:00</updated>
    <id>http://ikennd.ac//blog/2011/01/were-not-retreating-were-advancing-in-a-different-direction</id>
    <content type="html"><![CDATA[<p>Oh, boy.</p>

<p>A few weeks ago, I gave a talk at a Stockholm Cocoaheads meeting about
being an &#8220;indie&#8221; developer. Rather than talking about programming, I
talked about the lifestyle and what it&#8217;s like to live under this model,
eventually concluding that although it can be tough at times, the
tradeoffs are very much worth it if you can stomach the pitfalls of a
life without guaranteed fixed income.</p>

<p><img class="center" src="http://ikennd.ac/pictures/for_posts/2011/01/Indietalkslide.jpg" title="Indie Talk Slide" ></p>

<p>You can download the slides from the talk
<a href="http://dl.dropbox.com/u/1399296/Indie%20Life%20Slides.pdf">here</a>.</p>

<p>Well, I feel a bit silly now.</p>

<p>As of February 7th, 2010, I will no longer be an independent developer —
I&#8217;m joining the great team at <a href="http://www.spotify.com/">Spotify</a> here in
Stockholm. For the two of you on Earth who aren&#8217;t aware of Spotify,
their tagline sums it up nicely: &#8220;All the music, all the time&#8221;. They run
a music streaming service with the idea that you can listen to whatever
you want whenever and wherever you want to. It&#8217;s a great service which
I&#8217;ve been using for a long time, and I&#8217;m really excited to be able to
help make it better.</p>

<p><img class="center" src="http://ikennd.ac/pictures/for_posts/2011/01/SpotifyLogo.jpg" title="Spotify Logo" ></p>

<p>I&#8217;m aware that this change is the opposite of what many think is the
ideal path. The idea is to work for &#8220;the man&#8221; for a few years while
slowly building up ideas and projects in your spare time, before
quitting and making a break for it as an independent developer. So, why
give up a successful independent software business and go work one
someone else&#8217;s product?</p>

<p>Well, the last couple of years have
<a href="http://ikennd.ac/blog/2010/02/playing-the-game%E2%80%A6-and-losing/">been</a>
<a href="http://ikennd.ac/blog/2009/05/being-passionate-about-x-and-running-a-business-in-x-are-incompatible-discuss/">tough</a>,
for sure. However, I&#8217;ve gone through the worst and am pretty much out
the other side. The main problem here is that I suck at running a
business. Like, <em>really</em>suck. I hate it. I want to be coding, not
dealing with payroll and VAT and corporation tax and so on.</p>

<p>Still, everything is looking up and I came to Sweden with the idea of
carrying on with it, and possibly incorporating in Sweden down the line
if we decided to stay.</p>

<p>Then, at the Cocoaheads meeting I mentioned above, I got chatting with a
guy from Spotify and how they were looking for more developers. After a
little while, we agreed to meet up at Spotify HQ for an informal chat
(which I later learned was actually my first interview), after which I
was invited back a second time for a &#8220;more formal&#8221; interview.</p>

<p>At this point, I realised that I needed to sit down and figure out what
I wanted to do, since it wouldn&#8217;t be fair to go back knowing that I&#8217;d
never take a position because of my indie work. So, I sat down with my
fiancée and talked it out — what it&#8217;d mean for us, if we would be happy
to stay in Sweden long-term, and so on. Eventually, it boiled down to
one question:</p>

<blockquote><p>In ten years, which decision could I most regret taking?</p></blockquote>

<p>This was fairly easy. I know I have the skills to be an indie developer,
even if I hate certain aspects of it. I did it once, and I can do it
again. If working at Spotify turns out to be the wrong decision, I can
leave and start again.</p>

<p>However, what if I turn down a position at Spotify? This could be the
only chance I&#8217;ll ever get, and I&#8217;d never know what I missed out on.</p>

<p>So, I went to my &#8220;more formal&#8221; interview confident that I was interested
in a position at Spotify. It went well, until they asked a very academic
question that could&#8217;ve been on a computer science exam paper. I
completely blanked — the question was on Complexity, and while I did it
at university and have practical knowledge of implementing algorithms
and optimising them, I&#8217;ve pretty much lost the ability to express the
complexity of an algorithm as a function. I managed to muddle my way
through, showing my working and how I&#8217;d implement the algorithm, but
couldn&#8217;t answer their question.</p>

<p>When I left, I was <em>crushed</em> — surprisingly so. This told me that deep
down, I <em>really</em> wanted to work at Spotify, but unfortunately I&#8217;d just
blown it. Rather upset, I headed home, confident that I wouldn&#8217;t be
hearing back. I guess the fact that I&#8217;d been discussing it so much with
my fiancée, and that I&#8217;d pretty much decided I&#8217;d take the position if it
was offered set me up for a big fall.</p>

<p>A couple of weeks later, an email arrived. Spotify wanted to bring me
back for <em>two</em> more interviews! They wouldn&#8217;t want to tell me how much I
sucked <em>twice</em>, would they? This must be a positive thing! The rest was
history, and I start in a couple of weeks.</p>

<h3>Q&amp;A</h3>

<h4>What about your existing projects?</h4>

<p><strong>Music Rescue</strong> will continue to be available. It works just fine, and
I&#8217;ll keep it that way. The in-progress major rewrite will be scrapped,
and in the next week or so I&#8217;ll release an update (version 4.2) that&#8217;ll
bring some of the completed under-the-hood changes planned for version
5.0, including a rewritten (faster!) copy engine, simplified licensing,
playlist folders, etc.</p>

<p><strong>Clarus</strong> will continue in my spare time as a labour of love.</p>

<p><strong>Teleport: AddOns</strong> will be finished, released and will continue in my
spare time as a labour of love. It&#8217;ll also be free. Hooray!</p>

<p><strong>Open Source and Minor Projects</strong> will continue to exist but only
worked on in my spare time.</p>

<h4>So, wait, does that mean you&#8217;ll be staying in Sweden forever?</h4>

<p>Who knows what the future will bring? For now, though, yes.</p>

<h4>So my friend and I started this <em>awesome</em> band. We&#8217;re gonna be the next, like, JLS, you know? JLS but <em>ironic</em>. Can you get us on Spotify?</h4>

<p>Sure! Go <a href="http://www.spotify.com/se/work-with-us/labels-and-artists/">here</a>.</p>

<h4>Can you get me free stuff/subscriptions?</h4>

<p>I think I have a couple of Spotify stickers somewhere. Other than that,
unfortunately not.</p>

<h4>OMG YOU SELLOUT!</h4>

<p>That isn&#8217;t a question, but yes.</p>

<h4>You&#8217;re really going to stay in Sweden? It&#8217;s SO COLD.</h4>

<p>Sweden is awesome. In fact, before I even learned that Spotify needed
developers, I was looking for reasons to stay longer than 18 months. It
isn&#8217;t as expensive to live here as I was led to believe, either.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Cheaply Mounting a Gaming Steering Wheel]]></title>
    <link href="http://ikennd.ac//blog/2011/01/cheaply-mounting-a-gaming-steering-wheel/"/>
    <updated>2011-01-22T16:21:47+01:00</updated>
    <id>http://ikennd.ac//blog/2011/01/cheaply-mounting-a-gaming-steering-wheel</id>
    <content type="html"><![CDATA[<p>Ladies and gentlemen, I&#8217;m serious about my virtual racing. I&#8217;ve been a
fan of the Gran Turismo series on the Playstation for years, from before
I even owned a console and used to go to my friend&#8217;s house to play it on
his Playstation 2. I quickly learned that you can&#8217;t really play Gran
Turismo <em>properly</em> with the DualShock controller — to get the most from
the game, you need a decent steering wheel. Recently, I bought a
<a href="http://www.logitech.com/en-us/gaming/wheels/devices/4172">Logitech Driving Force GT</a> wheel, and
it&#8217;s a superb bit of kit.</p>

<p><a href="http://www.flickr.com/photos/ikenndac/5377459701/" title="Driving Force GT Setup Rear Quarter View by iKenndac, on Flickr"><img class="center" src="http://farm6.static.flickr.com/5168/5377459701_80166e33c0_z.jpg"></a></p>

<p>While I&#8217;m serious about my virtual racing, I don&#8217;t see the point in
spending <a href="http://www.amazon.com/dp/B000O00JE8">ridiculous amount of money</a> on a mount — my steering
wheel is mounted on a 199kr/£15/$18 height-adjustable desk called
<a href="http://www.ikea.com/se/sv/catalog/products/00120818">DAVE</a> from Ikea.
Unfortunately, the desk is far too light to be used without modification
— the force feedback is powerful enough to cause the desk to kick away
from underneath you when you&#8217;re gripping the wheel. Fortunately, there&#8217;s
a very simple modification you can do to the desk to stop this from
happening.</p>

<p>The solution I used is to attach the pedal box to the base of the desk,
allowing the weight placed on it by your feet to keep the desk steady.
This is nice and simple — the screw holes in the bottom of the pedal box
line up nicely with the &#8220;arms&#8221; of the desk&#8217;s base — simply screw a
couple of screws into the base at the correct places, hook on the pedal
box, and you&#8217;re good to go!</p>

<p>Another problem with the DAVE desk is that its feet are hard plastic,
which aren&#8217;t grippy on <em>anything</em>. Depending on your floor&#8217;s surface,
you&#8217;ll need either some sticky rubber feet or some carpet spikes to keep
it from sliding away from you while you&#8217;re driving. It&#8217;s also worth
noting that you get a vertical driving position with this desk — you&#8217;ll
need a fairly high chair (i.e., probably not your sofa) to use this
without doing your back in. If you&#8217;d prefer a more horizontal position
(in that the pedals are more in front of you than below), this isn&#8217;t the
solution for you!</p>

<p><strong>Update:</strong> I&#8217;ve found that you can get a much more natural driving
position if you cut off a single guide pin and put the desk top on
backwards — the pedal box then hooks to the base at the front rather
than the back. This is much closer to the driving position in a typical
car than if you put the desk together &#8220;correctly&#8221;. Picture at the bottom
of the post.</p>

<p><a href="http://www.flickr.com/photos/ikenndac/5377459941/" title="Driving Force GT Pedal Box Screw Holes by iKenndac, on Flickr"><img class="center" src="http://farm6.static.flickr.com/5249/5377459941_735f9a03a2_z.jpg"></a></p>

<p><a href="http://www.flickr.com/photos/ikenndac/5378059768/" title="Driving Force GT Setup Desk Screws by iKenndac, on Flickr"><img class="center" src="http://farm6.static.flickr.com/5246/5378059768_c20c50d984_z.jpg"></a></p>

<p><a href="http://www.flickr.com/photos/ikenndac/5377460567/" title="Driving Force GT Setup Pedal Box Fixed To Desk by iKenndac, on Flickr"><img class="center" src="http://farm6.static.flickr.com/5164/5377460567_c3b77c4934_z.jpg"></a></p>

<p><a href="http://www.flickr.com/photos/ikenndac/5378746908/" title="Driving Force GT Setup Desk Top Reversed by iKenndac, on Flickr"><img class="center" src="http://farm6.static.flickr.com/5203/5378746908_f1bfc6a574_b.jpg"></a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Moving to the App Store: How Not To Do It]]></title>
    <link href="http://ikennd.ac//blog/2011/01/moving-to-the-app-store-how-not-to-do-it/"/>
    <updated>2011-01-08T16:15:34+01:00</updated>
    <id>http://ikennd.ac//blog/2011/01/moving-to-the-app-store-how-not-to-do-it</id>
    <content type="html"><![CDATA[<p>The Mac App Store was released a couple of days ago, and one of the main challenges for us developers with existing user bases has been what to do if we want our applications on the store — Apple don&#8217;t give us a way to move our users to the App Store versions of our applications for free while allowing us to charge money to new users.</p>


<p>I&#8217;ve seen a few solutions to this from different developers, and the most prominent ones seem to be:</p>


<p><strong>Sell your application on the App Store store at normal price while continuing to distribute bugfix updates to existing users as before</strong></p>


<p>This is what I do, and it&#8217;s the best of both worlds. Existing customers get updates and I get new customers through the App Store.</p>


<p><strong>Go App Store only for sales and refund existing customers if they&#8217;d like to buy your application again on the App Store</strong></p>


<p>This is how Realmac are dealing with the <a href="http://realmacsoftware.com/blog/mac-app-store-pricing">transition for their Courier application</a>.</p>


<p><strong>Go App Store only for sales, rewarding people who opt to purchase again with genuine added value</strong></p>


<p>An excellent example of this is how Pixelmator is <a href="http://www.pixelmator.com/">being transitioned</a> — they&#8217;ve temporarily discounted Pixelmator greatly and announced that it&#8217;s going to be App Store only in the future. If users want to switch, they can&#8217;t get a refund but they can buy it again for cheap, with the promise of a free upgrade to version 2.0 when it ships.</p>


<p>Since Pixelmator has been out for quite a long time, they&#8217;re essentially letting users pre-order 2.0 on the App Store. However, right at the end:</p>


<blockquote>
<p>P.S. Even if you decide not to move to the Mac App Store we will continue to provide free Pixelmator 1.X updates til version 2.0.</p>
</blockquote>


<p>So, I get free updates to my current version <em>and</em> 2.0 for cheap? Sign me up!</p>


<p>Both of these solutions are great, as they treat customers and their money with respect. However, a fairly high-profile catastrophe happened with a little application called <a href="http://www.sophiestication.com/coversutra/">CoverSutra</a>. Their policy is:</p>


<p><strong>Go App Store only, give existing customers no refunds and if they want to receive any further updates, they have to buy the application again</strong></p>


<p>You can read the first explanation <a href="http://www.sophiestication.com/blog/coversutra-2-5/">here</a>, along with a followup to the backlash <a href="http://www.sophiestication.com/blog/about-coversutra-the-mac-app-store-and-sanity/">here</a>. People are <em>pissed</em>, and it strikes me that the application&#8217;s author misunderstands <em>why</em> people are pissed.</p>


<p>In my Twitter stream I&#8217;ve seen a fair amount of discussion on this, and a lot of people defending the decision with things like:</p>


<ul>
<li>$5 isn&#8217;t a lot of money! If they like the application enough, they should be happy to pay again.</li>
<li>I never expect free updates to any piece of software I buy.</li>
<li>That was a hard to keep promise, so it&#8217;s OK that it&#8217;s been broken.</li>
<li>It&#8217;s only a little piece of software, why are people getting so pissed about $5? Surely they&#8217;ve got more important things to be worried about?</li>
</ul>


<p>All of those defences may be true. And don&#8217;t call me Shirley. However, let me state a <em>fact</em> about software distribution, especially amongst indie developers. I will stake my reputation on this being true.</p>


<p><strong>The policy to give free updates to a purchased major version of a piece of software is so commonplace, if that&#8217;s <em>not</em> what you do then you need to either state that explicitly at purchase time or, preferably, rethink that policy.</strong></p>


<p>I&#8217;m an application developer and I&#8217;ve <em>never</em> expected anything less from a software purchase. If I buy version 1.x of an application, I expect to get all the updates to 1.x for free, but then pay for 2.0. It&#8217;s how everything I own works, and how I operate my own software. What if the 1.0 I buy only ever stays at 1.0 and I don&#8217;t get any updates? Fine. What if the updates are only bug fixes? Fine!</p>


<p>So, having the update to CoverSutra 2.5 from version 2.2.2 be paid? Big no-no. However, this implicit expectation of free updates was explicitly backed up with this:</p>


<p><img style="display: block; margin-left: auto; margin-right: auto; border: 0px initial initial;" src="http://ikennd.ac/pictures/for_posts/2011/01/coversutra.png" border="0" alt="CoverSutra's Licensing Promise" width="590" height="315" /></p>


<h3>Trust takes an age of good deeds to build, but only one misdeed to shatter instantly</h3>


<p>I bought CoverSutra, trusting that I&#8217;d get free updates as promised. My trust was broken, and even though it&#8217;s over something as stupid as updates to a cheap little application, it makes me feel like an idiot for trusting in the first place. People don&#8217;t like being made to feel like idiots!</p>


<p>No, $5 isn&#8217;t much. Yes, things change, and you perhaps shouldn&#8217;t promise things you&#8217;re not sure you can deliver. Perhaps users shouldn&#8217;t expect free updates unless you promise them.</p>


<p><strong>Tough.</strong> That&#8217;s not how customers think.</p>


<p>If you promise free updates until version 3, give them. Even if you don&#8217;t promise? Give them. If moving to the App Store and keeping a non-App Store distribution of your application going at the same time is too hard*, don&#8217;t. Either be smarter about dealing with it, or wait until you have a major upgrade to distribute.</p>


<p>That&#8217;s why people were pissed at Sophiestication to start with. Everything that followed — talking down at her customers, etc, just made things worse.</p>


<h3>Developers - Disagree At Your Peril</h3>


<p>Honestly? If you&#8217;re an application developer and you disagree with me, then fine. However, I&#8217;d be willing to bet that you&#8217;re also disagreeing with the vast majority of your customers, which is less fine. They give you money, and you probably need that money to live. Even if you don&#8217;t? They give you money. When someone gives <em>me</em> money, I <em>damn sure</em> try to keep them happy, because I expect nothing less of people I give money to.</p>


<p>* I personally think the argument that keeping two distributions going is too hard is BS, and is just the developer being lazy. I do it, and it&#8217;s not hard or time consuming at all.</p>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Quick Tip: Build numbers from Mercurial]]></title>
    <link href="http://ikennd.ac//blog/2011/01/quick-tip-build-numbers-from-mercurial/"/>
    <updated>2011-01-06T14:14:17+01:00</updated>
    <id>http://ikennd.ac//blog/2011/01/quick-tip-build-numbers-from-mercurial</id>
    <content type="html"><![CDATA[<p>All of my applications these days are versioned after the revision number of the version control repository they&#8217;re built from. Normally, having a version number different from the human readable version number isn&#8217;t necessary, but it&#8217;s handy in some cases, such as distributing beta builds and managing multiple builds of the same version.</p>


<p><img style="float: left;" src="http://ikennd.ac/pictures/for_posts/2011/01/ClarusAbout.png" border="0" alt="Clarus' About Box" width="364" height="414" /></p>

<p>For example, to the left you can see Clarus version 1.5.4 (239), which is the version you can download from my <a href="http://www.kennettnet.co.uk/products/clarus/">website</a>. The version submitted to the Mac App Store is 1.5.4 (247) for a couple of reasons:</p>


<ul>
<li>If you&#8217;re distributing apps both in and out of the App Store, you want the human-readable version number to be the same in both so users don&#8217;t feel the version in the App Store (or not) is &#8220;newer&#8221; than their version.</li>
<li>It&#8217;s handy for easily identifying App Store copies of your app with a simple &#8220;What version do you have?&#8221; question, just in case the App Store build has a unique issue.</li>
<li>The <em>only</em> changes between the builds are App Store related - no functionality changes at all.</li>
</ul>


<p>This build number is inserted into the CFBundleVersion key in the application&#8217;s Info.plist automatically by a build script. It&#8217;s based on <a href="http://www.mcubedsw.com/blog/index.php/site/comments/build_numbers_from_bazaar/">a script by Martin Pilkington</a> that does a similar thing for the Bazaar VCS, but with a few differences:</p>


<ul>
<li>It uses Mercurial rather than Bazaar.</li>
<li>It doesn&#8217;t use the presence of a .hg directory to determine whether the project is under version control or not, since this breaks if your Xcode project isn&#8217;t at the root level of the repository. </li>
</ul>


<p>And, most importantly in my eyes:</p>


<ul>
<li>It modifies the Info.plist file inside the built application rather than the one in your project. This minor difference means you don&#8217;t get an unclean repository by building the application.</li>
</ul>


<p>To use the script, right-click your Target in Xcode and choose Add &gt; New Build Phase &gt; New Run Script Build Phase. Set the new script to use the /usr/bin/perl shell, and paste in the script below. Enjoy!</p>




<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
<span class='line-number'>21</span>
<span class='line-number'>22</span>
<span class='line-number'>23</span>
<span class='line-number'>24</span>
<span class='line-number'>25</span>
<span class='line-number'>26</span>
<span class='line-number'>27</span>
<span class='line-number'>28</span>
<span class='line-number'>29</span>
<span class='line-number'>30</span>
</pre></td><td class='code'><pre><code class='perl'><span class='line'><span class="c1">#Check if we&#39;re versioned under hg</span>
</span><span class='line'><span class="k">my</span> <span class="nv">$revno</span> <span class="o">=</span> <span class="sb">`/usr/local/bin/hg id -n`</span><span class="p">;</span>
</span><span class='line'>
</span><span class='line'><span class="k">if</span> <span class="p">(</span><span class="nv">$revno</span> <span class="o">&amp;&amp;</span> <span class="nv">$revno</span> <span class="o">!~</span> <span class="sr">m/abort/i</span><span class="p">)</span> <span class="p">{</span>
</span><span class='line'>
</span><span class='line'>  <span class="k">print</span><span class="p">(</span><span class="s">&quot;Revision number is &quot;</span> <span class="o">.</span> <span class="nv">$revno</span><span class="p">);</span>
</span><span class='line'>
</span><span class='line'>    <span class="c1">#get the revno minus the new line</span>
</span><span class='line'>    <span class="nv">$revno</span> <span class="o">=~</span> <span class="nb">tr</span><span class="sr">/+/</span><span class="o">/</span><span class="n">d</span><span class="p">;</span>
</span><span class='line'>    <span class="nb">substr</span><span class="p">(</span><span class="nv">$revno</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">);</span>
</span><span class='line'>    <span class="c1">#open the info plist</span>
</span><span class='line'>    <span class="nb">open</span><span class="p">(</span><span class="k">my</span> <span class="nv">$input</span><span class="p">,</span>  <span class="s">&quot;&lt; &quot;</span><span class="p">,</span>  <span class="s">&quot;$ENV{BUILT_PRODUCTS_DIR}/$ENV{INFOPLIST_PATH}&quot;</span><span class="p">)</span>  <span class="ow">or</span> <span class="nb">die</span> <span class="s">&quot;Can&#39;t open Info.plist: $!&quot;</span><span class="p">;</span>
</span><span class='line'>    <span class="k">my</span> <span class="nv">$outputstring</span> <span class="o">=</span> <span class="s">&quot;&quot;</span><span class="p">;</span>
</span><span class='line'>
</span><span class='line'>    <span class="c1">#loop through each line until we find CFBundleVersion, then substitute the next line</span>
</span><span class='line'>    <span class="k">while</span> <span class="p">(</span><span class="o">+</span><span class="sr">&lt;$input&gt;</span><span class="p">)</span> <span class="p">{</span>
</span><span class='line'>        <span class="nv">$outputstring</span> <span class="o">.=</span> <span class="s">&quot;$_&quot;</span><span class="p">;</span>
</span><span class='line'>        <span class="k">if</span> <span class="p">(</span><span class="sr">/[\t ]+&lt;key&gt;CFBundleVersion&lt; \/key&gt;\n/</span><span class="p">)</span> <span class="p">{</span>
</span><span class='line'>            <span class="k">my</span> <span class="nv">$line</span> <span class="o">=</span> <span class="o">+&lt;</span> <span class="nv">$input</span><span class="o">&gt;</span><span class="p">;</span>
</span><span class='line'>            <span class="nv">$line</span> <span class="o">=~</span> <span class="sr">s/([\t ]+&lt;string&gt;)(.*?)(&lt; \/string&gt;)/$1.($revno).$3/eg</span><span class="p">;</span>
</span><span class='line'>            <span class="nv">$outputstring</span> <span class="o">.=</span> <span class="nv">$line</span><span class="p">;</span>
</span><span class='line'>        <span class="p">}</span>
</span><span class='line'>    <span class="p">}</span>
</span><span class='line'>
</span><span class='line'>    <span class="c1">#write back out to Info.plist</span>
</span><span class='line'>    <span class="nb">open</span><span class="p">(</span><span class="k">my</span> <span class="nv">$output</span><span class="p">,</span>  <span class="s">&quot;&gt;&quot;</span><span class="p">,</span>  <span class="s">&quot;$ENV{BUILT_PRODUCTS_DIR}/$ENV{INFOPLIST_PATH}&quot;</span><span class="p">)</span>  <span class="ow">or</span> <span class="nb">die</span> <span class="s">&quot;Can&#39;t open Info.plist: $!&quot;</span><span class="p">;</span>
</span><span class='line'>    <span class="k">print</span> <span class="nv">$output</span> <span class="nv">$outputstring</span><span class="p">;</span>
</span><span class='line'><span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
</span><span class='line'>    <span class="k">print</span> <span class="s">&quot;This project is not versioned&quot;</span><span class="p">;</span>
</span><span class='line'><span class="p">}</span>
</span></code></pre></td></tr></table></div></figure>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[iPod Transporter: An Exciting New Product!]]></title>
    <link href="http://ikennd.ac//blog/2010/12/ipod-transporter-an-exciting-new-product/"/>
    <updated>2010-12-31T17:44:49+01:00</updated>
    <id>http://ikennd.ac//blog/2010/12/ipod-transporter-an-exciting-new-product</id>
    <content type="html"><![CDATA[<p>Are you sick and tired of having your collection of nearly 20 test iPods for work cluttering up your desk, getting lost and broken?</p>


<p><em>Me too!</em></p>


<p>That&#8217;s why I&#8217;ve come up with a revolutionary new product — the <strong>iPod Transporter</strong>!</p>


<p><a title="View 'iPod Transporter Front Quarter View' on Flickr.com" href="http://www.flickr.com/photos/24169642@N06/5309420645"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://farm6.static.flickr.com/5245/5309420645_9c22e54dd2_z.jpg" border="0" alt="iPod Transporter Front Quarter View" width="640" height="427" /></a></p>


<p>Using the iPod Transporter, you can store and transport your iPods and iPhones in speed and style!</p>


<h2>Features</h2>


<h3>Equipped for Speed and Style</h3>


<p>iPod Transporter is outfitted with <em>two</em> motors, for unrivalled power and speed! In addition, the tracks are independently operated allowing iPod Transporter to turn a full circle on the spot!</p>


<p style="text-align: center;"><iframe src="http://www.youtube.com/embed/WZO07I_L76k?rel=0&amp;hd=1" width="853" height="510" frameborder="0"></iframe></p>


<h3>Built for Stability and Versatility</h3>


<p>Unlike <em>other</em> Lego-based iPod storage and transport solutions on the market, the iPod Transporter has its battery pack and motors as low as possible in the chassis, giving great stability during those high-speed turns — and the tracks allow it to traverse rough terrain with ease!</p>


<p><a title="View 'iPod Transporter Side View' on Flickr.com" href="http://www.flickr.com/photos/24169642@N06/5309419785"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://farm6.static.flickr.com/5201/5309419785_781142feaf_z.jpg" border="0" alt="iPod Transporter Side View" width="640" height="427" /></a></p>


<h3>Built-In iPod Dock and Cable Management</h3>


<p>Sick and tired of losing your iPod cables and docks? With its built-in Universal Dock, iPod Transporter makes that problem a thing of the past. Simply drive your iPod Transporter up to the computer of choice, plug it into a spare USB port and place your chosen device into the built-in Dock.</p>


<p><a title="View 'iPod Transporter Rear View' on Flickr.com" href="http://www.flickr.com/photos/24169642@N06/5310008546"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://farm6.static.flickr.com/5242/5310008546_dae9a12eff_z.jpg" border="0" alt="iPod Transporter Rear View" width="427" height="640" /></a></p>


<h3>Remote Controlled</h3>


<p>No longer do you have to, um, manually drive your iPods around! iPod Transporter comes with remote-control functionality as standard!</p>


<p><a title="View 'iPod Transporter Front View' on Flickr.com" href="http://www.flickr.com/photos/24169642@N06/5310009194"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://farm6.static.flickr.com/5006/5310009194_7879ef7474_z.jpg" border="0" alt="iPod Transporter Front View" width="640" height="427" /></a></p>


<h3>Shuffle Pouch</h3>


<p>No longer will you lose those tiny iPod Shuffles down the back of the sofa! iPod Transporter is equipped with an innovative storage solution for your iPod Shuffles — and even the Sixth Generation iPod Nano. Simply extend the pouch, place your iPods inside and safely stow it away again.</p>


<p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://farm6.static.flickr.com/5209/5310010856_05f36cf9b8_z.jpg" border="0" alt="iPod Transporter Shuffle Pouch Extended" width="640" height="427" /><a title="View 'iPod Transporter Shuffle Pouch Stowed' on Flickr.com" href="http://www.flickr.com/photos/24169642@N06/5309421373"></a></p>


<p><a title="View 'iPod Transporter Shuffle Pouch Stowed' on Flickr.com" href="http://www.flickr.com/photos/24169642@N06/5309421373"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://farm6.static.flickr.com/5125/5309421373_0169f006d7_z.jpg" border="0" alt="iPod Transporter Shuffle Pouch Stowed" width="640" height="427" /></a></p>


<p>Don&#8217;t delay, get yours today!</p>


<h3>Disclaimer</h3>


<p>This isn&#8217;t a real product. If you want to build one yourself, you&#8217;re on your own! However, mine was built pretty much exclusively built with parts from the <a href="http://shop.lego.com/product/?p=8275">Lego Motorised Bulldozer</a>.</p>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Sparkle and the Mac App Store: Techniques for managing optional code]]></title>
    <link href="http://ikennd.ac//blog/2010/12/techniques-for-managing-optional-code/"/>
    <updated>2010-12-27T20:17:04+01:00</updated>
    <id>http://ikennd.ac//blog/2010/12/techniques-for-managing-optional-code</id>
    <content type="html"><![CDATA[<h3>Example 1: Managing Optional Features in Different Builds of the Same Application (like, say, Sparkle)</h3>

<p>With the announcement of the Mac App Store, one framework has been
causing lots of trouble for a lot of people: Sparkle. Sparkle is a
framework that implements automatic updating, and is awesome —
therefore, everyone uses it. However, it directly violates the App Store
rule stating that you&#8217;re not allowed to do your own updating. I made a
new build configuration that defined an &#8220;App Store build&#8221; build
variable, then had the App Store build hide those parts of the UI from
users and disable Sparkle&#8217;s checking. Unfortunately, this wasn&#8217;t enough!</p>

<p>The trick for this isn&#8217;t to remove Sparkle from the App Store build —
it&#8217;s to <em>add</em> Sparkle to the non-App Store build. The problem here isn&#8217;t
the framework itself — simply create a new Target for your application
that doesn&#8217;t include it. More tricky is managing UI — to do this, I made
a little helper class to keep things simple for my applications that may
want to use Sparkle and have a separate version for the App Store.</p>

<p>My technique moves all of the application&#8217;s self-updating UI into a
separate nib file, which is controlled by my helper class, a subclass of
<code>NSViewController</code>:</p>

<p><img class="center" src="http://ikennd.ac/pictures/for_posts/2010/12/SparkleHelperXib.png" title="SparkleHelper.xib" ></p>

<p>As for the helper class, allow me to present the <em>simplest sample code ever:</em></p>

<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
<span class='line-number'>21</span>
<span class='line-number'>22</span>
<span class='line-number'>23</span>
<span class='line-number'>24</span>
<span class='line-number'>25</span>
</pre></td><td class='code'><pre><code class='objc'><span class='line'><span class="cp">#import &quot;SparkleHelper.h&quot;</span>
</span><span class='line'>
</span><span class='line'><span class="k">static</span> <span class="n">NSString</span> <span class="o">*</span> <span class="k">const</span> <span class="n">kSparkleHelperNibName</span> <span class="o">=</span> <span class="s">@&quot;SparkleHelper&quot;</span><span class="p">;</span>
</span><span class='line'><span class="k">static</span> <span class="n">NSString</span> <span class="o">*</span> <span class="k">const</span> <span class="n">kSparkleUpdaterClassName</span> <span class="o">=</span> <span class="s">@&quot;SUUpdater&quot;</span><span class="p">;</span>
</span><span class='line'>
</span><span class='line'><span class="k">@implementation</span> <span class="nc">SparkleHelper</span>
</span><span class='line'>
</span><span class='line'><span class="o">-</span><span class="p">(</span><span class="kt">id</span><span class="p">)</span><span class="n">init</span> <span class="p">{</span>
</span><span class='line'>
</span><span class='line'>    <span class="k">if</span> <span class="p">(</span><span class="n">NSClassFromString</span><span class="p">(</span><span class="n">kSparkleUpdaterClassName</span><span class="p">)</span> <span class="o">==</span> <span class="nb">nil</span><span class="p">)</span> <span class="p">{</span>
</span><span class='line'>        <span class="p">[</span><span class="n">self</span> <span class="n">release</span><span class="p">];</span>
</span><span class='line'>        <span class="k">return</span> <span class="nb">nil</span><span class="p">;</span>
</span><span class='line'>    <span class="p">}</span>
</span><span class='line'>
</span><span class='line'>    <span class="k">if</span> <span class="p">((</span><span class="n">self</span> <span class="o">=</span> <span class="p">[</span><span class="n">super</span> <span class="nl">initWithNibName:</span><span class="n">kSparkleHelperNibName</span> <span class="nl">bundle:</span><span class="nb">nil</span><span class="p">]))</span> <span class="p">{</span>
</span><span class='line'>        <span class="p">[</span><span class="n">self</span> <span class="n">view</span><span class="p">];</span>
</span><span class='line'>    <span class="p">}</span>
</span><span class='line'>    <span class="k">return</span> <span class="n">self</span><span class="p">;</span>
</span><span class='line'><span class="p">}</span>
</span><span class='line'>
</span><span class='line'><span class="o">-</span><span class="p">(</span><span class="n">NSMenuItem</span> <span class="o">*</span><span class="p">)</span><span class="n">checkForUpdatesMenuItem</span> <span class="p">{</span>
</span><span class='line'>    <span class="k">return</span> <span class="n">checkForUpdatesMenuItem</span><span class="p">;</span>
</span><span class='line'><span class="p">}</span>
</span><span class='line'>
</span><span class='line'><span class="k">@end</span>
</span></code></pre></td></tr></table></div></figure>


<p>All this does is check if the <code>SUUpdater</code> class, used by Sparkle, exists.
If it does, it loads the nib file containing my &#8220;Check for Updates&#8230;&#8221;
menu item into an <code>IBOutlet</code> and the chunk of UI to be placed into the
Preferences window into the view controller&#8217;s view property. Below is
code copied and pasted from Clarus itself — applicationMenu is an
<code>IBOutlet</code> to the Application menu, and updatesView is an <code>IBOutlet</code> to a
view in the Preferences window that should contain the self-updating UI.</p>

<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
</pre></td><td class='code'><pre><code class='objc'><span class='line'><span class="n">SparkleHelper</span> <span class="o">*</span><span class="n">helper</span> <span class="o">=</span> <span class="p">[[</span><span class="n">SparkleHelper</span> <span class="n">alloc</span><span class="p">]</span> <span class="n">init</span><span class="p">];</span>
</span><span class='line'>
</span><span class='line'><span class="k">if</span> <span class="p">(</span><span class="n">helper</span> <span class="o">!=</span> <span class="nb">nil</span><span class="p">)</span> <span class="p">{</span>
</span><span class='line'>
</span><span class='line'>    <span class="p">[</span><span class="n">applicationMenu</span> <span class="nl">insertItem:</span><span class="p">[</span><span class="n">helper</span> <span class="n">checkForUpdatesMenuItem</span><span class="p">]</span> <span class="nl">atIndex:</span><span class="mi">1</span><span class="p">];</span>
</span><span class='line'>    <span class="p">[</span><span class="n">applicationMenu</span> <span class="nl">insertItem:</span><span class="p">[</span><span class="n">NSMenuItem</span> <span class="n">separatorItem</span><span class="p">]</span> <span class="nl">atIndex:</span><span class="mi">1</span><span class="p">];</span>
</span><span class='line'>
</span><span class='line'>    <span class="p">[</span><span class="n">updatesView</span> <span class="nl">addSubview:</span><span class="p">[</span><span class="n">helper</span> <span class="n">view</span><span class="p">]];</span>
</span><span class='line'>
</span><span class='line'>    <span class="p">[</span><span class="n">helper</span> <span class="n">release</span><span class="p">];</span>
</span><span class='line'><span class="p">}</span>
</span></code></pre></td></tr></table></div></figure>


<p>This technique will avoid having to use compile-time #ifdefs to change
the behaviour of the application. Simply create a target that doesn&#8217;t
include the Sparkle framework and the little helper class will do the
rest. This is an incredibly simple technique, but it saves a fair amount
of effort if you ever have to do this more than once.</p>

<h3>Example 2: Supporting Multiple OS Versions Using Bundles</h3>

<p><img class="right" src="http://ikennd.ac/pictures/for_posts/2010/12/ClarusTargets.png" title="Clarus Target List" >
We&#8217;ve all had it. A new operating system version comes out, and we&#8217;d
really love to support X or Y new user feature in our applications.
However, what about our customers on older systems? Depending on your
userbase and attitude, this might not be an issue. However, if you&#8217;ve a
really large userbase, even the 5% or whatever who are still on Mac OS X
makes up a large number of people I&#8217;d like to keep happy.</p>

<p>The standard technique, in Xcode at least, is to set your <strong>Base SDK</strong>
to (say) Mac OS 10.6, and your <strong>Deployment Target</strong> to (say) Mac OS
10.4. That way, your app will run on 10.4 but the compiler will let you
write code for 10.6 as long as you&#8217;re careful about what you use when.</p>

<p>Personally, I&#8217;ve never been a huge fan of this approach. It works
absolutely fine, but you&#8217;re pretty much on your own on when it comes to
defending against calling a new API on an older OS version. You can do
all the <code>-respondsToSelector:</code> and <code>NSClassFromString</code>s you like, but I&#8217;m
always scared I&#8217;ll miss something and crash.</p>

<p>Clarus uses one specific Mac OS 10.6-only feature: the Image Capture
API, which provides views for viewing and importing images directly from
a camera or scanner.</p>

<p>To achieve this, Clarus has both its <strong>Base SDK</strong> and <strong>Deployment
Target</strong> to Mac OS 10.5. However, it has a separate target with <strong>Base
SDK</strong>and<strong>Deployment Target</strong> set to Mac OS X 10.6, which is compiled
into a bundle and embedded in the Clarus application. This allows me to
have the compiler defend against using 10.6 APIs in the main application
while having a place I can write 10.6 code without restrictions or
checks all the time.</p>

<p>If you try to load this bundle in Mac OS 10.5, you&#8217;ll get a nil bundle
and an error in the Console, so it&#8217;s dead easy to check for. Since
spewing stuff into the user&#8217;s console is bad (I&#8217;m looking at you,
Steam), you might like to put minimum/maximum OS versions in the
bundle&#8217;s Info.plist and check them before attempting to load.</p>

<p><img class="center" src="http://ikennd.ac/pictures/for_posts/2010/12/KNPluginMinimumSystemVersion2.png" title="KNPluginMinimumSystemVersion" ></p>

<p>In code, this can then be used as needed. For example, Clarus attempts
to load all the embedded bundles present, and maintains a list of these
internally. When a piece of code, it can do a simple check and alter the
UI as needed:</p>

<p><img class="center" src="http://ikennd.ac/pictures/for_posts/2010/12/ClarusPluginManager.png" title="Clarus Plugin Manager" ></p>

<h3>Conclusion</h3>

<p>Neither of these techniques are new or special. However, they work very
well for dealing with &#8220;optional&#8221; code in your application, which you&#8217;ll
need to do if you want your application to be distributed using multiple
methods, or if you want to support multiple operating system versions
intelligently.</p>
]]></content>
  </entry>
  
</feed>

