<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[HarveyNick.com]]></title>
  
  <link href="http://www.harveynick.com/" />
  <updated>2013-06-16T18:09:26+01:00</updated>
  <id>http://www.harveynick.com/</id>
  <author>
    <name><![CDATA[Nick Johnson]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Harveynick" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="harveynick" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
    <title type="html"><![CDATA[That Ad]]></title>
    <link href="http://www.harveynick.com/blog/2013/06/16/that-ad/" />
    <updated>2013-06-16T16:36:00+01:00</updated>
    <id>http://www.harveynick.com/blog/2013/06/16/that-ad</id>
    <content type="html"><![CDATA[<p>So. There has been a small(ish) ad off to the right hand side of this blog for a couple of months now. It is as small as <a href="https://www.google.com/adsense">AdSense</a> will let me make it, though ideally I&#8217;d prefer if it had a size not unlike those used by <a href="http://mattgemmell.com/">Matt Gemmell</a> and
<a href="http://www.marco.org/">Marco Arment</a>. On the whole, though, it doesn&#8217;t bother me as much as I worried it might, aside from the occasional animated flash ad.</p>

<!-- More -->


<p>As <a href="http://harveynick.com/blog/2013/03/22/ch-ch-ch-changes/">previously explained</a>, it&#8217;s not there in any sort of attempt to make money from this blog (I&#8217;ll come back to that, though), but more as an exercise in learning more about the product I work on. To that end, it&#8217;s been quite successful. Having an account of your own (with actual numbers flowing through it) turns out to be very useful. I now have experience of the AdSense website as an actual end user. I have a better handle on what works well (and not so well). I&#8217;m also more familiar with the end products of the various sub-teams I work with, which is always a good idea.</p>

<p>So what about earnings, then? Will I be packing in my day job to instead pursue the glamorous life of a blogger? That would be a no. A <em>hell no</em>, in fact. Before I talk about this more: a little bit of background.  Advertising is <em>COMPLICATED</em>. Ad serving, in particular, is insanely complicated. You would not believe the amount effort it took to make that 200 by 200 square appear over to the right hand side of this page and in the grander scheme of things this example was very, very simple.</p>

<p>Ad revenue is also quite complicated. I&#8217;m over simplifying, but there are essentially four ways a publisher might get paid for the ads on their site:</p>

<ol>
<li><p><strong>Cost per Click (CPC).</strong> This is (in some ways) the simplest and probably the one you expect. If someone clicks on ad on your site, the advertiser pays you. How much varies wildly, based on a variety of factors.</p></li>
<li><p><strong>Cost per Mille (CPM).</strong> In this model the publisher gets paid per thousand impressions. That is: people seeing the ads but not clicking on them. It is generally the case that this pays a lot less than CPC.</p></li>
<li><p><strong>Cost per Action (CPA).</strong> This is the affiliate model. You know those times when you look at pair of shoes (or, so I&#8217;m told: an&#8230; item of adult paraphernalia) on Amazon, and then they follow you around the internet? Chances are if you actually click on one of those ads, the publisher doesn&#8217;t get paid unless you then proceed to buy the item in question (or possibly something else in the same session).</p></li>
<li><p><strong>Cost per Day (CPD).</strong> This one is the closest to traditional advertising, in my opinion. Basically, the advertiser pays a set amount for their ad to appear on the publisher&#8217;s site for a set period of time.</p></li>
</ol>


<p>The meagre revenue I see in AdSense comes entirely from CPC and CPM. To put it into perspective: on a particularly good day, harveynick.com might have a <em>Revenue per Mille</em> (RPM, the corollary of CPM) of £0.18. That means that if I get a thousand page views, AdSense will pay me 18p. On a good day, this site gets maybe 50 page views. I get the occasional click, and the revenue from that eclipses any CPM revenue to such an extent as to make it essentially invisible. My total revenue to date is in single figures of pounds. AdSense does not, in fact, pay you until your revenue reaches the equivalent of $100.</p>

<p>So no, I&#8217;m not going to be making money off this site any time soon. That&#8217;s okay, though, because it&#8217;s not my intent and I&#8217;ve not really been trying to do so.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Further Watching and Reading]]></title>
    <link href="http://www.harveynick.com/blog/2013/05/21/further-watching-and-reading/" />
    <updated>2013-05-21T20:37:00+01:00</updated>
    <id>http://www.harveynick.com/blog/2013/05/21/further-watching-and-reading</id>
    <content type="html"><![CDATA[<p>This was supposed to go at the end of my last post, but it was running a little long. Basically, here is collection of writings about fitness from around the internet which I&#8217;ve found either useful, thought provoking, or fun.</p>

<p><em>Warning: the blog post features two pictures of women in bikinis. It&#8217;s totally relevant in context, be in case that isn&#8217;t safe for your work: be warned.</em></p>

<!-- More -->


<h3><a href="http://www.mensjournal.com/magazine/everything-you-know-about-fitness-is-a-lie-20120504">Everything You Know About fitness is a Lie</a></h3>

<p>I really have to start here, because I think this is possibly the best article about fitness I&#8217;ve ever read. The internet, by and large, seems to agree with me. I&#8217;ll keep me commentary on it to a minimum. Seriously. Go read it.</p>

<h3><a href="http://matt.might.net/articles/hacking-strength/">Matt Might on Gaining Muscle with Least Resistance</a></h3>

<p><a href="http://matt.might.net/">Matt Might</a> is an assistant professor in Computer Science at the University of Utah. His posts on programming languages are a fairly common sight towards the top of <a href="http://news.ycombinator.com/">Hacker News</a>. Then out of nowhere he wrote this post about how he&#8217;d gone about getting himself into shape. I don&#8217;t agree with everything he writes here*, but this is a well written post which is worth reading for three things in particular:</p>

<ol>
<li>His motivations, which I can understand completely, even though I don&#8217;t have kids of my own;</li>
<li>The improvement in his overall quality of life;</li>
<li>It&#8217;s basically an ode to the principle of &#8220;the best workout program is the one which works for you&#8221;.</li>
</ol>


<h3><a href="http://www.soheefit.com/cardio-bunny-stop-it-stop-it-now/">Sohee Lee on Why Being a Cardio Bunny is Bad for Your Butt</a></h3>

<p>This one (and the next one) is for you, H. You know who you are.</p>

<p>Here&#8217;s an article by Sohee Lee, who is actually the online trainer I worked with. That really didn&#8217;t work out, but I still have a lot of respect for her and the philosophy behind a lot of her writing. The TL;DR here is that if you (girls) want your ass to look like this:</p>

<p><img class="center" src="http://www.soheefit.com/wp-content/uploads/2012/01/Screen-shot-2012-01-23-at-12.10.22-AM1.png" title="Definitely copyright Sohee Lee" ></p>

<p>&#8230;you should do heavy squats, <em>not</em> cardio. Let&#8217;s continue along that thread some.</p>

<h3>Miss America&#8217;s Workout Program</h3>

<p>Now let&#8217;s talk a little bit about one of Miss Sohee Lee&#8217;s clients. It seems to be the case that women don&#8217;t want to lift weights, because they&#8217;re worried it will make them bulky. I guess that depends on how you define bulky. This is a picture of Mallory Hagan, the current Miss America:</p>

<p><img class="center" src="http://www.aceshowbiz.com/images/wennpic/mallory-hagan-2013-miss-america-final-competition-04.jpg"></p>

<p>Now, I can only speak for myself here, but I do not look at that picture and think &#8220;too bulky.&#8221; To pull a quote from the West Wing, I look at that picture and think something along the lines of &#8220;That&#8217;s a fine looking woman.&#8221; If you&#8217;re thinking the same thing, perhaps you&#8217;re curious about her training program. I&#8217;ll let her explain:</p>

<iframe src="http://www.youtube.com/embed/NfnyBOpCZOU" width="" height="" frameborder="0" allowfullscreen></iframe>


<p>I guess the takeaway here is that if you&#8217;re female, lifting heavy weights isn&#8217;t going to suddenly make you look like an Olympic weight lifter. If you work incredibly hard you might end looking a bit more like an Olympic heptathlete though, if you catch my drift.</p>

<p>Why do I care? It&#8217;s not entirely un self serving. I personally think that healthy is more attractive than skinny. See also: <a href="http://www.bodbot.com/Blog/Rise_of_the_Hardbodied_Woman.html">The Rise of the Hard Bodied Woman</a> and <a href="http://i2.cdnds.net/13/12/618x335/movies_star-trek-into-darkness.jpg">Alice Eve in Star Trek Into Darkness</a>.</p>

<h3><a href="http://www.youtube.com/channel/UCduKuJToxWPizJ7I2E6n1kA">Bro Science Life</a></h3>

<p>Okay, time for a little bit of comedy. Bro Science Life is a YouTube channel featuring a series of fitness / gym related comedy videos. I find most of them utterly hilarious (but then I used to think <a href="http://askaninja.com/">Ask a Ninja</a> was hilarious as well).</p>

<p>The videos are, in particular, making fun of &#8220;bro culture&#8221;, which in my experience does exist, but is not as prevalent as you might think. There&#8217;s also actually a surprising amount of solid information in the videos, if you can separate the &#8220;funny because it&#8217;s true&#8221; from the hyperbole and comedy bro science. <a href="http://www.youtube.com/watch?v=_0WxyKGD7sU">For example</a>:</p>

<iframe src="http://www.youtube.com/embed/0WxyKGD7sU" width="" height="" frameborder="0" allowfullscreen></iframe>


<p>I think I actually agree with all of that… except for the thing about not using small plates. Slow and steady wins the race.</p>

<h3><a href="http://www.strstd.com/">Strength Standards</a></h3>

<p>Lastly here&#8217;s a site a friend introduced me to, and which I&#8217;ve come to find quite useful. Basically: plug in your gender and weight, then your weight and reps for each of the four primary barbell lifts. It then gives you a theoretical one rep max, and places you on a scale from &#8220;Untrained&#8221; to &#8220;Elite&#8221;. I find it to be a fairly useful progress tracking tool. Also: I like graphs.</p>

<p>* I wouldn&#8217;t go anywhere near that &#8220;strength training&#8221; contraption.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Barbell Training Follow Up]]></title>
    <link href="http://www.harveynick.com/blog/2013/05/19/barbell-training-follow-up/" />
    <updated>2013-05-19T18:23:00+01:00</updated>
    <id>http://www.harveynick.com/blog/2013/05/19/barbell-training-follow-up</id>
    <content type="html"><![CDATA[<p>So: after writing that giant post about the three main beginners programs I read up on while trying to figure out the best way to get myself into some sort of (non round) shape, I thought I&#8217;d switch to a topic on which I can confidently talk with some authority: me.</p>

<p>More specifically, in case you are interested: the program I&#8217;ve ended up putting myself on, the other things which are important and how this all is actually working out for me.</p>

<!-- More -->


<h2>The Program I&#8217;m Following</h2>

<p>As I mentioned in my <a href="http://harveynick.com/blog/2013/05/10/a-very-rough-guide-to-beginners-barbell-training-programs/">previous post</a>, I&#8217;m currently following the <a href="http://strengthvillain.com/forum/viewtopic.php?f=9&amp;t=89">Greyskull LP</a> (Linear Progression) barbell training program, having previously spent a few months on <a href="http://stronglifts.com/">Strong Lifts 5x5</a> and then working with an online trainer for three months (which is another story entirely). Greyskull is made up of a &#8220;core program&#8221; (which I waffled about at length in my previous post, so will try to avoid repeating myself here) and a set of &#8220;plug-ins&#8221;* which add exercises or rearrange the program in order to add flexibility or meet specific goals.</p>

<p>I do the core program as previously described and add the following &#8220;plug-ins&#8221;:</p>

<ol>
<li>On bench days I perform two sets of barbell curls, on press days two sets of V-Bar lat pulldowns, though I&#8217;ll be switching that to weighted chin ups next time around;</li>
<li>On bench days I do two sets of either reverse crunches or knees to elbows, press days two sets of planks;</li>
<li>On &#8220;non training&#8221; week days I walk for around 40 minutes before breakfast (so completely fasted);</li>
<li>On Saturdays I go for a run. Fifteen minutes of intervals (Thirty seconds on, one minute off, times ten), followed by a fifteen minute steady jog;</li>
<li>Every evening before bed I do chin-up &#8220;ladders&#8221; (1 rep, 2 reps, 3 reps, 4 reps, 5 reps, 1 rep, and so on).</li>
</ol>


<p>The first of these is lifted directly from Johnny Pain&#8217;s original forum post describing the program. The second is my replacement for the &#8220;neck harness&#8221; work also included in the forum post. I don&#8217;t want a giant neck, but I would quite like to have abs. I also primarily put on fat around my middle and figure anything I can do to shift the muscle/fat ratio in that area is probably a good thing.</p>

<p>The fasted walk idea is suggested in the <a href="http://www.amazon.co.uk/The-Greyskull-LP-Edition-ebook/dp/B007WNC50Q">Greyskull LP book</a> as something to help with fat loss, and I figure &#8220;what the hell, can&#8217;t hurt&#8221;. I also like to do something active on my off days, as it seems conducive to keeping in good habits.</p>

<p>The Saturday run is something which was added to my program by the online trainer I worked with, and I found I really enjoyed. Working on stamina (when almost everything else I do is focussed on strength) seems like a good idea as well… especially in terms of being prepared for the <a href="http://www.youtube.com/watch?v=6TiXUF9xbTo">zombie apocalypse</a>. We all know the importance of cardio in those circumstances.</p>

<p>In my experience there is no better exercise than chin-ups for making you feel strong. Sure, you lift the heaviest in deadlift, and shoulder press actually lets you throw something above your head… but neither of these is quite the same as lifting yourself off the ground and into the air. Psychologically, that&#8217;s huge. (Greyskull LP author) Johnny Pain actually recommends doing sets of chin-ups throughout the day, gradually increasing the number of set and reps, but suggests doing a ladder before bed as an alternative if this isn&#8217;t practical for you. Option A is not even a little bit practical for me, so option B it is.</p>

<p>In general I&#8217;m really happy with this program and how I&#8217;m progressing. If my progress slows down, or I seem to need extra work in one area in particular, I&#8217;ll likely switch to the four day version of the program. Hopefully neither of these will come up for a while, though.</p>

<p>Is this program right for you? Maybe. Maybe not. The ideal workout program is a lot like the ideal diet: it&#8217;s the one you stick to.</p>

<h2>Other Variables</h2>

<p>It seems pretty logical that working out in the gym makes you stronger. Actually the opposite is true. Working out in the gym makes you weaker, if you&#8217;re doing it right. When you lift heavy weights you damage your muscles and, in the short term, decrease their capability.</p>

<p>Your muscles don&#8217;t get stronger until later, while you&#8217;re asleep. Even then, they only do so if you&#8217;ve taken in adequate nutrition to feed their growth. Thus it&#8217;s vitally important to ensure you&#8217;re taking in enough food and getting enough sleep.</p>

<center>
<img src="http://varsitysideline.com/wp-content/uploads/2013/05/May13_2013.jpg"><!-- header_img http://varsitysideline.com/wp-content/uploads/2013/05/May13_2013.jpg -->
</center>


<p>Consistently getting quality sleep has always been a bit of a problem for me, but I do the best I can. My diet is more in my control, though. In general, I tend to concentrate on getting enough protein, which means plenty of chicken, fish or (more rarely) steak at lunch and dinner, and plenty of eggs at breakfast. I also tend top this up with one or two protein shakes a day.</p>

<p><em>Oh no! Supplements!</em></p>

<p>I&#8217;m generally of the opinion that most fitness related supplements to be complete bollocks, and likely to do you at least as much harm as good. That said, I don&#8217;t include protein shakes in this category. It&#8217;s basically food, if mildly suboptimal food. It is convenient, however, and sometime convenience is king. Choose the right brand** and drinking the things doesn&#8217;t need to be a completely miserable experience, either.</p>

<p>I also try to make sure I get plenty of carbs, especially on days I work out. Yes, carbs. Evil, evil, insulin spiking carbs. I try to cut them out towards the the end of the day, though, a practice for which I&#8217;ve heard several explanations with varying degrees of &#8220;BroScience&#8221;. Here&#8217;s an example:</p>

<blockquote><p>The insulin created by the body to process and absorb carbs eaten stops the use of fat as an energy source. Your body naturally burns the most fat while sleeping, and so going to sleep with elevated insulin levels interferes with fat loss.</p><footer><strong>Micheal Matthews</strong> <cite><a href='http://www.amazon.co.uk/Bigger-Leaner-Stronger-Building-ebook/dp/B006XF5BTG'>&#8220;Bigger, Leaner, Stronger&#8221;</a></cite></footer></blockquote>


<p>All of this being said: I am still a foodie. I still love eating good food with good food with good friends. Food is still an end in and of itself, and not just a source of nutrients. It&#8217;s just that now I keep a much closer eye on what I&#8217;m consuming 90% of the time.</p>

<h2>How I&#8217;m Actually Doing</h2>

<p>Upcoming immodesty alert.</p>

<p>I think I can say at this point that I am without a shadow of a doubt in the best shape of my life. You need to understand here, though, that this is an extremely low bar for me to have lept over. This bar was basically underground.</p>

<p>Right now I am definitely stronger than I have been at any previous point in my life. Again, not hard. I&#8217;m definitely not &#8220;strong&#8221; in the absolute sense, but I am considerably stronger than I was before. Going climbing recently for the first time in years really brought this home.</p>

<p>At school I would collapse the ground after running the 1500m, then proceed to lay there panting and feeling my heart pounding (for some reason) in my butt cheeks. Now I usually end up running for a little under 6km on my Saturday runs, and at some point I plan to run an actual organised 5k. I think my time might actually be quite reasonable.</p>

<p>I&#8217;m also going to say that I look better (naked or otherwise) than I have at any previous point in my life. This is REALLY not hard. At some point in the last ten or fifteen years I moved from the &#8220;skinny&#8221; category to the &#8220;skinny fat&#8221; category. That oh so sexy combination of podgy belly, visible ribs, pipe cleaner arms and incipient man boobs. Now I&#8217;ve gone down two waste sizes and clothes are more likely be tight around my chest than my belly. Friends have remarked that I&#8217;ve lost weight and have a bit more in the way of shoulders.</p>

<p>Brad Pitt in Fight Club I am not, but I don&#8217;t hate what I see when I look in the mirror anymore, either. There are things wrapped around my skeleton which I could describe as muscles without worrying that I might be sniggered at. Stand me next to <strike>The Rock</strike> Dwayne Johnson and I&#8217;ll still look like I&#8217;m made out of plastic spoons and low quality play dough, but I feel like I&#8217;m making progress in the right direction.</p>

<p>* Yes, &#8220;plug-ins&#8221;. I&#8217;m sure you couldn&#8217;t possibly imagine why this terminology might appeal to me.</p>

<p>** I tend to use PhD Nutrition Pharma Whey. It actually tastes pretty good&#8230; and alright, yes, fine, using a brand with that name kind of amuses me. My Dad likes Reflex, and one of my work colleagues goes for Optimum. Another uses PhD. Your millage may vary. Flavour wise: chocolate or banana, all the way.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[A (Very) Rough Guide to Beginners' Barbell Training Programs]]></title>
    <link href="http://www.harveynick.com/blog/2013/05/10/a-very-rough-guide-to-beginners-barbell-training-programs/" />
    <updated>2013-05-10T16:30:00+01:00</updated>
    <id>http://www.harveynick.com/blog/2013/05/10/a-very-rough-guide-to-beginners-barbell-training-programs</id>
    <content type="html"><![CDATA[<p>As I promised in my <a href="blog/2013/05/06/do-you-even-lift/">last post</a>, I&#8217;d now like to talk a bit about the different weight lifting programs I ended up researching. I spent a fairly silly amount of time here, so I&#8217;m hoping that you find it useful.</p>

<p>I&#8217;m going to talk about the three primary beginners lifters programs I read up on, tell you what they actually involve… and also what I think the person behind them is trying to sell you.</p>

<p><span class='pullquote-right' data-pullquote='Disclaimer: I am not an expert on any of this.'>
<em>Disclaimer: I am not an expert on any of this. I am, at best, an amateaur of the sort who tends to read everything he can find about a subject which interests him (translation: a geek). You should consider the majority of what&#8217;s written here to be opinion and look into these things yourself. I hope I can provide a good jumping off point, though.</em>
</span></p>

<!-- More -->


<p>Pretty much all the programs I&#8217;ve found centre around four barbell lifts. So I figured I&#8217;d start by quickly describing them:</p>

<ul>
<li><em>Bench press.</em> You know what this one is. It&#8217;s the one you saw in the montages of all those action movies. Lie with your back against the bench and lift the barbell from your nipples straight up until your arms are fully locked.</li>
<li><em>Shoulder press.</em> Stand with the barbell held approximately level with your shoulders, forearms vertical. Lift the bar directly upwards until your arms are fully locked. This has more nuance than it sounds.</li>
<li><em>Squat.</em> Stand with the bar braced across your shoulders, ideally resting on your lats. Drop down into a squatting position (duh) keeping your feet flat against the floor and pushing your knees apart. Stand, pushing up through your heels.</li>
<li><em>Deadlift.</em> I&#8217;m not going to try and explain this one. That&#8217;s a lawsuit waiting to happen. Here&#8217;s a video:</li>
</ul>


<iframe src="http://www.youtube.com/embed/Syt7A23YnpA" width="" height="" frameborder="0" allowfullscreen></iframe>


<p>Having thrown a Mark Ripptoe video in this post already, it seems only right that I start with…</p>

<h3>Starting Strength (SS)</h3>

<p>Starting Strength is essentially three things:</p>

<ul>
<li>A barbell lifting program for beginners;</li>
<li>A <a href="http://www.amazon.co.uk/Starting-Strength-3rd-Mark-Rippetoe/dp/0982522738">book</a> which describes the lifts in the program in <em>incredible</em> biomechanical detail;</li>
<li>A series of seminars.</li>
</ul>


<p>The man behind all three of these is one Mark Ripptoe, whose dulcet tones guided you through the deadlift in the video above. Pretty obviously: he wants to sell you a copy of his book (though hard copies are <em>really</em> hard to come by) or possibly a ticket to a seminar. In fairness there is pretty much nothing else like the book out there. It might arguably be more detail than you need, but it&#8217;s still seriously impressive.</p>

<p>&#8220;Rip&#8221; is also something of personality. There are <a href="http://startingstrength.wikia.com/wiki/Wit_and_Wisdom_of_Mark_Rippetoe">entire websites</a> dedicates to things he&#8217;s said. Here&#8217;s one which made me laugh:</p>

<blockquote><p>&#8220;I don&#8217;t go to titty bars much anymore. They have never really appealed to me. Like going into an expensive restaurant, reading the menu for 2 hours, drinking a little, then getting up and leaving without having had anything to eat but paying the bill anyway.&#8221;</p><footer><strong>Mark Ripptoe</strong> <cite><a href='http://startingstrength.wikia.com/wiki/Wit_and_Wisdom_of_Mark_Rippetoe'>startingstrength.wikia.com/wiki/&hellip;</a></cite></footer></blockquote>


<p>…and here&#8217;s one which actually has something to do with what I&#8217;m supposed to be taking about here:</p>

<blockquote><p>&#8220;There is simply no other exercise, and certainly no machine, that produces the level of central nervous system activity, improved balance and coordination, skeletal loading and bone density enhancement, muscular stimulation and growth, connective tissue stress and strength, psychological demand and toughness, and overall systemic conditioning than the correctly performed full squat.&#8221;</p><footer><strong>Mark Ripptoe</strong> <cite><a href='http://startingstrength.wikia.com/wiki/Wit_and_Wisdom_of_Mark_Rippetoe'>startingstrength.wikia.com/wiki/&hellip;</a></cite></footer></blockquote>


<p>I&#8217;m going to admit right away that there is more to the actual program than I originally thought there was. I&#8217;ll describe what I&#8217;ve seen called the &#8220;core&#8221; program here, but you can find a more complete explanation over at the <a href="http://www.fitocracy.com/knowledge/official-starting-strength-guide-for-fitocrats/">Fitocracy knowledge base</a>.</p>

<p>Each lift in the program is preceded by a warm up, which is the case for ever lift in every program here, even if I don&#8217;t mention it. You start with the empty bar* and then increase the weight in stages until you reach your work weight.</p>

<p>In the Starting Strength program** you work out Monday, Wednesday and Friday, performing three lifts each day. There are two workouts, which you rotate:</p>

<ul>
<li>Workout A: Squat 3x5, shoulder press 3x5, deadlift 1x5.</li>
<li>Workout B: Squat 3x5, bench press 3x5, power clean 5x3.</li>
</ul>


<p>&#8220;Rotate&#8221; means that your first week would look like this:</p>

<ul>
<li>Monday: Workout A</li>
<li>Wednesday: Workout B</li>
<li>Friday: Workout A</li>
</ul>


<p>&#8230;then your second week would look like so:</p>

<ul>
<li>Monday: Workout B</li>
<li>Wednesday: Workout A</li>
<li>Friday: Workout B</li>
</ul>


<p>&#8230;and so on.</p>

<p>Firstly, the numbers after each of the lifts are in the form &lt;sets>x&lt;repetitions>. Secondly, the sharp eyed amongst you will probably have noticed that I snuck an extra lift in there. So, what exactly is a power clean? Basically, it&#8217;s like a deadlift… but you keep going, explosively lifting the weight up to your shoulders (though not above your head).</p>

<p>Generally speaking weights should be increased gradually after each successful workout, and not usually by more than 2.5kg (except perhaps for the deadlift). Again, see the link to the Fitrocracy knowledge base above for more details, but I would also be quite remiss if I did not mention <a href="http://startingstrength.com/">StartingStrength.com</a>.</p>

<p>Also: anytime you want to see a good demonstration of a barbell lift, try typing &#8220;Mark Ripptoe &lt;name of lift>&#8221; into YouTube. This is a man who knows what he&#8217;s talking about.</p>

<h3>Strong Lifts 5x5 (SL)</h3>

<p><span class='pullquote-right' data-pullquote='This is the secret training program used by Arnold Schwarzenegger, apparently.'>
Strong Lifts 5x5 is very much a program from the internet. In fact, if you were to go <a href="http://stronglifts.com">stronglifts.com</a> there is a good chance that you might come away with the impression that Mehdi (the guy behind it) is trying to sell you snake oil. This is the secret training program used by Arnold Schwarzenegger, apparently. Ignore that, though, since insofar as I can tell this program is up there with SS for the amount respect it gets for a beginners program. Mehdi wants you to come to his website and make use of the resources there (which are actually pretty good), because he&#8217;s monetized the site with ads. He would also like you to sign up for the paid &#8220;Strong lifts inner circle&#8221; members only community.
</span></p>

<p>SL is very similar in structure to SS in that it&#8217;s the four main lifts plus one extra, with two alternating workouts each featuring three lifts to be performed on Mondays, Wednesdays and Fridays. The two workouts look like this:</p>

<ul>
<li>Workout A: Squat 5x5, bench press 5x5, Pendley Row 5x5.</li>
<li>Workout B: Squat 5x5, shoulder press 5x5, deadlift 1x5.</li>
</ul>


<p>This time around the fifth lift is the bent over (or Pendley) row, which is basically the exact opposite of the bench press. Yes, this is exactly as awkward as it sounds and, like the deadlift, is a really good way to knacker your back if performed incorrectly. That being the case, I&#8217;ll let the man Glen Pendley himself explain it to you rather than trying to do the job myself:</p>

<iframe src="http://www.youtube.com/embed/ZlRrIsoDpKg" width="" height="" frameborder="0" allowfullscreen></iframe>


<p>The other differences to SS are that with SL you perform five sets of five reps at your work weight (deadlift is again one set), and you you have a strictly defined methodology for increasing the weight of your lifts:</p>

<ul>
<li>If you hit five reps on all five sets you add 2.5kg the next time you do the lift (5kg for deadlift);</li>
<li>If you miss any reps, you stay at the same weight;</li>
<li>If you miss reps multiple times, you deload by 10% and then work your way back up.</li>
</ul>


<p>This is the program I originally started doing, largely because it was easier to find a strict definition of what the program actually <em>was</em> than was the case for SS. It worked pretty well for me in the beginning, but as you increase the weight you&#8217;ll also tend to increase the rest between sets, so after a couple of months I just seemed to be spending forever in the gym. In the end I stopped doing the program to try working with an online trainer, which I might talk about some in a later post.</p>

<h3>Greyskull Linear Progression (GLP)</h3>

<p>Greyskull LP is the beginners lifting program used at the Greyskull Barbell Club on the East Coast of the USA and created by the club&#8217;s owner, John Sheaffer aka &#8220;Johnny Pain&#8221;, a former student of Mark Ripptoe (remember him?).</p>

<p>What Johnny Pain is trying to sell you is the idea that you might like to train at his gym, and failing that maybe one of his books, such as the very one which <a href="http://www.amazon.co.uk/Greyskull-LP-Second-John-Sheaffer/dp/0615635571">describes the program</a>. You can also find one variation of the program described in some detail by the man himself on <a href="http://strengthvillain.com/forum/viewtopic.php?f=9&amp;t=89#p376">the forums at StrengthVillain.com</a>, though not in anywhere near as much detail as in the book.</p>

<p>Side note about the book: I bought it. I think it&#8217;s a really good resource and actually quite well written (I laughed out loud more than once), but perhaps not for the feint of heart. Dear old Johnny Pain can get a little bawdy, from time to time.</p>

<p>This is, again, very similar to Starting Strength, but with more of a focus on maintaining the linear progression for as long as possible. This is also a very flexible program, being made of a core program and a set of &#8220;plug-ins&#8221;.</p>

<p>The core program is three days a week, again: Monday, Wednesday and Friday. For your first lift on each day, you alternate bench press and shoulder press. On Mondays and Fridays you then do squats. On Wednesdays: Deadlift. After warming up, you move on to three sets at your work weight. Again like SS, your first two sets are of five reps, however your third set is to failure (or as close to it as you&#8217;re prepared to go), so basically as may reps as you can do, but at least five. The exception is the deadlift, for which you just perform a single set of as many reps as you can manage.</p>

<p>If you manage to hit at least 5 reps for each of your work sets, you increase the weight. 2.5kg for squat and deadlift, 1.25kg for bench and shoulder press. This last is actually quite tricky, since it involves using &#8220;fractional&#8221; plates, which most gyms don&#8217;t carry and I, as yet, have not been able to find a good place to buy. If you fail to hit your five reps on each set you knock 10% off the weight for the next time (rounding down) and start working your way back up.</p>

<p><span class='pullquote-right' data-pullquote='Seeing that you can now do eights reps at a weight you could only manage five at before drives home that you have gotten stronger and are making progress.'>
The upshot of this is that firstly the relaxed pace (two main lifts a day and small increases in weight) means that you&#8217;re much less likely to stall and so will continue the linear progression for longer. Secondly, doing the third set to failure mean that you&#8217;ll build a little more muscle (hypertrophy) and also you&#8217;ll tend to hit either a reps or weight personal best every time you lift. Deloading can be frustrating in that it feels like moving backwards. Seeing that you can now do eights reps at a weight you could only manage five at before drives home that you have gotten stronger and are making progress.
</span></p>

<p>Given the amount of time I&#8217;ve spent talking about it, you might have worked out that this is the program I&#8217;m actually following at the moment. I liked the more gradual approach to increasing the weight here, and I like the additional flexibility of the plug-ins, which I&#8217;ll talk about in another post.</p>

<p>* Or as close as possible, clearly that isn&#8217;t going to work for the conventional deadlift. If you <em>do</em> need to start at a lower weight, however, you can improvise by either propping the weights up on spare plates, or perform a <a href="http://www.bodybuilding.com/exercises/detail/view/name/romanian-deadlift">Romanian Deadlift</a> instead.</p>

<p>** Calling it the SS program seems… wrong.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Do You Even Lift, Bro?]]></title>
    <link href="http://www.harveynick.com/blog/2013/05/06/do-you-even-lift/" />
    <updated>2013-05-06T15:24:00+01:00</updated>
    <id>http://www.harveynick.com/blog/2013/05/06/do-you-even-lift</id>
    <content type="html"><![CDATA[<p>After I arrived in London I decided to take a second stab at Couch to 5k, having abandoned it <a href="blog/2013/04/07/running-the-first-time/">the first time around</a>. The problem now was finding a time and place. At first I tried running in the evenings around Wandsworth Common, conveniently close to where I was staying. That started to feel more than a little unsafe, however, especially on the evenings I got home safe enough to push me through -twilight- dusk and into full dark. I&#8217;m fortunate enough to work very close to Hyde Park, however, so I transplanted my runs here and started taking time out of my work day. Running through Hyde Park in the sun is awesome, by the way.</p>

<p>All was fine and dandy until I fell off a surf board during a short break and cracked the top of my foot against the sea bed. I&#8217;d twisted myself into a slightly odd position in order to accomplishing this, and so it had the added bonus effect of pushing my foot much further back than it&#8217;s really supposed to go. By the time I got back to London, my entire foot had turned a lovely combination of purple and yellow. Shit.</p>

<!-- More -->


<p>Needless to say, this put a fairly major obstacle in the way of any running that I might try to do, given that it really hurt to even walk. So, once again, the running stopped. In parallel to all of this, however, I&#8217;d spent some time clicking around the &#8220;connected apps&#8221; section on Run Keeper&#8217;s website and found something called <a href="https://www.fitocracy.com">&#8220;Fitocracy&#8221;</a>. It was two things rolled into one:</p>

<ol>
<li>A fitness related social network;</li>
<li>A gamification system which awards points and achievements based on fitness activities performed.</li>
</ol>


<p><span class='pullquote-right' data-pullquote='Gamification works ridiculously well on my computer game addled brain.'>
Gamification works ridiculously well on my computer game addled brain. Scoring those points (and levelling up!) worked as an excellent motivator for me while I was running. When I signed up to the site I also joined the mailing list. Against all normal logic, some of those emails actually turned out to be quite interesting. A lot of them were member spotlights, and a lot of these members were talking about the fact that it was lifting weights, and not doing cardio, which got them into shape.
</span></p>

<p>
<center>
<a href="http://xkcd.com/940/">
<img src="http://imgs.xkcd.com/comics/oversight.png"><!-- header_img http://imgs.xkcd.com/comics/oversight.png -->
</a>
</center>
</p>


<p>I did some more reading and found myself pointed at <a href="http://reddit.com/r/fitness">/r/fitness</a>, where a lot of people were saying very similar things. Two workout programs were suggested for beginners, <a href="http://startingstrength.com/">Starting Strength</a> and <a href="http://stronglifts.com/">Strong Lifts 5x5</a>. Having made <a href="blog/2013/04/01/a-fitness-story/">the decision to get myself back in shape</a>, I decided I would have a go at one of these programs. As for which, why, and what they entail: that&#8217;s actually post of its own, because there are actually a couple of other programs I want to talk about as well. Stay tuned.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[The Wheel Weaves as the Wheel Wills]]></title>
    <link href="http://www.harveynick.com/blog/2013/05/05/the-wheel-weaves-as-the-wheel-wills/" />
    <updated>2013-05-05T15:53:00+01:00</updated>
    <id>http://www.harveynick.com/blog/2013/05/05/the-wheel-weaves-as-the-wheel-wills</id>
    <content type="html"><![CDATA[<p>On what was, all things considered, otherwise a fairly shitty day, I finished reading A Memory of Light, the final volume of <a href="http://en.wikipedia.org/wiki/The_Wheel_of_Time">The Wheel of Time</a>. This is, if you don&#8217;t know, a fourteen book epic fantasy series whose author died prior to its completion. Each of these books is, by itself, around the size of the entire Lord of the Rings trilogy. One or two of them are really very dry, and finishing them comes dangerously close to feeling like work.</p>

<p>So do I recommend that you set out on this 12 thousand page, 4 million word journey? Emphatically yes.</p>

<!-- More -->


<p>I should probably admit up front that I only really set out to read the series because knew it was being completed, after Robert Jordan&#8217;s death, by Brandon Sanderson, whom I think I may have mentioned being <a href="blog/2011/03/14/brave-new-worlds/">a bit of a fan of</a> in the past. The books are quite intimidating, to say the least, and do have a (well deserved) reputation for being quite meandering and (in places) slow.</p>

<p><img class="center" src="http://upload.wikimedia.org/wikipedia/en/0/00/WoT01_TheEyeOfTheWorld.jpg"></p>

<p>What they also have, though, is a truly excellent set of characters and an incredibly detailed and epic world. This is, essentially, the story of five country bumpkins who leave their small village in fear of their lives, and slowly accept the mantle of legendary heroes which is placed upon their unwilling shoulders. There are many, many other characters, but everything for the most part revolves around these five. A don&#8217;t want to say too much about them specifically, because I don&#8217;t want to spoil anything, but I will say this: the character I started off liking the least ended up being my absolute favourite. There are some excellent character arcs here.</p>

<p>It&#8217;s also the story of a world which was once a utopia, but was (literally) broken due to the actions of those striving for more power. A world filled with magic and wonder… but also bone chilling evil. A world on the brink of destruction, where magic is a path to madness and death for any man who wields it, while female magic users (channellers) are both feared and respected.</p>

<p>It&#8217;s not a perfect series by any means. A couple of the books towards the middle are particularly slow and uneventful. It&#8217;s also not a series which coddles you. The actual events of the prologue, which begins just as the greatest hero of the last age has succumbed to his madness* and unwittingly killed everyone he loves, are not fully illuminated until something like the sixth book. It&#8217;s also quite jarring when Brandon Sanderson takes over the reins of the series in book 12. The voice of the characters changes subtly, but noticeably.</p>

<p><img class="center" src="http://upload.wikimedia.org/wikipedia/en/0/06/TheGatheringStormUSCover.jpg" title="center" ></p>

<p>When one side of the seesaw goes down, the other rises, however. Sanderson writes action better than just about any other author I&#8217;ve ever read and the finale <em>really</em> doesn&#8217;t disappoint. A lot of plot threads are woven together and the series many, many characters are mostly given satisfying conclusions (even if that conclusion is sometimes &#8220;No! Why did they have to die!?&#8221;). Sanderson also understands &#8220;awesome moments&#8221;, and there was much in the last three books which left me grinning from ear to ear.</p>

<p>Actually that&#8217;s not entirely true, one thing does disappoint: I want more. I want to know what happens to these characters next, and there aren&#8217;t too many higher recommendations than that. I&#8217;m very glad I took the time to read this series, and would do so again.</p>

<center>
<img src="http://upload.wikimedia.org/wikipedia/en/2/27/A_Memory_of_Light_cover.jpg"><!-- header_img http://upload.wikimedia.org/wikipedia/en/2/27/A_Memory_of_Light_cover.jpg -->
</center>


<p>* Possibly a minor spoiler: The madness is a result of his own actions. He saved the world, but imperfectly, and in the process damned all male magic users, including himself, to this fate. He&#8217;s an incredibly tragic character, is Lews Therin Telamon. The once saviour of the world, but one who has been remembered for thousands of years only as &#8220;Lews Therin Kin Slayer&#8221;.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Perilously Close to Perfection]]></title>
    <link href="http://www.harveynick.com/blog/2013/04/19/perilously-close-to-perfection/" />
    <updated>2013-04-19T17:09:00+01:00</updated>
    <id>http://www.harveynick.com/blog/2013/04/19/perilously-close-to-perfection</id>
    <content type="html"><![CDATA[<p>A friend told me about a restaurant he&#8217;d visited on a trip to New York. There was essentially no menu. You walked in, you are seated, and you are asked a single question:</p>

<blockquote><p>&#8220;How would you like your steak cooked?&#8221;</p></blockquote>


<p>Then they bring you an utterly fantastic steak with fries and bernaise sauce. They do this <em>one</em> thing, they do it incredibly well, and they do it cheaply because they can take advantage of economies of scale.</p>

<p>I love this mindset of setting out to do something as utterly right as humanly possible. The example I had previously was a cafe in Edinburgh called Loudon&#8217;s. This is obviously the result of someone setting out to create as perfect a cafe as possible. It&#8217;s incredibly well laid out. Lots of tables, but not even a little bit cramped. So much so, in fact, that the presence of parents with small children doesn&#8217;t ruin the atmosphere. They just get lost in the space. This is not enough by itself, obviously. The coffee is also very good and the food is absolutely first rate. Don&#8217;t even get me started on either the quantity or the quality of the cakes.</p>

<p>So where am I going with this? Well, this last week during a short(ish) break in Austria, I found another one.</p>

<!-- More -->


<p>Bad weather led us to take a day trip into Salzburg, which we wandered around aimlessly for a few hours. Getting dinner in town pushed us to a late train… but where to get dinner and what to do to entertain ourselves for a few hours. Someone mentioned a brewery one of our PMs (Product Managers) had recommended. A brewery with attached drinking hall which serves food. Apparently they served the best beer he&#8217;d ever tasted. Even coming from a PM* this is the sort of claim which needs to be be tested… and what the hell, it was on the way to the station (ish) anyway.</p>

<p>So we take a wander to this brewery… and I&#8217;m here to tell you that I&#8217;m very glad that we did. We walked in. We were asked (at this point) three questions:</p>

<ol>
<li>How many people?</li>
<li>Smoking or non-smoking?</li>
<li>How many beers would you like?</li>
</ol>


<p>Beautiful. We were shown to a table in a fairly massive room (one of three). Simple chairs simple tables. A friendly buzz, but in no way crowded.</p>

<p><img class="center" src="http://www.harveynick.com/images/blog/2013/04/18/IMG_1171.jpg"></p>

<p>Within minutes the very same guy had reappeared at our table carrying <em>eight litres of beer</em>. How good was this beer? It was pretty awesome. Frankly I&#8217;m still craving it. How much was this beer? I&#8217;ll come back to that.</p>

<p>There was no table service for food, but just outside of the room was, for all intents and purposes, a small food market.</p>

<p><img class="center" src="http://www.harveynick.com/images/blog/2013/04/19/IMG_1169.jpg"></p>

<p>I wondered back and forth for a little while before deciding on half a roast chicken with a small pretzel on the side. Huge grin firmly affixed on face (as Spartacus might say) I proceeded to gleefully wash this meat and starch based feast down with more of that wonderful beer.</p>

<p>Some hours later we stood, fully satiated and mildly inebriated. We waited with beer baited breath to see what the bill would say. How much was this beer?</p>

<p>€6.70 a litre.</p>

<p>You&#8217;re basically paying that for a <em>pint</em> in London, and it&#8217;s probably not as good. Not even close. For me, they really knocked this one out of the park.</p>

<p>If you&#8217;re in Salzburg, by all means see the kirk (it&#8217;s beautiful), drop by the castle (it&#8217;s really interesting… though you might want to stay out of the creepy marionette museum) and eat a slice of Sachertorte (it&#8217;s tasty). But when you&#8217;re looking for some hearty food and perhaps an adult beverage or three, you really need to drop by the church of beer, meat and starch. You&#8217;ll be glad you did.</p>

<p><img class="center" src="http://www.harveynick.com/images/blog/2013/04/18/IMG_1166.jpg"><!-- header_img /images/blog/2013/04/18/IMG_1166.jpg --></p>

<p>* You can&#8217;t trust &#8216;em ;-)</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Running, The First Time]]></title>
    <link href="http://www.harveynick.com/blog/2013/04/07/running-the-first-time/" />
    <updated>2013-04-07T22:54:00+01:00</updated>
    <id>http://www.harveynick.com/blog/2013/04/07/running-the-first-time</id>
    <content type="html"><![CDATA[<p>When I decided to drag myself back on to the fitness wagon, it seemed to me that running was the answer. Getting myself to an actual gym clearly wasn&#8217;t working, but I lived a short walk from a large and beautiful park (oh The Meadows, how I miss you still). I went out and spent what I still consider to be a fair amount of money on a pair of running shoes (Nike+ compatible, obviously). I&#8217;ve had knee issues in the past, which motivated me to err towards the top end of the range, I swear. The presence of the striking red headed shop assistant with her beautiful blue eyes and athletic physique had absolutely nothing to do with my decision.</p>

<p>What was I talking about? Running! Right.</p>

<!-- More -->


<p><img class="center" src="http://www.harveynick.com/images/blog/2013/04/07/P1000436.JPG"><!-- header_img /images/blog/2013/04/07/P1000436.JPG --></p>

<p>Thusly equipped, I began striking out in the evenings and doing mixed running and walking intervals. Given my complete lack of a plan, I decided to work my way around the Meadows&#8217; sign posted mile long circuit, alternately running and walking the segments. After a couple of sessions of this, a few things become clear:</p>

<ul>
<li>I had absolutely no idea what sort of progress I was making. I was gathering no data;</li>
<li>I could only make fairly rough guesses at my actual pace;</li>
<li>I had no plan for how to increase the difficulty of my runs;</li>
<li>I wasn&#8217;t having any fun. No data equals no graphs. No Graphs equals no fun. Obviously.</li>
</ul>


<p>As luck would have it, it was around that time when I stumbled across an ArsTecnica <a href="http://arstechnica.com/gadgets/2009/11/reader-favorites-fitness-tech/">article which mentioned RunKeeper</a>, a combination of a website and (at the time) iPhone app which could be used to plan and track your runs. It would draw your route on a map, and draw all manner graphs of the data you generated. My. Oh. My.</p>

<p>Also mentioned in the review was the <a href="http://www.nhs.uk/Livewell/c25k/Pages/couch-to-5k-plan.aspx">Couch to 5K program</a>, an NHS approved to program to take you from doing no running at all to being able to run 5K in one session over a period of several weeks, with a particular focus on preventing you getting either a) injured or b) bored. Seemed like a plan. I didn&#8217;t want to be either of those things.</p>

<p>Like any good nerd I didn&#8217;t go right out and sign up with RunKeeper, but spent a good long while reading reviews of other apps, some of which were C25K specific. RunKeeper won out in the end, though, and I started following the program during my lunch breaks (much more manageable than the evenings if you live in Scotland and don&#8217;t want to run in the dark). Then the thing I&#8217;d been waiting over a year for happened. I got on a plane to Australia to support <a href="http://www.unmanned.co.uk/unmanned-vehicles-news/unmanned-autonomous-underwater-vehicles-uuv-auv-news/seebyte-breaks-record-with-gavia-auv/">Fugro&#8217;s first foray into autonomous pipeline tracking</a>.</p>

<p>Now I was in Perth (the warm one) with a fair amount of spare time on my hands. Sometimes running around Edinburgh could be a serious chore. Even in summer it&#8217;s not exactly warm a lot of the time and often times it&#8217;s a bit on the rainy side. Perth was something else altogether, however. I&#8217;d chosen to stay in a small motel in the west of the city because:</p>

<ul>
<li>It was close to where I would be doing my work in the first phase of the job, so my commute would be short;</li>
<li>It was much cheaper than the more central hotels my company would normally have used, so I could spend more of the budget on food.</li>
</ul>


<p>Somehow, the thing which I hadn&#8217;t factored into my planning was that the motel was also about a minute&#8217;s walk from the coast road. That was a nice surprise, I can tell you. A long, helpfully flat, road with a minimum of interruptions which winds around a beautiful beach… and, oh yeah, looks sort of like this around sunset:</p>

<p><img class="center" src="http://www.harveynick.com/images/blog/2013/04/07/P1000203.JPG"></p>

<p>Let me tell you: running under these circumstances is not a chore. Don&#8217;t get me wrong: generally speaking it&#8217;s something I like having done, rather than something I actually like doing. But these are pretty ideal circumstances. While waiting for the operations to actually get into gear (a common theme with any work in this field) a managed to get in a fair few runs.</p>

<p>I&#8217;ll tell you what&#8217;s not ideal for running, though: getting sent to Karratha, a baking hot oil and gas company town in the North of Western Australia, which unlike Perth has a lot of really small things which can kill you really, really quickly. Quickly <em>and</em> painfully.</p>

<p><img class="center" src="http://www.harveynick.com/images/blog/2013/04/07/DSC01052.JPG"></p>

<p>Even less ideal is actually being sent offshore and spending a week or so floating on a small boat. Less ideal still is if that boat turns out to be a catamaran, and this is how you find out that catamarans make you very, very seasick. I&#8217;d worked offshore previously and even in bad weather, so I swear I&#8217;m not usually that much of a delicate flower when it comes to a bit of pitch and roll… but the evidence doesn&#8217;t lie. I&#8217;ve never spent more time hugging either a railing or a toilet bowl than I did on that trip. Try working a laptop under <em>those</em> circumstances. But I digress&#8230;</p>

<p><img class="center" src="http://www.harveynick.com/images/blog/2013/04/07/DSC00889.JPG"></p>

<p>The final nail in the coffin of this crack at C25K was actually arriving back in Edinburgh and finding that in summer the weather was far less clement that Perth&#8217;s winter climate. Going outside and running just plain wasn&#8217;t something I had the will for.</p>

<p>I don&#8217;t want to be too unfair to Edinburgh, though. I mean, Perth doesn&#8217;t have any of this:</p>

<p><img class="center" src="http://www.harveynick.com/images/blog/2013/04/07/P1000458.JPG"></p>

<p><img class="center" src="http://www.harveynick.com/images/blog/2013/04/07/P1000426.JPG"></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[A Fitness Story]]></title>
    <link href="http://www.harveynick.com/blog/2013/04/01/a-fitness-story/" />
    <updated>2013-04-01T20:07:00+01:00</updated>
    <id>http://www.harveynick.com/blog/2013/04/01/a-fitness-story</id>
    <content type="html"><![CDATA[<p>During most of university I was in pretty crap shape, but in the second year of my PhD my physical condition got particularly lousy. I caught a bus every morning which left from directly outside my flat and took me directly to the university. I did pretty much no exercise and ate an awful lot of takeaway. A few of my friends remarked that I&#8217;d gained weight. &#8220;Don&#8217;t worry,&#8221; they said &#8220;it&#8217;s fine,&#8221; in response to my mortified expression, I&#8217;m sure &#8220;You look well with it&#8221;. But I knew I looked nothing of the sort.  To paraphrase Eddie Izzard: when I looked in the mirror I sure as hell didn&#8217;t want to have sex with myself.</p>

<!-- More -->


<p>Then, as part of the job which ran in tandem with my studies I spend a couple of weeks working offshore on a maintenance ship. Where there was pretty much nothing to do. A worked, I ate, I slept. I played my way through Grand Theft Auto: San Andreas. But I also started to make use of the small gym on board the ship. Every day at around the same time I would go down, use the rowing machine for a while, use the cross trainer for a bit, maybe fiddle with the pec deck or the lat pulldown machine. Basically: I had no idea what I was doing… but I knew I had to do something.</p>

<p>Back on dry land I signed up for a gym and was given a workout program as part of a complementary training session. I told the trainer I wanted to use the machines and not the free weights, basically because I thought the guys who used the free weights were a bit douchey (based on the evidence I&#8217;d seen on the ship and the one time I&#8217;d visited the university gym). So for a year or two I diligently hit the gym three evenings a week and gradually increased the amount of weight I was moving around. Equally gradually I also started to like what I was seeing in the mirror.</p>

<p>It didn&#8217;t last, though. My circumstances changed and I found myself working full time in a different part of the city, while also needing to finish writing my thesis. Getting to the gym in the evenings was now a lot harder… and so started to not happen. I fell back into bad habits and put back on a lot of the weight I&#8217;d lost.</p>

<p>I kept trying to get back on the wagon. Twice I started <a href="http://www.nhs.uk/Livewell/c25k/Pages/couch-to-5k-plan.aspx">Couch to 5k</a>, and twice I failed to make it all the way through. The first, ironically, because I was sent to work offshore again in my previous job, and then my second attempt was scuppered by a foot injury. Every once in a while I would manage to drag myself to the work gym down here in London… but I didn&#8217;t have any sort of a plan and I didn&#8217;t really make any sort of progress.</p>

<p>Then it happened. This is the part of the story I&#8217;m very hesitant about discussing further. It&#8217;s deeply personal. But it&#8217;s also key.</p>

<p>I found myself in a rather fantastic situation with a very attractive member of the opposite sex. One I&#8217;d wanted to be in for some time. It was, as I&#8217;m sure you can imagine, a very positive experience. But it was also mortifying, because I found myself looking at this gorgeous lady and realizing how hard I was trying <em>not</em> to look at myself. The contrast between us was, to me, quite shocking. It was then that I thought to myself (and yes, I&#8217;m aware of the cliche) &#8220;I have to get myself in shape&#8221; and this time I really, really meant it.</p>

<p>What happened next? Well… fitness wise I got really geeky about it. Really geeky indeed. I&#8217;ll talk about it more in a different post, but I will say this: I&#8217;m definitely making progress, much more successfully than I every did before. Project &#8220;look good naked&#8221; is in effect, and I&#8217;m bringing the technologies.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Categories and Goals]]></title>
    <link href="http://www.harveynick.com/blog/2013/03/25/categories-and-goals/" />
    <updated>2013-03-25T22:53:00+00:00</updated>
    <id>http://www.harveynick.com/blog/2013/03/25/categories-and-goals</id>
    <content type="html"><![CDATA[<p>It&#8217;s good to have goals. Even if you fail to meet them. Sometimes especially when you fail to meet them. It&#8217;s quite widely publicized that at Google we&#8217;re expected to score 0.7 (on a scale where 0 is a complete failure and 1 means all targets were met) when assessing our OKRs (objectives and key results). Generally this is good. It means you&#8217;re always striving, always raising your eyes, hitting the top of the tree by aiming for the sky.</p>

<p>In my personal life, though, this probably isn&#8217;t the best approach. Be that as it may, this year I have goals.</p>

<!-- More -->


<p>1. Get myself in shape.</p>

<p>Also known as: project &#8220;look good naked&#8221;. There&#8217;s a bit more to it than this, of course. There&#8217;s also a bit of a story behind it, which I&#8217;ll probably tell in a later post. I also have some ideas around this area which might turn into something else. If I&#8217;m going to set goals, I need a way to measure success, after all.</p>

<p>Talking about this here leaves me with a slightly odd problem, though. When I relaunched this blog I adjusted all of my category names to be descriptive nouns, which means a can auto-generate the part of the about text (on the right) which references them. I don&#8217;t know what the appropriate noun is for someone who participates in and thinks about fitness related activities. This is a stupid problem to have, but it is a problem, nevertheless.</p>

<p>2. Get my House in order.</p>

<p>In the literal sense. One of the reasons things went dark on this blog last year is that I actually took the plunge and bought a flat. This ate a lot of my time and left my life in a bit of an inconsistent state for a month or so. Now I&#8217;m in, though, and having spent a winter in the place I&#8217;ve taken stock. It needs some work. It needs to be warmer when the weather is cold. It needs a bit more personality… and some of the really odd design decisions made by the previous owners need to be reversed.</p>

<p>It&#8217;s also a whole new playground for me to seek adventures in. My Clockwork Aphid project was a casualty of the upheaval in my life last year and I&#8217;m not sure how much attention it&#8217;ll get this year… because this year I&#8217;d also like to start playing with home automation. Nothing crazy. No robot butlers; but we&#8217;ll see.</p>

<p>3. Read. Travel. Watch. Write.</p>

<p>This one is more straight forward. I&#8217;d like to start more closely measuring how much a read, travel, watch (mainly in terms of films) and write, on this blog an elsewhere.</p>

<p>Reading is straightforward, I think. I read a lot. On my way to work, before bed, in coffee shops at the weekend, But I&#8217;m curious to try and keep tabs on what I&#8217;m reading and how much. It frustrates the hell out of me that my kindle can&#8217;t easily supply me with the information.</p>

<p>One of my friends has a goal for this year that she will get out of Edinburgh at least once every month. That&#8217;s not a bad goal to have at all. For me, I&#8217;d just like to see and experience more of the wider world in general, but also the part of it which I inhabit.</p>

<p>As for watching films and keeping tabs on what I saw… well… I already have <a href="http://ohsohumbleopinion.tumblr.com">a place to keep tabs on that</a>. Simple. This is mostly a matter of &#8220;keep it up&#8221;.</p>

<p>Lastly: writing. Er… yes. I don&#8217;t have such a great record with this one. Obviously I want to get back to posting regularly on this blog… but I&#8217;d also like to try and do something with the two screenplays I wrote during university (and the pile of partially developed ones). I used to regularly do some sort of creative writing and lately I&#8217;m starting to feel the lack of it in my life.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Ch-Ch-Ch-Changes]]></title>
    <link href="http://www.harveynick.com/blog/2013/03/22/ch-ch-ch-changes/" />
    <updated>2013-03-22T00:30:00+00:00</updated>
    <id>http://www.harveynick.com/blog/2013/03/22/ch-ch-ch-changes</id>
    <content type="html"><![CDATA[<p>So a couple of things about this website have changed. Perhaps you&#8217;ve noticed.</p>

<p>Firstly, I changed the background. Much as I love that dark linen image I was using, it&#8217;s really obviously &#8220;the apple background&#8221;, which carries connotations I didn&#8217;t really want to project. The first place I saw it was on an apple device, granted, but I wasn&#8217;t using it <em>because</em> it&#8217;s the apple background. The new one is similar aesthetically, yet distinct enough that I don&#8217;t think it screams &#8220;fanboi&#8221;. It&#8217;ll do for now. More on that later.</p>

<p>I&#8217;ve also removed that cool effect where the background and title remained static, and the actual content appear to slide up an over them. Again, I loved it, but it made the scrolling really janky on a lot of devices. I&#8217;m choosing to assume it was the combination of the drop shadow and static background which was causing this&#8230; and since the slide effect doesn&#8217;t work anywhere near as well without the drop shadow, but the drop shadow seems just fine without the slide I&#8217;ve decided to move over to plain old normal scrolling. Unless you&#8217;re on a really small screen, in which case the drop shadow should disappear as well (try resizing your browser window, you&#8217;ll see what I mean).</p>

<!-- More -->


<p>Lastly, there&#8217;s a small ad at the bottom of the sidebar.</p>

<blockquote><p>Say what? Oh no your didn&#8217;t! Why? WHY!?</p></blockquote>


<p>As you may or may not be aware, I work on the <a href="http://www.google.com/adsense">AdSense</a> team at Google, and our management has encouraged us to actually become AdSense publishers. I&#8217;ve been resisting this change for quite some time, but decided it was probably time to bite the bullet and start eating my team&#8217;s dog food. It bothers me a bit, I have to admit. I&#8217;m going to play with moving it around and changing the settings on the AdSense Front End and see if I can achieve a situation where:</p>

<ul>
<li>It doesn&#8217;t bother me so much;</li>
<li>It&#8217;s actually effective.</li>
</ul>


<p>I hope it doesn&#8217;t bother you too much. Don&#8217;t worry, this isn&#8217;t me trying to monetize you. There will probably more some more changes coming, but let&#8217;s not get ahead of ourselves.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[I Disagree with Film Critic Hulk]]></title>
    <link href="http://www.harveynick.com/blog/2013/03/17/i-disagree-with-film-critic-hulk/" />
    <updated>2013-03-17T17:52:00+00:00</updated>
    <id>http://www.harveynick.com/blog/2013/03/17/i-disagree-with-film-critic-hulk</id>
    <content type="html"><![CDATA[<p>While <a href="http://badassdigest.com/2013/01/09/film-crit-hulk-smash-hulk-vs.-tom-hooper-and-art-of-cinematic-affectation/">Film Critic Hulk&#8217;s argument</a> generally seems quite well reasoned, I find it a little difficult to stomach someone attempting to lecture me on the theory behind the form of anything in ALL CAPS, and at such length. Also, he makes the unforgivable (in my opinion) mistake of representing his opinion as fact. He states the film falls flat, not that he <strong>believes</strong> it falls flat. No one, apparently, thought to mention this to the legions of people who rated Les Mis so highly on IMDB and Rotten Tomatoes.</p>

<!-- more -->


<p>At the end of the day in film, just like any other art form, theory is merely a tool. It doesn&#8217;t really matter. Emotional response is what actually matters. Banging on about theory in situations like this just makes you look like someone standing on the deck of the Titanic, harping on to anyone who&#8217;ll listen about how the ship is unsinkable.</p>

<p>I quite like the visual presentation of the film, as did almost everyone else I spoke to about it. When I brought the matter of how it was shot, and how this flies in the face of film theory, they usually laughed and replied: &#8220;So?&#8221;</p>

<p>Also: yes. I&#8217;m back. I hope.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Wandering Around London]]></title>
    <link href="http://www.harveynick.com/blog/2012/05/17/wandering-around-london/" />
    <updated>2012-05-17T21:57:00+01:00</updated>
    <id>http://www.harveynick.com/blog/2012/05/17/wandering-around-london</id>
    <content type="html"><![CDATA[<p>Apologies, once again, for the radio silence. Over the past couple of months there have been some complications in my private life, and a remarkable amount of my attention has been taken up with figuring out where exactly I&#8217;m going to be living after my current lease runs out (more on that later, perhaps).</p>

<p>Be that as it may, after almost a year, I did find some time to go wandering around the city I now call home. Whilst I took every opportunity to make a brisk constitutional around Edinburgh, I&#8217;d never managed to really do this in London. Part of the reason, I think, is while that you can essentially wander across central Edinburgh in an hour or two, this is really not the case in London. Nipping across town via public transport can take <em>hours</em>.</p>

<p>Recently, though, two excellent excuses presented themselves. Firstly, my father came to visit for a few days and professed an interest to go take a good look at <a href="http://www.kew.org/">Kew Gardens</a>, the Japanese themed portion in particular.</p>

<!-- more -->


<p>First stop was the <a href="http://www.kew.org/visit-kew-gardens/garden-attractions-A-Z/Pagoda.htm">Pagoda</a>:</p>

<p><img class="center" src="http://www.harveynick.com/images/blog/2012/05/13/IMG_0402.jpg"></p>

<p>This is a fairly impressive and imposing building, at least from a distance. Close up it&#8217;s curiously less so. I think it&#8217;s the red brick construction which does it. I&#8217;ve never visited Japan, but this seems a slightly inappropriate building material to me. My father, who has, concurred.</p>

<p>Next was the <a href="http://www.kew.org/visit-kew-gardens/garden-attractions-A-Z/japanese-gateway.htm">Japanese Gateway</a> which, in conjunction with the weather, gave me an excellent opportunity to try out the HDR mode on my phone&#8217;s camera. Here it is without the benefit of HDR:</p>

<p><img class="center" src="http://www.harveynick.com/images/blog/2012/05/17/IMG_0408.jpg"></p>

<p>…and here it is with the HDR turned on:</p>

<p><img class="center" src="http://www.harveynick.com/images/blog/2012/05/13/IMG_0409.jpg"></p>

<p>I&#8217;ll be listing that featuring under &#8220;worthwhile&#8221; from here on out. At this point it&#8217;s probably worth confirming a slightly frustrating fact which I suspect is now true of many people: the camera on my phone has completely killed any use of my point and shoot camera. It&#8217;s extremely convenient (being as I <em>always</em> have it with me) and, since my last upgrade, actually very capable. The only thing it lacks is zoom, which is a trade off I&#8217;m willing to make. If I plan on going on a serious photo taking excursion at any point in the future I may bite the bullet and pick up a decent digital SLR. The point and shoot just feels like a weird middle gear at this point.</p>

<p>Back to Kew Gardens, though. Tucked off to one side and not especially well advertised is the Bonsai house. It&#8217;s small, but quite cool, and something my dad specifically wanted to see (Bonsai being a hobby of his).</p>

<p><img class="center" src="http://www.harveynick.com/images/blog/2012/05/13/IMG_0448.jpg"></p>

<p><img class="center" src="http://www.harveynick.com/images/blog/2012/05/13/IMG_0450.jpg"></p>

<p>Next, we moved away from the specifically Asian attractions and took a look in the <a href="http://www.kew.org/visit-kew-gardens/garden-attractions-A-Z/Palm-House.htm">Palm House</a>. This really is an impressive building, if uncomfortably hot and humid. Be ready to sweat, all ye who enter here. Besides the tropical plants (which I don&#8217;t seem to have taken any pictures of), the green house itself has an impressive art deco* construction:</p>

<p><img class="center" src="http://www.harveynick.com/images/blog/2012/05/13/IMG_0451.jpg"></p>

<p>Shortly after this, we took the train from Richmond back to my flat, and I had the fun of explaining to my father the difference between underground and overground trains this far out of the centre (&#8220;you can tell that&#8217;s an underground train because it says &#8216;underground&#8217; on it…&#8221;).</p>

<p>A week or two later, I professed a desire to go see <a href="http://ohsohumbleopinion.tumblr.com/post/19950925968/john-carter">John Carter</a> to friend who suggested we see it in Canary Wharf, allowing us to go wandering around the area beforehand. So we did.</p>

<p>Canary Wharf is one of the parts of London containing buildings which can legitimately be called skyscrapers (I think). I believe it&#8217;s also London&#8217;s financial district. Surprisingly, I actually find it a very pleasant place to be. The taller buildings make you feel as though you&#8217;re walking through canyons, and the area is very clean, though not to the point of feeling antiseptic.</p>

<p><img class="center" src="http://www.harveynick.com/images/blog/2012/05/13/IMG_0463.jpg"></p>

<p>At the weekend it&#8217;s extremely quiet without quite feeling like a ghost town and there are a surprising amount of things to find. These include a large underground mall, some very cool riverside buildings:</p>

<p><img class="center" src="http://www.harveynick.com/images/blog/2012/05/17/IMG_0460.jpg"></p>

<p>…and one or two very cool statue / landmark type things:</p>

<p><img class="center" src="http://www.harveynick.com/images/blog/2012/05/13/IMG_0456.jpg"><!-- header_img /images/blog/2012/05/13/IMG_0456.jpg --></p>

<p>Interestingly, the whole area is also private property, so you might have submit to a vehicle search on the way in. Be that as may, I can recommend it as a reasonable place to wander around at the weekend.</p>

<p>Until next time&#8230;</p>

<p>* This is art deco, right?</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Now We're Blogging with Photos!]]></title>
    <link href="http://www.harveynick.com/blog/2012/04/14/now-were-blogging-with-photos/" />
    <updated>2012-04-14T10:42:00+01:00</updated>
    <id>http://www.harveynick.com/blog/2012/04/14/now-were-blogging-with-photos</id>
    <content type="html"><![CDATA[<p><em>Fair warning: this is going to be a bit of a programming heavy blog post. It&#8217;s also going to be quite Mac specific.</em></p>

<p>One of the things I wanted to change about the format of this blog was to make it more visual, specifically with pictures. This first part of this was to add pictures to the front page. There were a couple of options for doing so. I could just scan through an article, look for the first image tag and use this. Alternatively I could add a mechanism which allowed me to choose the image, in a similar manner to the way <a href="http://octopress.org/">Octopress</a> allows me to choose the except which appears on the front page. I decided to go with option two.</p>

<!-- more -->


<p>The first part of this was to modify the image tag plug-in like so:</p>

<figure class='code'><figcaption><span>image_tag.rb  </span></figcaption>
 <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>
<span class='line-number'>35</span>
<span class='line-number'>36</span>
<span class='line-number'>37</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="k">module</span> <span class="nn">Jekyll</span>
</span><span class='line'>
</span><span class='line'>  <span class="k">class</span> <span class="nc">ImageTag</span> <span class="o">&lt;</span> <span class="no">Liquid</span><span class="o">::</span><span class="no">Tag</span>
</span><span class='line'>    <span class="vi">@img</span> <span class="o">=</span> <span class="kp">nil</span>
</span><span class='line'>    <span class="vi">@header</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
</span><span class='line'>
</span><span class='line'>    <span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="n">tag_name</span><span class="p">,</span> <span class="n">markup</span><span class="p">,</span> <span class="n">tokens</span><span class="p">)</span>
</span><span class='line'>      <span class="n">attributes</span> <span class="o">=</span> <span class="o">[</span><span class="s1">&#39;class&#39;</span><span class="p">,</span> <span class="s1">&#39;src&#39;</span><span class="p">,</span> <span class="s1">&#39;width&#39;</span><span class="p">,</span> <span class="s1">&#39;height&#39;</span><span class="p">,</span> <span class="s1">&#39;title&#39;</span><span class="o">]</span>
</span><span class='line'>
</span><span class='line'>      <span class="k">if</span> <span class="n">markup</span> <span class="o">=~</span> <span class="sr">/(?&lt;class&gt;\S.*\s+)?(?&lt;src&gt;(?:https?:\/\/|\/|\S+\/)\S+)(?:\s+(?&lt;width&gt;\d+))?(?:\s+(?&lt;height&gt;\d+))?(?&lt;title&gt;\s+.+)?/i</span>
</span><span class='line'>        <span class="vi">@img</span> <span class="o">=</span> <span class="n">attributes</span><span class="o">.</span><span class="n">reduce</span><span class="p">({})</span> <span class="p">{</span> <span class="o">|</span><span class="n">img</span><span class="p">,</span> <span class="kp">attr</span><span class="o">|</span> <span class="n">img</span><span class="o">[</span><span class="kp">attr</span><span class="o">]</span> <span class="o">=</span> <span class="vg">$~</span><span class="o">[</span><span class="kp">attr</span><span class="o">].</span><span class="n">strip</span> <span class="k">if</span> <span class="vg">$~</span><span class="o">[</span><span class="kp">attr</span><span class="o">]</span><span class="p">;</span> <span class="n">img</span> <span class="p">}</span>
</span><span class='line'>        <span class="k">if</span><span class="sr"> /(?:&quot;|&#39;)(?&lt;title&gt;[^&quot;&#39;]+)?(?:&quot;|&#39;)\s+(?:&quot;|&#39;)(?&lt;alt&gt;[^&quot;&#39;]+)?(?:&quot;|&#39;)/</span> <span class="o">=~</span> <span class="vi">@img</span><span class="o">[</span><span class="s1">&#39;title&#39;</span><span class="o">]</span>
</span><span class='line'>          <span class="vi">@img</span><span class="o">[</span><span class="s1">&#39;title&#39;</span><span class="o">]</span>  <span class="o">=</span> <span class="n">title</span>
</span><span class='line'>          <span class="vi">@img</span><span class="o">[</span><span class="s1">&#39;alt&#39;</span><span class="o">]</span>    <span class="o">=</span> <span class="n">alt</span>
</span><span class='line'>        <span class="k">else</span>
</span><span class='line'>          <span class="vi">@img</span><span class="o">[</span><span class="s1">&#39;alt&#39;</span><span class="o">]</span>    <span class="o">=</span> <span class="vi">@img</span><span class="o">[</span><span class="s1">&#39;title&#39;</span><span class="o">].</span><span class="n">gsub!</span><span class="p">(</span><span class="sr">/&quot;/</span><span class="p">,</span> <span class="s1">&#39;&amp;#34;&#39;</span><span class="p">)</span> <span class="k">if</span> <span class="vi">@img</span><span class="o">[</span><span class="s1">&#39;title&#39;</span><span class="o">]</span>
</span><span class='line'>        <span class="k">end</span>
</span><span class='line'>        <span class="vi">@img</span><span class="o">[</span><span class="s1">&#39;class&#39;</span><span class="o">].</span><span class="n">gsub!</span><span class="p">(</span><span class="sr">/&quot;/</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">)</span> <span class="k">if</span> <span class="vi">@img</span><span class="o">[</span><span class="s1">&#39;class&#39;</span><span class="o">]</span>
</span><span class='line'>        <span class="k">if</span> <span class="n">tag_name</span> <span class="o">==</span> <span class="s2">&quot;header_img&quot;</span>
</span><span class='line'>          <span class="vi">@header</span> <span class="o">=</span> <span class="s2">&quot;&lt;!-- header_img </span><span class="si">#{</span><span class="vi">@img</span><span class="o">[</span><span class="s1">&#39;src&#39;</span><span class="o">]</span><span class="si">}</span><span class="s2"> --&gt;&quot;</span>
</span><span class='line'>        <span class="k">end</span>
</span><span class='line'>      <span class="k">end</span>
</span><span class='line'>      <span class="k">super</span>
</span><span class='line'>    <span class="k">end</span>
</span><span class='line'>
</span><span class='line'>    <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="n">context</span><span class="p">)</span>
</span><span class='line'>      <span class="k">if</span> <span class="vi">@img</span>
</span><span class='line'>        <span class="s2">&quot;&lt;img </span><span class="si">#{</span><span class="vi">@img</span><span class="o">.</span><span class="n">collect</span> <span class="p">{</span><span class="o">|</span><span class="n">k</span><span class="p">,</span><span class="n">v</span><span class="o">|</span> <span class="s2">&quot;</span><span class="si">#{</span><span class="n">k</span><span class="si">}</span><span class="s2">=</span><span class="se">\&quot;</span><span class="si">#{</span><span class="n">v</span><span class="si">}</span><span class="se">\&quot;</span><span class="s2">&quot;</span> <span class="k">if</span> <span class="n">v</span><span class="si">}</span><span class="s2">.join(&quot;</span> <span class="s2">&quot;)}&gt;</span><span class="si">#{</span><span class="vi">@header</span><span class="si">}</span><span class="s2">&quot;</span>
</span><span class='line'>      <span class="k">else</span>
</span><span class='line'>        <span class="s2">&quot;Error processing input, expected syntax: &lt;img class=&quot;</span><span class="o">[</span><span class="k">class</span> <span class="nb">name</span><span class="p">(</span><span class="n">s</span><span class="p">)</span><span class="o">]</span><span class="s2">&quot; src=&quot;</span><span class="o">[</span><span class="n">http</span><span class="o">[</span><span class="n">s</span><span class="o">]</span><span class="ss">:/</span><span class="o">]/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">image</span><span class="s2">&quot; title=&quot;</span><span class="o">[</span><span class="n">width</span> <span class="o">[</span><span class="n">height</span><span class="o">]]</span> <span class="o">[</span><span class="n">title</span> <span class="n">text</span> <span class="o">|</span> <span class="p">\</span><span class="o">&amp;</span><span class="c1">#34;title text\&amp;#34; [\&amp;#34;alt text\&amp;#34;]]&quot; alt=&quot;[width [height]] [title text | \&amp;#34;title text\&amp;#34; [\&amp;#34;alt text\&amp;#34;]]&quot;&gt;&quot;</span>
</span><span class='line'>      <span class="k">end</span>
</span><span class='line'>    <span class="k">end</span>
</span><span class='line'>  <span class="k">end</span>
</span><span class='line'><span class="k">end</span>
</span><span class='line'>
</span><span class='line'><span class="no">Liquid</span><span class="o">::</span><span class="no">Template</span><span class="o">.</span><span class="n">register_tag</span><span class="p">(</span><span class="s1">&#39;img&#39;</span><span class="p">,</span> <span class="no">Jekyll</span><span class="o">::</span><span class="no">ImageTag</span><span class="p">)</span>
</span><span class='line'><span class="no">Liquid</span><span class="o">::</span><span class="no">Template</span><span class="o">.</span><span class="n">register_tag</span><span class="p">(</span><span class="s1">&#39;header_img&#39;</span><span class="p">,</span> <span class="no">Jekyll</span><span class="o">::</span><span class="no">ImageTag</span><span class="p">)</span>
</span></code></pre></td></tr></table></div></figure>


<p>This adds an <code>html</code> comment containing the image path to the page when I use <code>header_img</code> as a <a href="https://github.com/Shopify/liquid/wiki">Liquid</a> tag name rather than the original <code>img</code>. Next I need to do something with this comment. I created an additional Liquid filter which pulls the path out and replaces it with an actual image embed:</p>

<figure class='code'><figcaption><span>harveynick_filters.rb  </span></figcaption>
 <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>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="k">module</span> <span class="nn">HarveyNickFilters</span>
</span><span class='line'>
</span><span class='line'>  <span class="c1"># Used on the blog index to split posts on the &lt;!--more--&gt; marker</span>
</span><span class='line'>  <span class="k">def</span> <span class="nf">header_image</span><span class="p">(</span><span class="n">input</span><span class="p">)</span>
</span><span class='line'>    <span class="k">if</span> <span class="n">input</span> <span class="o">=~</span> <span class="sr">/&lt;!-- header_img (?&lt;src&gt;(?:https?:\/\/|\/|\S+\/)\S+) --&gt;/</span>
</span><span class='line'>      <span class="s2">&quot;&lt;img class=</span><span class="se">\&quot;</span><span class="s2">header</span><span class="se">\&quot;</span><span class="s2"> src=</span><span class="se">\&quot;</span><span class="si">#{</span><span class="vg">$~</span><span class="o">[</span><span class="s1">&#39;src&#39;</span><span class="o">]</span><span class="si">}</span><span class="se">\&quot;</span><span class="s2">/&gt;&quot;</span>
</span><span class='line'>    <span class="k">else</span>
</span><span class='line'>      <span class="s2">&quot;&quot;</span>
</span><span class='line'>    <span class="k">end</span>
</span><span class='line'>  <span class="k">end</span>
</span><span class='line'><span class="k">end</span>
</span><span class='line'>
</span><span class='line'><span class="no">Liquid</span><span class="o">::</span><span class="no">Template</span><span class="o">.</span><span class="n">register_filter</span><span class="p">(</span><span class="no">HarveyNickFilters</span><span class="p">)</span>
</span></code></pre></td></tr></table></div></figure>


<p>Next I modified my theme to run this filter over the page contents just before the one which creates the except on the front page. I&#8217;ll leave this as an exercise for the reader. Lastly, I needed to account for the fact that the created image could be just about any size, while I want some uniformity on the front page. Those of you playing at home will have noticed I assigned <code>header</code> as the class of the image. This allows me to control the appearance of the front page images by adding the following to the <code>sass</code> files in my theme (which are used to generate the <code>css</code>):</p>

<figure class='code'><figcaption><span>_styles.scss  </span></figcaption>
 <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>
</pre></td><td class='code'><pre><code class='scss'><span class='line'><span class="nt">img</span> <span class="p">{</span>
</span><span class='line'>  <span class="k">&amp;</span><span class="nc">.header</span><span class="p">{</span>
</span><span class='line'>    <span class="na">float</span><span class="o">:</span> <span class="no">left</span><span class="p">;</span>
</span><span class='line'>    <span class="na">width</span><span class="o">:</span> <span class="mi">250</span><span class="kt">px</span><span class="p">;</span>
</span><span class='line'>    <span class="na">max-width</span><span class="o">:</span> <span class="mi">50</span><span class="kt">%</span><span class="p">;</span>
</span><span class='line'>    <span class="na">margin-right</span><span class="o">:</span> <span class="mi">10</span><span class="kt">px</span><span class="p">;</span>
</span><span class='line'>    <span class="na">margin-bottom</span><span class="o">:</span> <span class="mi">10</span><span class="kt">px</span><span class="p">;</span>
</span><span class='line'>    <span class="k">@media</span> <span class="nt">only</span> <span class="nt">screen</span> <span class="nt">and</span> <span class="o">(</span><span class="nt">max-width</span><span class="nd">:</span> <span class="nt">768px</span><span class="o">)</span> <span class="p">{</span>
</span><span class='line'>      <span class="na">width</span><span class="o">:</span> <span class="mi">50</span><span class="kt">%</span><span class="p">;</span>
</span><span class='line'>      <span class="na">max-width</span><span class="o">:</span> <span class="mi">250</span><span class="kt">px</span><span class="p">;</span>
</span><span class='line'>    <span class="p">}</span>
</span><span class='line'>    <span class="k">@media</span> <span class="nt">only</span> <span class="nt">screen</span> <span class="nt">and</span> <span class="o">(</span><span class="nt">max-width</span><span class="nd">:</span> <span class="nt">400px</span><span class="o">)</span> <span class="p">{</span>
</span><span class='line'>      <span class="na">width</span><span class="o">:</span> <span class="mi">100</span><span class="kt">%</span><span class="p">;</span>
</span><span class='line'>      <span class="na">max-width</span><span class="o">:</span> <span class="mi">100</span><span class="kt">%</span><span class="p">;</span>
</span><span class='line'>      <span class="na">margin-right</span><span class="o">:</span> <span class="mi">0</span><span class="kt">px</span><span class="p">;</span>
</span><span class='line'>    <span class="p">}</span>
</span><span class='line'>  <span class="p">}</span>
</span><span class='line'><span class="p">}</span>
</span></code></pre></td></tr></table></div></figure>


<p>Presto. Front page images.</p>

<p>Next, I wanted to try and make it easier to include pictures which I myself have taken with an actual camera (or, more likely, my phone). There really isn&#8217;t any problem when you&#8217;re linking to images elsewhere on the internet, but things can get a bit stickier when you want to include your own images on an Octopress blog. One option is to use a hosted service, like Flickr or PhotoBucket, but this only works when you have an internet connection. I really love that Octopress allows me to work on my site while offline, and I didn&#8217;t want to lose this advantage when I&#8217;m posting pictures. Thus, I decided to just stick the images in my blog&#8217;s images folder.</p>

<p>iPhoto is pretty great for organising and sharing photos (with supported services), but definitely doesn&#8217;t make your life easy if you want to actually get at the image files themselves. That&#8217;s the first problem. The second is that I also want to resize them to something reasonable for my blog. Lastly I want this to be low hassle. I came to the conclusion that an <a href="http://en.wikipedia.org/wiki/AppleScript">Applescript</a> is what was required, and this is what I came up with:</p>

<figure class='code'><figcaption><span>bloggify.script  </span></figcaption>
 <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='applescript'><span class='line'><span class="k">set</span> <span class="nv">blog_path</span> <span class="k">to</span> <span class="s2">&quot;~/GitHub/octopress/source&quot;</span>
</span><span class='line'><span class="k">set</span> <span class="nv">images_path</span> <span class="k">to</span> <span class="s2">&quot;/images/blog/&quot;</span>
</span><span class='line'><span class="k">set</span> <span class="nv">blog_image_path</span> <span class="k">to</span> <span class="nv">blog_path</span> <span class="o">&amp;</span> <span class="nv">images_path</span>
</span><span class='line'><span class="k">set</span> <span class="nv">max_width</span> <span class="k">to</span> <span class="mi">992</span>
</span><span class='line'>
</span><span class='line'><span class="k">set</span> <span class="p">{</span><span class="nb">year</span><span class="p">:</span><span class="nv">y</span><span class="p">,</span> <span class="nb">month</span><span class="p">:</span><span class="nv">m</span><span class="p">,</span> <span class="nb">day</span><span class="p">:</span><span class="nv">d</span><span class="p">}</span> <span class="k">to</span> <span class="p">(</span><span class="nb">current date</span><span class="p">)</span>
</span><span class='line'><span class="k">set</span> <span class="nv">date_string</span> <span class="k">to</span> <span class="s2">&quot;&quot;</span> <span class="o">&amp;</span> <span class="nv">y</span> <span class="o">&amp;</span> <span class="s2">&quot;/&quot;</span> <span class="o">&amp;</span> <span class="nv">two_digits</span><span class="p">(</span><span class="nv">m</span> <span class="o">*</span> <span class="mi">1</span><span class="p">)</span> <span class="o">&amp;</span> <span class="s2">&quot;/&quot;</span> <span class="o">&amp;</span> <span class="nv">two_digits</span><span class="p">(</span><span class="nv">d</span><span class="p">)</span>
</span><span class='line'><span class="k">set</span> <span class="nv">folder_path</span> <span class="k">to</span> <span class="nv">blog_image_path</span> <span class="o">&amp;</span> <span class="nv">date_string</span> <span class="o">&amp;</span> <span class="s2">&quot;/&quot;</span>
</span><span class='line'>
</span><span class='line'><span class="nb">do shell script</span> <span class="s2">&quot;mkdir -p &quot;</span> <span class="o">&amp;</span> <span class="nv">folder_path</span>
</span><span class='line'>
</span><span class='line'><span class="k">tell</span> <span class="nb">application</span> <span class="s2">&quot;iPhoto&quot;</span>
</span><span class='line'>  <span class="k">set</span> <span class="nv">the_photos</span> <span class="k">to</span> <span class="nv">selection</span>
</span><span class='line'>  <span class="k">set</span> <span class="nv">the_photo</span> <span class="k">to</span> <span class="nb">item</span> <span class="mi">1</span> <span class="k">of</span> <span class="nv">the_photos</span>
</span><span class='line'>  <span class="k">set</span> <span class="nv">image_path</span> <span class="k">to</span> <span class="na">image</span> <span class="na">path</span> <span class="k">of</span> <span class="nv">the_photo</span>
</span><span class='line'>  <span class="k">set</span> <span class="nv">image_name</span> <span class="k">to</span> <span class="na">name</span> <span class="k">of</span> <span class="nv">the_photo</span>
</span><span class='line'><span class="k">end</span> <span class="k">tell</span>
</span><span class='line'>
</span><span class='line'><span class="k">tell</span> <span class="nb">application</span> <span class="s2">&quot;Image Events&quot;</span>
</span><span class='line'>  <span class="k">set</span> <span class="nv">current_image</span> <span class="k">to</span> <span class="nb">open</span> <span class="nv">image_path</span>
</span><span class='line'>  <span class="k">set</span> <span class="nv">image_type</span> <span class="k">to</span> <span class="nv">current_image</span>&#39;s <span class="na">file type</span>
</span><span class='line'>  <span class="k">set</span> <span class="no">AppleScript</span>&#39;s <span class="no">text item delimiters</span> <span class="k">to</span> <span class="s2">&quot;/&quot;</span>
</span><span class='line'>  <span class="k">set</span> <span class="nv">image_path</span> <span class="k">to</span> <span class="nb">last</span> <span class="nb">item</span> <span class="k">of</span> <span class="nb">text</span> <span class="nb">items</span> <span class="k">of</span> <span class="nv">image_path</span>
</span><span class='line'>  <span class="k">set</span> <span class="no">AppleScript</span>&#39;s <span class="no">text item delimiters</span> <span class="k">to</span> <span class="s2">&quot;&quot;</span>
</span><span class='line'>  <span class="nv">scale</span> <span class="nv">current_image</span> <span class="k">to</span> <span class="na">size</span> <span class="nv">max_width</span>
</span><span class='line'>  <span class="k">set</span> <span class="nv">new_image</span> <span class="k">to</span> <span class="nv">folder_path</span> <span class="o">&amp;</span> <span class="nv">image_path</span>
</span><span class='line'>  <span class="nv">save</span> <span class="nv">current_image</span> <span class="k">in</span> <span class="nv">new_image</span> <span class="k">as</span> <span class="nv">image_type</span>
</span><span class='line'><span class="k">end</span> <span class="k">tell</span>
</span><span class='line'>
</span><span class='line'><span class="nb">set the clipboard to</span> <span class="nv">images_path</span> <span class="o">&amp;</span> <span class="nv">date_string</span> <span class="o">&amp;</span> <span class="s2">&quot;/&quot;</span> <span class="o">&amp;</span> <span class="nv">image_path</span>
</span><span class='line'>
</span><span class='line'><span class="k">on</span> <span class="nv">two_digits</span><span class="p">(</span><span class="nv">the_number</span><span class="p">)</span>
</span><span class='line'>  <span class="no">return</span> <span class="p">(</span><span class="nb">text</span> <span class="o">-</span><span class="mi">2</span> <span class="nb">thru</span> <span class="o">-</span><span class="mi">1</span> <span class="k">of</span> <span class="p">((</span><span class="nv">the_number</span> <span class="o">+</span> <span class="mi">100</span><span class="p">)</span> <span class="k">as </span><span class="nc">string</span><span class="p">))</span>
</span><span class='line'><span class="k">end</span> <span class="nv">two_digits</span>
</span></code></pre></td></tr></table></div></figure>


<p>Now, Applescript the programming language is completely mental and can be a complete pain in the arse to get right, but Applescript the mechanism is spectacularly powerful. You can do some serious automation with it. This script grabs the path to the currently selected photograph in iPhoto, resizes it and copies it to a folder inside my blog, generated using today&#8217;s date to avoid duplication. Lastly, it places the location of the image on the clipboard, in the form it&#8217;s needed.</p>

<p>To use it, I enabled the scripts menu (it&#8217;s an option in the Applescript editor) and copied the script to the iPhoto scripts folder, which will be something like <code>/Users/&lt;user&gt;/Library/Scripts/Applications/iPhoto</code>. This might be hidden by default, but you can find it via the scripts menu while in iPhoto.</p>

<p>Then, all that is required is to select a photo, trigger the script, and then hit cmd-c in the post I&#8217;m writing. Bingo!</p>

<p>After getting this working, I remembered an <a href="http://arstechnica.com/apple/guides/2011/09/tutorial-os-x-automation-with-macruby-and-the-scripting-bridge.ars/2">ArsTecnica article</a> about using <a href="http://www.ruby-lang.org/en/">Ruby</a> in place of Applescript for this purpose, so I converted the script to Ruby as an exercise. This is what I came up with:</p>

<figure class='code'><figcaption><span>blogify.rb  </span></figcaption>
 <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>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="c1">#!/usr/local/bin/macruby  </span>
</span><span class='line'>
</span><span class='line'><span class="n">framework</span> <span class="s2">&quot;ScriptingBridge&quot;</span>
</span><span class='line'>
</span><span class='line'><span class="n">blog_path</span> <span class="o">=</span> <span class="s2">&quot;~/GitHub/octopress/source&quot;</span>
</span><span class='line'><span class="n">images_path</span> <span class="o">=</span> <span class="s2">&quot;/images/blog/&quot;</span>
</span><span class='line'><span class="n">max_width</span> <span class="o">=</span> <span class="mi">992</span>
</span><span class='line'><span class="n">convert</span> <span class="o">=</span> <span class="s2">&quot;/opt/local/bin/convert&quot;</span>
</span><span class='line'>
</span><span class='line'><span class="n">date_string</span> <span class="o">=</span> <span class="no">Time</span><span class="o">.</span><span class="n">now</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s2">&quot;%Y/%m/%d&quot;</span><span class="p">)</span>
</span><span class='line'>
</span><span class='line'><span class="n">source_path</span> <span class="o">=</span> <span class="no">SBApplication</span><span class="o">.</span><span class="n">applicationWithBundleIdentifier</span><span class="p">(</span><span class="s2">&quot;com.apple.iPhoto&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">selection</span><span class="o">[</span><span class="mi">0</span><span class="o">].</span><span class="n">imagePath</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="s2">&quot; &quot;</span><span class="p">,</span> <span class="s2">&quot;</span><span class="se">\\</span><span class="s2"> &quot;</span><span class="p">)</span>
</span><span class='line'><span class="n">image_name</span> <span class="o">=</span> <span class="n">source_path</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot;/&quot;</span><span class="p">)</span><span class="o">[-</span><span class="mi">1</span><span class="o">]</span>
</span><span class='line'><span class="n">destination_folder</span> <span class="o">=</span> <span class="s2">&quot;</span><span class="si">#{</span><span class="n">blog_path</span><span class="si">}#{</span><span class="n">images_path</span><span class="si">}#{</span><span class="n">date_string</span><span class="si">}</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="s2">&quot; &quot;</span><span class="p">,</span> <span class="s2">&quot;</span><span class="se">\\</span><span class="s2"> &quot;</span><span class="p">)</span>
</span><span class='line'><span class="n">destination_path</span> <span class="o">=</span> <span class="s2">&quot;</span><span class="si">#{</span><span class="n">destination_folder</span><span class="si">}</span><span class="s2">/</span><span class="si">#{</span><span class="n">image_name</span><span class="si">}</span><span class="s2">&quot;</span>
</span><span class='line'>
</span><span class='line'><span class="n">ensure_dir_cmd</span> <span class="o">=</span> <span class="s2">&quot;mkdir -p </span><span class="si">#{</span><span class="n">destination_folder</span><span class="si">}</span><span class="s2">&quot;</span>
</span><span class='line'><span class="nb">puts</span> <span class="n">ensure_dir_cmd</span>
</span><span class='line'><span class="nb">system</span> <span class="n">ensure_dir_cmd</span>
</span><span class='line'>
</span><span class='line'>
</span><span class='line'><span class="n">convert_cmd</span> <span class="o">=</span> <span class="s2">&quot;</span><span class="si">#{</span><span class="n">convert</span><span class="si">}</span><span class="s2"> </span><span class="si">#{</span><span class="n">source_path</span><span class="si">}</span><span class="s2"> -resize </span><span class="si">#{</span><span class="n">max_width</span><span class="si">}</span><span class="s2">x2000 </span><span class="si">#{</span><span class="n">destination_path</span><span class="si">}</span><span class="s2">&quot;</span>
</span><span class='line'><span class="nb">puts</span> <span class="n">convert_cmd</span>
</span><span class='line'><span class="nb">system</span> <span class="n">convert_cmd</span>
</span><span class='line'>
</span><span class='line'><span class="no">IO</span><span class="o">.</span><span class="n">popen</span><span class="p">(</span><span class="s1">&#39;pbcopy&#39;</span><span class="p">,</span> <span class="s1">&#39;w&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">print</span> <span class="s2">&quot;</span><span class="si">#{</span><span class="n">images_path</span><span class="si">}#{</span><span class="n">date_string</span><span class="si">}</span><span class="s2">/</span><span class="si">#{</span><span class="n">image_name</span><span class="si">}</span><span class="s2">&quot;</span>
</span></code></pre></td></tr></table></div></figure>


<p>Ruby is a much more sensible language, and this, to me, is a lot easier to follow. I&#8217;m fairly new to Ruby, so this might not actually be the most Ruby-ish way of doing it, mind. It should be noted that it will only work with <a href="http://www.macruby.org/">MacRuby</a>, though. You will also need <a href="http://www.imagemagick.org/script/index.php">ImageMagick</a> installed. I made this executable with a quick <code>chmod +x</code> and moved it to the iPhoto scripts folder as well, where it seems to work just fine. So now I have two options. Hopefully, someone out there finds this useful.</p>

<p>Finally, to prove it works, and because it feels a little strange to not actually have any pictures in this entry: here&#8217;s a nice shot taken at Kew Gardens (which hopefully I&#8217;ll talk about more later):</p>

<p><img class="center" src="http://www.harveynick.com/images/blog/2012/04/14/IMG_0442.JPG"><!-- header_img /images/blog/2012/04/14/IMG_0442.JPG --></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Origin Story, Raspberry Pi, and the ZX Spectrum]]></title>
    <link href="http://www.harveynick.com/blog/2012/03/27/origin/" />
    <updated>2012-03-27T23:41:00+01:00</updated>
    <id>http://www.harveynick.com/blog/2012/03/27/origin</id>
    <content type="html"><![CDATA[<p>One of the fun things about working for Google is that from time to time interesting people come into the office to give talks. We had Richard Dawkins a few weeks ago, who gave an interesting if… uncompromising talk. Yesterday we had one of the founders of the <a href="http://www.raspberrypi.org/">Raspberry Pi</a> foundation. For those of you who aren&#8217;t aware, the Raspberry Pi is an extremely small (exactly credit card sized) and cheap ($25), yet very capable computing platform. The foundation is the charity formed to produce this hardware.</p>

<p>Why is a charity building computer hardware? Because there is a need for it, caused by a problem you&#8217;re possibly not even aware of. Let me explain; for I am part of the problem. These days when I play computer games it&#8217;s usually on my X-Box or iPhone. They make my life very easy in this regard, since I never have to worry about whether a game will actually run or not. It just works. They are essentially closed systems, though. There is a reasonably high barrier to entry if I actually want to start playing with them as a developer. Specifically: I can&#8217;t do it on the device itself. Furthermore, the very simplicity of the device works against me in this regard, because very little action on my part is required to make it work.</p>

<p>It was not always this way. Let me tell you a story.</p>

<!-- more -->


<p>When I was 9 years old (I think), my parents bought me a <em>Sinclair ZX Spectrum +2A</em> computer. It&#8217;s highly likely those words mean nothing to you. It looked like this:</p>

<p><img class="center" src="http://upload.wikimedia.org/wikipedia/commons/thumb/6/6a/Spectrum_128-2.png/800px-Spectrum_128-2.png"><!-- header_img http://upload.wikimedia.org/wikipedia/commons/thumb/6/6a/Spectrum_128-2.png/800px-Spectrum_128-2.png --></p>

<p>Truly, it was a wondrous machine, with its 128kB of memory and complete lack of long term storage, and I was utterly thrilled with it. I&#8217;m a nerd. Of course I was. They also bought me a joystick, and a copy of <em>Teenage Mutant Ninja Turtles</em>. To load this game, you placed the tape (yes, as in audio cassette) into the drive and hit play, having selected the right option from the machine&#8217;s opening menu. You then wandered off for a while to let the machine screech and whine away to itself while it loaded the game. Partly for this reason I quickly tired of the game. I got others eventually, but I was a curious and easily bored child, so I started to read the manual which came with the system.</p>

<p>The vast majority of this was actually a guide to programming in the version of the <a href="http://en.wikipedia.org/wiki/BASIC">BASIC</a> (Beginners&#8217; All Purpose Symbolic Instruction Code) supported by the <em>+2A</em>. I read it, and I started to tinker. The <em>Sinclair</em> gave you essentially three options after booting:</p>

<ol>
<li>Loading a program from tape;</li>
<li>Program in +2A mode;</li>
<li>Program in 48k mode.</li>
</ol>


<p>The first two are fairly straight forward, but the third was a bit of an odd beast. It emulated the older <em>ZX Spectrum 48k</em>, which looked like this:</p>

<p><img class="center" src="http://upload.wikimedia.org/wikipedia/commons/thumb/3/33/ZXSpectrum48k.jpg/800px-ZXSpectrum48k.jpg"></p>

<p>You might notice that there seems to be an awful lot of extra writing on those keys. This is because each key had one or more BASIC keywords bound to it. In 48k mode you couldn&#8217;t just type your program, you have to press the right key for the keyword you were looking for. This could be fast, or it could be <em>slow</em>. Especially if your keyboard lacked this extra data.</p>

<p>The <em>Spectrum</em> also had one or two other interesting quirks. For example, take a look at this screen shot from the classic <em>Treasure Island Dizzy</em>:</p>

<p><img class="center" src="http://upload.wikimedia.org/wikipedia/en/4/44/Treasure_Island_Dizzy.png"></p>

<p>For a start, this screen shot is showing fully more than half of the colours the <em>Sinclair</em> was capable of producing. Secondly, you might notice that there&#8217;s something slightly odd about the distribution of these colours. Specifically: each block of 8x8 pixels contains at most two, because this was the maximum allowed. Given the limitations of the system, you had to be quite creative if you wanted to produce something worthwhile. Nevertheless, it happened. Not by me, though, because I did very little more than tinker with it.</p>

<p>It did give me a feel for programming, such that I knew more or less what was expected of me when I arrived at Edinburgh University to study Computer Science, though. A course which did its level best to beat every last scrap of BASIC out of me, because BASIC, quite frankly, is a horrible language. It was a reasonable place to start, though, and it was how I started out, so I guess it wasn&#8217;t all bad.</p>

<p>Today&#8217;s computers are clearly a lot easier to use than the <em>Spectrum</em> ever was. For the general consumer, this is a very good thing (in my opinion), because you should not need to be a software engineer to operate one any more than you should need to be a mechanic to operate a car. I don&#8217;t own any general purpose computers which aren&#8217;t made by Apple. As a result (I would say), operating my computer requires an extremely low amount of hassle. I don&#8217;t need to know how it works. If I did want to do some programming, in the simplest possible case, I could follow these steps:</p>

<ol>
<li>Push &lt;CMD> + &lt;Space></li>
<li>Type &#8220;Terminal&lt;Enter>&#8221;</li>
<li>Wait a moment for the terminal to load</li>
<li>Type &#8220;python&lt;Enter>&#8221;</li>
</ol>


<p>I can now start fiddling with the <a href="http://python.org">Python</a> programming language, which is a much better place to start than BASIC ever was. A more likely scenario is that I might have to load a couple of other programs to help me, such as a good programmer&#8217;s text editor. The point here is that I would have to know how to get my computer in this state in the first place, though. It&#8217;s not front and centre as soon as I turn it on. The <em>Spectrum</em> <a href="http://en.wikipedia.org/wiki/Affordance">afforded</a> programming in ways that modern computers don&#8217;t. As a result, a curious youngster is much less likely to start tinkering with their computer than they might have been *cough* 21 years ago *cough*.</p>

<p>Modern computers are very much not toys, at least not in the way a bucket of Lego bricks is. They are expensive pieces of equipment. You don&#8217;t don&#8217;t want kids carrying them backwards and forwards from school. Which is where the Raspberry Pi comes in. It is designed to be played with, and cheap enough that if play gets rough and the system breaks it&#8217;s not actually that much of a big deal. It might be quite important for the economy of the UK (and perhaps your country too) that children start playing with computers again. Playing the way you can play with Lego, not the way you play with Action Man. Building things; breaking them; building them again: better.</p>

<p><img class="center" src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/9c/Raspberry_Pi_Beta_Board.jpg/800px-Raspberry_Pi_Beta_Board.jpg"></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[New (ish) Year, New (ish) Blog]]></title>
    <link href="http://www.harveynick.com/blog/2012/03/17/new-ish-year-new-ish-blog/" />
    <updated>2012-03-17T11:22:00+00:00</updated>
    <id>http://www.harveynick.com/blog/2012/03/17/new-ish-year-new-ish-blog</id>
    <content type="html"><![CDATA[<p>2011 was an interesting year for me. A lot changed. I turned 30. After 10 years of residency I moved away from Edinburgh, a city I love dearly, and took a job in London. With <a href="http://www.harveynick.com/blog/tags/google">Google</a>. As a result, I no longer work with <a href="http://www.harveynick.com/blog/tags/autonomous-underwater-vehicles">Autonomous Underwater Vehicles</a> for a living. Instead I build web services. Quite the change, I&#8217;m sure you&#8217;ll agree. In the early months of the year I finally completed the corrections to my <a href="http://www.harveynick.com/blog/tags/phd">PhD</a>, and then in the summer: I graduated. It took 6 years (all together) but I am now Dr. Nick Johnson. I also <a href="http://www.harveynick.com/blog/2011/07/18/the-sound-of-one-hand-clapping/">lost my grandmother</a>, a fact which still brings me to tears on occasion.</p>

<p>In this light, the fact that I decided, towards the end of the year, to shift my blog away from <a href="http://wordpress.org">Wordpress</a> and over to its own domain barely even casts a shadow. I did, though, and as a result you&#8217;re now reading these words on a site built using <a href="http://octopress.org">Octopress</a>, which is hosted at harveynick.com. As you may have noticed, all of the old posts from my <a href="http://harveynick.wordpress.com">wordpress site</a> have been ported over, minus the short film reviews, which you&#8217;ll find <a href="http://ohsohumbleopinion.tumblr.com">here</a>. I&#8217;m not going to go into how I accomplished this, except to say: I did it the same way <a href="http://mattgemmell.com/2011/09/12/blogging-with-octopress/">Matt Gemmel did</a>.</p>

<!-- more -->


<p><span class='pullquote-right' data-pullquote='It&#8217;s not finished, but it will serve well enough for me to try and start producing actual content again'>
For the most part, this site is stock Octopress. I&#8217;ve played with the fonts, made the heading and background static and added a little more infrastructure (index pages for tags, embed scripts for YouTube and Vimeo videos and a couple of other bits). It&#8217;s not finished, but it will serve well enough for me to try and start producing actual content again. I do want to make it a bit more visual, particularly the front page, and somehow integrate other content I produce into it. I also want to make it work a little better on mobile browsers and, lastly, make it a little bit more my own. The colours will change, and I&#8217;ll try to find a background which doesn&#8217;t require such a large file and isn&#8217;t so closely associated with Apple.
</span></p>

<p>What will I be writing about though? Well:</p>

<p>I plan to have <a href="http://www.harveynick.com/blog/tags/clockwork-aphid">Clockwork Aphid</a> actually doing something of use this year. I&#8217;m going to enhance the current Java version up to a point where it can generate interesting landscapes efficiently and in a parallel fashion. I&#8217;m then going to then have a crack at porting it to <a href="http://golang.org">Go</a>, which I think may turn out to be an excellent language for writing computer games.</p>

<p>I like films. Perchance you may have noticed. I may chat a bit more in depth about a couple of this year&#8217;s releases. Just to pick three with a common theme off the top of my head:</p>

<ul>
<li><strong>The Amazing Spider-Man</strong>. I went to a preview event for this in Leicester Square a month or two ago and was very impressed with what I saw. I&#8217;m hopeful they made a Spider-Man movie in the same way that Christopher Nolan makes Batman movies. Really really.</li>
<li><strong>The Dark Knight Rises</strong>. Speaking of which. This <em>is</em> exciting. It&#8217;s the last of the trilogy. It&#8217;s got a lot to live up to, especially since the last film Nolan made was <em>Inception</em>. I wouldn&#8217;t bet against it, though.</li>
<li><strong>The Avengers</strong>. Now here&#8217;s a film with some scope. All these characters in one film? With this cast? Written and directed by <a href="http://en.wikipedia.org/wiki/Joss_Whedon">Joss Mother Fucking* Whedon</a>? Please, please let this film live up to the frankly stupid amount of potential it has.</li>
</ul>


<p>Quite recently, at the aforementioned age of 30, I started playing Dungeons and Dragons with a selection of my colleagues. Well, we&#8217;re actually playing <a href="http://en.wikipedia.org/wiki/Pathfinder_Roleplaying_Game">Pathfinder</a>, but let us not quibble about semantics. I&#8217;m having a really great time on several different levels. It&#8217;s an interesting experience for someone who has played computer games for most of their life, but never dabbled in table top RPGs.</p>

<p>I mentioned before that I now have a shiny new PhD, with the letters before and after my name to prove it. I&#8217;m of the opinion that the work which led to this is quite interesting (but then I would be). It&#8217;s also not completely divorced from my Clockwork Aphid project. I&#8217;m of a mind to try talking about this some, also.</p>

<p>See you when we get there.</p>

<p>* I think these are his actual middle names.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Simplifying the Landscape]]></title>
    <link href="http://www.harveynick.com/blog/2011/12/01/simplifying-the-landscape/" />
    <updated>2011-12-01T09:28:05+00:00</updated>
    <id>http://www.harveynick.com/blog/2011/12/01/simplifying-the-landscape</id>
    <content type="html"><![CDATA[<p>At the end of the <a href="http://www.harveynick.com/blog/2010/10/22/now-in-eye-popping-3d/">last post</a> I wrote about the actual implementation of my Clockwork Aphid project, I said the next step was going to be display simplification. At that point I&#8217;d generated a few landscapes which were just starting barely starting to test the limits of my computer, though they were nothing like the size or complexity I had in mind. That said, it was looking at landscapes containing 1579008 polygons and it was obvious that not all of these needed to be put on screen. Moreover, because my landscapes are essentially made up of discrete samples (or nodes): I needed to reduce the number of samples which were displayed to the user, otherwise my performance was really going to tank as the landscapes increased in size.</p>

<!-- more -->


<p>Shamus Young talked about terrain simplification <a href="http://www.shamusyoung.com/twentysidedtale/?p=142">some time ago</a> during his original terrain project. This seemed as good a place as any to start, so I grabbed a copy of <a href="http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.14.4771">the paper</a> he used to build his algorithm. I didn&#8217;t find it as complicated as it appears he did, but this is probably because I&#8217;m more used to reading papers like this (I must have read hundreds during my PhD, and even wrote a couple), so I&#8217;m reasonably fluent in academicese. It was, as I suspected, a good starting point, though I wouldn&#8217;t be able to use the algorithm wholesale as it&#8217;s not directly compatible with the representation I&#8217;m using. Happily, my representation does make it very simple to use the core idea, though.</p>

<p>If you <a href="http://www.harveynick.com/blog/2010/10/19/youre-speaking-my-landscape-baby/">remember</a>, my representation stores the individual points in a sparse array, indexed using fractional coordinates. This makes it very flexible, and allows me to use an irregular level of detail (more on that later). Unlike the representation used in the paper, this means a can&#8217;t make optimisations based on the assumption that my data is stored in a regular grid. Thankfully, the first stage of the simplification algorithm doesn&#8217;t care about this and examines points individually. Also thankfully, the simplification algorithm uses the same parent/child based tessellation strategy that I do.</p>

<p>The first step is decide which points are &#8220;active&#8221;. This is essentially based on two variables:</p>

<ul>
<li>The amount of &#8220;object space error&#8221; a point has (i.e. how much it differs from its parents);</li>
<li>The distance between the point and the &#8220;camera&#8221;.</li>
</ul>


<p>A local constant is also present for each point:</p>

<ul>
<li>The point&#8217;s bounding radius, or the distance to its furthest child (if it has children);</li>
</ul>


<p>I&#8217;m not sure if I actually need this last in my current implementation (my gut says no, I&#8217;ll explain why later), but I&#8217;m leaving it in for the time being. Finally, two global constants are used for tuning, and we end up with this:</p>

<p><img class="center" src="http://harveynick.files.wordpress.com/2011/12/simplificationequation21.png"></p>

<p>Where:</p>

<ul>
<li><em>i</em> = the point in question</li>
<li><em>λ</em> = a constant</li>
<li><em>ε<sub>i</sub></em> = the object space error of <em>i</em></li>
<li><em>d<sub>i</sub></em> = the distance between <em>i</em> and the camera</li>
<li><em>r<sub>i</sub></em> = the bounding radius of <em>i</em></li>
<li><em>τ</em> = another constant</li>
</ul>


<p>This is not entirely optimal for processing, but a little bit of maths wizardry transforms this like so:</p>

<p><img class="center" src="http://harveynick.files.wordpress.com/2011/12/simplificationequation31.png"></p>

<p>This looks more complicated, and it&#8217;s less intuitive to see what it actually does, but from the point of view of the computer it&#8217;s a lot simpler, as it avoids the square root needed to calculate the distance between the point and the camera. Now we get to the fun part: diagrams! Consider the following small landscape, coloured as to the granularity of each of the points (aka the distance to the node&#8217;s parents, see <a href="http://www.harveynick.com/blog/2010/10/22/fractal-errata/">this post</a>):</p>

<p><img class="center" src="http://harveynick.files.wordpress.com/2011/12/allpoints.jpg"></p>

<p>Next, we&#8217;ll pick some arbitrary values for the constants mentioned above (ones which work well for explanatory purposes), and place the viewpoint in the top left hand corner, and we end up with this the following active points (inactive points are hidden):</p>

<p><img class="center" src="http://harveynick.files.wordpress.com/2011/12/activepoints.jpg"></p>

<p>Now, we take the active points with the smallest granularity, and we have them draw their polygons, <a href="http://www.harveynick.com/blog/2010/10/22/now-in-eye-popping-3d/">exactly as before</a>, which looks like this:</p>

<p><img class="center" src="http://harveynick.files.wordpress.com/2011/12/smallestpolygons.jpg"></p>

<p>When we come to draw the polygons of the next highest granularity you&#8217;ll see that we have a problem, though. The previous set of polygons have encroached on their territory. To avoid this, each node informs its parents that it is active and then the parent doesn&#8217;t draw any polygons in the direction of its active children. If we add in the polygons drawn by the each of the other levels of granularity, we now end up with this:</p>

<p><img class="center" src="http://harveynick.files.wordpress.com/2011/12/filledpolygons.jpg"></p>

<p>Oh no! There&#8217;s a hole in my landscape! I was actually expecting that my simplistic approach would lead to more or less this result, but it was still a little annoying when it happened. If I was a proper analytical type I would next have sat down and worked over the geometry at play here, then attempted to find a formulation which would prevent this from happening. Instead, though, I stared at it for a good long while, displaying it in various different ways, and waited for something to jump out at me.</p>

<p>Eventually it did, and thankfully it was a very simple rule. Each parent stores a list of the directions in which it has active children in order to prevent overdrawing (as mentioned above). The new rule is that a node is also considered active if this list is non-empty. With this addition, our tessellated landscape now look alike this:</p>

<p><img class="center" src="http://harveynick.files.wordpress.com/2011/12/backfilledpolygons.jpg"></p>

<p>Presto! A nice simple rule which fills in all of the gaps in the landscape without any over or under simplification, or any overdrawing. I suspect this rule also negates the need for the bounding radius mentioned above, though I have not as yet tested that thought. To recap, we have three simple rules:</p>

<ol>
<li>A node is active if the object space error/distance equation says it is;</li>
<li>A node is active if any of its children are active;</li>
<li>Polygons are tessellated for each active point, but not in the direction of any active children.</li>
</ol>


<p>But what does this look like in actual eye poppingly 3D landscapes? Well, here&#8217;s an example, using the height based colouring I&#8217;ve used before:</p>

<p><img class="center" src="http://harveynick.files.wordpress.com/2011/12/simplifiedlandscape.jpg"><!-- header_img http://harveynick.files.wordpress.com/2011/12/simplifiedlandscape.jpg --></p>

<p>I&#8217;m quite pleased with this, though what I&#8217;m doing here is still quite inefficient and in need of some serious tuning. There are a couple of further simplification tricks I can try (including the next step from the (paper) paper). More to come later. Honest.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Mercury Rising]]></title>
    <link href="http://www.harveynick.com/blog/2011/09/20/mercury-rising/" />
    <updated>2011-09-20T10:00:44+01:00</updated>
    <id>http://www.harveynick.com/blog/2011/09/20/mercury-rising</id>
    <content type="html"><![CDATA[<p>Monday the 5th of September was Freddie Mercury day. The day he would have turned 65, had he lived. This makes me feel a little old, but that&#8217;s not the point. The day&#8217;s <a href="http://www.youtube.com/watch?v=KX2BQM0D01M">Google doodle</a> (pointed out to me with furious glee by one of my coworkers) led me to YouTube and numerous videos of Queen performing live. As I often do, I&#8217;d forgotten just how good they were. I spent much of the day fighting the urge to pump my fist and throw shapes at my desk*. Since I had so much fun with this, I&#8217;m going to pepper this post with some of the videos I found the most fun. Anything under the videos and written in italics is a comment on the video itself, and not strictly related to the rest of this post.</p>

<!-- more -->




<iframe src="http://www.youtube.com/embed/LncAQR47eZo" width="" height="" frameborder="0" allowfullscreen></iframe>


<p><em>If you have to start somewhere, you might as well start here. File under: moments which made history.</em></p>

<p>As I was walking to the cinema yesterday to see <a href="http://ohsohumbleopinion.tumblr.com/post/10360864080/tinker-tailor-soldier-spy">Tinker Tailer Soldier Spy</a>, I found myself thinking back to the Queen videos, but also to the <a href="http://www.harveynick.com/blog/2011/08/07/film-related-blog-post/">post</a> I previously wrote about how much I hated the last two Transformers films, and how much I adored Fast 5. I started wondering if a person&#8217;s taste in music might be reflected in their taste in film. I have fairly eclectic fast in music. I like a bit of <em>Dido</em>, a bit of <em>Bjork</em>. I love me some <em>Avenged Sevenfold</em> and some <em>In Flames</em>. I&#8217;m as likely to throw on a bit of <em>Massive Attack</em> as I am a bit of <em>Linkin Park</em>. Today I might be listening to <em>At The Drive-In</em>, where as on my walk yesterday my choice of backdrop was <em>Spiritual Beggars</em>. Like my mother before me, I&#8217;m also a bit of a Queen fan.</p>

<iframe src="http://www.youtube.com/embed/oozJH6jSr2U" width="" height="" frameborder="0" allowfullscreen></iframe>


<p><em>Obviously I have to include this one. Queen at their operatic best.</em></p>

<p>When challenged to name my favourite films, I&#8217;ve been picking the same five for quite some time (in no particular order):</p>

<ul>
<li>Fight Club;</li>
<li>American Beauty;</li>
<li>Donnie Darko;</li>
<li>Amelie;</li>
<li>The Matrix.</li>
</ul>


<p>I might also offer up three others I really love:</p>

<ul>
<li>Out of Sight;</li>
<li>Pitch Black;</li>
<li>X-Men**.</li>
</ul>


<p>Perhaps I might also add the first <em>Pirates of the Caribbean</em> film (or maybe <em>Zoolander</em>) to that list. Be that as it may, I&#8217;d say the list is reasonably eclectic. Not entirely evident in this list is my love of a really good action movie. <em>Bad Boys</em>. <em>The Transporter. Rambo (2008). Fast 5. Demolition Man. Army of Darkness. Welcome to the Jungle. The Long Kiss Goodnight. Die Hard.</em> I&#8217;m not going to try and match items from my musical taste to each of the films I&#8217;ve named here, because I don&#8217;t think the analogy is that exact, but I think Queen serves as an excellent peer to these action films.</p>

<iframe src="http://www.youtube.com/embed/kXOOwNS2qk0" width="" height="" frameborder="0" allowfullscreen></iframe>


<p><em>I love this intro. That is how you work a crowd.</em></p>

<p>Freddie Mercury did not so much walk around the stage as stay perfectly still at the centre of everyone&#8217;s vision while the stage moved around him. He worked the crowd like a master while knocking every single note right out of the stadium. It wasn&#8217;t just about him, though. The band behind him was as tight as a gnat&#8217;s arse. Everything clicked together like the internals of a cuckoo clock. Queen songs were not generally high art, but they flowed brilliantly and they just <em>took hold</em> of you.</p>

<p>This is how a good action film should be. I want the characters to chew the scenery and have it feel right. I want the characters to be fleshed out enough to feel worthwhile. They don&#8217;t have to be Lester Burnham or Jack Foley, but I do need to give a shit about what happens to them. The plot should feel, if not possible, then plausible. If something doesn&#8217;t quite make sense then it should be okay because I&#8217;m having too much fun to care. I want to laugh joyously at the outrageousness of it. I want to feel like pumping my fist along with the protagonists&#8217; success and then leave the cinema with a huge smile on my face. I&#8217;ll listen to some Emilíana Torrini soon, there&#8217;ll be time enough for that later. Right now, <em>we are the champions</em>, baby!</p>

<iframe src="http://www.youtube.com/embed/pCA6b36pCro" width="" height="" frameborder="0" allowfullscreen></iframe>


<p><em>A beautiful, melancholic and very appropriate song. Seems like a good place to stop.</em></p>

<p>* For the record: conversation with my coworkers has revealed to me that had I done so, I could simply have told them I was listening to a bit of Queen and this otherwise odd behaviour would have become at least marginally understandable.</p>

<p>** Yes, the first one. It has a wonderful lightness of touch and flow, which, though it doesn&#8217;t excuse the film&#8217;s complete lack of a third act, does make it very dear to me.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Revisiting the Language Issue]]></title>
    <link href="http://www.harveynick.com/blog/2011/09/14/revisiting-the-language-issue/" />
    <updated>2011-09-14T10:00:14+01:00</updated>
    <id>http://www.harveynick.com/blog/2011/09/14/revisiting-the-language-issue</id>
    <content type="html"><![CDATA[<p>Some time ago, I wrote a <a href="http://www.harveynick.com/blog/2010/10/09/youre-speaking-my-language-baby-part-1-introduction/">series</a> <a href="http://www.harveynick.com/blog/2010/10/10/youre-speaking-my-language-baby-part-2-java/">of</a> <a href="http://www.harveynick.com/blog/2010/10/11/youre-speaking-my-language-baby-part-3-c/">posts</a> <a href="http://www.harveynick.com/blog/2010/10/12/youre-speaking-my-language-baby-part-4-objective-c/">about</a> <a href="http://www.harveynick.com/blog/2010/10/13/youre-speaking-my-language-baby-part-5-conclusion/">language</a> choice for my Clockwork Aphid project. In the end I decided to start the project in Java, this being the language I&#8217;m most comfortable with. Once the project reaches a stable state, with some minimum amount of functionality, the plan is to port it to C++ for comparison purposes, this being the language which is likely to provide the best performance.</p>

<p>I still plan on doing this, but I&#8217;ve also decided to add a couple of extra candidate languages to the melting pot and get an even broader comparison. The first of these languages is Go, a relatively new language developed at Google. This is not coincidence. I&#8217;ve been doing some reading about it lately and finding a lot of things I really like. It has the potential to provide the benefits of both Java <em>and</em> C++, whilst avoiding many of the pitfalls. This is definitely a good thing. It will also give me chance to dogfood (there&#8217;s <a href="http://www.harveynick.com/blog/2011/08/26/dogfood-nom-nom-nom/">that word</a> again!) some more Google technology.</p>

<!-- more -->


<p>One of Go&#8217;s features which I really like is implicit interfaces. Allow me to explain. In most regular statically typed object orientated languages, such as Java (which I&#8217;ll use for this example), you can abstract functionality using something like an interface. For example, let&#8217;s say I have a class which looks like this:</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>
</pre></td><td class='code'><pre><code class='java'><span class='line'><span class="kd">class</span> <span class="nc">Counter</span> <span class="o">{</span>
</span><span class='line'>  <span class="kt">int</span> <span class="n">value</span><span class="o">;</span>
</span><span class='line'>  <span class="kt">int</span> <span class="nf">get</span><span class="o">()</span> <span class="o">{</span>
</span><span class='line'>    <span class="k">return</span> <span class="n">value</span><span class="o">;</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'><span class="o">}</span>
</span></code></pre></td></tr></table></div></figure>


<p>Here we have defined an class which declares a single method which returns an integer value. I might then make use of this an instance of this class elsewhere:</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>
</pre></td><td class='code'><pre><code class='java'><span class='line'><span class="kd">class</span> <span class="nc">Printer</span> <span class="o">{</span>
</span><span class='line'>  <span class="kt">void</span> <span class="nf">update</span><span class="o">(</span><span class="n">Counter</span> <span class="n">counter</span><span class="o">)</span> <span class="o">{</span>
</span><span class='line'>  <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">counter</span><span class="o">.</span><span class="na">get</span><span class="o">());</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'><span class="o">}</span>
</span></code></pre></td></tr></table></div></figure>


<p>All is good with the world, unless I decide I want to change the behaviour of the code. Perhaps I want the value to increment after each call, for example. I could extend the Counter class and change its behaviour that way:</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>
</pre></td><td class='code'><pre><code class='java'><span class='line'><span class="kd">class</span> <span class="nc">IncrementingCounter</span> <span class="kd">extends</span> <span class="n">Counter</span> <span class="o">{</span>
</span><span class='line'>  <span class="kt">int</span> <span class="nf">get</span><span class="o">()</span> <span class="o">{</span>
</span><span class='line'>  <span class="k">return</span> <span class="n">value</span><span class="o">++;</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'><span class="o">}</span>
</span></code></pre></td></tr></table></div></figure>


<p>I can now pass an instance of this new class into the update method of the Handler. Done. Right? Well&#8230; no. This is a bit of a clumsy way to go about this. It doesn&#8217;t scale and it&#8217;s not always possible. A better way to handle this is to use an interface:</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>
</pre></td><td class='code'><pre><code class='java'><span class='line'><span class="kd">interface</span> <span class="nc">CounterInterface</span> <span class="o">{</span>
</span><span class='line'>  <span class="kt">int</span> <span class="nf">get</span><span class="o">();</span>
</span><span class='line'><span class="o">}</span>
</span></code></pre></td></tr></table></div></figure>


<p>This specifies the interface of the methods, but not their implementation. We can then change the Printer class to use this interface, rather than the concrete class:</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>
</pre></td><td class='code'><pre><code class='java'><span class='line'><span class="kd">class</span> <span class="nc">Printer</span> <span class="o">{</span>
</span><span class='line'>  <span class="kt">void</span> <span class="nf">update</span><span class="o">(</span><span class="n">CounterInterface</span> <span class="n">counter</span><span class="o">)</span> <span class="o">{</span>
</span><span class='line'>  <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">counter</span><span class="o">.</span><span class="na">get</span><span class="o">());</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'><span class="o">}</span>
</span></code></pre></td></tr></table></div></figure>


<p>Now any class which implements this interface can be passed to the Printer. So, going to back to our original example:</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>
</pre></td><td class='code'><pre><code class='java'><span class='line'><span class="kd">class</span> <span class="nc">Counter</span> <span class="kd">implements</span> <span class="n">CounterInterface</span> <span class="o">{</span>
</span><span class='line'>  <span class="kt">int</span> <span class="n">value</span><span class="o">;</span>
</span><span class='line'>  <span class="kt">int</span> <span class="nf">get</span><span class="o">()</span> <span class="o">{</span>
</span><span class='line'>  <span class="k">return</span> <span class="n">value</span><span class="o">;</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'><span class="o">}</span>
</span></code></pre></td></tr></table></div></figure>


<p>We can now make any number of alternative implementations (incrementing, decrementing, random, fibronatchi…) and as long as they implement the interface they can be passed to the printer. This is fine if you&#8217;re in control of the implementation, and even more fine if you&#8217;re in control of the interface as well. There are times, however, when you&#8217;re in change of neither. Things can get a little messy and you may have to find a way of pushing a round peg through a square hole.</p>

<p>In dynamically typed languages, such as Python and Ruby, things work a little differently. These languages are often referred to as being &#8220;duck&#8221; typed, as they make the assumption that if something &#8220;looks like a duck and quacks like a duck, treat it as though it&#8217;s a duck.&#8221; In this case we wouldn&#8217;t bother with any of the interfaces and our Printer class would look more like this:</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>
</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="k">class</span> <span class="nc">Printer</span><span class="p">:</span>
</span><span class='line'>  <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="n">counter</span><span class="p">):</span>
</span><span class='line'>    <span class="k">print</span> <span class="n">counter</span><span class="o">.</span><span class="n">get</span><span class="p">()</span>
</span></code></pre></td></tr></table></div></figure>


<p>So long as the counter object has a method called get() we don&#8217;t have a problem. Everything will be fine. This is much simpler, and is one of the things which makes Python very quick to program in, but it does have problems. The main problem (for me, at least) is specification. Without examining the source code, I can&#8217;t see what sort of object I have to pass into the update method. If the method has been manually commented then there&#8217;s no problem, but this is an incredible tedious thing to have to do. In the Java code I can see the type right there in the auto-generated documentation, and even if the writer has written no comments at all (what a bastard!) I can still get a good idea of what I need to pass into the method.</p>

<p>Go takes a different approach. It&#8217;s statically typed, and it has interfaces, but a class doesn&#8217;t need to state that it implements an interface. This is implicit and automatic. If a class has the methods defined in an interface, then it is automatically considered to implement it. You get the flexibility of Python with the specification and predicability of Java. This is just one of the things in Go which I think is a really good idea.</p>

<p>On the other hand, I think functional programming is a really stupid idea. I find the languages to be completely horrendous. I feel they must be created by the sort of people who think Linux is user friendly. I consider them curiosities whose only merit is academic. It appears to me that their major use case is to make programming appear more obscure than it actually is and to abstract way the programmer&#8217;s knowledge of what the computer is actually doing.</p>

<p>You may be surprised to learn, then, that the third language I&#8217;m going to be trying to port Clockwork Aphid into is Scala, a functional programming language. The reason for this is simple: while I personally believe that functional programming (FP) is rubbish, many people disagree. Not a majority, but certainly a very vocal minority. Within Google this minority is very vocal in indeed. The word &#8220;fundamentalists&#8221; might be appropriate to describe them. When someone believes something that hard it makes me very curious. This is turn tends to lead me towards testing my own beliefs. Sometimes I discover something new and exciting which I was missing out on previously*, and sometimes my initial suspicions are confirmed**. We&#8217;ll see which way it goes with Scala.</p>

<p>* Such as the Harry Potter books, which I had stubbornly refused to read until just before the first film was released.<br/>
** Such as when I noticed that the Twilight books had taken up the first four places on the Waterstone&#8217;s chart and decided I aught to find out what all the fuss was about.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[The Ol' Homestead]]></title>
    <link href="http://www.harveynick.com/blog/2011/09/11/the-ol-homestead/" />
    <updated>2011-09-11T16:59:41+01:00</updated>
    <id>http://www.harveynick.com/blog/2011/09/11/the-ol-homestead</id>
    <content type="html"><![CDATA[<p>You may or may not be aware that, though I now lived in London and previously lived in Edinburgh, I&#8217;m originally from South Yorkshire. Since I visited my parents this weekend for my father&#8217;s 60th birthday*, I though I&#8217;d take a moment to talk about a couple of Yorkshire related titbits which have crossed my mind recently.</p>

<p>The first is the fact that no matter how far you go from your your roots, they have a way of inserting themselves into your life in unexpected places. The other day (or &#8220;t&#8217;other day&#8221; if we&#8217;re going to be properly Yorkshire about this) I was walking through Waterloo train station on my way to meet some friends for dinner. There&#8217;s a theatre attached to the station which is showing &#8220;The Railway Children&#8221;, and thus it has been named &#8220;The Yorkshire Theatre&#8221;. Next to the theatre is a booth organised by &#8220;Visit Yorkshire&#8221;, which is essentially the Yorkshire Tourist Board. As is often the case with these booths, it has a couple of large posters showing sights intended to entice you to… well… visit Yorkshire.</p>

<!-- more -->


<p>So far, so normal, but the beautiful yet ruined abbey in one of the pictures looked very familiar indeed. In fact, it looked a lot like the very beautiful yet ruined abbey just outside my otherwise almost entirely unremarkable home town. A little bit of Googling later and I confirmed that, sure enough, there was a great big picture of Roche Abbey sitting in Waterloo train station. See for yourself:</p>

<p><img class="center" src="http://www.ntopsearch.com/media/images/f/f/ffba50d6-a214-4204-8fe8-9562dae62447/ffba50d6-a214-4204-8fe8-9562dae62447.jpg"><!-- header_img http://www.ntopsearch.com/media/images/f/f/ffba50d6-a214-4204-8fe8-9562dae62447/ffba50d6-a214-4204-8fe8-9562dae62447.jpg --></p>

<p>Maltby was once a proud coal mining town, but those days are very much gone. Now it&#8217;s mostly a hub for people who commute into the surrounding larger towns and cities. There&#8217;s not a lot here. To my knowledge, not even a Starbucks or Subway. Thus, it was a pleasant surprise to see one of the local sights held up next to the Jorvic Viking Centre as one of the main attractions in Yorkshire. Go us.</p>

<p>Something which is potentially less of an attraction in Yorkshire is the people. They&#8217;re not unfriendly, but but they can seem a little cold, and don&#8217;t aways warm to a person as quickly as they might. Know this, though: if I Yorkshireman calls you friend, he <em>means</em> it**. There is also strong streak on competitiveness in the Yorkshire folk, and a fierce pride in working class roots, though it feels as though this is being eroded in Yorkshire as it is everywhere in the UK. Some years ago, Monty Python sent this up almost perfectly in what I consider to be the finest comedy sketch every written:</p>

<iframe src="http://www.youtube.com/embed/Xe1a1wHxTyo" width="" height="" frameborder="0" allowfullscreen></iframe>


<p>(There&#8217;s also an alternative version <a href="http://www.youtube.com/watch?v=-eDaSvRO9xA">here</a>)</p>

<p>I say best written because the performance does not, in my opinion, quite live up to the writing. The delivery is fantastic, but most of the accents aren&#8217;t quite right. But still, <em>beggars can&#8217;t me choosers</em>. Also: <em>waste not, want not</em>, and <em>close your mouth, there&#8217;s a bus coming</em>.</p>

<p>* This makes me feel old, but I suspect it makes him feel older&#8230;<br/>
** The same, of course, goes for the ladies of Yorkshire, but &#8220;Yorkshireman&#8221; scans so much better than any unisex pronoun I could think of.</p>
]]></content>
  </entry>
  
</feed>
