<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" version="2.0">

<channel>
	<title>Muffin Research Labs</title>
	
	<link>http://muffinresearch.co.uk</link>
	<description>the personal blog of Stuart Colville covering modern web development techniques and best practices</description>
	<lastBuildDate>Tue, 12 Mar 2013 20:56:45 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/muffinres/skimmed" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="muffinres/skimmed" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/</creativeCommons:license><item>
		<title>Can’t install user.js in Google Chrome</title>
		<link>http://muffinresearch.co.uk/archives/2012/10/01/cant-install-user-js-in-google-chrome/</link>
		<comments>http://muffinresearch.co.uk/archives/2012/10/01/cant-install-user-js-in-google-chrome/#comments</comments>
		<pubDate>Mon, 01 Oct 2012 08:36:27 +0000</pubDate>
		<dc:creator>Stuart Colville</dc:creator>
				<category><![CDATA[Browsers]]></category>

		<guid isPermaLink="false">http://muffinresearch.co.uk/?p=1267</guid>
		<description><![CDATA[In recent Chrome versions (22 in my case on Ubuntu) it&#8217;s not possible to install user.js (Greasemonkey) scripts by just dragging them onto a window. Instead the script is downloaded and you see the following message: &#8220;Extensions, apps and user scripts can only be added from the Chrome Web Store&#8221; Fortunately the resolution is quite [...]]]></description>
				<content:encoded><![CDATA[<p>In recent Chrome versions (22 in my case on Ubuntu) it&#8217;s not possible to install user.js (Greasemonkey) scripts by just dragging them onto a window. Instead the script is downloaded and you see the following message:</p>
<p><img class="bord" src="http://mrl.staticfil.es/img/chrome-warning-user-js.png" alt="Extensions, apps and user scripts can only be added from the Chrome Web Store" /></p>
<p>&#8220;Extensions, apps and user scripts can only be added from the Chrome Web Store&#8221;</p>
<p>Fortunately the resolution is quite straight-forward. First download the script you want to a local directory/folder, then go to <a href="chrome://chrome/extensions/">chrome://chrome/extensions/</a> and drag the user.js script there instead. This feature is designed to protect users from malicious installs and as long as you know the workaround to install user.js scripts it&#8217;s not too much of a big deal.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=HIGbVI6Onsc:LWNx3M0cCjE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=HIGbVI6Onsc:LWNx3M0cCjE:2nqncYFp4_M"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=2nqncYFp4_M" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=HIGbVI6Onsc:LWNx3M0cCjE:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=HIGbVI6Onsc:LWNx3M0cCjE:2mJPEYqXBVI"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=2mJPEYqXBVI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://muffinresearch.co.uk/archives/2012/10/01/cant-install-user-js-in-google-chrome/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fixing pbuilder dependency 404 errors</title>
		<link>http://muffinresearch.co.uk/archives/2012/09/15/fixing-pbuilder-dependency-404-errors/</link>
		<comments>http://muffinresearch.co.uk/archives/2012/09/15/fixing-pbuilder-dependency-404-errors/#comments</comments>
		<pubDate>Sat, 15 Sep 2012 12:45:47 +0000</pubDate>
		<dc:creator>Stuart Colville</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>

		<guid isPermaLink="false">http://muffinresearch.co.uk/?p=1240</guid>
		<description><![CDATA[If you&#8217;re building packages with pbuilder sometimes you might hit something like the following errors which cause the build to fail because the dependencies can&#8217;t be found. Err http://archive.ubuntu.com/ubuntu/ precise-updates/main devscripts i386 2.11.6ubuntu1.2 404 Not Found [IP: 91.189.92.188 80] Err http://archive.ubuntu.com/ubuntu/ precise-updates/main openssl i386 1.0.1-4ubuntu5.2 404 Not Found [IP: 91.189.92.188 80] The cause is the [...]]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;re building packages with pbuilder sometimes you might hit something like the following errors which cause the build to fail because the dependencies can&#8217;t be found.</p>
<pre><code>Err http://archive.ubuntu.com/ubuntu/ precise-updates/main devscripts i386 2.11.6ubuntu1.2
  404  Not Found [IP: 91.189.92.188 80]
Err http://archive.ubuntu.com/ubuntu/ precise-updates/main openssl i386 1.0.1-4ubuntu5.2
  404  Not Found [IP: 91.189.92.188 80]</code></pre>
<p>The cause is the pbuilder image being out of date and some dep packages are no longer present becuase they&#8217;ve been superceded by more recent versions. The good news is the fix is really simple just run:</p>
<p><code>pbuilder-&lt;dist&gt; update</code></p>
<p>Which will update your pbuilder image and from there the dependency installation should work just fine.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=HJLItxNHRTM:VNn1Pehr21A:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=HJLItxNHRTM:VNn1Pehr21A:2nqncYFp4_M"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=2nqncYFp4_M" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=HJLItxNHRTM:VNn1Pehr21A:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=HJLItxNHRTM:VNn1Pehr21A:2mJPEYqXBVI"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=2mJPEYqXBVI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://muffinresearch.co.uk/archives/2012/09/15/fixing-pbuilder-dependency-404-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recover Files from Nandroid Backup</title>
		<link>http://muffinresearch.co.uk/archives/2011/10/27/recover-files-from-nandroid-backup/</link>
		<comments>http://muffinresearch.co.uk/archives/2011/10/27/recover-files-from-nandroid-backup/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 22:42:24 +0000</pubDate>
		<dc:creator>Stuart Colville</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://muffinresearch.co.uk/?p=1216</guid>
		<description><![CDATA[I recently flashed my Htc Desire with CyanogenMod 7.1 and I have to say it&#8217;s great to be free of htc sense. Given the rigmarole around the official Gingerbread update for the Desire I don&#8217;t think my next phone will be an htc one. Anyhow, prior to installing CM 7.1 I&#8217;d carefully made a nandroid [...]]]></description>
				<content:encoded><![CDATA[<p>I recently flashed my Htc Desire with CyanogenMod 7.1 and I have to say it&#8217;s great to be free of htc sense. Given the <a href="http://crave.cnet.co.uk/mobiles/htc-desire-gingerbread-update-available-if-youre-feeling-brave-50004594/">rigmarole around the official Gingerbread update</a> for the Desire I don&#8217;t think my next phone will be an htc one. </p>
<p>Anyhow, prior to installing CM 7.1 I&#8217;d carefully made a nandroid backup with ClockWorkMod recovery. Having set everything up I chose a ringtone + notification sound. Having lived with it for a bit I realised I miss the old sounds from the stock desire rom. To recover them I needed to mount extract the system.img file and then push the old audio files to the correct place.</p>
<p class="update">Warning: Please follow these steps at your own risk!</p>
<h3>Compiling unyaffs</h3>
<p>To extract .img files you&#8217;ll need <a href="http://code.google.com/p/unyaffs/">unyaffs</a> which can extract the files from a yaffs file system image. First copy the .img file into a directory. (For me the Nandroid img files were found in clockworkmod/backup/&lt;date&gt;/&lt;foo&gt;.img on the sdcard)</p>
<p>To compile unyaffs grab the unyaff.c and unyaffs.h from http://code.google.com/p/unyaffs/downloads/list and compile it with:</p>
<pre><code>gcc -o unyaffs unyaffs.c</code></pre>
<p>Once you&#8217;ve done that and added it to your path (alternatively copy it to /usr/local/bin).</p>
<p>Navigate to the directory containing the yaff img and run:</p>
<pre><code>./unyaffs system.img</code></pre>
<p>This will un-pack the files into that directory. </p>
<h3>Getting Files onto a Rooted Phone</h3>
<p>Once you have the files the next step is to get them onto your phone. To do that you&#8217;ll need the <a href="http://developer.android.com/sdk/index.html">Android SDK to be installed and set-up</a>.</p>
<p>When the SDK is there, connect your phone with the USB cable (with USB debugging enabled &#8211; Settings->Application->Development) run the following from the sdk&#8217;s platform-tools directory. </p>
<pre><code>./adb reboot recovery</code></pre>
<p>When the phone reboots to recovery mount the system partition.</p>
<p>Next as an example here&#8217;s the command I ran to copy the ringtones from the desire rom onto the phone:</p>
<pre><code>./adb remount
./adb push /home/bungle/desire-system/media/audio/ringtones /system/media/audio/ringtones</code></pre>
<p>This will copy all the files in the ringtones dir onto the phone.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=vnHVOWqe-Fs:YEsMvhKR-Ho:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=vnHVOWqe-Fs:YEsMvhKR-Ho:2nqncYFp4_M"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=2nqncYFp4_M" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=vnHVOWqe-Fs:YEsMvhKR-Ho:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=vnHVOWqe-Fs:YEsMvhKR-Ho:2mJPEYqXBVI"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=2mJPEYqXBVI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://muffinresearch.co.uk/archives/2011/10/27/recover-files-from-nandroid-backup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux: Spotify Screensaver D-Bus Script update</title>
		<link>http://muffinresearch.co.uk/archives/2011/10/27/linux-spotify-screensaver-d-bus-script-update/</link>
		<comments>http://muffinresearch.co.uk/archives/2011/10/27/linux-spotify-screensaver-d-bus-script-update/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 22:07:37 +0000</pubDate>
		<dc:creator>Stuart Colville</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Linux/Unix]]></category>

		<guid isPermaLink="false">http://muffinresearch.co.uk/?p=1207</guid>
		<description><![CDATA[Following on from my previous post about a script to Pause and Play tracks on spotify based on the status of the screensaver as reported by D-Bus on a Linux Desktop, here&#8217;s an update: With the latest versions of Spotify on Linux (e.g: 0.6.1.309.gb871a7d0, 0.6.2.291.gcccc1f58) the DBus interface has changed a little which has resulted [...]]]></description>
				<content:encoded><![CDATA[<p>Following on from my <a href="http://muffinresearch.co.uk/archives/2010/11/03/spotify-screensaver-toggle-with-dbus/">previous post</a> about a script to Pause and Play tracks on spotify based on the status of the screensaver as reported by D-Bus on a Linux Desktop, here&#8217;s an update:</p>
<p>With the latest versions of Spotify on Linux (e.g: 0.6.1.309.gb871a7d0, 0.6.2.291.gcccc1f58) the DBus interface has changed a little which has resulted in the need to make some changes so that the playing status is tracked correctly.</p>
<p>The code can be found here on github as a <a href="https://gist.github.com/1320970">Gist</a> or the <a href="https://raw.github.com/gist/1320970/e117fc63de0ee231c44eb6a532353bbab364673d/spotify_dbus_screensaver.py">raw file.</a></p>
<p><script src="https://gist.github.com/1320970.js?file=spotify_dbus_screensaver.py"></script></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=UmMJhEcGasM:m0ZM3KvY0b4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=UmMJhEcGasM:m0ZM3KvY0b4:2nqncYFp4_M"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=2nqncYFp4_M" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=UmMJhEcGasM:m0ZM3KvY0b4:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=UmMJhEcGasM:m0ZM3KvY0b4:2mJPEYqXBVI"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=2mJPEYqXBVI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://muffinresearch.co.uk/archives/2011/10/27/linux-spotify-screensaver-d-bus-script-update/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fronteers Conference 2011 – Day 2</title>
		<link>http://muffinresearch.co.uk/archives/2011/10/13/fronteers-conference-2011-day-2/</link>
		<comments>http://muffinresearch.co.uk/archives/2011/10/13/fronteers-conference-2011-day-2/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 22:03:26 +0000</pubDate>
		<dc:creator>Stuart Colville</dc:creator>
				<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://muffinresearch.co.uk/?p=1194</guid>
		<description><![CDATA[Here&#8217;s an overview of day two of the Fronteers Confernence. For day one see: Fronteers Conference 2011 &#8211; Day One Web Components and Model Driven Views &#8211; Alex Russell Alex Russell&#8217;s presentation was a really interesting look at the state of modern browsers along with the deatails on some really shiny but potentially controversial new [...]]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s an overview of day two of the Fronteers Confernence. For day one see: <a href="http://muffinresearch.co.uk/archives/2011/10/13/fronteers-conference-2011-day-one/">Fronteers Conference 2011 &#8211; Day One</a></p>
<h3>Web Components and Model Driven Views &#8211; <a href="http://infrequently.org/">Alex Russell</a></h3>
<p>Alex Russell&#8217;s presentation was a really interesting look at the state of modern browsers along with the deatails on some really shiny but potentially controversial new features that are currently being worked on in webkit. </p>
<p>First was a look at how the speed of new browser versions being released affects the progress of the web. With slides based <a href="http://arstechnica.com/web/news/2011/09/august-browser-stats-mobile-safari-on-top.ars">on the browser adoption graphs in this ars technica article</a>, it&#8217;s clear that Internet Explorer users tend to be much slower to upgrade their browsers. Especially with Firefox&#8217;s new release schedule both Chrome and Firefox are seeing much faster uptake of new versions. Faster releases means browsers are beginning to evolve more quickly resulting in a faster rate of progress. All of which can only be good for the web.</p>
<p>Moving beyond this Alex took a look at aspect of web components. First up was scoped CSS, the idea here being that you can &#8220;scope&#8221; CSS to a specific element. In this way that CSS will only apply to the children of that element.</p>
<p>Next was a look at Web Components. The first part of this is API that allows you to extend the DOM and create your own custom elements. The example given was the creation of a Comment object. Next a feature called DOM Shadow allows you to &#8220;hide&#8221; or make private the subtree that your custom object is created from so that it&#8217;s invisible to anything else. Interestingly, this is already something used in the development of video controls in webkit. This allows you to make something with divs and spans but hide the implementation details from the world. Depending on your point of view this is either fantastic news or will leave you feeling a little bit icky.</p>
<p>Lastly was a look at templating and model driven views which really do look good. It allows a template to be bound to data in such a way that when the data changes the template is updated. Definitely looks to be useful. </p>
<p>To see the full set of slides head over to <a href="http://infrequently.org/11/fronteers/fronteers.html">http://infrequently.org/11/fronteers/fronteers.html</a></p>
<h3>The New Developer Workflow &#8211; <a href="http://nimbupani.com/">Divya Manian</a></h3>
<p>This presentation was a walkthrough of steps that make-up the work flow of a modern web developer from using Version Control to deciding what browser features to use and when to use polyfills or not, vendor prefixes, CSS preprocessors and build scripts. </p>
<p>I enjoyed the walk-through of the features and capabilities of Compass (a CSS preprocessor). From a personal stand-point I&#8217;ve ever used SASS or LESS but seeing some of the features that Divya talked about I can see some worthwhile use-cases (time to try it out on a personal project maybe <img src='http://muffinresearch.co.uk/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ).</p>
<p><a href="http://nimbu.in/fronteers/">The New Developer Workflow Slides</a></p>
<h3>HTML5 Forms &#8211; KISS time &#8211; Robert Nyman</h3>
<p>Robert&#8217;s presentation was an honest look at the features of HTML5 forms and provided really good practical information on where the issues are and where as a developer you need to be careful. </p>
<p>Of particular interest was a number of caveats around using form validation features. For example: Required attribute will pass if you just submit a space. Email validation can&#8217;t cope with international characters e.g: röbert@kissonline.com won&#8217;t work. Pattern attributes can be submitted if they are empty (This is counter-intuitive though a commenter at the end of the session pointed out it makes sense that you would to use the required attr as well).</p>
<p>Overall the key takeaway here was the new HTML5 form features are cool, but like everything else they need to be used with care.</p>
<div style="width:425px" id="__ss_9583687"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/robnyman/html5-forms-kiss-time-fronteers" title="HTML5 Forms - KISS time - Fronteers" target="_blank">HTML5 Forms &#8211; KISS time &#8211; Fronteers</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/9583687" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/robnyman" target="_blank">Robert Nyman</a> </div>
</p></div>
<h3>CreativeJS &#8211; beauty in the browser &#8211; Seb Lee-Delisle</h3>
<p>This was perhaps the most surprising presentation of the event. Seb has a fantastic speaking style, very down to earth and good humoured. His presentation was in two parts, first was looking at how to create beautiful particle effects using JavaScript. Seb showed some very simple code which produced fantastic results. The approach was to create effects such as smoke and roman-candle like firework effects by approximating the physics and making it look just about right rather than spending a lot longer nailing an effect based on a 100% accurate physics model.</p>
<p>To play with all of this the files are on github. <a href="https://github.com/sebleedelisle/JavaScript-PixelPounding-demos">https://github.com/sebleedelisle/JavaScript-PixelPounding-demos</a></p>
<p>The next part was Seb&#8217;s software which turned the audiences mobiles into a giant display. This was mind-blowingly creative and a fascinating demonstration. The problems involved in this are pretty big, first was that of synchronising the signals sent to the phones so they would display in sync. This was done by measuring the delay from sending data to each phone. The next, even bigger problem was that of identifying where in the audience a given phone was. My understanding is that the software sends a pattern to each phone which it then looks for in the camera pointing at the audience. Having identified the location the audiences phones could then be used like a big display. Very cool stuff indeed!</p>
<h3>jQuery and the Open Source Process &#8211; <a href="http://ejohn.org/">John Resig</a></h3>
<p>John Resig talked in detail about how JQuery became popular through being very responsive to users in the early days and through building and fostering a community by being open and transparent.</p>
<div style="width:425px" id="__ss_8684698"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/openjournalism/open-source-process-jquery-by-john-resig" title="Open Source Process: jQuery by John Resig" target="_blank">Open Source Process: jQuery by John Resig</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/8684698" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/openjournalism" target="_blank">Open Journalism on the Open Web</a> </div>
</p></div>
<h3>In your @font-face &#8211; <a href="https://twitter.com/#!/jaffathecake">Jake Archibald</a></h3>
<p>Jake&#8217;s talk was very good &#8211; highly entertaining and also packed with interesting details about the potential issues and pitfalls in using web-fonts today. </p>
<p>There&#8217;s a number of problems to solve from how browsers treat @font-face, how to reduce the weight of fonts to download by reducing the glyphs used, to the way in which browser actually download the fonts to use them. All in all it&#8217;s a royal mess. Lastly Jake looked at how the way browser download fonts affects the final rendering.</p>
<p>Bottom line was that it really shouldn&#8217;t be this hard. </p>
<p>Jakes slides can be found at <a href="http://speakerdeck.com/u/jaffathecake/p/in-your-font-face">http://speakerdeck.com/u/jaffathecake/p/in-your-font-face</a></p>
<h3>The Prestige of being a web developer &#8211; <a href="http://www.wait-till-i.com/">Christian Heilmann</a></h3>
<p>Christian&#8217;s closing presentation was built around a theme of the film &#8220;<a href="http://www.imdb.com/title/tt0482571/">the Prestige</a>&#8220;. Christian made lots of good points about how we can be better developers by being inventive, learning from others, contributing to projects through documentation or submitting bugs and being open about what we do.</p>
<p><a href="http://www.wait-till-i.com/2011/10/07/the-prestige-of-being-a-web-developer-fronteers-11/">Slides and audio with a transcript are available on Christian&#8217;s blog</a> </p>
<p>And that was it.</p>
<p>A big thank-you to the speakers and organisers for putting on an excellent conference.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=cmn5i5HQZMo:_MHb0P2CylM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=cmn5i5HQZMo:_MHb0P2CylM:2nqncYFp4_M"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=2nqncYFp4_M" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=cmn5i5HQZMo:_MHb0P2CylM:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=cmn5i5HQZMo:_MHb0P2CylM:2mJPEYqXBVI"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=2mJPEYqXBVI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://muffinresearch.co.uk/archives/2011/10/13/fronteers-conference-2011-day-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fronteers Conference 2011 – Day One</title>
		<link>http://muffinresearch.co.uk/archives/2011/10/13/fronteers-conference-2011-day-one/</link>
		<comments>http://muffinresearch.co.uk/archives/2011/10/13/fronteers-conference-2011-day-one/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 17:04:49 +0000</pubDate>
		<dc:creator>Stuart Colville</dc:creator>
				<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://muffinresearch.co.uk/?p=1177</guid>
		<description><![CDATA[Recently I attended Fronteers 2011 held in Amsterdam. The entire conference was very well organised and the content across the two days was nicely balanced between more general thought provoking presentations, practical things that you could take away and use today and talks on where the web is heading, with good detail on some of [...]]]></description>
				<content:encoded><![CDATA[<p>Recently I attended <a href="http://fronteers.nl/congres/2011">Fronteers 2011</a> held in Amsterdam. The entire conference was very well organised and the content across the two days was nicely balanced between more general thought provoking presentations, practical things that you could take away and use today and talks on where the web is heading, with good detail on some of the new things we will have to play with in the future.</p>
<p>Here&#8217;s an overview of Day One. </p>
<h3>The Future is Native &#8211; <a href="http://aralbalkan.com/">Aral Balkan</a></h3>
<p>Aral Balkan presented the opening keynote with a presentation looking at where web experiences sit in relation to experiences provided by native applications. In a nutshell this presentation was about inspiring developers to embrace Use Experience (UX), to focus on the user&#8217;s needs rather than focus on technical considerations at the beginning. </p>
<p>Aral advocated a notion of &#8220;Write once, optimise everywhere&#8221;, starting with progressive enhancement as a basis, then optimising for features, and then to optimise for specific devices. I personally feel this is good ideal to aim for, however my immediate thought was that it&#8217;s important to be pragmatic and choose the battles to fight in terms of what devices you optimise for. </p>
<p>Towards the end of Aral&#8217;s presentation he looked at how UX is difficult; as you move away from face to face communication towards using a device you&#8217;re losing visual and audible cues. This means getting things right can be difficult but the right UX provides the &#8220;Superman effect&#8221; which in other words is to make the user feel empowered and feel good about their interactions with an application.</p>
<h3>Accessibility for the Modern Web &#8211; <a href="http://boxofchocolates.ca/">Derek Featherstone</a></h3>
<p>Derek Featherstone, gave a great talk on what considerations there are around building web applications that take into account accessibility. Firstly he looked at work he&#8217;d done in the past that had been criticised as being a collection of hacks. These were scripts that added accessibility features to existing applications, for example: <a href="http://simplyaccessible.com/article/keyboard-accessible-youtube-controls/">keyboard accessible you tube controls</a>, and adding keyboard accessible controls to <a href="http://ironfeathers.ca/routes/29/">google maps</a>. Derek went on to explain that the need for such &#8220;hacks&#8221; is because of decisions someone else made.</p>
<p>Following on from these inital examples Derek walked through a number of real-world examples where odd markup decisions had been made to provide (in come cases) a certain look and feel rather than using the best-fit native elements. For example Amazon use a convoluted customized checkbox widget rather than use a checkbox. Another example was Gmail&#8217;s compose links being a span with an onclick rather than a link. </p>
<p>Looking at examples of real-world problems the key points made were around choosing the right control for the job. Buttons for actions link to take the user somewhere. If you&#8217;re needing to use tabindex=0 to make something focusable then this a good point to reconsidering if you&#8217;re using the right control. </p>
<p>Another issue considered was management of focus. If a link opens a dialogue then once the user has closed the dialogue the focus should go back to the link that opened the dialogue. For a keyboard user focus is crucial and if you send focus to the top of the page constantly then you&#8217;re providing a very poor user experience. </p>
<p>Derek also provided some examples of use of tabindex had resulted in &#8220;keyboard trap&#8221;, in this case it was a form that had focus controlled in such a way that you couldn&#8217;t get to to certain fields through the use of tabbing to move through the fields. </p>
<p>Looking at keyboard interactivity Derek pointed out the caveats of using role=button on links. As assistive technology that support aria roles announces a link with role=button as a button the user will expect to be able to use the spacebar to activate it. However unless the site author has added keyboard handling to allow for this spacebar will do nothing. This is something that&#8217;s all too easy to do and whilst trying to be well-meaning the addition of such a role has impaired accessibility. </p>
<p>Derek&#8217;s presentation provided lots of great examples and practical advice and it&#8217;s definitely made me want to dive in to everything that we&#8217;re building an re-evaluate what improvements we can make to provide a better experience for all our users. In addition I feel it&#8217;s important to get a good sense for what a baseline experience should be so that it becomes a given that we build accessibility into sites rather than facing the prospect of retro-fitting it afterwards, as that&#8217;s always going to be more expensive in terms of time and effort.</p>
<h3>CSS3 Secrets: Ten things you might not know about CSS3 &#8211; <a href="http://leaverou.me/">Lea Verou</a></h3>
<p>Lea provided a great showcase of cool tips and tricks you can achieve with CSS3. Lots of interesting and cool stuff here. I particularly like the gradient tricks for faux-columns and the background-origin tips. Interestingly this highlights something I love about working with CSS in that creative approaches to problems can yield really good results. One of the best examples of this was the use of nth-child selectors to provide layout control based on the number of elements. </p>
<div style="width:425px" id="__ss_9591089"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/LeaVerou/css3-secrets-10-things-you-might-not-know-about-css3" title="CSS3 secrets: 10 things you might not know about CSS3" target="_blank">CSS3 secrets: 10 things you might not know about CSS3</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/9591089" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/LeaVerou" target="_blank">Lea Verou</a> </div>
</p></div>
<h3>You too can be a bedwetting antf**ker: <a href="http://www.brucelawson.co.uk/">Bruce Lawson</a></h3>
<p>Bruce&#8217;s Presentation highly entertaining presentation walked us through the new elements in HTML5, noting problems that currently existing in the specifications. This was a good overview of what&#8217;s new in HTML5 and where new elements provide more options for describing your content with more appropriate semantics.</p>
<div style="width:425px" id="__ss_9588237"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/brucelawson/you-too-can-be-a-bedwetting-antfucker-bruce-lawson-opera-fronteers-2011" title="You too can be a bedwetting antfucker: Bruce Lawson, Opera, Fronteers 2011" target="_blank">You too can be a bedwetting antfucker: Bruce Lawson, Opera, Fronteers 2011</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/9588237" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/brucelawson" target="_blank">brucelawson</a> </div>
</p></div>
<h3>Go with the flow: <a href="http://www.the-haystack.com/">Stephen Hay</a></h3>
<p>Stephen gave a talk on the exciting features of CSS Regions. <a href="http://caniuse.com/css-regions">CSS regions are just appearing on the horizon in terms of current browser support</a>, but that doesn&#8217;t diminish what interest creative possibilities they open up. I&#8217;d definitely recommend checking out the deck.</p>
<div style="width:425px" id="__ss_9595283"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/stephenhay/go-with-the-flow-9595283" title="Go With The Flow" target="_blank">Go With The Flow</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/9595283" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/stephenhay" target="_blank">Stephen Hay</a> </div>
</p></div>
<h3>The future of CSS&mdash;Current Experiments and Near Future Reality &#8211; <a href="http://www.xanthir.com/blog/">Tab Atkins Jr</a></h3>
<p>In this presentation Tab Atkins Jr (who works for google as a CSS specification writer) outlined a lot of cool features that are coming into CSS specifications and in some cases these are things that are starting to be implemented albeit experimentally in most cases.</p>
<h4>Image function</h4>
<pre><code>background: image("foo.webp", "foo.svg", "foo.png", blue);
background: image(rgba(0,0,255,.2)), url(foo.jpg);</code></pre>
<p>This allows fall-backs in the first example the first item that loads is used.<br />
The second example allows a transparent colour to be overlaid an image.</p>
<h4>Flexbox</h4>
<p>I particularly liked the flexbox example which demonstrated an input and button with the flex() used for the width so that it takes up the remaining space up to the button.</p>
<pre><code>&lt;div style="display: flexbox;"&gt;
	&lt;input style="width: flex(); display: block;"&gt;
	&lt;button&gt;foo&lt;/button&gt;
&lt;/div&gt;</code></pre>
<h4>Calc</h4>
<p>The <code>calc()</code> function (I can see this coming in very handy):</p>
<pre><code>calc(50% + 20px)
calc(100% / 7)</code></pre>
<p><code>attr()</code> lets you pull values from attributes on the element.</p>
<pre><code>width: attr(data-size as px, 100px);</code></pre>
<h4>CSS vars!!!</h4>
<pre><code>@var $header-color #006;
@var $main-color #06c;
@var $secondary-color #c06;
a { color: $main-color; }
a:visited { color: $secondary-color; }
h1 { 
  color: $header-color;
  background: linear-gradient(left,$main-color, transparent 25%);
}</code></pre>
<p>Tab noted that a lot of innovation was happening in the CSS preprocessor space and this was being recognised and informing some of the newer specs.</p>
<p>To see the full range of examples Tab&#8217;s Slides can be seen here: <a href="http://www.xanthir.com/talks/2011-10-06/">http://www.xanthir.com/talks/2011-10-06/</a></p>
<h3>Passion. Purpose. Promise. Pursuit &#8211; <a href="http://www.jenseninman.com/">Leslie Jensen-Inman</a></h3>
<p>The final presentation of day one was a call to action to embrace the things we are passionate about, define our purpose, make commitments to ourselves and others (promise) and to pursue these goals to make greats things and do good.</p>
<p>This was a sound message, and it&#8217;s easy to see how it can apply to being a web developer. Also something that we don&#8217;t often do is step back and evaluate ourselves and look at where we are heading and rationalise our interests with what we want to achieve.</p>
<p><a href="http://speakerdeck.com/u/jenseninman/p/passion-purpose-promise-pursuit ">Passion. Purpose. Promise. Pursuit. slide deck on Speaker Deck</a></p>
<p>For Day two see: <a href="http://muffinresearch.co.uk/archives/2011/10/13/fronteers-conference-2011-day-2/">Fronteers Conference Day 2</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=YaN3HnGyXAU:J-S48R8wr-I:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=YaN3HnGyXAU:J-S48R8wr-I:2nqncYFp4_M"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=2nqncYFp4_M" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=YaN3HnGyXAU:J-S48R8wr-I:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=YaN3HnGyXAU:J-S48R8wr-I:2mJPEYqXBVI"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=2mJPEYqXBVI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://muffinresearch.co.uk/archives/2011/10/13/fronteers-conference-2011-day-one/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux: Spotify Track Notifier with added D-Bus love</title>
		<link>http://muffinresearch.co.uk/archives/2011/03/23/linux-spotify-track-notifier-with-added-d-bus-love/</link>
		<comments>http://muffinresearch.co.uk/archives/2011/03/23/linux-spotify-track-notifier-with-added-d-bus-love/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 01:55:28 +0000</pubDate>
		<dc:creator>Stuart Colville</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Linux/Unix]]></category>

		<guid isPermaLink="false">http://muffinresearch.co.uk/?p=1135</guid>
		<description><![CDATA[I&#8217;ve recently updated the spotify notifier example I&#8217;d previously posted as an example along with my spotify screensaver script. First, I made an update to have it listen to the PropertiesChanged signal. Annoyingly for some unknown reason this signal isn&#8217;t visible in D-feet which had led to the erroneous assumption it wasn&#8217;t implemented. Implementing Album [...]]]></description>
				<content:encoded><![CDATA[<p><img src="http://mrl.staticfil.es/img/spotify-track-notifier.jpg" alt="spotify track notifier" /></p>
<p>I&#8217;ve recently updated the spotify notifier example <a href="http://muffinresearch.co.uk/archives/2010/11/03/spotify-screensaver-toggle-with-dbus/">I&#8217;d previously posted as an example along with my spotify screensaver script</a>. First, I made an update to have it listen to the <code>PropertiesChanged</code> signal. Annoyingly for some unknown reason this signal isn&#8217;t visible in D-feet which had led to the erroneous assumption it wasn&#8217;t implemented.</p>
<h3>Implementing Album Art</h3>
<p>After getting it working again, I started to think about how it would be nice to add album art. So I rigged up the script to the last.fm API to grab album art. I&#8217;d have preferred to pull the album art from spotify or via open.spotify.com, but annoyingly there doesn&#8217;t seem to be a way to get the album art url without scraping, which just seemed too much of a kludge. If anyone knows how to get album art from the spotify cache (assuming it&#8217;s there) then I&#8217;d be interested to hear about it.</p>
<h3>Listening for Spotify announcing itself on D-Bus</h3>
<p>Once I had that done, I then thought about how this script would run. Ideally it needs to run before spotify is necessarily open. This causes a problem though because if you try and listen for D-Bus events when the app in question isn&#8217;t running you&#8217;ll get an error.</p>
<p>So I used the <code>NameOwnerChanged</code> signal and listened for Spotify joining D-Bus and leaving it again. This then provided all that was needed to turn on or off the listener for the <code>PropertiesChanged</code> signal that fires when the track changes.</p>
<p>Also I added a check to try and set-up the <code>PropertiesChanged</code> listener at start-up in-case spotify is already running when the script is launched.</p>
<h3>The code</h3>
<pre><code>#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Title: Spotify Notification Demo
Author: Stuart Colville, http://muffinresearch.co.uk
License: BSD

"""

import os
import dbus
import gobject
import pynotify
import httplib2
from urllib import quote
from cgi import escape
from xml.dom.minidom import parseString
from hashlib import md5
from dbus.mainloop.glib import DBusGMainLoop
from dbus.exceptions import DBusException

LASTFM_API_KEY = os.environ.get("LASTFM_API_KEY")
HTTP_CACHE_DIR = os.path.expanduser("~/.cache/spotify/http/")
IMAGE_CACHE_DIR = os.path.expanduser("~/.cache/spotify/art/")
BASE_URL = ("https://ws.audioscrobbler.com/2.0/?method=album."
            "getinfo&#038;api_key=%s&#038;artist=%%s&#038;album=%%s" % LASTFM_API_KEY)

MISSING = os.path.realpath(os.path.join(os.path.dirname(__file__), "missing.png"))

if not os.path.isdir(HTTP_CACHE_DIR):
    os.makedirs(HTTP_CACHE_DIR)
if not os.path.isdir(IMAGE_CACHE_DIR):
    os.makedirs(IMAGE_CACHE_DIR)


class SpotifyNotifier(object):

    def __init__(self):
        """initialise."""
        bus_loop = DBusGMainLoop(set_as_default=True)
        self.bus = dbus.SessionBus(mainloop=bus_loop)
        loop = gobject.MainLoop()
        self.http = httplib2.Http(HTTP_CACHE_DIR)
        self.notify_id = None
        try: 
            self.props_changed_listener()
        except DBusException, e:
            if not ("org.mpris.MediaPlayer2.spotify "
                    "was not provided") in e.get_dbus_message():
                raise
        self.session_bus = self.bus.get_object("org.freedesktop.DBus", 
                                 "/org/freedesktop/DBus")
        self.session_bus.connect_to_signal("NameOwnerChanged", 
                                        self.handle_name_owner_changed,
                                        arg0="org.mpris.MediaPlayer2.spotify")

        loop.run()

    def props_changed_listener(self):
        """Hook up callback to PropertiesChanged event."""
        self.spotify = self.bus.get_object("org.mpris.MediaPlayer2.spotify", 
                                           "/org/mpris/MediaPlayer2")
        self.spotify.connect_to_signal("PropertiesChanged", 
                                        self.handle_properties_changed)

    def handle_name_owner_changed(self, name, older_owner, new_owner):
        """Introspect the NameOwnerChanged signal to work out if spotify has started."""
        if name == "org.mpris.MediaPlayer2.spotify":
            if new_owner:
                # spotify has been launched - hook it up.
                self.props_changed_listener()
            else:
                self.spotify = None


    def handle_properties_changed(self, interface, changed_props, invalidated_props):
        """Handle track changes."""
        metadata = changed_props.get("Metadata", {})
        if metadata:
            if pynotify.init("Spotify Notifier Demo"):

                title = unicode(metadata.get("xesam:title").encode("latin1"))
                album = unicode(metadata.get("xesam:album").encode("latin1"))
                artist = unicode(metadata.get("xesam:artist").encode("latin1"))
                hash_ = md5()
                hash_.update("%s-%s" % (artist, album))
                hash_path = hash_.hexdigest()
                image_path = os.path.join(IMAGE_CACHE_DIR, hash_path)
                if not os.path.exists(image_path):
                    url = BASE_URL % (escape(quote(artist.encode("utf8"))),
                                       escape(quote(album.encode("utf8"))))
                    response, content = self.http.request(url, "GET")
                    dom = parseString(content)
                    images = dom.getElementsByTagName("image")
                    for image in images:
                        for attr, value in image.attributes.items():
                            if attr == "size" and value == "medium":
                                image_url = None
                                if image and image.firstChild:
                                    image_url = image.firstChild.nodeValue
                                if image_url:
                                    response, image_contents = \
                                                self.http.request(image_url)
                                    if image_contents:
                                        fh = open(image_path, "w")
                                        fh.write(image_contents)
                                        fh.close()            

                if not os.path.exists(image_path):
                    image_path = MISSING

                alert = pynotify.Notification(title,
                              "by %s from %s" % (artist, album), image_path)
                if self.notify_id:
                    alert.props.id = self.notify_id
                alert.set_urgency (pynotify.URGENCY_NORMAL)
                alert.show()
                self.notify_id = alert.props.id

if __name__ == "__main__":
    SpotifyNotifier()</code></pre>
<h3>Pre-requisites</h3>
<ul class="ext">
<li><a href="http://www.spotify.com/uk/download/previews/">Spotify for Linux</a></li>
<li>A Spotify unlimited or premium account</li>
<li>Install httplib2: sudo apt-get install python-httplib2 (I think that&#8217;s the only dep that isn&#8217;t installed by default)</li>
<li>Set-up the script as outlined below.</li>
</ul>
<h3>Getting the code</h3>
<p>The code is available in a bzr branch here: <a href="http://code.projectfondue.com/stuart.colville/spotify-track-notify/files">code.projectfondue.com</a></p>
<p>To run it check it out and follow the notes in the README file. No doubt there might be some bugs so feel free to let me know of any possible improvements that can be made to it.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=-E6fNXMOHzo:WjEyLLF5hds:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=-E6fNXMOHzo:WjEyLLF5hds:2nqncYFp4_M"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=2nqncYFp4_M" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=-E6fNXMOHzo:WjEyLLF5hds:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=-E6fNXMOHzo:WjEyLLF5hds:2mJPEYqXBVI"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=2mJPEYqXBVI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://muffinresearch.co.uk/archives/2011/03/23/linux-spotify-track-notifier-with-added-d-bus-love/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Updating Vim to Use Plugins From Branches</title>
		<link>http://muffinresearch.co.uk/archives/2011/02/11/updating-vim-to-use-plugins-from-branches/</link>
		<comments>http://muffinresearch.co.uk/archives/2011/02/11/updating-vim-to-use-plugins-from-branches/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 00:05:00 +0000</pubDate>
		<dc:creator>Stuart Colville</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Linux/Unix]]></category>

		<guid isPermaLink="false">http://muffinresearch.co.uk/?p=1101</guid>
		<description><![CDATA[I decided the other evening that I should refresh my vim plugins to pick up any updates that have landed since the last time I updated them. The downside is that every time I want to do this, I have the pain of manually re-installing the updated files into the various plugin directories to get [...]]]></description>
				<content:encoded><![CDATA[<p>I decided the other evening that I should refresh my vim plugins to pick up any updates that have landed since the last time I updated them. The downside is that every time I want to do this, I have the pain of manually re-installing the updated files into the various plugin directories to get the plugins updated. This is far from ideal, so this time I decided to do something about it. First I stripped out all of the old plugins from <code>~/.vim/plugins</code> and made a list of the plugin repos on github.</p>
<h3>Pathogen</h3>
<p><a href="https://github.com/tpope/vim-pathogen">pathogen</a> is a helper for modifying the runtimepath. This makes it possible to branch a plugin from github to <code>.vim/bundle</code> and then pathogen will ensure that it&#8217;s added to the runtime path.</p>
<p>To make this work first you need to download pathogen and place it in <code>.vim/autoload</code></p>
<p>Next add the following to your <code>.vimrc</code> file:</p>
<pre><code>call pathogen#runtime_append_all_bundles()</pre>
<p></code></p>
<p>Once you have done this simple check-out the branches of your favorite vim plugins to .vim/bundle and that's it.</p>
<h3>Scripting plugin updates</h3>
<p>To make life even easier I knocked up a very crude python script and Makefile to clone all my favorite plugins when I run "make get" and update them when I run "make update".</p>
<p>It's crude because currently it only cares about git (currently all the plugins I care about are on github) and it doesn't currently allow revs to be specified. Though both of these features could be fairly easily added. Anyway, in-case it's useful as a starting point to for someone else, here's the script:</p>
<p>Also if you're using git to version your branch (I'm not). Then you could use <a href="http://book.git-scm.com/5_submodules.html">git submodules</a> to achieve a similar effect.</p>
<pre><code>#!/usr/bin/env python

import os
import sys
import subprocess

BUNDLE_DIR = os.path.expanduser("~/.vim/bundle")

plugin_branches = {
    "git": [
        "git://github.com/tomtom/tlib_vim.git",
        "git://github.com/garbas/vim-snipmate.git",
        "git://github.com/scrooloose/nerdtree.git",
        "git://github.com/scrooloose/syntastic.git",
        "git://github.com/MarcWeber/vim-addon-mw-utils.git",
        "git://github.com/scrooloose/nerdcommenter.git",
    ],
}

def get():
    os.chdir(BUNDLE_DIR)
    for vcs_type, branches in plugin_branches.items():
        if vcs_type == "git":
            for branch in branches:
                subprocess.call(["git", "clone", branch])

def update():
    os.chdir(BUNDLE_DIR)
    for vcs_type, branches in plugin_branches.items():
        if vcs_type == "git":
            for branch in branches:
                subdir = os.path.split(branch)[-1][:-4]
                os.chdir(subdir)
                subprocess.call(["git", "pull"])
                os.chdir("../")

if __name__ == "__main__":
    args = sys.argv
    if args and len(args) > 1:
        if args[1] == "get":
            sys.exit(get())
        elif args[1] == "update":
            sys.exit(update())</pre>
<p></code></p>
<p>If you save this somewhere as deps.py you can then run it as <code>python deps.py get</code> and <code>python deps.py update</code>. I use a simple Makefile to do this.        </p>
<p>The code is deliberately structured to make it easy to modify if you wanted to add mercurial or bzr support. That is left as an excercise for the reader.</p>
<p>It's likely I will update this script in due course, to keep up to date with that and any other aspects of my vim conf you can get the whole thing from here: <a href="https://code.launchpad.net/~muffinresearch/+junk/dotvim">lp:~muffinresearch/+junk/dotvim</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=L86684AN9tE:hoyQ849PGDI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=L86684AN9tE:hoyQ849PGDI:2nqncYFp4_M"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=2nqncYFp4_M" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=L86684AN9tE:hoyQ849PGDI:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=L86684AN9tE:hoyQ849PGDI:2mJPEYqXBVI"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=2mJPEYqXBVI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://muffinresearch.co.uk/archives/2011/02/11/updating-vim-to-use-plugins-from-branches/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FOSDEM 2011</title>
		<link>http://muffinresearch.co.uk/archives/2011/02/10/fosdem-2011/</link>
		<comments>http://muffinresearch.co.uk/archives/2011/02/10/fosdem-2011/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 18:02:41 +0000</pubDate>
		<dc:creator>Stuart Colville</dc:creator>
				<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://muffinresearch.co.uk/?p=1100</guid>
		<description><![CDATA[Photo by geekgrunge Last weekend I attended FOSDEM in Brussels. Here&#8217;s a few of my chosen highlights: James Turnbull &#8211; DevOps &#8211; More than Marketing This was a good overview of the devops mentality, and how operations and developers can work together more effectively for the greater good. In his presentation James Turnbull related how [...]]]></description>
				<content:encoded><![CDATA[<p><img src="http://mrl.staticfil.es/img/fosdem-2011.jpg" alt="janson room at fosdem 2011" width="540" height="329" /></p>
<p><a href="http://www.flickr.com/photos/geekgrunge/5424572353/in/photostream/">Photo by geekgrunge</a></p>
<p>Last weekend I attended <a href="http://fosdem.org/">FOSDEM</a> in Brussels. </p>
<p>Here&#8217;s a few of my chosen highlights:</p>
<h3>James Turnbull &#8211; DevOps &#8211; More than Marketing</h3>
<p>This was a good overview of the devops mentality, and how operations and developers can work together more effectively for the greater good.</p>
<p>In his presentation <a href="http://jamesturnbull.net/">James Turnbull</a> related how Operations people need to be involved in projects from the beginning. Otherwise there&#8217;s a tendency for developers to build something and then just throw it over the wall. Often this results in systems failing over as soon as there&#8217;s load. When things <em>do</em> go wrong, each side blames the other. Involvement from the beginning helps to avoid these &#8220;blame storms&#8221;. After-all It&#8217;s far better to spend time working on fixing the actual problem and ensuring it doesn&#8217;t happen again.</p>
<p>James listed several things that are important to smooth running of services, such as testing everything, ensuring that failures are expected and building redundancy in to allow for that. Testing is something that developers tend to have had more experience in, so systems people can potentially learn a lot from that. There was a reference to ops people thinking that testing means monitoring, whereas apps people see this differently. For example, a check for a mail server port being open, doesn&#8217;t actually prove it can send mail.</p>
<p>The last part of the presentation covered how it&#8217;s always better to hit problems hard early on, to prevent them evolving into larger problems. In the final part of the presentation James explained how it&#8217;s typical that people fear change. If you are someone that makes changes people will hate you! However, the good news is that often fear of change is mostly irrational and it can be dealt with by listening to concerns and providing clear examples of how change will provide benefits.</p>
<h3>Moving to the Client, HTML 5 is here &#8211; Christian Heilmann and Robert Nyman</h3>
<p><a href="http://www.wait-till-i.com/">Christian</a> and <a href="http://robertnyman.com/">Robert</a> make a great double-act. The presentation was informative but also at the same time light-hearted. Between them they listed key features of HTML5 and how those things can practically help you. They made good practical points <em>without</em> relying on superfluous shiny demos.</p>
<p>First up was forms and how all of the additional features of HTML5 can make for much richer experiences. For example; there are plenty of new input field types, such as colourpicker, range, search, email, phone, autocomplete, etc. The benefit of these is that by providing a more semantically correct field the user-agent can provide a much better experience by providing client-based validation and specific controls that match the information in a much more meaningful way. Validation can provide hooks for CSS by providing valid/invalid pseudo-classes on each element. New events provide additional hooks for behavioural changes. For example <code>onInputChange</code> allows the developer to provide step by step validation should they wish. Obviously all of this doesn&#8217;t negate the need for server-side validation but it does all add-up to a richer experience for the end-user.</p>
<p>Next up was a walkthrough of what was possible with HTMLCanvas. Robert detailed how to create shapes fills and paths. Clip was particularly interesting as it provides a way to provide a mask which only allows what&#8217;s in the transparent part to be visible. There was mention of using <a href="http://excanvas.sourceforge.net/">ExplorerCanvas</a> a JS library that converts canvas to vml for Internet Explorer  versions that don&#8217;t support canvas.</p>
<p>The next subject was video. Flash is seen to be a black box whereas HTML5 audio and video are like any other HTML element. The big benefit with HTML5 audio and video is that they provide native controls provided by the browser. This is immediately much better for accessibility, but not only that HTML5 provides a far more extensive API. <a href="http://vid.ly">Vid.ly</a> was mentioned as a great new way to provide video in many formats, e.g. webm, ogg, streaming for iOS etc. The particularly nice thing is that it provides a single universal url, and the correct video format will be supplied depending on the usage.</p>
<p>Web storage was up next with some examples of storing and retrieving JSON from storage. An interesting note was that 5mb is the limit on what can be stored without the user being asked if they allow it. A goal with web storage is that it should provide the ability to have a seamless offline experience. A point was made about the IE api being different by actually being the most robust for determining when it is offline.</p>
<p>Lastly there was some focus on some good examples of pratical demos that show off what is possible with HTML5. Shape detection e.g. Face detection. <a href="http://www.patrick-wied.at/static/nudejs/">Nude.js</a> was mentioned which is a library that looks to provide client-side nudity detection with JS and HTMLCanvas (potentially NSFW). Audio analysis, Image generation. </p>
<p>Overall a lot of ground was covered that made you think about what&#8217;s possible with HTML5.</p>
<h4>Slides and Audio</h4>
<ul class="ext">
<li><a href="http://www.slideshare.net/cheilmann/moving-to-the-client-html5-is-here">Slides</a></li>
<li><a href="http://www.archive.org/details/Html5IsHere-ChrisHeilmannAndRobertNymanAtFosdem2011">Audio</a></li>
</ul>
<h3>I&#8217;m going M.A.D. (Monitoring and Metrics) &#8211; Spike Morelli</h3>
<p><a href="http://www.spikelab.org/">Spike&#8217;s</a> presentation provided plenty of great reasons why you should look to having as much data about your application as possible. He showed some good examples of how metrics can provide great in-sights into what is happening with your code. I missed the early part of the talk due to cross over with the HTML5 one, but there were some interesting points about code metrics, e.g. code coverage, number of tests and lines of code. The lines of code metric in isolation doesn&#8217;t tell you very much. However when combined with the number of tests and code coverage, when the coverage increased and the number of lines dropped it was clear to see this was a point where the code was refactored.</p>
<p>Spike related how style-based metrics are useful too, e.g. Linting, PEP8 and that beautiful code should be rewarded. He then went on to say how Monitoring provides the means to see problems before they happen, for example monitoring memory on staging could spot a memory leak before it hits production. For me this raises the important point that monitoring staging and non-production systems can be worthwhile. Though clearly for that to be really effective you would need a good way of reproducing the load of production in your staging environments.</p>
<h3>Practical Go Programming &#8211; Andrew Gerrand</h3>
<p>This was a really good presentation, taking the example of building out a URL shortener using GO. It went all the way from dealing with the basics to a Master/Slave configuration using RPC, finishing with a great demo showing a realtime graph of live testing against the master and the read-only slaves.</p>
<p>Due to the code example based nature of this presentation, the best way to see this is to take a look at the slide deck which is available here: <a href="http://wh3rd.net/practical-go/#(1)">Practical Go Programming</a></p>
<p>Go intrigues me and I came away thinking I would certainly look to take a close look at it, time allowing <img src='http://muffinresearch.co.uk/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<h3>The Storage Technologies Behind Facebook Messages &#8211; Nicolas Spiegelberg</h3>
<p>This talk went into great detail about the HBase set-up used at facebook where they condense many sources of message; emails, sms and chat into a consolidated approach that allows people to talk to their friends without needing to care about the medium. It started off with a glossy video describing the high-level problem and their high level solution to combine message into one simple approach.</p>
<p>The details on the amounts of data were amazing, 15 Billion emails, 120 Billion chat messages amounting to 25TB data per month. As people aren&#8217;t deleting data this solution needs to provide greater and greater amounts of storage on an ongoing basis.</p>
<p>HBase solves this problem by providing a strong consistency model, automatic failover, multiple shards per server for load balancing and to prevent cascading failures. The other interesting point is that it allows them to take down a large amount of machines and keep running with the rest. This is handy for when they are running dark launches where they were testing some of the new messaging features without exposing it to users but to put it under live load conditions. All of this helps them meet the goal of having zero data loss.</p>
<p>An interesting facet of the talk was where they talked about their contributions to the HBase project. It sounded like they are very actively involved and there&#8217;s good cross-company collaboration on the project which is certainly good to hear. </p>
<h3>In Summary</h3>
<p>In summary Fosdem 2011 was a great experience, and I thoroughly enjoyed it. </p>
<p>One thing I did learn was that staying in the centre of Brussels is probably overall easier for socialising in the evening vs getting to and from the venue. However this did at least give me a great opportunity to take a walk and see more of the city.</p>
<p>Everything was very well organised. The only downside was that I couldn&#8217;t see some of the presentations I wanted to because I had been to other presentations first. Some tracks like the configuration management one were full from start to finish so. That said, there were so many great presentations happening it was really easy to go and find something else interesting.</p>
<p>This was my first Fosdem and it was excellent, I look forward to next year.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=ilzSzgyfvDM:sX23wYqTx1w:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=ilzSzgyfvDM:sX23wYqTx1w:2nqncYFp4_M"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=2nqncYFp4_M" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=ilzSzgyfvDM:sX23wYqTx1w:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=ilzSzgyfvDM:sX23wYqTx1w:2mJPEYqXBVI"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=2mJPEYqXBVI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://muffinresearch.co.uk/archives/2011/02/10/fosdem-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android: Force Moving Apps to an SD Card</title>
		<link>http://muffinresearch.co.uk/archives/2011/02/02/android-force-moving-apps-to-an-sd-card/</link>
		<comments>http://muffinresearch.co.uk/archives/2011/02/02/android-force-moving-apps-to-an-sd-card/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 19:19:55 +0000</pubDate>
		<dc:creator>Stuart Colville</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://muffinresearch.co.uk/?p=1081</guid>
		<description><![CDATA[This isn&#8217;t anything new but I thought I would share my experiences of trying to free space on my HTC desire by forcing apps to be movable to the sd card using the android SDK on linux. WARNING: Ensure you have a backup of any important data before you start in case something goes wrong. [...]]]></description>
				<content:encoded><![CDATA[<p><img src="http://mrl.staticfil.es/img/droids.png" alt="Droids Skateboarding" with="540" height="245" /></p>
<p>This isn&#8217;t anything new but I thought I would share my experiences of trying to free space on my HTC desire by forcing apps to be movable to the sd card using the android SDK on linux.</p>
<p><strong>WARNING</strong>: Ensure you have a backup of any important data before you start in case something goes wrong. Carrying out these instructions is at your own risk.</p>
<p>Running out of space is really the only annoyance I have come across since owning an android phone. Every now and again the low space icon comes up and you have to try and free up some space.</p>
<p>Since Froyo you&#8217;ve been able to move certain apps to SD card, but it&#8217;s only if the developer allows it. If you&#8217;re an android developer and you want to know how to do it, see this post: <a href="http://mobile.tutsplus.com/tutorials/android/move-to-sd-card/">Enabling the Android Move To SD Card Feature</a></p>
<p>So if you&#8217;re stuck with a bunch of apps you can&#8217;t move by default because &#8220;Move to SD Card&#8221; is greyed out in &#8220;Settings -> Applications -> Manage Applications -> Appname&#8221; then you might be thinking it&#8217;s not possible. However, <em>it is</em> possible to change the default install location to SD card via adb.</p>
<h3>Introducing the Android Debug Bridge</h3>
<p>Adb is the <a href="http://developer.android.com/guide/developing/tools/adb.html">Android Debug Bridge</a> which comes as part of the SDK. If you don&#8217;t have the SDK the first thing you will need to do is install it (get it from<a href="http://developer.android.com/sdk/index.html">developer.android.com</a>). Once you have the SDK you can find the adb tool in &lt;sdk&gt;/platform-tools/, though in my case I have it at &lt;sdk&gt;/tools/.</p>
<p class="update">Update 2012-01-26: You may find when you unpack the SDK adb isn&#8217;t there. If that&#8217;s the case you may need to run the &#8220;<code>android</code>&#8221; program (<code>./android</code> under linux) to be shown a window which provides a way to download platform-tools. once you have installed that you should find <code>adb</code> there.</p>
<p>After you&#8217;ve installed the SDK you&#8217;ll need to connect your phone to your computer using the USB data cable. You&#8217;ll also need to make sure that debugging is possible by visiting &#8220;Settings -> Applications -> Development&#8221; and checking &#8220;USB Debugging&#8221;.</p>
<h3>Enabling moving of apps to SD card</h3>
<p>To change the the install location we are going to run the pm command via the adb shell. Here&#8217;s the details of the pm command:</p>
<pre><code>The setInstallLocation command changes the default install location
  0 [auto]: Let system decide the best location
  1 [internal]: Install on internal device storage
  2 [external]: Install on external media</code></pre>
<p>To change the default install location to the SD card (which also enables moving most apps to the SD card.) run the following from the dir containing the adb command:</p>
<pre><code>./adb shell pm setInstallLocation 2</code></pre>
<p>If you at any point hit the following:</p>
<pre><code>error: insufficient permissions for device</code></pre>
<p>Try doing this:</p>
<pre><code>./adb kill-server
sudo ./adb  start-server</code></pre>
<p>You should now find you can run the above commands without error.</p>
<h3>Insufficient Storage Available</h3>
<p>The other error I had was that when I was trying to move any app after changing the default install location to the SD card was something along the lines of &#8220;Unable to move application. Insufficient Storage&#8221;.</p>
<p>The way I got around this was to uninstall twitter which was using about 17mb (it was the largest app). After that I re-installed it and it used far less space (naturally as the data would have been removed by the re-install process). After that I was able to successfully move most of my remaining apps (twitter included) to my SD card.</p>
<h3>Re-setting the installation location back to auto</h3>
<p>I&#8217;d strongly recommend re-setting the default installation location when you are done moving apps. The reason for this is that apps will fail to be installed directly to the external location, at least this is what I experienced when trying to re-install the twitter app.</p>
<p>To reset the install location to automatic (let the system decide) use the following:</p>
<pre><code>./adb shell pm setInstallLocation 0</code></pre>
<p>Should you forget where it was left at you can always run:</p>
<pre><code>./adb shell pm getInstallLocation</code></pre>
<p>e.g:</p>
<pre><code>$ ./adb shell pm getInstallLocation
0[auto]</code></pre>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=nRgh-QRtSSw:X1-FYfPRYp0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=nRgh-QRtSSw:X1-FYfPRYp0:2nqncYFp4_M"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=2nqncYFp4_M" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=nRgh-QRtSSw:X1-FYfPRYp0:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/muffinres/skimmed?a=nRgh-QRtSSw:X1-FYfPRYp0:2mJPEYqXBVI"><img src="http://feeds.feedburner.com/~ff/muffinres/skimmed?d=2mJPEYqXBVI" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://muffinresearch.co.uk/archives/2011/02/02/android-force-moving-apps-to-an-sd-card/feed/</wfw:commentRss>
		<slash:comments>111</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 0.386 seconds -->
