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

  <title><![CDATA[Sam Starling]]></title>
  <link href="http://www.samstarling.co.uk/atom.xml" rel="self"/>
  <link href="http://www.samstarling.co.uk/"/>
  <updated>2011-11-10T22:28:58+00:00</updated>
  <id>http://www.samstarling.co.uk/</id>
  <author>
    <name><![CDATA[Sam Starling]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Festival Radio 2011]]></title>
    <link href="http://www.samstarling.co.uk/2011/11/festival-radio-2011/"/>
    <updated>2011-11-10T00:00:00+00:00</updated>
    <id>http://www.samstarling.co.uk/2011/11/festival-radio-2011</id>
    <content type="html"><![CDATA[<p>Much like <a href="http://www.samstarling.co.uk/2010/10/radio-festival-radio-roundup-radio/">last year</a>, I thought it&#8217;d be useful to write up a few quick thoughts about Festival Radio &#8211; which took place at this year&#8217;s <a href="http://www.radioacademy.org/events/radio-festival-2011/">Radio Festival</a> up in Salford.</p>

<p>This year, we took on a slightly different incarnation. Instead of being live on various local DAB multiplexes and running it out of the old Xfm live room at Global&#8217;s Manchester studios, we were given a decent bit of space inside the Lowry itself to use as a base. Being in the same building as all the action was fantastic &#8211; it allowed us to be really flexible in what we covered, and meant we could turn things around a lot more quickly than we did last time.</p>

<p>Whilst this year might have seemed less &#8216;radio&#8217; than last year, podcasts are much more suitable for the occasion. The main aim was to bring the Festival to those who were unable to make it, but there&#8217;s no denying that the delegates form a fairly large chunk of our audience. Last year, it was fairly impossible for delegates to tune in as our hours matched those of the Festival. Having it on demand is a massive improvement.</p>

<p>We&#8217;ve had some really good feedback from various people on Twitter, as well as a nice thank you from John Myers. As a team, it meant a lot to us to hear good things from respected people in the industry &#8211; so thanks, if you took the time to let us know you enjoyed it. I think the most interesting bit is listening to how they progressively improve.</p>

<p>Hopefully it&#8217;ll be back again next year, and no doubt it&#8217;ll be even better. If you didn&#8217;t catch them, you can <a href="http://radioacademy.org/podcasts/">listen to the podcasts</a> on the Radio Academy website, or <a href="http://itunes.apple.com/gb/podcast/the-radio-academy-podcast/id273748000">subscribe using iTunes</a>.</p>

<hr />

<p>Big thanks to Kate Cocker and Heather Davies for organising the whole thing, everyone at the Radio Academy for their help in making it happen, and to James Stodd and Dan Snaith at BBC Radio XTrails for the production.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Google Analytics and "Like" Buttons]]></title>
    <link href="http://www.samstarling.co.uk/2011/11/google-analytics-and-like-buttons/"/>
    <updated>2011-11-09T00:00:00+00:00</updated>
    <id>http://www.samstarling.co.uk/2011/11/google-analytics-and-like-buttons</id>
    <content type="html"><![CDATA[<p>This is a quick post to show you how to track user interactions with &#8220;social&#8221; buttons inside Google Analytics.</p>

<p>Luckily, the three main social interaction buttons that you see around the web (Facebook&#8217;s &#8216;Like&#8217;, Twitter&#8217;s &#8216;Tweet, and Google&#8217;s &#8216;+1&#8217;), all have ways of letting you perform an action when they&#8217;re clicked.</p>

<p>To do so, you just need to add some Javascript into your page along these lines:</p>

<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
</pre></td><td class='code'><pre><code class='js'><span class='line'><span class="o">&lt;</span><span class="nx">script</span> <span class="nx">type</span><span class="o">=</span><span class="s2">&quot;text/javascript&quot;</span><span class="o">&gt;</span>
</span><span class='line'>  <span class="cm">/* Facebook */</span>
</span><span class='line'>  <span class="nx">FB</span><span class="p">.</span><span class="nx">Event</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s1">&#39;edge.create&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">href</span><span class="p">,</span> <span class="nx">widget</span><span class="p">)</span> <span class="p">{</span>
</span><span class='line'>    <span class="nx">_gaq</span><span class="p">.</span><span class="nx">push</span><span class="p">([</span><span class="s1">&#39;_trackEvent&#39;</span><span class="p">,</span> <span class="s1">&#39;Social Media&#39;</span><span class="p">,</span> <span class="s1">&#39;Facebook&#39;</span><span class="p">,</span> <span class="nx">href</span><span class="p">]);</span>
</span><span class='line'>  <span class="p">});</span>
</span><span class='line'>  <span class="cm">/* Twitter */</span>
</span><span class='line'>  <span class="nx">twttr</span><span class="p">.</span><span class="nx">events</span><span class="p">.</span><span class="nx">bind</span><span class="p">(</span><span class="s1">&#39;tweet&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">event</span><span class="p">)</span> <span class="p">{</span>
</span><span class='line'>    <span class="nx">_gaq</span><span class="p">.</span><span class="nx">push</span><span class="p">([</span><span class="s1">&#39;_trackEvent&#39;</span><span class="p">,</span> <span class="s1">&#39;Social Media&#39;</span><span class="p">,</span> <span class="s1">&#39;Twitter&#39;</span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">URL</span><span class="p">]);</span>
</span><span class='line'>  <span class="p">});</span>
</span><span class='line'>  <span class="cm">/* Google */</span>
</span><span class='line'>  <span class="kd">function</span> <span class="nx">plusone_vote</span><span class="p">(</span><span class="nx">obj</span><span class="p">)</span> <span class="p">{</span>
</span><span class='line'>    <span class="nx">_gaq</span><span class="p">.</span><span class="nx">push</span><span class="p">([</span><span class="s1">&#39;_trackEvent&#39;</span><span class="p">,</span> <span class="s1">&#39;Social Media&#39;</span><span class="p">,</span> <span class="s1">&#39;Google&#39;</span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">URL</span><span class="p">]);</span>
</span><span class='line'>  <span class="p">}</span>
</span><span class='line'><span class="o">&lt;</span><span class="err">/script&gt;</span>
</span></code></pre></td></tr></table></div></figure>


<p>That code assumes that you&#8217;ve got <code>_gaq</code> available as a variable &#8211; that is, this Javascript should come after your the Google Analytics <a href="http://code.google.com/apis/analytics/docs/tracking/asyncTracking.html">tracking snippet</a>.</p>

<p>I&#8217;ve assumed you&#8217;ve already got <code>FB</code> and <code>twttr</code> available as objects, which will be true if you&#8217;ve got Facebook and Twitter buttons loaded in the usual way.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Running a Blog on Jekyll]]></title>
    <link href="http://www.samstarling.co.uk/2011/07/jekyll/"/>
    <updated>2011-07-18T00:00:00+01:00</updated>
    <id>http://www.samstarling.co.uk/2011/07/jekyll</id>
    <content type="html"><![CDATA[<p>Don&#8217;t get me wrong, I love <a href="http://wordpress.org/">Wordpress</a>. It&#8217;s ridiculously flexible, there are a huge number of plugins and themes available, and it has an extremely active community surrounding it.</p>

<p>However, for my blog (which is just a bunch of posts and not a huge amount else) I feel like it&#8217;s overkill. I don&#8217;t really need a database, or plugins, or comments, or any of that cruft. I just need a very simple set of pages.</p>

<p>Enter <a href="http://jekyllrb.com/">Jekyll</a> &#8211; a Ruby-based static site generator that takes a directory of layouts, a directory of posts, and applies a bit of cleverness to combine the two and spit out a directory of flat HTML files. Posts are written in <a href="http://www.textism.com/tools/textile/">Textile</a> (Markdown is also supported) with a single file used for each post.</p>

<p>The advantages? No databases to worry about, and no pre-processing. Just static files being spit out to users by <a href="http://nginx.org/">nginx</a>. No hanging around for the database to be queried and for PHP to process that into a page. The whole thing lives in a <a href="https://github.com/samstarling/samstarling.co.uk">repository on Github</a>, if you want to see how it all hangs together. I&#8217;ve yet to set it up so that the site gets re-deployed when I commit, but that&#8217;s next.</p>

<p>Plus, there&#8217;s a nice non-technical bonus to the whole thing: you write all your posts in a text editor. I like that, it takes away all the fancy widgets and buttons that you get in WYSIWYG editors and lets you focus on what you&#8217;re actually writing.</p>

<p>If that sounds interesting but you&#8217;re not quite sure where to start then let me know, I&#8217;d be glad to help.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Facebook Connect and Python]]></title>
    <link href="http://www.samstarling.co.uk/2011/07/facebook-connect-python/"/>
    <updated>2011-07-06T00:00:00+01:00</updated>
    <id>http://www.samstarling.co.uk/2011/07/facebook-connect-python</id>
    <content type="html"><![CDATA[<p>This afternoon I&#8217;ve been wrestling with <a href="https://developers.facebook.com/blog/post/108/">Facebook Connect</a> for a project I&#8217;m working on. Chances are that you&#8217;ve come across it before. It&#8217;s a button on third-party sites that says something along the lines of &#8220;Login Using Facebook&#8221;, allowing you to identify yourself to them using an account you already have.</p>

<p>Think what you like about Facebook as a company, but I think the tools they release to developers (particularly the <a href="https://developers.facebook.com/docs/reference/plugins/login/">Login Button</a> and <a href="https://developers.facebook.com/docs/reference/plugins/comments/">Comments</a>) are great. They lower the friction of an action by making it as easy as possible: in this case, adding a comment or becoming a member of a site. Not only do they make this easy, but things like Comments provide a familiar interface to users that encourage them to engage &#8211; and it&#8217;s becoming increasingly popular.</p>

<p>I could ramble on for ages, but this post is a technical one.</p>

<p>The downside of Facebook is that it&#8217;s massive. And it&#8217;s popular. And they keep changing their APIs and the way things hang together. The result is a large number of libraries and tutorials that are either irrelevant or out-of-date. I prefer to know how something hangs together technically, and then make it work in whatever I&#8217;m coding. So here&#8217;s how it works.</p>

<h2>Set Up a Facebook App</h2>

<p>First thing&#8217;s first &#8211; you&#8217;ll need to set up an app through the <a href="https://developers.facebook.com/apps">Facebook Developers</a> site, which will give you an application ID and secret that you&#8217;ll need to use in order to be able to &#8216;talk&#8217; to Facebook.</p>

<h2>Putting a Login Button on Your Site</h2>

<p>Next, you&#8217;ll need to put some Facebook Javascript onto your site:</p>

<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
</pre></td><td class='code'><pre><code class='html'><span class='line'><span class="nt">&lt;div</span> <span class="na">id=</span><span class="s">&quot;fb-root&quot;</span><span class="nt">&gt;&lt;/div&gt;</span>
</span><span class='line'><span class="nt">&lt;script </span><span class="na">src=</span><span class="s">&quot;http://connect.facebook.net/en_US/all.js&quot;</span><span class="nt">&gt;&lt;/script&gt;</span>
</span><span class='line'><span class="nt">&lt;script&gt;</span>
</span><span class='line'>    <span class="nx">FB</span><span class="p">.</span><span class="nx">init</span><span class="p">({</span>
</span><span class='line'>        <span class="nx">appId</span><span class="o">:</span> <span class="s1">&#39;YOUR_APP_ID&#39;</span><span class="p">,</span>
</span><span class='line'>        <span class="nx">cookie</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
</span><span class='line'>        <span class="nx">status</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
</span><span class='line'>        <span class="nx">xfbml</span><span class="o">:</span> <span class="kc">true</span>
</span><span class='line'>    <span class="p">});</span>
</span><span class='line'><span class="nt">&lt;/script&gt;</span>
</span></code></pre></td></tr></table></div></figure>


<p>With that done, you&#8217;ll be able to use FBML to add a login button:</p>

<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='html'><span class='line'><span class="nt">&lt;fb:login</span><span class="na">-button</span><span class="nt">&gt;</span>Log in using Facebook<span class="err">&lt;</span>/fb:login-button&gt;
</span></code></pre></td></tr></table></div></figure>


<h2>Talking to Facebook</h2>

<p>Once you&#8217;ve got that done, you&#8217;ll be able to visit that page and click the &#8220;Login&#8221; button. That&#8217;ll take the user through the steps they need to grant permission to your application to use their data. It pops up as a new window, which closes once the process is over.</p>

<h2>Fetching Data</h2>

<p>Once the user has granted permission, you&#8217;re all ready to talk to Facebook to get data about that user.</p>

<p>In this example, we&#8217;re using a method which is used as a Django view. But whatever Python web framework you&#8217;re using, it&#8217;s going to be similar. The key thing is that <code>get_user_from_cookie</code> searches through an array of cookies looking for the Facebook authorisation token.</p>

<p>Here, we&#8217;re using Facebook&#8217;s own <a href="https://github.com/facebook/python-sdk/">Python SDK</a> &#8211; it&#8217;s ace. Below, The token is used to create a new instance of the Graph API, and then we just query it for that user&#8217;s details. The bit at the end is somewhat Django-specific, but we&#8217;re just passing that array of profile data to the template.</p>

<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="kn">from</span> <span class="nn">django.views.generic.simple</span> <span class="kn">import</span> <span class="n">direct_to_template</span>
</span><span class='line'><span class="kn">import</span> <span class="nn">facebook</span>
</span><span class='line'>
</span><span class='line'><span class="k">def</span> <span class="nf">user_home</span><span class="p">(</span><span class="n">request</span><span class="p">):</span>
</span><span class='line'>    <span class="n">extra_context</span> <span class="o">=</span> <span class="p">{}</span>
</span><span class='line'>    <span class="n">user</span> <span class="o">=</span> <span class="n">facebook</span><span class="o">.</span><span class="n">get_user_from_cookie</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">COOKIES</span><span class="p">,</span>\
</span><span class='line'>        <span class="n">app_id</span><span class="p">,</span> <span class="n">secret</span><span class="p">)</span>
</span><span class='line'>    <span class="k">if</span> <span class="n">user</span><span class="p">:</span>
</span><span class='line'>        <span class="n">graph</span> <span class="o">=</span> <span class="n">facebook</span><span class="o">.</span><span class="n">GraphAPI</span><span class="p">(</span><span class="n">user</span><span class="p">[</span><span class="s">&quot;access_token&quot;</span><span class="p">])</span>
</span><span class='line'>        <span class="n">extra_context</span><span class="p">[</span><span class="s">&#39;profile&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">graph</span><span class="o">.</span><span class="n">get_object</span><span class="p">(</span><span class="s">&quot;me&quot;</span><span class="p">)</span>
</span><span class='line'>    <span class="k">return</span> <span class="n">direct_to_template</span><span class="p">(</span>
</span><span class='line'>        <span class="n">request</span><span class="p">,</span>
</span><span class='line'>        <span class="s">&#39;template.html&#39;</span><span class="p">,</span>
</span><span class='line'>        <span class="n">extra_context</span>
</span><span class='line'>    <span class="p">)</span>
</span></code></pre></td></tr></table></div></figure>


<h2>Finished</h2>

<p>There, you&#8217;re done. You&#8217;ve got a user to grant you permission over some of their data, and you&#8217;ve managed to fetch their data in your Python application. What you do with it now is up to you &#8211; this isn&#8217;t meant to be a massively in depth tutorial, but more of a guide to get you up and running.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[RadioVIS Slides with HTML]]></title>
    <link href="http://www.samstarling.co.uk/2011/02/radiovis-slides-with-html/"/>
    <updated>2011-02-19T00:00:00+00:00</updated>
    <id>http://www.samstarling.co.uk/2011/02/radiovis-slides-with-html</id>
    <content type="html"><![CDATA[<p><em>This is a bit of an introduction to what I made at the RadioDNS Hackday in Geneva on 15th February. If you just want the code, you can skip to the end!</em></p>

<p>Once you’re all set up with your infrastructure to serve RadioVIS, what you’re essentially left with is a nice blank canvas to fill with content — but it’d be a bit boring to just fill it with static images. What you really want to do is create some dynamic slides that pull through information (like now playing data) from various places and put that together in a way that looks decent.</p>

<p>To do this you need to use some kind of imaging library like GD or PIL, which in layman’s terms lets you write a set of instructions to construct an image. However, there’s a couple of problems with most of these libraries. Firstly, the instructions for putting together these images can be a bit fiddly — it’s all absolute co-ordinates, and you have to write your own clever methods to do things like text wrapping. Secondly, the font rendering is a bit rubbish with lots of jagged edges and some odd transparency.</p>

<p>Before the RadioDNS Hackday in Geneva last week, I had a cunning idea. Web browsers (and especially Safari) do a great job of rendering fonts, and we can do lots of CSS3 wildness like 3D transforms and drop shadows. Plus, HTML and CSS are a bit more accessible for Joe Public to understand and create. So why not code up our slides in HTML, and then transform that into an image?</p>

<p>Here’s an example of the kind of image the program makes:</p>

<p><img src="http://www.samstarling.co.uk/img/visslide.png"/></p>

<p>Because the program uses WebKit, we’re taking full advantage of lots of nice CSS3 bits like gradients, rotation, box-shadow and @font-face.</p>

<p>I’ve popped the code that does this up on Github — it’s a bit messy at the moment, and you’ll need a few things like <code>pyobjc</code>. I’m pretty sure this will only work on a Mac, unfortunately, but the project is still young. There’s a few examples of templates in there to give you an idea of how it works. Comments, bug reports and forks are all welcome!</p>

<p><a href="https://github.com/samstarling/htmlvis">Get the source from Github</a>.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Links for 13th February 2011]]></title>
    <link href="http://www.samstarling.co.uk/2011/02/links-for-13-february-2011/"/>
    <updated>2011-02-13T00:00:00+00:00</updated>
    <id>http://www.samstarling.co.uk/2011/02/links-for-13-february-2011</id>
    <content type="html"><![CDATA[<ul>
<li><a href="http://www.slideshare.net/lincolnloop/customizing-the-django-admin">Customizing the Django Admin</a><br/>
Django’s ‘automatic’ admin interface is good but it falls down in places – namely, lack of customisation and the bits that appear in things like the WordPress Dashboard. This presentation from Linked Loop outlines some ways to start solving these problems.</li>
</ul>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Interview with Andy Parfitt]]></title>
    <link href="http://www.samstarling.co.uk/2010/11/interview-with-andy-parfitt/"/>
    <updated>2010-11-11T00:00:00+00:00</updated>
    <id>http://www.samstarling.co.uk/2010/11/interview-with-andy-parfitt</id>
    <content type="html"><![CDATA[<p>Whilst I was working on Radio Festival Radio this year, I got a chance to interview Andy Parfitt – the controller of Radio 1 and 1Xtra, amongst other job titles. I managed to grab a quick interview with him, without making myself seem like too much of an idiot. Only part of it made it to air, so I thought I’d post up the whole thing here.</p>

<p>He talks a bit about what he enjoyed at the first day of this year’s Radio Festival, and his thoughts on the increase of visualisation at Radio 1.</p>

<p>Get the MP3 here.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Installing MySQL on an EC2 Micro Instance]]></title>
    <link href="http://www.samstarling.co.uk/2010/10/installing-mysql-on-an-ec2-micro-instance/"/>
    <updated>2010-10-30T00:00:00+01:00</updated>
    <id>http://www.samstarling.co.uk/2010/10/installing-mysql-on-an-ec2-micro-instance</id>
    <content type="html"><![CDATA[<p>I’ve been doing a fair bit of work with Amazon EC2 instances recently, for my Final Year Project at uni. If you’ve not come across them before, then it’s basically Amazon’s way of making web-scale computing easy to set up and access. And it’s even more interesting when you see that they’re bringing in a free usage tier for the Linux Micro instances from 1st November this year.</p>

<p>When you create a new instance, you can choose an OS. If you choose “Basic Amazon Linux” (like I did) then you’ll get a stripped-down version that doesn’t have some bits you might be used to (like apt-get). I had to install MySQL recently, so here’s how to do that on such a setup:</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=''><span class='line'>sudo yum install mysql
</span><span class='line'>sudo yum install mysql-server
</span><span class='line'>sudo yum install mysql-devel
</span><span class='line'>sudo chgrp -R mysql /var/lib/mysql
</span><span class='line'>chmod -R 770 /var/lib/mysql
</span><span class='line'>sudo service mysqld start</span></code></pre></td></tr></table></div></figure>


<p>By this stage, you’ll have MySQL installed and the service started. The next step is to set a password for the root user:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>/usr/bin/mysqladmin -u root password yourpasswordhere</span></code></pre></td></tr></table></div></figure>


<p>If you only want to use MySQL internally, then you’re all done now. But if you want to access MySQL externally then you’ll need to follow a few extra steps.</p>

<p>Firstly, go to the AWS Management Console, and find the Security Group that you assigned to your instance when you first set it up. Add “MySQL” to the group using the dropdown, or manually add port 3306. Save your changes.</p>

<p>Finally, create a MySQL user which is able to connect from any host (identified by a percent sign below) by running the following SQL using mysql from your instance’s command line:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>mysql> CREATE USER 'myuser'@'localhost' IDENTIFIED BY 
</span><span class='line'>    -> 'yourpasswordhere';
</span><span class='line'>mysql> GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'localhost'
</span><span class='line'>    -> WITH GRANT OPTION;
</span><span class='line'>mysql> CREATE USER 'myuser'@'%' IDENTIFIED BY 'yourpasswordhere';
</span><span class='line'>mysql> GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%'
</span><span class='line'>    -> WITH GRANT OPTION;</span></code></pre></td></tr></table></div></figure>


<p>And then you’re done, ready to connect from anywhere with that username and password.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Radio Festival Radio Roundup… Radio]]></title>
    <link href="http://www.samstarling.co.uk/2010/10/radio-festival-radio-roundup-radio/"/>
    <updated>2010-10-24T00:00:00+01:00</updated>
    <id>http://www.samstarling.co.uk/2010/10/radio-festival-radio-roundup-radio</id>
    <content type="html"><![CDATA[<p>So I’m fresh back from working as a producer/technician/jack-of-all-trades at Radio Festival Radio, a pop-up station that ran for three days to cover this year’s Radio Festival in Salford. Apologies in advance that I’m sort of stealing the format of this blogpost from fellow RFR man Matt Harrison. So what did I learn?</p>

<p><em>It’s a friendly industry.</em><br/>
This wasn’t completely new to me, but the whole project was built upon favours and the goodwill of others – right through from the presenters to the studio space and the streaming. Big thanks to Colin, Mike and the team at Global Manchester for letting us use the studio, office and kettle. I’m pretty sure we may have made Clint Boon late at one stage as well. Oops.</p>

<p><em>The Lowry is a fantastic venue.</em><br/>
But, Salford Quays and MediaCityUK still seem a bit odd to me – I think it’s because the whole place has shot up over the past few years and it doesn’t feel very “bedded in” yet. Don’t get me wrong, it’s a brilliant place, it just feels somewhat uninhabited at the moment. I challenge you to find a decent pub within walking distance of The Lowry, and before you say Lime Bar, that definitely doesn’t count.</p>

<p><em>&#8220;Celebrities&#8221; are more approachable than you think.</em><br/>
I managed to pluck up the courage to ask Andy Parfitt a quick question, and the rest of the team managed to get Richard Bacon to come and do an interview with us live on air. It echoes what I saw at Folder Media – nearly everyone is happy to help out where they can, even if that’s just a friendly chat. Even Ashley Tabor took time to pop his head around the door when he was touring around Global Manchester.</p>

<p><em>Doing a live radio show is scary, but a massive amount of fun.</em><br/>
Our team produced a huge amount of fantastic content, but the running order of our live shows evolved as they happened. As a result, we were left with some great stuff that we just didn’t have the time to use. I have absolutely no experience of how time-sensitive live shows like that work in the “real world”, but it made me wonder how much content gets produced elsewhere without ever seeing the light of day. I’d be interested to hear comments on that one.</p>

<p><em>Scheduling music radio is tricky.</em><br/>
I have no idea how the music bosses of stations manage to separate what they want to hear, and what their listeners want to hear. Me and Kieran (the station manager) had lots of fun mashing the ‘K’ button in Selector and telling it to play something else. Craig David anyone? No?</p>

<p><em>No song should begin like Diana Vickers&#8217; &#8220;Once&#8221;.</em><br/>
It makes everyone in the studio panic.</p>

<p>We also played host to the first ever live edition of RadioTalk, which is available in podcast form. If you’re even mildly interested in radio, then you should subscribe. It’s good. But then I’m biased, because I helped to record the latest one…</p>

<p>Whilst I only made it to one of the sessions across the whole festival (Evans and Mallett, a good choice), I had a fantastic time and worked with a team of absolutely brilliant people. If you listened, then I hope we managed to bring you a taste of what was going on at the Radio Festival. And if you didn’t get a chance to tune in, we’ll try and get some highlights online soon.</p>

<p>Same again next year, anyone?</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Leaving London]]></title>
    <link href="http://www.samstarling.co.uk/2010/08/leaving-london/"/>
    <updated>2010-08-16T00:00:00+01:00</updated>
    <id>http://www.samstarling.co.uk/2010/08/leaving-london</id>
    <content type="html"><![CDATA[<p>A few weeks ago, I left Folder Towers in sunny Shoreditch, packed all my worldly possessions into cardboard boxes, and headed back up to Manchester.</p>

<p>My year-long stint at Folder was part of my Computer Science degree – a year in industry that I was allowed to find my own job for. After applying for (and eventually being rejected by) several big name banks, I decided to fire off e-mails to various contacts (hi, Andy) and see if they had any suggestions. Long story short – one Mr. Matt Deegan turned up, took a punt on a random student, and I spent an excellent 12 months with <a href="http://www.foldermedia.co.uk/">Folder Media</a>.</p>

<p>This is a very quick, and admittedly very belated, post to thank some of the people who’ve helped me out during the year – everyone at Folder Media, Hallett Arendt, the Global Radio Creative Technology Team, and the Radio Academy, thank you all for your help/advice/tea over the past year.</p>

<p>I’m proud of the things we’ve made and achieved in the past year, if you get a spare five minutes with Matt, then make sure you persuade him to show some of it off to you. I’m carrying on working with Folder Media part-time whilst in Manchester, so watch out London – I’ll be back.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[pyradiodns]]></title>
    <link href="http://www.samstarling.co.uk/2010/06/pyradiodns/"/>
    <updated>2010-06-14T00:00:00+01:00</updated>
    <id>http://www.samstarling.co.uk/2010/06/pyradiodns</id>
    <content type="html"><![CDATA[<p>I was reminded this evening that I’ve been sitting on an early version of <a href="https://github.com/samstarling/pyradiodns">pyradiodns</a> for a while, without really announcing it or doing anything with it. So this is that.</p>

<p>It’s a direct port of Andy Buckingham’s <a href="http://code.google.com/p/php-radiodns/">php-radiodns</a>, so everything is named the same and all the methods have an identical ‘footprint’. All the technical details, along with a quick and dirty example, are available on the Google Code page. If you spot anything that looks wrong (no prizes), or you’d like to contribute to the project then let me know.</p>

<p>There was a fair deal of interest in RadioDNS at the recent Radio Academy event, although that may have been more to do with Matt’s iPad. If you’ve heard about it but you’re not really sure what it is, then you should definitely read this <a href="http://radiodns.org/about-radiodns/">quick introduction</a>.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Python and SQLite]]></title>
    <link href="http://www.samstarling.co.uk/2010/04/python-and-sqlite/"/>
    <updated>2010-04-09T00:00:00+01:00</updated>
    <id>http://www.samstarling.co.uk/2010/04/python-and-sqlite</id>
    <content type="html"><![CDATA[<p>Often, I find myself writing a script or application where I want to do some quick data extraction and analysis using a database, but where it&#8217;d be overkill to set up a MySQL schema to store the data. So, enter my recently-beloved Python and the sqlite3 module.</p>

<p>SQLite has the advantage of storing data in a single flat file – which is fine if you&#8217;re creating something to be used locally, and by a single user. Plus, if you&#8217;re using Python 2.5 or above, pysqlite2 comes pre-bundled, so all you need to do is:</p>

<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="kn">from</span> <span class="nn">sqlite3</span> <span class="kn">import</span> <span class="o">*</span>
</span></code></pre></td></tr></table></div></figure>


<p>Then it&#8217;s just a case of creating your tables, popping in some data, and performing some queries. Simples. Firstly, create a connection object and a cursor to go with it:</p>

<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="n">connection</span> <span class="o">=</span> <span class="n">connect</span><span class="p">(</span><span class="s">&#39;data.db&#39;</span><span class="p">)</span>
</span><span class='line'><span class="n">cursor</span> <span class="o">=</span> <span class="n">connection</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
</span></code></pre></td></tr></table></div></figure>


<p>Then it&#8217;s just a case of creating some tables:</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>
</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="n">cursor</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">&quot;CREATE TABLE person</span><span class="se">\</span>
</span><span class='line'><span class="s">    (id int primary key, firstname text, lastname text)&quot;</span><span class="p">)</span>
</span></code></pre></td></tr></table></div></figure>


<p>Putting some data in them:</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>
</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="n">cursor</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">&quot;INSERT INTO person VALUES (null, &#39;Joe&#39;, &#39;Bloggs&#39;)&quot;</span><span class="p">)</span>
</span><span class='line'><span class="n">connection</span><span class="o">.</span><span class="n">commit</span><span class="p">()</span>
</span></code></pre></td></tr></table></div></figure>


<p>&#8230;and then querying them:</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="n">cursor</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">&#39;SELECT * FROM person&#39;</span><span class="p">)</span>
</span><span class='line'><span class="k">for</span> <span class="n">row</span> <span class="ow">in</span> <span class="n">cursor</span><span class="p">:</span>
</span><span class='line'>    <span class="k">print</span> <span class="n">row</span>
</span></code></pre></td></tr></table></div></figure>


<p>Anyway &#8211; that&#8217;s my first go at writing a quick and dirty tutorial, if you find it helpful or you think I&#8217;ve missed anything out then leave me a comment.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Links for 25th March 2010]]></title>
    <link href="http://www.samstarling.co.uk/2010/03/links-for-25th-march-2010/"/>
    <updated>2010-03-25T00:00:00+00:00</updated>
    <id>http://www.samstarling.co.uk/2010/03/links-for-25th-march-2010</id>
    <content type="html"><![CDATA[<ul>
<li><a href="http://uxmag.com/design/the-impossible-bloomberg-makeover">The impossible Bloomberg makeover</a><br/>
Always interesting to see something that goes against the grain – this article from UX Magazine explains how users of Bloomberg’s financial terminals have resisted changes to the painful UI.</li>
<li><a href="http://www.codinghorror.com/blog/2010/03/the-opposite-of-fitts-law.html">The Opposite of Fitts&#8217; Law</a><br/>
Jeff Attwood explains what we should think about when you don’t want users to click on things. Bonus points for featuring a dog in a fighter plane.</li>
<li><a href="http://ajaxian.com/archives/jquery-ui-1-8-comes-with-new-plugins-effect-and-fixes">jQuery UI 1.8</a><br/>
I use jQuery. A lot. What’s great to see is that it now ships with an Autocomplete widget. If you work with Javascript and you’ve never checked it out, take a look.</li>
</ul>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Oh, Vienna!]]></title>
    <link href="http://www.samstarling.co.uk/2010/01/oh-vienna/"/>
    <updated>2010-01-13T00:00:00+00:00</updated>
    <id>http://www.samstarling.co.uk/2010/01/oh-vienna</id>
    <content type="html"><![CDATA[<p>Me, Elly, Olivia and Dan (who took the photo above) have just returned from a very amusing and somewhat chilly trip to Vienna. All in all, it was a smooth journey – apart from the cancellation of our first flight out, which cost us 12 hours. easyJet decided it was fine to lie and tell us that Vienna airport was closed. Still, the wares of duty-free helped pass a bit of the time.</p>

<p>The weather was somewhat bracing and provided a good excuse to stop off at numerous bars, cafés (for hot chocolate mit schlag) and even the oddly-floored Kunst Haus Wien, the latter of which had a fantastic Annie Leibovitz exhibition on. And on the subject of photography, Dan took some amazing photos of the trip which he put up on his blog.</p>

<p>Novelties of the trip included the musical Wiesel trains, the Opera Toilet, a plate of spare ribs twice the size of my head, and the regular recital of a particular Ultravox song. And of course, the company. Roll on the next trip!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[New Systems]]></title>
    <link href="http://www.samstarling.co.uk/2009/11/new-systems/"/>
    <updated>2009-11-10T00:00:00+00:00</updated>
    <id>http://www.samstarling.co.uk/2009/11/new-systems</id>
    <content type="html"><![CDATA[<p>bq. &#8220;It must be remembered that there is nothing more difficult to plan, more doubtful of success, nor more dangerous to management than the creation of a new system. For the initiator has the enmity of all who would profit by the preservation of the old institution and merely the lukewarm defense in those who gain by the new ones.&#8221;</p>

<p>&#8211; Nicolo Machiavelli</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Analysing Exercise]]></title>
    <link href="http://www.samstarling.co.uk/2009/11/analysing-exercise/"/>
    <updated>2009-11-01T00:00:00+00:00</updated>
    <id>http://www.samstarling.co.uk/2009/11/analysing-exercise</id>
    <content type="html"><![CDATA[<p>Recently, I’ve been using Dailymile to track my running, a service which is basically like Google Analytics for exercise. It’s nice and simple to input data and has nice ways of tracking progress – for example, I’ve burned 26.88 donuts so far, but have still only made it 0.00% around the world. Still, there’s a goal.</p>

<p>Whilst it has an API, it’s still difficult to get recent data out of the service in a format that isn’t one of the badges they provide. However, a little bit of Javascript and RegEx magic later, and I’ve written a quick PHP wrapper that gets the latest data for a particular user and spits it out. You can see it in action on the right hand side.</p>

<p>I’ve started a project on Google Code where you can see the code and download it. You’re more than welcome to use and/or modify it, and it’d be great to hear from you if you do. Download it here. Hopefully putting the figures here for all to see might persuade me to run a bit more…</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Pure Sensia and RadioDNS]]></title>
    <link href="http://www.samstarling.co.uk/2009/09/pure-sensia-and-radiodns/"/>
    <updated>2009-09-17T00:00:00+01:00</updated>
    <id>http://www.samstarling.co.uk/2009/09/pure-sensia-and-radiodns</id>
    <content type="html"><![CDATA[<p>So the news I got this morning was a bit disappointing. The RadioVIS slideshows we had prepared for a few radio stations didn’t work on the demo models of the rather lovely Pure Sensia that was released today. It eventually came down to connectivity issues that only seemed to happen inside the venue where the event took place — and the detail of that certainly isn’t what this blog post is for.</p>

<p>From what I’ve seen and heard over the past 24 hours, the Sensia is a great little bit of kit whose touch-sensitive glass screen I am very much looking forward to grubbying with my fingers. It’s pretty much the first device that takes advantage of the fact that there’s a web connection in most of the places in which it’ll be used, and then uses that to provide more than just additional web-only stations. The important bit is the support for RadioVIS, which I’ve written a bit about before. As my boss Matt points out, it’s something we expect to have on our devices.</p>

<p>It opens up a whole new range of ways for stations to interact with listeners, and provide additional content to supplement what’s on air and engage listeners. For instance, if you’ve got a radio on your desk and you know that Capital FM broadcasts the status of tube lines (which it does), then you might just wait a little bit to see that come around. Who knows, if you’re not a regular listener then you may well hear something to convince you otherwise. And that’s just the tip of the iceberg, with many of us (including the firm I work for, Folder Media) coming up with all sorts of interesting things to serve up to the masses.</p>

<p>As someone who is very much a newcomer to the entire industry, Ben sums up the atmosphere surrounding the whole project very well in his comment on Matt’s post. It’s fantastic to be able co-operate with teams who are essentially competitors, and in a friendly and constructive way. My thanks go out especially to Andy, Ben and the Global team, as well as Matt and Dave who I work with directly, and Colin and Matt at Pure – here’s to more of the same in the future.</p>

<p>Photo courtesy of James Cridland. Thanks to him too.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Great Yorkshire Run 2009]]></title>
    <link href="http://www.samstarling.co.uk/2009/09/great-yorkshire-run-2009/"/>
    <updated>2009-09-09T00:00:00+01:00</updated>
    <id>http://www.samstarling.co.uk/2009/09/great-yorkshire-run-2009</id>
    <content type="html"><![CDATA[<p>Myself and my two good friends Dan Pilkington and Rick Sellars all took part in the Great Yorkshire Run on Sunday. Perfect day for running – a bit cloudy and just the right side of being warm. I think Sheffield must have some kind of protective bubble around it, as the weather is almost too perfect every time I go… Managed to shave 5 minutes off my existing personal best to come in at 1:08:38, despite the lack of the promised run-through shower at the 7km mark. Nice. The next goal is to get under an hour.</p>

<p>Fantastic work from Rick and Dan though. Rick (who I did the Great Manchester Run with earlier this year) also got around 5 minutes off his best time with 42 minutes, and Dan got 47 minutes – and it was only his first proper run. We all ran for the Alzheimer’s Society, and it’s not to late to donate. For details of our times, you can search for us here.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Adventures into RadioDNS]]></title>
    <link href="http://www.samstarling.co.uk/2009/08/adventures-into-radiodns/"/>
    <updated>2009-08-21T00:00:00+01:00</updated>
    <id>http://www.samstarling.co.uk/2009/08/adventures-into-radiodns</id>
    <content type="html"><![CDATA[<p>Recently, I’ve been looking into the <a href="http://radiodns.org/">RadioDNS</a> project – specifically the RadioVIS side of things. For the uninitiated, RadioDNS is a project that allows radio devices to obtain extra information about the station or programme that you’re listening to. The project defines the way that these services can be discovered by devices, and broadcast by providers.</p>

<p>The RadioVIS part of things is where it gets interesting as it allows for a station to broadcast images in a slideshow-esque fashion, as well as text (just like the existing DLS text on DAB). Global and the BBC are already signed up as supporters of the project, and are starting to broadcast data to go along with their services. At the time of writing, Global&#8217;s <a href="http://capitalradio.co.uk">Capital FM</a> were the only station to be running a public RadioVIS service as it’s the one used in their iPhone app.</p>

<p>There are a huge number of possibilities here, and Capital have quite a few nice ideas up and running — including updates on the status of Tube lines, the latest news and chart recaps. Mind you, it’s no surprise that they lead the way, as the Creative Technology team at Global in Bristol are the ones behind the bulk of existing development.</p>

<p>I’m in the middle of getting to grips with the framework and it’s underlying technologies at the moment, and intend to write up a ‘dummies’ guide to getting started and writing some simple Python applications around it within the next week or so. It should be very interesting to see what content people decide to deliver using RadioVIS as the project gains momentum, so I’ll be keeping my eyes (and ears) peeled.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Crouch End Running]]></title>
    <link href="http://www.samstarling.co.uk/2009/08/running/"/>
    <updated>2009-08-16T00:00:00+01:00</updated>
    <id>http://www.samstarling.co.uk/2009/08/running</id>
    <content type="html"><![CDATA[<p>So I’ve taken to the roads again because a couple of my friends convinced me to do the Great Yorkshire Run, which takes place in Sheffield on Sunday 6th September. I didn’t really carry on running after the Great Manchester Run back in May, but it’s good to have another goal. I managed it in 1:13 last time, so anything better than that and I’ll be happy this time around.</p>

<p>A beautiful day in Crouch End today, so went out for a run around Priory Park and then Alexandra Park. Ended up at about 6.6km for the whole thing, coming in at about 50 minutes or so. I’ll put that down to the Farmer’s Market crowds hampering me on the way in to Alexandra Park, and the long slog of a hill you get as you run up to the Palace. Anyway, after a poke around Google Maps it looks like there’s a relatively gentle uphill run from the office to my flat that’s around 7.5km and skirts around Shoreditch Park and Finsbury Park. I’ll see how my pace fares there and report back!</p>
]]></content>
  </entry>
  
</feed>

