<?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-05-19T21:07:19+02: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[How to Win at Cycling For Fun]]></title>
    <link href="http://ikennd.ac//blog/2012/05/how-to-win-at-cycling-for-fun/"/>
    <updated>2012-05-19T18:00:00+02:00</updated>
    <id>http://ikennd.ac//blog/2012/05/how-to-win-at-cycling-for-fun</id>
    <content type="html"><![CDATA[<p>A while ago, I <a href="http://ikennd.ac/blog/2012/03/public-shaming-the-only-way/">publicly announced</a> that I was going to get my ass into gear and get fit enough to go snowboarding next winter. I&#8217;m happy to say that after ten weeks (<em>ish</em>), I&#8217;m now stronger, fitter, much better at recovering after tough hill climbs on my bike and… exactly that same weight as before. Perhaps celebrating a bike ride with a steak each time isn&#8217;t the right approach.</p>

<p>This wasn&#8217;t the original plan — I was going to get a FitBit and use the Personal Trainer feature to slowly build up the amount of walking and exercise I do to improve fitness. I did get a FitBit and while I really enjoy having it, my use for it now is simply to motivate me to walk where before I might take the lift or an escalator.</p>

<p>What&#8217;s happened is that a side-note in my original blog post (&#8221;<em>…as well as trying my hardest to cycle more.</em>&#8221;) has become a rekindled love of mine — I&#8217;m cycling multiple times a week and am having a ton of fun doing it, almost to the point where I forgot about the original plan to go snowboarding.</p>

<h2>Tips: Cycling For Fun</h2>

<p><a href="http://500px.com/photo/7714503"><img class="center" src="http://ikennd.ac/pictures/cycling/cycling-wide.jpg"></a></p>

<h3>Bike</h3>

<p>Try to match your bike to your terrain as much as you can. Or, rather — match where you ride to the bike you have. Mountain bikes do have more versatility in that you can ride one on the road much better than you can ride a road bike on forest trails, though. A few tips if you&#8217;re looking to buy a bike:</p>

<ul>
<li><p>Spend as much money as you can.</p></li>
<li><p>Don&#8217;t get a full-suspension bike that costs less than £1,000/$1,500. There&#8217;s no hard-and-fast rule, but every full-suspension bike I&#8217;ve seen for less than £1,000 has suffered for simply not having the budget available for decent components (the rear shock absorber on my bike retails for about £300 and is considered &#8220;middle of the range&#8221;). The result is &#8220;pedal bob&#8221; — a lot the work you put into pedalling ends up bouncing you up and down on the suspension instead of propelling you forwards.</p></li>
<li><p>Often, top-end components in one category are better than bottom-end components in the next category up. Cable disc brakes vs. hydraulic disc brakes, mechanically sprung forks vs. air sprung forks, etc.</p></li>
<li><p>Make sure your bike is properly set up for your size and weight, including tyre pressures, suspension setup, etc.</p></li>
<li><p>Find a <em>good</em> local bike shop to help you, and you&#8217;ll be rewarded in spades. See my <a href="http://ikennd.ac/blog/2012/05/the-bike-shop-the-birthday-and-the-averted-disaster/">recent story</a> about my fiancée&#8217;s birthday for a good example.</p></li>
<li><p>Most importantly: <strong>DO NOT BABY YOUR BIKE</strong>. Good bikes are <em>rewarding</em> when they take a pounding, get stupidly muddy and wet, etc. Plus, &#8220;So, I made it all the way to the bottom of the trail only to have my brakes not work right away because they were so covered in mud — I was squeezing so hard on the brakes that when the pads cleaned the discs they locked and I went right over the handlebars!&#8221; is a <em>much</em> more awesome story than &#8220;I went slowly, but at least my bike was clean!&#8221;</p></li>
</ul>


<p><a href="http://500px.com/photo/5883478"><img class="center" src="http://pcdn.500px.net/5883478/f67942a5693951e4ad65e504002d7fc0e8955e01/4.jpg"></a></p>

<p style="text-align:center;"> <em>My friend Tim on a cycling trip to Germany. No pictures of me here since I had the camera, unfortunately.</em></p>

<h3>Clothing</h3>

<p>Cycling can be a literal pain in the ass — I wear a pair of padded lycra cycling shorts every single time I go out on my bike, and a skintight base layer on top to control heat and sweat. Since I&#8217;m well aware nobody wants to see a guy of my figure in stuff like that, I wear a pair of baggy shorts and a t-shirt over the top.</p>

<p>In addition, make sure you have a decent pair of gloves and a comfy helmet.</p>

<h3>Equipment</h3>

<p>I cycle with a decent backpack that has an &#8220;air circulating&#8221; back — there&#8217;s a plastic board in the pack that keeps it away from your back, resulting in a much less sweaty time. Inside that backpack I have:</p>

<ul>
<li>A CamelBak holding 1.5-2 litres of water for continual refreshment.</li>
<li>A bike multi-tool.</li>
<li>A spare inner tube.</li>
<li>A puncture repair kit.</li>
<li>A bike lock.</li>
<li>A pump.</li>
</ul>


<p>On longer journeys, or trips away from home, I also add:</p>

<ul>
<li>A spare chain.</li>
<li>More inner tubes.</li>
</ul>


<p>Also, my bike has a decent light (Light &amp; Motion Seca 700) and a water bottle permanently attached, as well as my GPS, bell, etc.</p>

<h3>Base Route</h3>

<p>I have a 10km loop that I can do without feeling too tired. Over the past few weeks I&#8217;ve gotten faster and less tired around it, and it&#8217;s great to see my gradual improvement over time.</p>

<p align="center"><iframe height='405' width='590' frameborder='0' allowtransparency='true' scrolling='no' src='http://app.strava.com/runs/8677366/embed/332d9638814a1a82d97639cf6f692de7b464b8db'></iframe></p>


<h3>Data</h3>

<p>These posts are going in a category called &#8220;A Nerd Outdoors&#8221; for a reason! I now have a <a href="http://www.garmin.com/montana">Garmin Montana</a> strapped to my bike&#8217;s handlebars, which is linked to a cadence sensor for keeping track of how fast I&#8217;m pedalling.</p>

<p><a href="http://500px.com/photo/7738070"><img class="center" src="http://pcdn.500px.net/7738070/9825b53711f1b925af9f0a20f1fd835c1962002c/4.jpg" title="My Bike's &#34;Dashboard&#34;" alt="My Bike's &#34;Dashboard&#34;"></a></p>

<p style="text-align:center;"> <em>My bike&#8217;s &#8220;dashboard&#8221;</em></p>

<p>The Montana is perhaps overkill for this use, and you can get cheaper devices — even ones specifically designed for bike use — if you&#8217;re not interested in all of the features the Montana has.</p>

<p>Once I have this data, I upload it to <a href="http://wwww.strava.com/">Strava</a>, an <em>excellent</em> online service for keeping track of cycling which lets me compare how I&#8217;m doing with my friends and see my progress and statistics. For example, since April I:</p>

<ul>
<li>Have cycled 202km.</li>
<li>Am averaging 37km/week.</li>
<li>Am averaging 2 hours, 30 minutes on the bike a week.</li>
</ul>


<p>This is an example or a recent ride of mine:</p>

<p align="center"><iframe height='405' width='590' frameborder='0' allowtransparency='true' scrolling='no' src='http://app.strava.com/runs/8794036/embed/5a222d1d71e1017733388a37bb774f97de29e973'></iframe></p>


<p>I&#8217;m <a href="http://www.strava.com/athletes/ikenndac/">iKenndac</a> on Strava if you sign up!</p>

<h3>Maps</h3>

<p>I&#8217;ve already written <a href="http://ikennd.ac/blog/2012/04/high-tech-meets-low-tech-gps/">at length</a> about the advantages of having decent maps for hiking/cycling, but one more use has cropped up: Quite often I&#8217;ll be cycling along and see a path disappearing off into a forest and I&#8217;ll think &#8220;That looks fun, I wonder where that goes?&#8221;. Now I make a mental note of where it starts, and once I get home I can look on the map and see if I can fit it into my next ride.</p>

<p>This has already come up trumps — one of my favourite sections of trail in the area was found with this method. The entrance to it is a tiny, root-covered path with a &#8220;No horses&#8221; sign on it, but it opens out to a fantastically fun, fast, and sweeping section of trail that you can see me on a bit further up the page.</p>

<h3>Move To Sweden</h3>

<p>Well, this last one might be a bit far-fetched, but <em>man</em> is it awesome for cycling here. I live 13km from the centre of the capital city, and I have a nature reserve full of lakes and awesome cycling trails right on my doorstep. A typical rest stop looks like this:</p>

<p><a href="http://500px.com/photo/7740079"><img class="center" src="http://pcdn.500px.net/7740079/4292d49e61123fd6c8ce51f4a0e14bc57e06cb9e/4.jpg"></a></p>

<p>I guess I should get back out there!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[The Bike Shop, the Birthday and the Averted Disaster]]></title>
    <link href="http://ikennd.ac//blog/2012/05/the-bike-shop-the-birthday-and-the-averted-disaster/"/>
    <updated>2012-05-06T23:30:00+02:00</updated>
    <id>http://ikennd.ac//blog/2012/05/the-bike-shop-the-birthday-and-the-averted-disaster</id>
    <content type="html"><![CDATA[<p>I&#8217;m a country boy by heart — I grew up in a hamlet in Derbyshire with only 13 houses in it, then moved Down South to Hertfordshire and after a couple of moves, ended up in a small village in Bedfordshire that was surrounded by fields and trees.</p>

<p>Moving this close to a city — not to mention one in a foreign country — has taken some getting used to. Thankfully Stockholm is very small as cities go, and it&#8217;s a beautiful city at that. I&#8217;ve grown to love it here, and am finally starting to figure out that although Stockholm is small, it <em>is</em> the capital city of Sweden, so it&#8217;s <em>very</em> likely that if I want something I can find it nearby. However, most of the stores I&#8217;ve found are big-city style fancy shops — everything is expansive and the staff don&#8217;t know squat.</p>

<p><em>Finally</em> I found a place that&#8217;s different, and just in time!</p>

<h3>The Bike Shop</h3>

<p>It&#8217;s a rainy March afternoon and I&#8217;m scuttling through Södermalm (a district of Stockholm), cursing myself for not bringing a coat to work. I&#8217;d just received some new parts for my bike from a <a href="http://www.chainreactioncycles.com">big box retailer</a> and realised that I needed a specific tool fit them. I found a close-ish bike shop that looked halfway decent, and headed out in hope they&#8217;d even heard of a HollowTech II BB Tool, let alone have it in stock.</p>

<p>I opened the door to the small looking-shop and stood there in shock. And wet. But mostly in shock — this place was <em>nirvana</em>. To the right, the walls were jam-packed full of bike parts and accessories literally up to the ceiling. To the left are <em>hundreds</em> of bikes of all kinds — from the road bikes that most bike shops I&#8217;ve tried specialise in to the mountain bikes I love and crave parts and expertise in.</p>

<p>&#8220;<em>Do you have a HollowTech II BB tool in stock?</em>&#8221; I ask, with not much hope.</p>

<p>&#8220;<em>Well, be don&#8217;t have the Park one in, but we do have this other one that&#8217;s just as good,</em>&#8221; the guy behind the counter says while rummaging through shelves before producing the tool I need.</p>

<p>Well, this is unexpected. In a distant, grey corner of Södermalm I&#8217;ve stumbled on what appears to be the perfect bike shop — packed to bursting with parts and tools for <em>my</em> bike, not those damn hipster things, at a reasonable price and, most importantly, with staff who seem to be knowledgable at the task at hand. I&#8217;m in love!</p>

<h3>The Birthday</h3>

<p>&#8220;<em>Is there anything else I can help you with?</em>&#8221;</p>

<p>I pause for a moment to think. I <em>had</em> considered ordering this from a big retailer in the UK, but for stuff this big I <em>really</em> prefer getting it from a local place, but had come up fruitless so far.</p>

<p>&#8220;<em>How much would a <a href="http://www.specialized.com/gb/gb/bc/SBCProduct.jsp?spid=62136&amp;scid=1100&amp;scname=Mountain">Specialized Myka FSR Comp</a> in &#8216;Small&#8217; be? I&#8217;m buying one for my fiancé for her 25th birthday.</em>&#8221;</p>

<p>&#8220;<em>We don&#8217;t have it in stock here, but we could have one in a week or so,</em>&#8221; he said, before telling me the price. It&#8217;s a buttload of money, but actually worked out cheaper than any UK prices I&#8217;d found so far.</p>

<p>&#8220;<em>Great!</em>&#8221; I say. &#8221;<em>I&#8217;ll have one of those, too.</em>&#8221;</p>

<p>He looked slightly surprised at selling a bike so easily, and started taking my details.</p>

<p style="text-align:center;"> <em>~ One week later ~</em></p>

<p>After getting lost twice and likely scaring my friend Rick half to death — I&#8217;m so worried Alana will see through my weak excuse for going into Stockholm without her, my driving is less than ideal — we arrive back at Södermalm to pick up the bike.</p>

<p>To my surprise, the same guy is there again.</p>

<p>&#8220;<em>I didn&#8217;t know how heavy your fiancé is, so I set up the suspension for the average sort of weight of someone that high. Once she gets the bike, you can come back and we&#8217;ll set it up properly for her, if you like.</em>&#8221; At this point I&#8217;m gazing over the wall of parts again, fairly sure I&#8217;ll never need any other bike shop ever again, but assure him I already have the tools to set the suspension up myself and thank him for putting the bike together so quickly (it&#8217;d only arrived the day before, but he was sympathetic to my cause) and was on my way.</p>

<p><img class="center" src="http://pcdn.500px.net/7347795/0cdb26eeb070aef9325ccb716395e0e797c30a4b/4.jpg"></p>

<p style="text-align:center;"> <em>Hey look, a bike! And Rick&#8217;s arm.</em></p>

<p style="text-align:center;"> <em>~ Two weeks later ~</em></p>

<p>&#8220;<em>Surprise!</em>&#8221;</p>

<h3>The Averted Disaster</h3>

<p>My fiancé loves her bike. It&#8217;s been living in my friend&#8217;s apartment since I picked it up, and as I look it over properly for the first time, my heart begins to sink. The rebound on the rear shock absorber is so slow it&#8217;s like it has no pressure in it — when you push the bike down onto its suspension, it takes a good thirty seconds to come up again. I check the pressure — it&#8217;s fine. However, the rebound adjuster seems to be stuck and I don&#8217;t know enough about how shock absorbers to fix it.</p>

<p>Me and my fiancé are driving back to Södermalm to be at the shop for opening time. We walk in to find the same guy yet again.</p>

<p>&#8220;<em>Hi, I picked this bike up a couple of weeks ago,</em>&#8221; I say, &#8221;<em>and I think there&#8217;s something wrong with it — look.</em>&#8221; I push the suspension down and show him the problem.</p>

<p>&#8220;<em>Oh, that&#8217;s not right!</em>&#8221; he says. &#8221;<em>Unfortunately if the shock is broken there&#8217;s nothing I can do until Monday — the supplier is closed at weekends.</em>&#8221;</p>

<p>My heart sinks. I&#8217;d spent so much time organising not just getting the bike in secret, but organising a bunch of her friends to contribute towards it and to take photos saying &#8216;Happy Birthday!&#8217; for a photo book to accompany it. I go pretty much silent, as is often the case when I get upset. All this effort for a broken gift!</p>

<p>&#8220;<em>Oh, it&#8217;s your birthday, right?</em>&#8221; he says, turning to my fiancé. &#8221;<em>I&#8217;m so sorry I ruined the surprise!</em>&#8221;</p>

<p>Cheered up slightly by the fact that he remembered my plan, I ask &#8221;<em>Is there any chance you could take it apart today to see if it&#8217;s just stuck or something?</em>&#8221; It&#8217;s a long shot, but I <em>really</em> want my fiancé to have a working bike on her birthday.</p>

<p>&#8220;<em>Of course!</em>&#8221; he says.</p>

<p>The drive back home is <em>silent</em>. I&#8217;m back to being grumpy about the whole thing, and my fiancé&#8217;s attempts at cheering me up aren&#8217;t really doing much. After a horrible fifteen minutes, we&#8217;re 200 metres from home and her phone rings. They&#8217;d fixed it! We turned around and drove back to the shop.</p>

<p style="text-align:center;"> <em>~Fifteen minutes later~</em></p>

<p>Back at the shop, it&#8217;s <em>packed</em>. There&#8217;s a queue out the door to be served by one of the two people working there, and when it&#8217;s our turn, the same guy I&#8217;d worked with this whole time (I really should learn his name!) explained that the rear shock had simply got stuck in the lowest position and when he&#8217;d taken it out of the bike&#8217;s frame and re-pressurised it, it&#8217;d popped right back into position and was working fine.</p>

<p>I turn slightly red, realising that that might&#8217;ve been my fault — I&#8217;d sat on the bike after picking it up, which was the equivalent of trying to support a tank with car suspension. Genuinely happy again, I thanked him for fixing the bike so quickly — especially when it was this busy — and started to leave.</p>

<p>&#8220;<em>Okay, let&#8217;s get this bike properly set up for you,</em>&#8221; he says to my fiancé and motions us to follow him as he carries the bike down a tiny staircase to the basement, which turns out to be a workshop at least as large as the shop upstairs! In the next twenty minutes he proceeds to set up the bike exactly for my fiancé, from the pressures in the suspension to the rebound rate and even cutting the seat post down a bit (she&#8217;s slightly… <em>vertically challenged</em>). We end up leaving the shop with a perfectly tuned bike and a free water bottle for our trouble.</p>

<p>This bike shop is the kind of local business I will <em>gladly</em> pay the slight price increase over big-box online retailers to. To recap:</p>

<ul>
<li><p>I dealt with the same person every time, who was technically knowledgable and remembered me and my plan over the month it all took place in.</p></li>
<li><p>When something went wrong, not only did he bend over backwards to help us out in what I imagine is the busiest time of the week for the store, he took the time to make sure the bike was perfectly set up in every way once the problem was fixed.</p></li>
</ul>


<p>I can&#8217;t remember the last time I&#8217;ve experienced customer service this good — they managed to turn having my fiancé&#8217;s gift broken on her birthday into two incredibly happy people. That place has me as a customer for life! Everyone should go to <a href="http://www.cykelspecialisten.com">Cykelspecialisten</a> on Långholmsgatan, Södermalm RIGHT NOW and buy LOTS OF BIKES.</p>

<p>I&#8217;ll have a Specialized StumpJumper FSR Comp EVO, please!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Core Audio: AUGraph Basics in CocoaLibSpotify]]></title>
    <link href="http://ikennd.ac//blog/2012/04/augraph-basics-in-cocoalibspotify/"/>
    <updated>2012-04-24T13:31:00+02:00</updated>
    <id>http://ikennd.ac//blog/2012/04/augraph-basics-in-cocoalibspotify</id>
    <content type="html"><![CDATA[<p>Core Audio is one of the trickier frameworks in the Mac and iOS arsenal, but is incredibly powerful once you manage to tame it. I&#8217;ve been spending some time at Spotify getting to grips with it, and have released some Core Audio code as part of the open-source <a href="https://github.com/spotify/cocoalibspotify">CocoaLibSpotify</a> library.</p>

<p>CocoaLibSpotify is an Objective-C wrapper around the libSpotify library, which is a C API providing access to Spotify&#8217;s service for music streaming, playlists, etc etc. A more advanced example of what you can do with (Cocoa)LibSpotify is my open-source <a href="https://github.com/iKenndac/Viva">Viva</a> Spotify client.</p>

<p>CocoaLibSpotify contains a class called <code>SPCoreAudioController</code> that deals with getting audio data from libSpotify, through a Core Audio <code>AUGraph</code> and to the system audio output. The class also provides an easy way of customising the graph, and this post discusses the basics of Core Audio, <code>AUGraph</code>, and customising <code>SPCoreAudioController</code> with a 10-band graphic equalizier.</p>

<p><strong>Note:</strong> While this post discusses Spotify technologies, I wrote this because I enjoy the topic at hand and thought it&#8217;d be nice to share. The opinions expressed here may not represent those of Spotify, etc etc.</p>

<h3>Push vs. Pull</h3>

<p>Core Audio and libSpotify have two opposing methods of dealing with audio data.</p>

<ul>
<li><p>libSpotify uses the &#8220;push&#8221; method, which basically means it says &#8220;Here is some audio data, you should play it!&#8221;</p></li>
<li><p>Core Audio uses the opposite &#8220;pull&#8221; method, which means it asks &#8220;I need to play some audio, can I have some?&#8221;</p></li>
</ul>


<p>This means that, unfortunately, we can&#8217;t simply hook libSpotify up to Core Audio and get playback happening. Instead, we need to store the audio provided by libSpotify into a buffer which we&#8217;ll then read from when Core Audio requests some audio data.</p>

<p>To solve this in an elegant manner, CocoaLibSpotify includes a <a href="http://en.wikipedia.org/wiki/Circular_buffer">ring buffer</a>, which is a special kind of buffer that allows data to be read and written to is without reallocating memory, which can be expensive.</p>

<h3>Audio Units and AUGraph</h3>

<p>Core Audio uses a concept of &#8220;units&#8221; when working with audio. Each unit carries out a single task, such as applying an effect or actually playing the audio. <code>AUGraph</code> then provides a way to chain Audio Units together, much like how an amplifier stack works in the physical world.</p>

<p>To simplify this for most use cases, CocoaLibSpotify includes a class called <code>SPCoreAudioController</code>, which implements an <code>AUGraph</code> with three nodes:</p>

<ul>
<li><p><strong>Converter</strong> Node: Takes audio as delivered from libSpotify from the ring buffer and converts it into the canonical format used by Core Audio.</p></li>
<li><p><strong>Mixer</strong> Node: Mixers are normally used to mix audio from multiple sources, but here it&#8217;s used simply to provide the ability to control volume separately from the system volume, since the audio output unit on iOS doesn&#8217;t provide volume control.</p></li>
<li><p><strong>Output</strong> Node: This node takes the completed audio and delivers it to the system&#8217;s default audio output.</p></li>
</ul>


<p>Once this is up-and-running, <code>SPCoreAudioController</code> is managing an audio chain that looks like this:</p>

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

<h3>Customising SPCoreAudioController</h3>

<p>If you want to customise audio playback, <code>SPCoreAudioController</code> includes a handy pair of methods that allow you to insert any <code>AUNode</code> you like into the <code>AUGraph</code> without having to manage the whole graph, making the chain look like this:</p>

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

<p>So, let&#8217;s provide an example that inserts a 10-band graphic EQ into the graph:</p>

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

<p><strong>Note:</strong> The completed sample project can be found on GitHub <a href="https://github.com/iKenndac/SimplePlayer-with-EQ">here</a>.</p>

<p>First, create a new class subclassing <code>SPCoreAudioController</code> - the sample project calls it <code>EQCoreAudioController</code> - then override <code>-connectOutputBus:ofNode:toInputBus:ofNode:inGraph:error:</code>.</p>

<p>In this first example, set up a description of the EQ Audio Unit then have the graph add a node matching that description before getting a reference to the Audio Unit itself so we can set properties on it. Then, it initializes the Audio Unit and sets it to a 10-band EQ.</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>
<span class='line-number'>31</span>
<span class='line-number'>32</span>
<span class='line-number'>33</span>
<span class='line-number'>34</span>
</pre></td><td class='code'><pre><code class='objc'><span class='line'><span class="k">@implementation</span> <span class="nc">EQCoreAudioController</span> <span class="p">{</span>
</span><span class='line'>    <span class="c1">// Keep the node and unit around so we can reference them anytime.</span>
</span><span class='line'>    <span class="n">AUNode</span> <span class="n">eqNode</span><span class="p">;</span>
</span><span class='line'>    <span class="n">AudioUnit</span> <span class="n">eqUnit</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="kt">BOOL</span><span class="p">)</span><span class="nl">connectOutputBus:</span><span class="p">(</span><span class="n">UInt32</span><span class="p">)</span><span class="n">sourceOutputBusNumber</span>
</span><span class='line'>                 <span class="nl">ofNode:</span><span class="p">(</span><span class="n">AUNode</span><span class="p">)</span><span class="n">sourceNode</span>
</span><span class='line'>             <span class="nl">toInputBus:</span><span class="p">(</span><span class="n">UInt32</span><span class="p">)</span><span class="n">destinationInputBusNumber</span>
</span><span class='line'>                 <span class="nl">ofNode:</span><span class="p">(</span><span class="n">AUNode</span><span class="p">)</span><span class="n">destinationNode</span>
</span><span class='line'>                <span class="nl">inGraph:</span><span class="p">(</span><span class="n">AUGraph</span><span class="p">)</span><span class="n">graph</span>
</span><span class='line'>                  <span class="nl">error:</span><span class="p">(</span><span class="n">NSError</span> <span class="o">**</span><span class="p">)</span><span class="n">error</span> <span class="p">{</span>
</span><span class='line'>
</span><span class='line'>    <span class="c1">// A description for the EQ Device</span>
</span><span class='line'>    <span class="n">AudioComponentDescription</span> <span class="n">eqDescription</span><span class="p">;</span>
</span><span class='line'>    <span class="n">eqDescription</span><span class="p">.</span><span class="n">componentType</span> <span class="o">=</span> <span class="n">kAudioUnitType_Effect</span><span class="p">;</span>
</span><span class='line'>    <span class="n">eqDescription</span><span class="p">.</span><span class="n">componentSubType</span> <span class="o">=</span> <span class="n">kAudioUnitSubType_GraphicEQ</span><span class="p">;</span>
</span><span class='line'>    <span class="n">eqDescription</span><span class="p">.</span><span class="n">componentManufacturer</span> <span class="o">=</span> <span class="n">kAudioUnitManufacturer_Apple</span><span class="p">;</span>
</span><span class='line'>    <span class="n">eqDescription</span><span class="p">.</span><span class="n">componentFlags</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
</span><span class='line'>    <span class="n">eqDescription</span><span class="p">.</span><span class="n">componentFlagsMask</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
</span><span class='line'>
</span><span class='line'>    <span class="c1">// Add the EQ node to the AUGraph</span>
</span><span class='line'>    <span class="n">AUGraphAddNode</span><span class="p">(</span><span class="n">graph</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">eqDescription</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">eqNode</span><span class="p">);</span>
</span><span class='line'>
</span><span class='line'>    <span class="c1">// Get the Audio Unit from the node so we can set properties on it</span>
</span><span class='line'>    <span class="n">AUGraphNodeInfo</span><span class="p">(</span><span class="n">graph</span><span class="p">,</span> <span class="n">eqNode</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">eqUnit</span><span class="p">);</span>
</span><span class='line'>
</span><span class='line'>    <span class="c1">// Initialize the audio unit</span>
</span><span class='line'>    <span class="n">AudioUnitInitialize</span><span class="p">(</span><span class="n">eqUnit</span><span class="p">);</span>
</span><span class='line'>
</span><span class='line'>    <span class="c1">// Set EQ to 10-band</span>
</span><span class='line'>    <span class="n">AudioUnitSetParameter</span><span class="p">(</span><span class="n">eqUnit</span><span class="p">,</span> <span class="mi">10000</span><span class="p">,</span> <span class="n">kAudioUnitScope_Global</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
</span><span class='line'>
</span><span class='line'>    <span class="c1">//... continued in next code snippet.</span>
</span></code></pre></td></tr></table></div></figure>


<p>At this point, our EQ is set up and inserted into the audio controller&#8217;s graph. All that&#8217;s left to do now is hook it up to the provided source and destination nodes so audio gets piped through it:</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>
</pre></td><td class='code'><pre><code class='objc'><span class='line'>    <span class="c1">// ... continued from previous code snippet.</span>
</span><span class='line'>
</span><span class='line'>    <span class="c1">// Connect the output of the provided audio source node to the input of our EQ.</span>
</span><span class='line'>    <span class="n">AUGraphConnectNodeInput</span><span class="p">(</span><span class="n">graph</span><span class="p">,</span> <span class="n">sourceNode</span><span class="p">,</span> <span class="n">sourceOutputBusNumber</span><span class="p">,</span> <span class="n">eqNode</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
</span><span class='line'>
</span><span class='line'>    <span class="c1">// Connect the output of our EQ to the input of the provided audio destination node.</span>
</span><span class='line'>    <span class="n">AUGraphConnectNodeInput</span><span class="p">(</span><span class="n">graph</span><span class="p">,</span> <span class="n">eqNode</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">destinationNode</span><span class="p">,</span> <span class="n">destinationInputBusNumber</span><span class="p">);</span>
</span><span class='line'>
</span><span class='line'>    <span class="k">return</span> <span class="n">YES</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>That&#8217;s it! The EQ node is now inserted into the <code>AUGraph</code> managed by <code>SPCoreAudioController</code>, which now looks like this:</p>

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

<p>It&#8217;s important to do cleanup as well so we don&#8217;t leak memory and cause problems. <code>SPCoreAudioController</code> provides <code>-disposeOfCustomNodesInGraph:</code> to be overridden for just this purpose:</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>
</pre></td><td class='code'><pre><code class='objc'><span class='line'><span class="o">-</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span><span class="nl">disposeOfCustomNodesInGraph:</span><span class="p">(</span><span class="n">AUGraph</span><span class="p">)</span><span class="n">graph</span> <span class="p">{</span>
</span><span class='line'>
</span><span class='line'>    <span class="c1">// Shut down our unit.</span>
</span><span class='line'>    <span class="n">AudioUnitUninitialize</span><span class="p">(</span><span class="n">eqUnit</span><span class="p">);</span>
</span><span class='line'>    <span class="n">eqUnit</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
</span><span class='line'>
</span><span class='line'>    <span class="c1">// Remove the unit&#39;s node from the graph.</span>
</span><span class='line'>    <span class="n">AUGraphRemoveNode</span><span class="p">(</span><span class="n">graph</span><span class="p">,</span> <span class="n">eqNode</span><span class="p">);</span>
</span><span class='line'>    <span class="n">eqNode</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
</span><span class='line'><span class="p">}</span>
</span></code></pre></td></tr></table></div></figure>


<h3>Finishing Up &amp; Adding UI</h3>

<p>Now we have an EQ inserted into our Core Audio graph, we need to control the levels! To do this, the sample project implements the following method in <code>EQCoreAudioController</code>, which applies up to ten band values.</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="o">-</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span><span class="nl">applyBandsToEQ:</span><span class="p">(</span><span class="n">NSArray</span> <span class="o">*</span><span class="p">)</span><span class="n">tenBands</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">eqUnit</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="k">return</span><span class="p">;</span>
</span><span class='line'>
</span><span class='line'>    <span class="c1">// Loop through our bands and update them.</span>
</span><span class='line'>    <span class="k">for</span> <span class="p">(</span><span class="n">NSUInteger</span> <span class="n">bandIndex</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">bandIndex</span> <span class="o">&lt;</span> <span class="n">MIN</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="n">tenBands</span><span class="p">.</span><span class="n">count</span><span class="p">);</span> <span class="n">bandIndex</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
</span><span class='line'>
</span><span class='line'>        <span class="n">Float32</span> <span class="n">bandValue</span> <span class="o">=</span> <span class="p">[[</span><span class="n">tenBands</span> <span class="nl">objectAtIndex:</span><span class="n">bandIndex</span><span class="p">]</span> <span class="n">floatValue</span><span class="p">];</span>
</span><span class='line'>        <span class="n">AudioUnitSetParameter</span><span class="p">(</span><span class="n">eqUnit</span><span class="p">,</span> <span class="n">bandIndex</span><span class="p">,</span> <span class="n">kAudioUnitScope_Global</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">bandValue</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
</span><span class='line'>    <span class="p">}</span>
</span><span class='line'><span class="p">}</span>
</span></code></pre></td></tr></table></div></figure>


<p>The sample project then has ten continuous vertical sliders all hooked up to different <code>IBOutlet</code>s but calling the same <code>IBAction</code>. It&#8217;s best to set your sliders to range between <code>-12.0</code> and <code>+12.0</code> (this is the range iTunes uses in its EQ) otherwise the distortion gets a bit unbearable!</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>
</pre></td><td class='code'><pre><code class='objc'><span class='line'><span class="o">-</span><span class="p">(</span><span class="kt">IBAction</span><span class="p">)</span><span class="nl">eqSliderDidChange:</span><span class="p">(</span><span class="kt">id</span><span class="p">)</span><span class="n">sender</span> <span class="p">{</span>
</span><span class='line'>
</span><span class='line'>    <span class="n">NSMutableArray</span> <span class="o">*</span><span class="n">bands</span> <span class="o">=</span> <span class="p">[</span><span class="n">NSMutableArray</span> <span class="nl">arrayWithCapacity:</span><span class="mi">10</span><span class="p">];</span>
</span><span class='line'>
</span><span class='line'>    <span class="p">[</span><span class="n">bands</span> <span class="nl">addObject:</span><span class="p">[</span><span class="n">NSNumber</span> <span class="nl">numberWithFloat:</span><span class="n">self</span><span class="p">.</span><span class="n">eqSlider1</span><span class="p">.</span><span class="n">floatValue</span><span class="p">]];</span>
</span><span class='line'>    <span class="p">[</span><span class="n">bands</span> <span class="nl">addObject:</span><span class="p">[</span><span class="n">NSNumber</span> <span class="nl">numberWithFloat:</span><span class="n">self</span><span class="p">.</span><span class="n">eqSlider2</span><span class="p">.</span><span class="n">floatValue</span><span class="p">]];</span>
</span><span class='line'>    <span class="p">[</span><span class="n">bands</span> <span class="nl">addObject:</span><span class="p">[</span><span class="n">NSNumber</span> <span class="nl">numberWithFloat:</span><span class="n">self</span><span class="p">.</span><span class="n">eqSlider3</span><span class="p">.</span><span class="n">floatValue</span><span class="p">]];</span>
</span><span class='line'>    <span class="p">[</span><span class="n">bands</span> <span class="nl">addObject:</span><span class="p">[</span><span class="n">NSNumber</span> <span class="nl">numberWithFloat:</span><span class="n">self</span><span class="p">.</span><span class="n">eqSlider4</span><span class="p">.</span><span class="n">floatValue</span><span class="p">]];</span>
</span><span class='line'>    <span class="p">[</span><span class="n">bands</span> <span class="nl">addObject:</span><span class="p">[</span><span class="n">NSNumber</span> <span class="nl">numberWithFloat:</span><span class="n">self</span><span class="p">.</span><span class="n">eqSlider5</span><span class="p">.</span><span class="n">floatValue</span><span class="p">]];</span>
</span><span class='line'>    <span class="p">[</span><span class="n">bands</span> <span class="nl">addObject:</span><span class="p">[</span><span class="n">NSNumber</span> <span class="nl">numberWithFloat:</span><span class="n">self</span><span class="p">.</span><span class="n">eqSlider6</span><span class="p">.</span><span class="n">floatValue</span><span class="p">]];</span>
</span><span class='line'>    <span class="p">[</span><span class="n">bands</span> <span class="nl">addObject:</span><span class="p">[</span><span class="n">NSNumber</span> <span class="nl">numberWithFloat:</span><span class="n">self</span><span class="p">.</span><span class="n">eqSlider7</span><span class="p">.</span><span class="n">floatValue</span><span class="p">]];</span>
</span><span class='line'>    <span class="p">[</span><span class="n">bands</span> <span class="nl">addObject:</span><span class="p">[</span><span class="n">NSNumber</span> <span class="nl">numberWithFloat:</span><span class="n">self</span><span class="p">.</span><span class="n">eqSlider8</span><span class="p">.</span><span class="n">floatValue</span><span class="p">]];</span>
</span><span class='line'>    <span class="p">[</span><span class="n">bands</span> <span class="nl">addObject:</span><span class="p">[</span><span class="n">NSNumber</span> <span class="nl">numberWithFloat:</span><span class="n">self</span><span class="p">.</span><span class="n">eqSlider9</span><span class="p">.</span><span class="n">floatValue</span><span class="p">]];</span>
</span><span class='line'>    <span class="p">[</span><span class="n">bands</span> <span class="nl">addObject:</span><span class="p">[</span><span class="n">NSNumber</span> <span class="nl">numberWithFloat:</span><span class="n">self</span><span class="p">.</span><span class="n">eqSlider10</span><span class="p">.</span><span class="n">floatValue</span><span class="p">]];</span>
</span><span class='line'>
</span><span class='line'>    <span class="p">[</span><span class="n">self</span><span class="p">.</span><span class="n">audioController</span> <span class="nl">applyBandsToEQ:</span><span class="n">bands</span><span class="p">];</span>
</span><span class='line'><span class="p">}</span>
</span></code></pre></td></tr></table></div></figure>


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

<h3>Further Reading</h3>

<p><a href="http://my.safaribooksonline.com/book/audio/9780321636973">Learning Core Audio: A Hands-On Guide to Audio Programming for Mac and iOS</a> by Chris Adamson and Kevin Avila.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[High-Tech Meets Low-Tech: GPS, Topographic Mapping and the Great Outdoors]]></title>
    <link href="http://ikennd.ac//blog/2012/04/high-tech-meets-low-tech-gps/"/>
    <updated>2012-04-08T13:39:00+02:00</updated>
    <id>http://ikennd.ac//blog/2012/04/high-tech-meets-low-tech-gps</id>
    <content type="html"><![CDATA[<p>Software that comes with devices, 90% of the time, isn&#8217;t even worth installing. iTunes is almost universally hated. TomTom HOME is awful. <em>Anything</em> written by Sony makes me want to throw my computer out the window.</p>

<p><img class="center" src="http://ikennd.ac/pictures/vita/YES.png" title="Yes!" ></p>

<p style="text-align:center;"> <em>Yes! Sony&#8217;s PS Vita software seeing double and not communicating it very well.</em></p>

<p><a href="http://500px.com/photo/6401871/"><img class="left" src="http://pcdn.500px.net/6401871/f70b5bb699ca7bfe9f4317a2107a72ea5b015cd6/4.jpg" width="300" height="450" title="Garmin Colorado 300" ></a></p>

<p>This is why I&#8217;ve had this expensive GPS unit — a Garmin Colorado — strapped to my bike for nearly four years and I&#8217;ve barely even looked at the software. In 2008, Garmin&#8217;s software was largely Windows-only and while the mapping application (MapSource) was certainly powerful, its UI was very late-90s Windows and incredibly unintuitive to use.</p>

<p>I ended up with a set of incredibly detailed topographic maps on a device with a 3&#8221; display and nowhere else. I certainly got use out of them, but mainly on the trail with my bike or out hiking, using them to decide which direction to turn when I came to a junction.</p>

<p>A few weeks ago, while researching Gamin&#8217;s latest outdoor GPS unit, the Garmin Montana, I discovered they&#8217;d released a Mac version of their newer mapping application, <a href="http://www.garmin.com/us/products/onthetrail/BaseCamp">BaseCamp</a>. I decided to give it a try and it <em>instantly</em> increased the value of topographic maps ten-fold, and has completely transformed cycling and hiking for the better.</p>

<h3>You PAY for maps?! But Google Maps is free!</h3>

<p>As I was tweeting about this as I was researching it, someone derisively pointed out that &#8220;There&#8217;s an app for that!&#8221;, likely free. And sure, topographic maps are expensive — the maps on my device that cover the section of Sweden I&#8217;m in (roughly 1/4 of the country) cost $199. However, Google Maps doesn&#8217;t even come <em>close</em> to offering the level of detail these maps do, and while OpenStreetMap is better in my area they still don&#8217;t match the quality and level-of-detail of these proper maps. Oh, and there&#8217;s no way in hell I&#8217;m strapping an iPhone to my bike&#8217;s handlebars!</p>

<p><img class="center" src="http://ikennd.ac/pictures/mapping/GoogleVsTopo.png" title="Google vs. Topo" ></p>

<p style="text-align:center;"> <em>Google Maps on the left, 1:50,000 Topographic map on the right.</em></p>

<p><a href="http://500px.com/photo/6402371/"><img class="center" src="http://pcdn.500px.net/6402371/a886f9278fdadab7b243dc3096e89f09554ad080/4.jpg" title="This path is on the topographic maps." ></a></p>

<p style="text-align:center;"> <em>This path is on the topographic maps!</em></p>

<h3>Using Garmin BaseCamp and Good Maps for Fun and Adventure</h3>

<p>So, why is this so awesome? Well, BaseCamp has a superb map display, allowing you to virtually explore the paths and trails with ease and import logs of recent hikes and bikerides to be shown on the map.</p>

<p><img class="center" src="http://ikennd.ac/pictures/mapping/BasecampBikeride.png" title="BaseCamp Map Display" ></p>

<p style="text-align:center;"> <em>BaseCamp&#8217;s Map Display, overlaid with a track of a recent bikeride (magenta).</em></p>

<p>The software comes into its own when planning where to go, though. You can draw out potential routes on the maps and you&#8217;ll be given standard stuff like distance, but also a height map of the route. This is invaluable for planning outdoor treks — the route shown above was great fun because as the height map below shows, it&#8217;s paced nicely with each steep uphill part followed with a rest, and running it in reverse on the way home has a nice long downhill section to finish on.</p>

<p><img class="center" src="http://ikennd.ac/pictures/mapping/BasecampHeightProfile.png" title="BaseCamp Map Display" ></p>

<p style="text-align:center;"> <em>BaseCamp&#8217;s Height Map</em></p>

<p>As the <a href="http://ikennd.ac/blog/2012/03/public-shaming-the-only-way/">quest to go snowboarding</a> continues, this workflow is really helping me explore the countryside on my bike and have a lot of fun doing it. We&#8217;re going to the French Alps in the summer, and I&#8217;m really looking forward to getting maps of the area and going on some epic bikerides!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Public Shaming: The Only Way]]></title>
    <link href="http://ikennd.ac//blog/2012/03/public-shaming-the-only-way/"/>
    <updated>2012-03-06T23:35:00+01:00</updated>
    <id>http://ikennd.ac//blog/2012/03/public-shaming-the-only-way</id>
    <content type="html"><![CDATA[<p>Let&#8217;s be honest from the outset — I&#8217;m a big fat guy. During my third year at University (which was actually a placement year) I got an office job and piled on the weight stupidly fast. At one point I was so worried about it that I went to the doctor to get advice on how to best get healthy again. He did a couple of tests and said that I was fine, and that if I <em>really</em> wanted to lose weight, I should do it slowly rather than crash dieting.</p>

<p>Of course, I stopped worrying and &#8220;slowly&#8221; became &#8220;nothing&#8221;, and I&#8217;ve been more or less a constant weight ever since. In fact, according to the Wii Fit, I&#8217;ve lost 6lbs in the past 617 days.</p>

<p>The problem is, I <em>really</em> enjoy the outdoors. I love hiking, cycling and more recently snowboarding, and being a big fat guy kinda gets in the way of that. Like many people, every year or so I vow that I&#8217;ll cycle and walk more, reduce my cake intake and generally get fitter. And, like most of those people, I fail pretty hard at changing my bad habits.</p>

<p><a href="http://www.flickr.com/photos/ikenndac/6960110725/"><img class="center" src="http://farm8.staticflickr.com/7177/6960110725_d333c4a7cd_z.jpg"></a></p>

<p style="text-align:center;"> <em>Me, right, cycling at the Nürburgring with friends</em></p>

<h3>This Time, I Mean It — But Not Like Those Other Times I Said &#8220;This Time, I Mean It&#8221;</h3>

<p>The problem is setting goals. I hate the gym and don&#8217;t care about my weight in that I have no interest in getting to some arbitrary number. I can already walk and cycle to some degree, so goals like &#8220;I should be able to cycle <em>x</em> kilometres&#8221; ends up being another arbitrary goal I don&#8217;t have much interest in.</p>

<p>However, I&#8217;ve found a new activity I <em>really</em> care about, and that I currently can&#8217;t do very well — sliding down the side of a mountain on a plank of wood! A year or so before we moved to Sweden, my fiancé and I took some skiing and snowboarding lessons and got proficient enough to tackle a mountain. As luck would have it, my mother lives literally twenty minutes drives from Risoul, a ski resort in the French Alps, so off we went for some mountainside action!</p>

<p>I absolutely adore snowboarding — I could&#8217;ve stayed there all week. Except that&#8217;s the problem — I don&#8217;t have the stamina to keep my ample frame upright on a snowboard for more than a day, and after that I started to get exhausted very fast, causing me to fall over more, causing me to get exhausted even faster.</p>

<p><a href="http://www.flickr.com/photos/ikenndac/6813984322/"><img class="center" src="http://farm8.staticflickr.com/7187/6813984322_a14b35417e_z.jpg"></a></p>

<p style="text-align:center;"> <em>I fell over a LOT.</em></p>

<h3>There&#8217;s Nothing Like Public Shaming To Spur Motivation</h3>

<p>I&#8217;m writing about this plan here simply so it&#8217;s out in the public domain — if I fail, my friends and internet strangers have full permission to mock me mercilessly.</p>

<p><strong>The Goal:</strong> To be fit enough to go snowboarding in winter 2012/13 and have a <em>damn good time</em>.</p>

<p><strong>The Plan:</strong> I&#8217;ve bought a <a href="http://www.fitbit.com/">FitBit</a> to allow me to keep track of my daily activity. The software has a &#8220;Trainer&#8221; that slowly ramps up your activity targets over time, allowing me to increase my daily exercise levels in a way that doesn&#8217;t impact my daily routine. In addition, I&#8217;ll have a few of my friends set targets to meet that the software might not think of, as well as trying my hardest to cycle more.</p>

<p>And damnit, I&#8217;ll cut down on Coke/Pepsi/etc once and for all — which will be the hardest thing to do since there&#8217;s a fridge full of the damn stuff at work — for FREE!</p>

<p>So, friends and internet strangers — if I fail again, at least I&#8217;ll be doing it publicly so you can all yell at me for being a lazy bum.</p>

<p>Feel free to shout motivation and/or helpful goals to aim for - I&#8217;m <a href="http://twitter.com/iKenndac">@iKenndac</a> on Twitter. A nice one a friend of mine suggested today was, given <em>x</em> as the number of weeks since you started, do <em>2x</em> pushups each morning. In the first week it&#8217;s just two, which is nothing — but after a few months it really starts to add up!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[PS Vita Mini-Review and UI Discussion]]></title>
    <link href="http://ikennd.ac//blog/2012/02/ps-vita-review/"/>
    <updated>2012-02-24T13:25:00+01:00</updated>
    <id>http://ikennd.ac//blog/2012/02/ps-vita-review</id>
    <content type="html"><![CDATA[<p><a href="http://www.flickr.com/photos/ikenndac/6925488589/"><img class="center" src="http://farm8.staticflickr.com/7061/6925488589_47166469fc_z.jpg" title="Dragons LOVE Rayman" ></a></p>

<p style="text-align:center;"> <em>Dragons LOVE Rayman!</em></p>

<p>Thursday morning. It&#8217;s cold and wet, and me and three friends are trudging round Stockholm to pick up the PS Vita consoles they wanted. &#8220;I&#8217;m not going to get one!&#8221; I proudly proclaim, &#8220;I have a PSP and never play on it, and Sony have <em>never</em> made good software. Ever!&#8221;</p>

<p>&#8220;True!&#8221; they agreed, &#8220;But the launch lineup looks really good! And look how <em>shiny</em> it is!&#8221; I couldn&#8217;t disagree — it <em>is</em> shiny.</p>

<p>We get back to the office and Rick boots his Vita. &#8220;Would you like to use your PSN account?&#8221; it asked. Of course! He put in his details. Confirms that yes, he&#8217;d like to use his account. &#8220;Please wait…&#8221;.</p>

<p>&#8220;You need to update your Vita to the latest software version to sign into PSN.&#8221; A single button — <em>OK</em>. At this point, the Vita is back one step, at &#8220;Are you sure?&#8221;. We&#8217;re now stuck in the first-boot tutorial with no way forward. After a couple of minutes, we figure out that you need to go back two steps, answer <em>No</em> to &#8220;Would you like to use your PSN account?&#8221; then tell it your date of birth and country to get out of the tutorial and update the software.</p>

<p>I sit, piling a McDonald&#8217;s Big Mac into my face, happy about my decision to not buy one. Sony&#8217;s software is as bad as ever! However, as Rick starts navigating around the device, it doesn&#8217;t look that bad.</p>

<p><img class="center" src="http://ikennd.ac/pictures/vita/pleasewait.jpg" title="Please Wait" ></p>

<p style="text-align:center;"> <em>You&#8217;ll see this a LOT.</em></p>

<h3>The Downfall</h3>

<p>I start to feel a bit woozy. Thinking that perhaps inhaling a Big Mac in less than a minute wasn&#8217;t such a smart idea, I head back to my desk to carry on work. After ten minutes, staying upright in my chair is becoming a challenge and I remember that the hole where I had a tooth removed the week previous felt a bit… funny. I head home, go to the dentist to get told that my mouth is infected &#8220;a bit&#8221;, that I&#8217;ll need to double the use of the antibacterial mouthwash stuff I got last week, and that I&#8217;ll just have to put up with being dizzy for a while.</p>

<p>I return home, feeling rather sorry for myself. Confirm with my team lead that it&#8217;s OK to work from home for the rest of the week since while falling over a lot is hilarious to begin with, its gets old fast. Work for a little while. Porting Objective-C code to C++ starts draining my soul. Now I&#8217;m even more sad.</p>

<p>Hey, look! The Vita is only 1990kr at Elgiganten! That&#8217;s cheaper than Amazon UK!</p>

<h3>FINALLY The Review!</h3>

<p>I&#8217;m not going to do a full review here. You can find a hundred of them online, so I&#8217;ll just sum up my opinions:</p>

<ul>
<li>The screen is <em>beautiful</em>.</li>
<li>Proprietary memory cards and connectors are the spawn of Satan himself.</li>
<li>Rayman Origins and Wipeout 2048 are the most beautiful mobile games I&#8217;ve ever seen.</li>
</ul>


<p><img class="center" src="http://ikennd.ac/pictures/vita/rayman.jpg" title="Rayman Origins" ></p>

<p style="text-align:center;"> <em>Rayman Origins.</em></p>

<p>Oh, and the Mac software for connecting to the device is as awful as you might expect. It took 1.5Gb of RAM on my machine, then popped up this when I connected my Vita:</p>

<p><img class="center" src="http://ikennd.ac/pictures/vita/YES.png" title="Yes!" ></p>

<p>…so that got deleted pretty much right away.</p>

<p>What intrigues me most, though, about the Vita is the &#8220;home screen&#8221; menu system and multi-tasking UI, and the way it deals with the fact that only one &#8220;real&#8221; process can be active at a time. I really quite like the concepts they&#8217;ve employed, and this discussion will be looking past the stupid stuff Sony likes to do (like three separate &#8220;Please Wait…&#8221; dialogs when you sign into PSN) in favour of the overall flow of things.</p>

<p>A basic overview of the UI:</p>

<ul>
<li><p>The Vita displays applications as pebbles on a vertically scrolling grid. Each &#8220;screen&#8221; can hold ten pebbles, which can be moved around freely.</p></li>
<li><p>When you tap an application&#8217;s pebble, its card is loaded and added to the stack, which scrolls horizonally. The main button on this card will launch or resume the application, so getting from the home screen to your application is at least two taps.</p></li>
<li><p>An application&#8217;s card is customisable - each card has a button to launch or resume the application, as well as a optionally other buttons to launch to specific parts of the application, read the manual, visit related websites, and so on.</p></li>
<li><p>Only one major application can be active at a time. If you press the PS button in an application you&#8217;ll be sent back to the home screen and can browse the web, do social stuff and so on. If you try to launch another major application, the Vita will warn you that the other one will be closed.</p></li>
<li><p>Up to six cards can remain in the stack. If you want to remove a card from the stack, grab the top right-hand corner of it and rip it off the screen - this will remove the card and completely quit the application if it&#8217;s still running.</p></li>
</ul>


<p><img class="center" src="http://ikennd.ac/pictures/vita/pebbles.jpg" title="Pebbles" ></p>

<p style="text-align:center;"> <em>Application pebbles.</em></p>

<p><img class="center" src="http://ikennd.ac/pictures/vita/storecard.jpg" title="Please Wait" ></p>

<p style="text-align:center;"> <em>The PSN Store&#8217;s card, featuring buttons for categories and current &#8220;trending&#8221; games.</em></p>

<h3>In Action</h3>

<p>While that sounds like a complicated UI, it actually works really well in real-world use and I&#8217;m very fond of it. The cards allow applications to show useful information without actually launching the app, and tearing a card out of the stack has a wonderful feel. Navigating around the system to find what you need is slick and fast.</p>

<p>Below is a video of the stacks UI, which shows the first-world problem shiny, glossy devices bring - very visible dust!</p>

<p style="text-align: center;"><iframe width="640" height="360" src="http://www.youtube.com/embed/QDCms-8eS8c?rel=0" frameborder="0" allowfullscreen></iframe></p>


<p>Only time will tell, but I&#8217;m really enjoying the experience with the Vita - the games are fun to play and absolutely gorgeous, and the hardware is beautiful. Hopefully it&#8217;ll stand the test of time better than the PSP.</p>
]]></content>
  </entry>
  
  <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>
  
</feed>

