<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Clock Blog]]></title><description><![CDATA[Clock Blog]]></description><link>http://clock.co.uk</link><generator>NodeJS RSS Module</generator><lastBuildDate>Wed, 22 May 2013 12:06:36 GMT</lastBuildDate><atom:link href="http://clock.co.uk/feed" rel="self" type="application/rss+xml"/><item><title><![CDATA[Our responsive toolkit]]></title><description><![CDATA[Here at Clock, the vast majority of our web projects are now responsive. Whether we implement a fully fluid design or a set of fixed breakpoints, we now approach projects with an extended armoury – making sure we deliver a top experience across devices. Here's a run down of some of the tools and libraries that help us along the way…


## Stylus
[learnboost.github.io/stylus](http://learnboost.github.io/stylus)

Stylus is our CSS pre-processor of choice. You may prefer to look at SASS (or something else), which will have similar features. It's really handy for splitting styles out into small and easy to digest files. To keep all of our media queries in check, we set them up once in a settings file, then we can refer to them by name anywhere we want. If a breakpoint has to change by a few px in the future, no problem – we change it once, and it gets updated everywhere the variable was used!

```
/* settings.styl */
$b1 = "only screen and (min-width: 800px)"

/* some-styles.styl */
@media $b1
  *
    color red
```

## Break
[github.com/bengourley/break](http://github.com/bengourley/break)

Break is a little library that I've written to bring breakpoint awareness to JavaScript. Sometimes it's more than just a stylistic change that needs to happen based on the result of a media query, and the JS needs to do some setup/teardown when a breakpoint changes.

```
$(window)
  .on('enter.b1', function () {
    // The window size got increased from <800px to ≥800px
    setupLargerScreenFunctionality()
  })
  .on('exit.b1', function () {
    // The window size got decreased from ≥800px to <800px
    teardownLargerScreenFunctionality()
  })

// Add the breakpoint last because
// it gets evaluated when added
window.addBreakpoint('b1', 'only screen and (min-width: 800px)')
```

## Zepto FX
[bengourley.co.uk/css-transitions-for-jquery](http://bengourley.co.uk/css-transitions-for-jquery)

We still use jQuery so that we can offer decent support for pre ES5 browsers (though hopefully not for much longer!), but jQuery still uses the `setTimeout()` method for animation, which is notoriously slow on lower powered devices because it rapidly alters the DOM. While in this middle ground state between being able to rely on CSS transitions and having to support older browsers, we use the technique I have linked to above to hack on Zepto's FX module – which uses CSS transitions – as a jQuery plugin. This means we have an opt-in `$.fn.transition()` function that can provide us with performant animations, but we can fallback to the slow but stable `$.fn.animate()` if we need to.

## Responsive Grids
[github.com/csswizardry/csswizardry-grids](https://github.com/csswizardry/csswizardry-grids)

Every project of ours is different and has its own specific design requirements. For this reason we rarely are able to use exactly the same grid across projects. However, lately we have been able to spawn many project-specific grids from the csswizardy-grids project by Harry Roberts. This means that although there are slight project differences, usage across projects is pretty consistent and we get to leverage the great efforts in research and prototyping and testing that have gone into the grid system.

We find these tools incredibly useful for building responsive sites, so I hope they are of help to anyone reading. If you have any that you would recommend, feel free to do so in the comments.]]></description><link>http://clock.co.uk/tech-blogs/our-responsive-toolkit</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/our-responsive-toolkit</guid><dc:creator><![CDATA[Ben Gourley]]></dc:creator><pubDate>Wed, 08 May 2013 00:00:00 GMT</pubDate></item><item><title><![CDATA[Front-End London April]]></title><description><![CDATA[<script src="//storify.com/plimbs/front-end-london-april.js" ></script><noscript>[<a href="//storify.com/plimbs/front-end-london-april" >View the story "Front-end London April " on Storify</a>]</noscript><span rel="pastemarkerend" id="pastemarkerend7268"></span><br>
]]></description><link>http://clock.co.uk/creative-blogs/front-end-london-april</link><guid isPermaLink="true">http://clock.co.uk/creative-blogs/front-end-london-april</guid><dc:creator><![CDATA[Sophie Plimbley]]></dc:creator><pubDate>Thu, 25 Apr 2013 17:46:54 GMT</pubDate></item><item><title><![CDATA[Front-End London March]]></title><description><![CDATA[<div><span rel="pastemarkerend" id="pastemarkerend20787">
<script src="//storify.com/plimbs/front-end-london-march-bank-holiday.js"></script><noscript>[<a href="//storify.com/plimbs/front-end-london-march-bank-holiday" target="_blank">View the story "Front-end London March " on Storify</a>]</noscript>
</span></div>]]></description><link>http://clock.co.uk/creative-blogs/front-end-london-march</link><guid isPermaLink="true">http://clock.co.uk/creative-blogs/front-end-london-march</guid><dc:creator><![CDATA[Sophie Plimbley]]></dc:creator><pubDate>Sat, 30 Mar 2013 12:04:16 GMT</pubDate></item><item><title><![CDATA[Just remember...]]></title><description><![CDATA[<p>It's just another day. A commute into work, a general chit-chat about the nights activities with fellow early starter colleagues/friends, check some emails and quickly see what is going on in the big wide world... fire up Google Reader and, oh yeah, that dreaded, impending message:</p>

<p><img src="/asset/5141ae5e42048fc867000005/Screen Shot 2013-03-14 at 09.29.34.png" style="cursor: default;"></p>

<p>Oh no!</p>

<p>I guess all good things must come to an end.&nbsp;</p>

<p>It reminds us that when using cloud services (free or paid) we should be aware of the consequences of shut-down. Luckily Google are well versed at planning and looking after Users - so they have offered up solutions like Google Takeout in order to export personal feeds for use by another feed reader.</p>

<p>Our advice when choosing cloud services is to make sure you have an exit strategy when selecting your service.&nbsp;</p>

<p>A few quick questions should help when first choosing a service:</p>

<ul>
	<li>Is it the only service operating in this space? (e.g. will you become&nbsp;dependent&nbsp;on it?)</li>
	<li>Does it provide export options?</li>
	<li>Will other services allow imports?</li>
</ul>
<p>Even if all the answers are "<b>no</b>" - being aware that you are&nbsp;entering&nbsp;a service with no-failover could useful.&nbsp;You will be much more likely to create your own back-ups, fail safes etc and if the worse does happen, at least you will have considered it.</p>
<p>Anyway, personally we loved Google Reader and July 2nd will be a sad day :(</p>

<p>Just in case they can be swayed, we have signed this:&nbsp;<a href="https://www.change.org/petitions/google-keep-google-reader-running" style="line-height: 1.5em;">https://www.change.org/petitions/google-keep-google-reader-running</a></p>

<p>p.s If you are interested, the easiest import we have found so far has been Feedly - but with all feed readers it's a case of UI and making sure you are happy with the tools and layout it provides. Pulse looks nice, but not found a nice way to import easily from Google Reader exports yet.</p>]]></description><link>http://clock.co.uk/misc/just-remember</link><guid isPermaLink="true">http://clock.co.uk/misc/just-remember</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Thu, 14 Mar 2013 10:59:55 GMT</pubDate></item><item><title><![CDATA[Clock goes to Front-End London]]></title><description><![CDATA[<script src="//storify.com/plimbs/clock-creatives-and-tech-fel.js?header=false"></script><noscript>[<a href="//storify.com/plimbs/clock-creatives-and-tech-fel" >View the story "Clock Creatives & Tech #FEL" on Storify</a>]</noscript><span rel="pastemarkerend" id="pastemarkerend53714"></span><br>
]]></description><link>http://clock.co.uk/creative-blogs/clock-goes-to-front-end-london</link><guid isPermaLink="true">http://clock.co.uk/creative-blogs/clock-goes-to-front-end-london</guid><dc:creator><![CDATA[Sophie Plimbley]]></dc:creator><pubDate>Fri, 01 Mar 2013 14:03:24 GMT</pubDate></item><item><title><![CDATA[Conference Highlights: Digital Media Strategies 2013, Day 2]]></title><description><![CDATA[<script src="//storify.com/clock/digital-media-strategies-2013-2014.js"></script><noscript>[<a href="//storify.com/clock/digital-media-strategies-2013-2014" target="_blank">View the story "Digital Media Strategies, 2013 - Day 2" on Storify</a>]</noscript>]]></description><link>http://clock.co.uk/social-media-2/conference-highlights-digital-media-strategies-2013-day-2</link><guid isPermaLink="true">http://clock.co.uk/social-media-2/conference-highlights-digital-media-strategies-2013-day-2</guid><dc:creator><![CDATA[Sam Fresco]]></dc:creator><pubDate>Thu, 21 Feb 2013 12:51:54 GMT</pubDate></item><item><title><![CDATA[Conference Highlights: Digital Media Strategies 2013, Day 1]]></title><description><![CDATA[<div class="sfy-story" url="//storify.com/clock/digital-media-strategies-2013" style="display: block; clear: left;"><iframe src="//storify.com/clock/digital-media-strategies-2013/embed?" name="clock-digital-media-strategies-2013" scrolling="no" frameborder="no" allowtransparency="true" style="display: block; background-color: transparent; border: none; overflow: hidden; width: 100%; max-width: 900px; height: 4318px; min-height: 4318px;"></iframe></div>
<script src="//storify.com/clock/digital-media-strategies-2013.js"></script><noscript>[<a href="//storify.com/clock/digital-media-strategies-2013" target="_blank">View the story "Digital Media Strategies, 2013" on Storify</a>]</noscript>]]></description><link>http://clock.co.uk/social-media-2/conference-highlights-digital-media-strategies-2013-day-1</link><guid isPermaLink="true">http://clock.co.uk/social-media-2/conference-highlights-digital-media-strategies-2013-day-1</guid><dc:creator><![CDATA[Sam Fresco]]></dc:creator><pubDate>Thu, 21 Feb 2013 11:35:19 GMT</pubDate></item><item><title><![CDATA[Preventing 'http: Raise hangup error on destroyed socket write' from crashing your node.js server]]></title><description><![CDATA[[@tomgco](https://twitter.com/tomgco) and I were hacking late on a new Clock
node.js project. The caffeine fueled [@tomgco](https://twitter.com/tomgco) loves
pounding browser refresh like a freaking machine gun, then I hear “Oh my web server has
crashed!” Developers pummel refresh, it's a fact of life, but it doesn't normally cause the 
httpServer to crash. Earlier that day we'd upgraded node to 0.8.20 so it didn't take long to turn our attention to the changelog and then on to a tweet that Tom had spotted.

[https://twitter.com/nodejs/status/303893363877363712](https://twitter.com/nodejs/status/303893363877363712)

**‘No more leaking memory’**; This killer line fills me with mixed
emotion. Memory leaks are our new worst enemy since switching to node.js. Sneaking up on us, killing our services at peak times and keeping me up at night reading the dtrace manual. Naturally I’m ecstatic to find there will be less of them, but at the same time, **ALL MY NODE APPS ARE LEAKING
MEMORY** and the fix requires a code change. Dang!

After some googling and testing we confirmed the following fix in 0.8.20 was now causing
our development web server to crash:

      http: Raise hangup error on destroyed socket write (isaacs)

Here is the original commit:

[https://github.com/isaacs/node/commit/e261156e7386e3d870543bee4218c7f106bfcf22](https://github.com/isaacs/node/commit/e261156e7386e3d870543bee4218c7f106bfcf22)

Pulling down to the stable branch: [https://github.com/joyent/node/pull/4775](https://github.com/joyent/node/pull/4775)

and found issues were already coming in:
[https://github.com/ether/etherpad-lite/issues/1541](https://github.com/ether/etherpad-lite/issues/1541)
[https://github.com/LearnBoost/socket.io/issues/1160](https://github.com/LearnBoost/socket.io/issues/1160)

In case you missed it, this isn’t going to get fixed properly in 0.8

``` 
“The proper fix is to treat ECONNRESET correctly. However, this is a behavior/semantics change, and cannot land in a stable branch. So, the full-of-sad bandaid fix is to not put data into the output buffer if the socket is destroyed, and also remove anything that is in the output buffer when the HTTP request sees that it closes.”- issacs
```

We just needed a ‘bandaid’ on our 0.8 apps and I was actually glad to have good reason to retro fit Domains around our apps.

## The Problem

Below is a simple web server that waits 5 seconds before responding. This will
error in 0.8.20 when the client connection hangs up.

```
var http = require('http')

http.createServer(function (req, res) {

  // Wait 5 seconds before responding
  setTimeout(function () {
    res.writeHead(200, {'Content-Type': 'text/plain'})
    res.end('Hello World\n')
  }, 5000)

}).listen(1337, '127.0.0.1')

setInterval(function () {
  console.log(process.memoryUsage().rss)
}, 2000)

console.log('Server running at http://127.0.0.1:1337/')
```

Running this server pre 0.8.20 you can:

      curl http://127.0.0.1:1337/ & ; sleep 2 && killall curl

Which will kill the connection atfer 2 seconds and you won't see any errors from
the server but instead get a memory leak.

Switch to 0.8.20. (We use [nave](https://npmjs.org/package/nave)) to quickly switch node versions:

      nave use 0.8.20

Run the server, then connect run the curl oneliner

      curl http://127.0.0.1:1337/ & ; sleep 2 && killall curl

You'll see the server errors and dies.

```
timers.js:103
            if (!process.listeners('uncaughtException').length) throw e;
                                                                      ^
Error: socket hang up
    at createHangUpError (http.js:1360:15)
    at ServerResponse.OutgoingMessage._writeRaw (http.js:507:26)
    at ServerResponse.OutgoingMessage._send (http.js:476:15)
    at ServerResponse.OutgoingMessage.write (http.js:740:18)
    at ServerResponse.OutgoingMessage.end (http.js:882:16)
    at Object._onTimeout (/socket-hangup/server.js:8:9)
    at Timer.list.ontimeout (timers.js:101:19)
```

## Our Solution

Wrap the request and response in a domain.

```
var http = require('http')
  , domain = require('domain')
  , serverDomain = domain.create()

// Domain for the server
serverDomain.run(function () {

  http.createServer(function (req, res) {

    var reqd = domain.create()
    reqd.add(req)
    reqd.add(res)

    // On error dispose of the domain
    reqd.on('error', function (error) {
      console.error('Error', error, req.url)
      reqd.dispose()
    })

    // Wait 5 seconds before responding
    setTimeout(function () {
      res.writeHead(200, {'Content-Type': 'text/plain'})
      res.end('Hello World\n')
    }, 5000)

  }).listen(1337, '127.0.0.1')

})


setInterval(function () {
  console.log(process.memoryUsage().rss)
  if (typeof gc === 'function') {
    gc()
  }
}, 2000)

console.log('Server running at http://127.0.0.1:1337/')
```

## Express

If you are using express 3 you can apply a fix like this

```
var http = require('http')
  , domain = require('domain')
  , serverDomain = domain.create()
  , express = require('express')
  , app = express()

app.get('/', function (req, res) {

  // Wait 5 seconds before responding
  setTimeout(function () {
    res.send('Hello World')
  }, 5000)

})

// Domain for the server
serverDomain.run(function () {

  http.createServer(function (req, res) {

    var reqd = domain.create()
    reqd.add(req)
    reqd.add(res)

    // On error dispose of the domain
    reqd.on('error', function (error) {
      console.error('Error', error.code, error.message, req.url)
      reqd.dispose()
    })

    // Pass the request to express
    app(req, res)

  }).listen(1337, '127.0.0.1')

})

setInterval(function () {
  console.log(process.memoryUsage().rss)
  if (typeof gc === 'function') {
    gc()
  }
}, 2000)

console.log('Server running at http://127.0.0.1:1337/')
```

We’ve not got this in production yet but this patch looks like it is going to
get us by. If you have a better solution please let us know.]]></description><link>http://clock.co.uk/tech-blogs/preventing-http-raise-hangup-error-on-destroyed-socket-write-from-crashing-your-nodejs-server</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/preventing-http-raise-hangup-error-on-destroyed-socket-write-from-crashing-your-nodejs-server</guid><dc:creator><![CDATA[Paul Serby]]></dc:creator><pubDate>Wed, 20 Feb 2013 19:37:58 GMT</pubDate></item><item><title><![CDATA[Clock Week in Pictures 08/02/2013]]></title><description><![CDATA[<p><i>Say goodbye to the WIP, as this is the last one! Don't fear though – it's not as bad as it sounds, we're just changing format slightly. After this week, we'll be aiming for a fortnightly frequency, but the slightly less restrictive moniker of 'Clock in Pictures' will allow us to proceed at whatever speed our pictures come in at. Now, let's recap on this week's action…</i></p>

<p>Two days of hacking gets work started on a curiously codenamed project…</p>

<p><img src="/asset/51150529e6a982d763000005/catfish.jpg" style="cursor: default;"></p>

<p>Claire toured the university circuit to spread the word about our placement scheme. Speaking of which, if want to know more or think you've got what it takes, get in touch with us at <a href="mailto:jobs@clock.co.uk">jobs@clock.co.uk</a>…</p>

<p><img src="/asset/5115068217dd54d663000006/claire.jpg" style="cursor: default;"></p>

<p>Vince spots a confusingly permissive sign during a mad dash through Heathrow Airport…</p>

<p><img src="/asset/511506f217dd54d663000007/sign.jpg" style="cursor: default;"></p>

<p>Syd <i>literally</i> hits the slopes in Söll for a stag week – pictured here shortly before a collision resulting in a cracked rib. D'oh…</p>

<p><img src="/asset/5115078b17dd54d663000008/moutain.jpg" style="cursor: default;"></p>

<p>Suspicious about the presence of mice in his house, Paul sets up a motion sensing infra-red camera to email him a picture when the little suspects visit. So far the camera's been unsuccessful, but here's a test shot of a tiny elephant setting it off…</p>

<p><img src="/asset/5115089217dd54d663000009/mice.jpg" style="cursor: default;"></p>
]]></description><link>http://clock.co.uk/misc/clock-week-in-pictures-08-02-2013</link><guid isPermaLink="true">http://clock.co.uk/misc/clock-week-in-pictures-08-02-2013</guid><dc:creator><![CDATA[Ben Gourley]]></dc:creator><pubDate>Fri, 08 Feb 2013 13:43:58 GMT</pubDate></item><item><title><![CDATA[Press Release: Times+ newsletter gets a facelift]]></title><description><![CDATA[<p>Digital agency, Clock, is the creative team behind Times+ newsletter’s new look, which has boosted click rates from 28% to 40% making it one of the most successful electronic newsletters for its publisher, NI Group Ltd.</p>
<p>
 Each week, the Times+ newsletter delivers unique subscriber benefits to The Times and The Sunday Times subscribers. Clock was tasked with transforming the newsletter’s digital template, which was proving too rigid for the in-house team who wanted to be able to vary the layout regularly to better showcase content and stimulate greater user engagement. </p>
<p>
 Clock’s creative team responded with a crisp new style backed by a digital framework that offered full back end and CMS flexibility while still retaining The Times+ look and feel. </p>
<p><img src="http://i.imgur.com/iA7fkKX.jpg" style="line-height: 1.5em; cursor: default;"><span style="line-height: 1.5em;"><br>
 Claire Gribben, Product Manager of Times+, states, “Clock’s redesign has transformed the way we present our content. We now have the flexibility to switch from big hero features to smaller multiple items, add special formats that tie in with calendar events like Christmas, and to link in other sources and sites – as our needs dictate. Clock has helped make our newsletters much more visually appealing. Almost straight away, our open rate increased to 40% and our click-through to a staggering 17%.” </span><br>
</p>
<br>
<p>“The experience is now much richer,” Gribben adds. “Content can easily be linked back to editorial from The Times and The Sunday Times. For example, promotions can now be tied in to film, theatre and restaurant reviews – pushing traffic back through to the newspapers and adding value for our readers. There is also more scope for social interaction including Twitter feeds to columnists and readers’ comments, creating valuable dialogue and a community feel.” </p>
<br>
<p> Matt Dibben, MD of Clock adds, “For e-newsletters, the secret is building in flexibility without making it too complex. With Times+ we have created a really fluid format that can be adapted to suit the content. This has inspired their creative teams to make the end result much more engaging for the reader – without compromising the brand style. With its dramatic uplift in click rates, Times+ proves that compelling design is crucial in keeping digital audiences switched on and coming back for more.” </p>
<br>
<div><b>- - -</b></div>
<p><b>About Times+</b></p>
<p>Launched in October 2009, it was the first membership scheme and customer retention programme of any UK newspaper. Times+ is complimentary to subscribers to The Times and The Sunday Times. Members enjoy events, offers and extras at the Times+ website www.mytimesplus.co.uk. Times+ deepens the titles’ relationship with its readers, rewards their loyalty and generates new direct revenue streams. Times+ members show high levels of engagement and respond well above industry average to offers and newsletters.<br>
</p>]]></description><link>http://clock.co.uk/misc/press-release-times-newsletter-gets-a-facelift</link><guid isPermaLink="true">http://clock.co.uk/misc/press-release-times-newsletter-gets-a-facelift</guid><dc:creator><![CDATA[Sam Fresco]]></dc:creator><pubDate>Mon, 04 Feb 2013 14:35:44 GMT</pubDate></item><item><title><![CDATA[Clock Week in Pictures 01/02/2013]]></title><description><![CDATA[
<p><i>A pinch and a punch for the first of the month, and welcome to February's first week in pictures! We've been busy putting in the groundwork for some big and exciting projects that will soon be on the production line, but we've still got a few extra-curricular pics to show.</i></p>

<p>The boardroom has seen many a meeting this week…</p>

<p><img src="/asset/510bc7e5e6a982d763000003/meeting.jpg" style="cursor: default;"></p>

<p>An office renovation looms and some materials turn up. The new office floor will <i>most definitely</i>&nbsp;be pink rubber…</p>

<p><img src="/asset/510bc40fe6a982d763000002/floor.jpg" style="cursor: default;"></p>

<p>Adam T, after years of Windows abuse finally gets his hands on a shiny new Mac. Great timing too, as it arrived on his birthday…</p>

<p><img src="/asset/510bc44f17dd54d663000001/air.jpg" style="cursor: default;"></p>

<p>Rob, concerned his media armoury is decidedly lacking, has created a scheme to rectify this by 'volunteering' fellow colleagues to lend their personal personal favourites…</p>

<blockquote>I'd like to borrow a DVD, CD or Book (or all 3) from your top favourites - I promise to take good care of it and return in working order! :)</blockquote>

<p>And to achieve this, a state-of-the-art person selector device…</p>

<p><img src="/asset/510bc58d17dd54d663000002/spin.jpg" style="cursor: default;"></p>

<p>Tom G got accepted on the the&nbsp;<a href="https://www.leapmotion.com/">LeapMotion</a>&nbsp;developer programme. This week his device arrived, enabling him to wave his hands Harry Potter style at his Mac and have it <i>actually</i>&nbsp;respond (the lack of the LeapMotion didn't stop him trying before)…</p>

<p><img src="/asset/510bc79917dd54d663000003/leap.jpg" style="cursor: default;"></p>

<p>Ben G got his hands on a&nbsp;<a href="http://www.powerballs.com/">Powerball</a>&nbsp;to try to prevent the arm pump he gets while riding his trials bike. (It didn't stop him winning the clubman class&nbsp;<a href="http://iowmcc.co.uk/results">last weekend</a>&nbsp;though)…</p>

<p><img src="/asset/510bc8d917dd54d663000004/powerball.jpg" style="cursor: default;"></p>

<p>Over and out!</p>
]]></description><link>http://clock.co.uk/misc/clock-week-in-pictures-01-02-2013</link><guid isPermaLink="true">http://clock.co.uk/misc/clock-week-in-pictures-01-02-2013</guid><dc:creator><![CDATA[Ben Gourley]]></dc:creator><pubDate>Fri, 01 Feb 2013 13:21:49 GMT</pubDate></item><item><title><![CDATA[An Introduction to Backbone.js]]></title><description><![CDATA[<p><em>Last week I gave a presentation on Backbone.js to the rest of the developers here at Clock. The amount of exposure we've had to client side heavy-lifting varies, so the idea was to get everyone on the same page. The other guys found it pretty handy, so I thought I'd write it up here where there's a chance it could be useful to others.</em></p>

<h2>Why do we use Backbone?</h2>

<p>For those that don't know – <a href="http://backbonejs.org">Backbone.js</a> is a JavaScript library that runs in the browser. We use it to structure client-side applications – those that run in a web browser.</p>

<h3>From Fancy Scripting to Software Engineering</h3>

<p>Increasingly, application logic and heavy lifting is heading in to the browser. It used to be that JS was used for fancy effects and embellishments. Now though, it's stuff that matters – proper application code as well as the niceties. That means we need to take more care to organise and structure our source.</p>

<p>Some of the things we care about:</p>

<ul>
<li>Maintainability</li>
<li>Compatibility</li>
<li>Testability</li>
<li>Reusability</li>
<li>DRY-ness</li>
<li>Consistency</li>
<li>Modularity</li>
</ul>

<h3>What about jQuery?</h3>

<p>But we already use a framework, <a href="http://jquery.com">jQuery</a> on pretty much all of our sites. Doesn't that help? Well, jQuery is great for a number of things:</p>

<ul>
<li>Ironing out browser inconsistencies</li>
<li>Improving the DOM interface</li>
<li>AJAX</li>
<li>Animation</li>
</ul>

<p>These definitely make our lives easier, but what they don't do is help to structure applications. That's because jQuery is a <strong>utility belt</strong>.</p>

<p>We need no greater proof that jQuery doesn't help us to do the things that Backbone does, than the fact jQuery is a dependency of Backbone's.</p>

<p>Backbone sits on top of <a href="http://underscorejs.org">Underscore.js</a>, as well as jQuery, to provide a platform for building applications.</p>

<p><strong>So, we use Backbone to structure our applications with proven software patterns, separating UI logic from business logic.</strong></p>

<h3>Alternatives</h3>

<p>It's worth mentioning that, of course, alternatives to Backbone exist, for example:</p>

<ul>
<li><a href="http://emberjs.com/">Ember</a></li>
<li><a href="http://angularjs.org/">Angular</a></li>
<li><a href="http://spinejs.com/">Spine</a></li>
</ul>

<p>… and many more. Personally, I've never looked beyond Backbone – quite simply because it has done everything I've wanted from such a tool.</p>

<p>I will round off this introduction with an excerpt from the <a href="http://backbonejs.org/">Backbone docs</a> that I think succinctly and accurately specifies the problem that Backbone addresses:</p>

<blockquote>
  <p>When working on a web application that involves a lot of JavaScript, one of the first things you learn is to stop tying your data to the DOM. It's all too easy to create JavaScript applications that end up as tangled piles of jQuery selectors and callbacks, all trying frantically to keep data in sync between the HTML UI, your JavaScript logic, and the database on your server. For rich client-side applications, a more structured approach is often helpful.</p>
</blockquote>

<h2>What does Backbone do?</h2>

<p>Backbone provides the reusable building blocks that are required for the majority of applications – loosely following the MVC pattern. I say loosely – MVC is actually a very specific and well-defined pattern composed of <strong>M</strong>odels, <strong>V</strong>iews and <strong>C</strong>ontrollers. Of these components, Backbone only has models and views, and the view behaves like a view <em>and</em> and a controller – technically violating the pattern.</p>

<p>The amount of code in Backbone is remarkably small for a library and it does surprisingly little, actually. I recommend reading or at least scanning the <a href="http://backbonejs.org/docs/backbone.html">annotated source</a> to get a grasp on the internals.</p>

<p>So it provides a bit of code, but more importantly it provides a set of conventions about the structure of applications.</p>

<p>I will now take you through the 'building blocks' that Backbone provides, with code examples. If you want to run any of the examples, head over to the <a href="http://backbonejs.org/">Backbone site</a>, fire up your console and paste the code in.</p>

<h3>Backbone.Events</h3>

<p>Events is a trait that can be mixed in to other objects to give them event triggering and listening behaviour – a very effective way of promoting decoupling between components. The following example shows how to use <strong>Backbone.Events</strong> on your own objects:</p>

<pre><code>var o = {}
_.extend(o, Backbone.Events)

o.on('zap', function () {
  console.log('zapped')
})

o.trigger('zap')
//=> outputs 'zapped'
</code></pre>

<p>This Events trait is inherited by all of the other prototypes that Backbone provides.</p>

<h3>Backbone.Model</h3>

<p>Backbone models are for encapsulating entities that are associated with data. They provide <em>accessor</em> and <em>mutator</em> access to the data through <strong>get()</strong> and <strong>set()</strong> methods. This level of indirection allows other parts of the system to be notified when things change – useful, for example, for a view that should update when its underlying model changes.</p>

<p>The following is an example of instantiating and using a stock <strong>Backbone.Model</strong>:</p>

<pre><code>// Create a new model by passing in some data
var person = new Backbone.Model({ name: 'Bob', age: '30' })

// Access the data
person.get('name')
//-> returns 'Bob'

// Observe the data for changes
// using the event methods that
// the model has inherited
person.on('change', function () {
  console.log('Something about this person changed')
})

// Mutate the data
person.set('name', 'Robert')
//-> outputs 'Something about this person changed'
</code></pre>

<p>So that's pretty handy for wiring up simple models where you just need access to the data, but what if your models need to be more complex than that? This is where you need to <em>extend</em> the stock model with your own logic. In the first example, our model contained an age attribute – this is poor practice, because if that data was persistent it would have to be maintained every time the date changed. In the following example, the model will have a date of birth and the age will be calculated on the fly:</p>

<pre><code>// Create a new constuctor by extending
// the stock model with our custom method
var Person = Backbone.Model.extend(
  { age: function () {
      return (new Date() - this.get('dob'))
    }
  })

// Instantiate one of the new
// Person objects with some data
var person = new Person(
  { name: 'Bob'
  , dob: new Date('21 Sept 1988')
  })

// Use the custom function
person.age()
//-> returns the number of milliseconds since '21 Sept 1988' (useful!)
</code></pre>

<p>Everything we've seen so far is useful for connecting up with views and having a front-end that doesn't need persistence. Models also provided methods for communicating with a server to provide persistence. I won't be covering them here, but you should know that the methods <strong>sync()</strong> and <strong>destroy()</strong> are available. Backbone makes it very easy to wire up your models to a restful/crud-y JSON API.</p>

<h3>Backbone.Collection</h3>

<p>Collections are ordered sets of models, and there's not really a great deal to say about them. They get all of the Underscore array/collection methods for convenient set manipulations.</p>

<p>The most useful thing is that events triggered on models within the collection propagate up and get triggered on the collection instance too.</p>

<pre><code>// Create an array of models that
// can be passed in to a collection
var models = []
for (var i=0; i < 5; i++) {
  models.push(new Backbone.Model({ num: i })
}

// Create collection containing the models
var collection = new Backbone.Collection(models)

// An example of an underscore function -
// some will return true if the function
// passed to it returns true for any of
// the collection's contents
collection.some(function (model) {
  return model.get('num') === 3
})
//-> Returns the model that has { num: 3 }

// An example of events bubbling up to the
// containing collection - bind a listener
// to the change event on the collection
collection.on('change', function () {
  console.log('one of the models changed')
})

// Acces one of the models (not via
// the collection) and change it
models[4].set({ num: 10 })
//-> Logs 'one of the models changed'
</code></pre>

<h3>Backbone.View</h3>

<p>Views are my favourite part (I'm not sure if it makes sense to have a <em>favourite</em> part…).</p>

<p>I personally have spent a lot of time coding UIs without Backbone – not necessarily web-apps but things that have just a bit too much state for a jQuery plugin, so I really feel the benefits.</p>

<p>View objects are associated with a fragment of DOM. They are designed to be tied to models (data) that needs to be presented to the user. Against the traditional MVC pattern, and due to the nature of the DOM, Views act like controllers too. They are both presentational <em>and</em> interactive.</p>

<p>Each <strong>Backbone.View</strong>, upon creation gets its own 'root' DOM element. They come with a <strong>render()</strong> method, which is by default a noop. It's a convention. You have to extend <strong>Backbone.View</strong> with your own methods and implement render in the way that you want to.</p>

<pre><code>var v = new Backbone.View()
$('body').append(v.$el)
//-> Appends the default root element,
//-> a <div/>, to the document body
</code></pre>

<p>In order to acheive anything useful, the view needs to be extended:</p>

<pre><code>// Extend a View with a custom render
// function that writes the current date
var Clock = Backbone.View.extend(
  { render: function () {
      this.$el.empty().append(new Date)
    }
  })

// Instantiate a custom objet
var clock = new Clock()

// Append its element to the document body
clock.$el.appendTo('body')
//-> An empty div is attached to the body
//-> because render() has not yet been called

clock.render()
//-> Document now shows the current time

// Subsequent calls to render update the time…
clock.render()
clock.render()
clock.render()
</code></pre>

<p>Hold up though, there's a clock in our UI logic! Uh oh! What if there are other views that wanted to know about the time? The views would become tightly coupled. Instead, we'll factor the clock out into a model and have the view listen for changes:</p>

<pre><code>// Create model to hold the time
var clockModel = new Backbone.Model({ time: new Date() })

// Create view that listens to change
// events on the model, and renders
// each time it changes
var ClockView = Backbone.View.extend(
  { initialize: function () {
      this.model.on('change', _.bind(this.render, this))
    }
  , render: function () {
      this.$el.empty().append(this.model.get('time'))
    }
  })

// Instantiate a view and pass in the model
var clockView = new ClockView({ model: clockModel })

// Append the clockView element to the document body
clockView.$el.appendTo('body')

// Get the time to change every second
// triggering the view to render
setInterval(function () {
  clockModel.set('time', new Date())
}, 1000)

//-> The time in the document updates every second
</code></pre>

<p>That brings us the end of this introduction. I hope you found it useful.</p>

<p>As always, if you have any questions, don't hesitate to comment below.</p>
]]></description><link>http://clock.co.uk/tech-blogs/an-introduction-to-backbonejs</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/an-introduction-to-backbonejs</guid><dc:creator><![CDATA[Ben Gourley]]></dc:creator><pubDate>Wed, 30 Jan 2013 00:00:00 GMT</pubDate></item><item><title><![CDATA[Clock Week in Pictures 25/01/2013]]></title><description><![CDATA[
<p><i>It's been fairly quiet this week. Nonetheless we see some new wheels, some hardware hacking, the end of an era, and some dizzy heights!</i></p>

<p>Paul (our CTO by day, mountain-goat by night) takes a Luke and Francisco for a trip to the climbing wall to show them the ropes…</p>

<p><img src="/asset/510272e24936d2b866000010/fran.jpg" style="cursor: default;"></p>

<p><img src="/asset/510272ed4936d2b866000011/luke.jpg" style="cursor: default;"></p>

<p>And Francisco practices his figure of eight knot for the climbing competence test…</p>

<p><img src="/asset/5102735c4936d2b866000012/knot.jpg" style="cursor: default;"></p>

<p>Ben hacks his Raspberry Pi into an AirPlay device, so he can stream music wirelessly from his phone or computer anywhere in the house. Now to build some protective housing for those exposed components…</p>

<p><img src="/asset/510273c0840a4cba6600000e/airpi.jpg" style="cursor: default;"></p>

<p>Vince took a final trip to Vicarage Road to see Saracens play, as they bid farewell before moving on to their new stadium in London – The Allianz arena…</p>

<p><img src="/asset/510274154936d2b866000013/vicarage.jpg" style="cursor: default;"></p>

<p>And finally, Adam's mid-life crisis definitely <b>does not</b> arrive about 20 years early, as he casually acquires an understated and practical new motor…</p>

<p><img src="/asset/5102746f840a4cba6600000f/tt.jpg" style="cursor: default;"></p>
]]></description><link>http://clock.co.uk/misc/clock-week-in-pictures-25-01-2013</link><guid isPermaLink="true">http://clock.co.uk/misc/clock-week-in-pictures-25-01-2013</guid><dc:creator><![CDATA[Ben Gourley]]></dc:creator><pubDate>Fri, 25 Jan 2013 11:46:52 GMT</pubDate></item><item><title><![CDATA[The Black Art of Background Processing]]></title><description><![CDATA[<p>For the last few weeks I've been trying to think of a blog post idea that would be interesting to read and write about but also something that has not necessarily been discussed in any great depth and it was not until the other day that something came to me. There we were, working away when someone came into the room and asked “What do you think is the best way to process some long running task in the background? Do you think it's good practice to fork a process from PHP?” and this question got me thinking; is it bad practice to fork a process in PHP? My initial and gut reaction was to say yes. We have so many different options and methods that are designed to process background tasks but when you really start to think about it, it might not be all that bad practice so long as you don't expect a response from the forked process and that you don't effect the performance of Apache or whatever server you use. I still stand by my initial answer of “Yes, it is bad practice” for situations where you may be handling any more than 10 long running tasks but the following code should suffice where a small quantity of requests is concerned and it removes all the additional overhead associated with some other options discussed in this post.</p>


<pre>$cmd =&nbsp;"php location/to/some/long/running/task.php"; // Start the process and continue outputting your response to the user&nbsp;<span style="line-height: 1.5em;"> 
exec($cmd . " &gt; /dev/null &amp;"); 
echo(...); </span></pre>

<p><b>So what are our options?</b></p>

<p>Well as it turns out, there is a wealth of options to choose from when it comes to background processing including:</p>

<ul>
	<li>
<p class="western">Cron jobs – everyone knows what a cron job is – simply put, it's a scheduled task</p>
</li>
	<li>
<p class="western">Gearman – A highly scalable, language independent, open source background task manager</p>
</li>
	<li>
<p class="western">Event listening/triggering – not really practical with PHP</p>
</li>
	<li>
<p class="western">A polling script – A bit rudimentary but it works for a lot of things</p>
</li>
	<li>
<p class="western">Database triggers – only really an option if the task can be written in a stored procedure</p>
</li>
</ul>
<p>There are more, I'm sure but theses are the options that are most widely used and therefore the ones I will discuss.</p>

<p><b>Cron jobs</b></p>

<p>Cron jobs have existed in Unix based operating systems since 1979 (Unix V6), they have served us well and will continue to do so for the foreseeable future but there are some drawbacks to using this system to process background tasks in a web environment. In the fast paced, dynamic world of the modern day web any delay is considered unacceptable. If you and more importantly your clients have to wait for a cron job to be scheduled and pick up your task you could very well loose your competitive edge. To fix the problem of long delays we could set the cron to run every minute but in a server environment where every instruction execution counts this is not a ideal solution, after all, we're paying for the CPU time. We need to come to a compromise and this tends to be around the 5 minute mark, this still means your clients could be waiting up to 5 minutes before they see the effects of their actions, for a database import is not a problem but what if the action was to divert a plane away from a potential crash? Cron jobs are clearly unacceptable for time critical tasks or where there may be hundreds or thousands of tasks that need running every minute.</p>

<p><b>Gearman</b></p>

<p>Gearman is a highly scalable, powerful and potentially load balanced open source solution to the background task problem. Gearman is a scheduling manager that can handle many workers across multiple nodes, it is very good at handling bulk tasks such as mailing list distribution, user uploads, image manipulation, large dataset processing etc. and it is very flexible in what you can do with it, it simply runs your background code when a new task is added. One major disadvantage of Gearman is its overhead, we have used Gearman for a few of our projects here at Clock and its certainly not the easiest tool to setup, for large projects with thousands of tasks it's the ideal solution but for small websites, in my personal opinion its overhead outweighs its advantages.</p>

<p><b>Event listening/triggering</b></p>

<p>There's no real event handling API built into PHP and that makes listening to events a near impossibility. Although event listening seems to be ruled out in PHP, we can however trigger events using the PHP “exec” function to call the system’s “kill” command with the event number and process we want to trigger. The listening process obviously has to be built in a language that supports listening to events. I'm aware of a PECL library named “libevent” but it is still in beta and not really usable in production environments just yet. There are some obvious disadvantages to this approach, for example you have to load the kill process into memory every time you call an event, your listening process has to then fork the hard part off so that it can continue listening and it all seems a little hacky. Nevertheless, signals can be very useful and lightweight so maybe they are the ideal solution for the smaller environment. Signals can be used to process a request immediately and prevent your clients from waiting for some task that never seems to end.</p>

<p><b>A polling script</b></p>

<p>A polling script is another way to go and it's a very simple, lightweight way to process tasks in the background. The script will need to be set up in such a way that it runs regularly enough to process the tasks in a timely manor but not so often that it takes up too much processor time. A basic setup will look similar to the following:</p>


<pre>$taskManager = new TaskManager(); 
    while(!$taskManager-&gt;hasClosed()) { 
        while($task = $taskManager-&gt;getTask()) {
            // On a high load server or a really long running task we should 
            // pass this work onto another thread, possibly on a different node. 
            someTask($task); 
        } 
    sleep(10); 
} </pre>

<p>The obvious problem with this approach is that as soon as we get a bunch of tasks pushed onto the task queue, it will take&nbsp;</p>

<p><img src="/asset/50fec7d2840a4cba6600000c/formula.png" style="cursor: default; height: 52px;"></p>

<p>time to process the queue. A solution to this problem would be to fork or pass the task onto a different node, but if you’re thinking about that then this solution is probably not the one for you. If we take a closer look at the task manager we may find we have a FIFO type queue, the problem with this is that it probably&nbsp;isn't&nbsp;thread safe. </p>

<p>I'm going to briefly discuss a few techniques to achieve thread safety because I think it ties in nicely with shared access to a resource which the methods we've discussed thus far all do.</p>

<p><b>Shared Memory and Mutual Exclusivity</b></p>

<p>While shared memory is one type of resource that needs to be protected when inside a multithreaded environment, any resource that is shared and you cannot guarantee fully atomic read/write operations should be protected using some sort of mutual exclusivity scheme. The use of a Mutex or a Semaphore can ensure that only one, or only a set amount of processes in the case of a Semaphore, can access the shared resource. I’ll give a brief overview of both but I will not go into implementation specifics because it is OS dependant. </p>

<p><b><i>Mutex</i></b></p>

<p>A Mutex, simply put is like a token that is passed between each process trying to gain access to a shared resource. The process trying to gain access to a resource must first gain control over the token before it can proceed to use the resource. When one process has control over the Mutex, no other process can use the resource.</p>

<p><b><i>Semaphore</i></b></p>

<p>A Semaphore is very similar to a Mutex except for one major difference, a Semaphore has a counter built into it so it can allow multiple processes to gain access to a shared resource, once the counter has been exhausted it will not allow any more processes to gain access to the resource. The counter limit it specified at setup time.</p>

<p>In both cases, each process trying to gain access to the shared resource must block until the Mutex has been released or a process has decremented the counter in the Semaphore thus allowing one more process to gain access to the resource. The root process to start up must setup the Mutex or Semaphore before any other process tries to gain access to the resource. When using any sort of mutual exclusivity you should be aware of causing race conditions or locking out of a process.</p>

<p><b><i>Shared Memory</i></b></p>

<p>Shared memory is simply a block of memory that is shared by two or more processes and allows them to read and write to that block of memory. I simply used it here because it is an example of a shared resource that can obviously not be written to at the same time.</p>

<p>Fortunately, thinking about mutual exclusivity is not something we have to do very often because a lot of resources we may use such as a database have already thought about this and will not allow two processes to write to the database at the same time, leaving us developers to concentrate on the more important task of creating great products.</p>

<p><b>Database Triggers</b></p>

<p>I won't go into much detail on database triggers, it’s more of a side note. If all you are doing is a simple SQL query then why not create a database trigger that fires every time you insert a row into the database and leave the hard work up to the database.</p>

<p>So, what's with the title? I hear you ask. It's true, it's not really a black art but it caught your attention didn't it! Please note the methods and techniques I've suggested in this post are opinion and not necessarily the best or most efficient way to achieve background processing.</p>

<p>Please use the comments section below, it would be nice to have an active discussion on the topic.</p>]]></description><link>http://clock.co.uk/tech-blogs/the-black-art-of-background-processing</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/the-black-art-of-background-processing</guid><dc:creator><![CDATA[Oliver Johnstone]]></dc:creator><pubDate>Tue, 22 Jan 2013 16:55:27 GMT</pubDate></item><item><title><![CDATA[Clock Week in Pictures 18/01/2013]]></title><description><![CDATA[<p><i>This week's WIP is (as much of the UK is) primarily concerned with the weather. If you've forgotten what that transparent rectangle on your wall is for, then this week you're in for a treat.</i></p>

<p>To kick things off, five of us Clockers hit the slopes in Les Deux Alpes. Here we are snapped on Adam's GoPro at Pano Bar – 'Altitude Clubbing' at 2600m. Expect videos of slope action from the GoPro soon, after Adam has passed his PHP certification…</p>

<p><img src="/asset/50f933394936d2b86600000a/alpes.jpg" style="cursor: default;"></p>

<p>When we returned, as is to be expected, England was grey – exhibited by this snap, taken when the management team had a meet up on a crisp, wintery morning in Henley-on-Thames…</p>

<p><img src="/asset/50f93476840a4cba66000007/before.jpg" style="cursor: default;"></p>

<p>But Mother Nature had other ideas: this is the scene at the Old School House (a.k.a. Clock Towers) this morning…</p>

<p><img src="/asset/50f935254936d2b86600000b/after2.jpg" style="cursor: default;"></p>

<p>Our CEO has the right idea though, as he glams it up in sunny Mexico, escaping the chilly greys and whites for a warming yellow hue…</p>

<p><img src="/asset/50f935ac4936d2b86600000c/mexico.jpg" style="cursor: default;"></p>

<p>Anyway, enough about the weather!</p>

<p>A big screen makes a subtle and camouflaged entrance to the studio…</p>

<p><img src="/asset/50f93654840a4cba66000008/clockclock.jpg" style="cursor: default;"></p>

<p>Our resident Danish designer, Mikkel, awaits his final exam grade. He passed! Congratulations Mikkel…</p>

<p><img src="/asset/50f936ee4936d2b86600000d/exam.jpg" style="cursor: default;"></p>

<p>After racking up a poor travel to sleep ratio, Mike invests in an <a href="http://www.kickstarter.com/projects/ostrich-pillow/ostrich-pillow">Ostrich Pillow</a>  – a revolutionary 'Powernap enviroment' (seriously, follow the link!)…</p>

<p><img src="/asset/50f938284936d2b86600000e/photo.jpg" style="cursor: default;"></p>

<p>Remember Vince's happy injury from last time? Well it took this much wrapping up to prevent the flow and get it repaired. He's since had the bandaging off, but you don't want to see that photo. </p>

<p><img src="/asset/50f93846840a4cba66000009/vince.jpg" style="cursor: default;"></p>

<p>That's a wrap for this week folks. Enjoy the snow while it lasts!</p>
]]></description><link>http://clock.co.uk/misc/clock-week-in-pictures-18-01-2013</link><guid isPermaLink="true">http://clock.co.uk/misc/clock-week-in-pictures-18-01-2013</guid><dc:creator><![CDATA[Ben Gourley]]></dc:creator><pubDate>Fri, 18 Jan 2013 11:18:00 GMT</pubDate></item><item><title><![CDATA[Why Scrum simply works]]></title><description><![CDATA[After a few projects using Scrum, it becomes fairly easy to understand why Scrum works so well. Scrum is not the secret ingredient for success but it does certainly help us to achieve better results on our projects.

Here are a few reasons why Scrum works:

### 1) Emphasis on communication. 

Scrum promotes communication between our project team members, as well as between our clients and us. It also promotes a good team work attitude.

### 2) Quick results. 

On average, a couple of iterations (sprints) is sufficient to show a working product to the client. This way, we get early feedback which helps shape the work ahead.

### 3) Focus on what is important. 
Since all the items are prioritised based on their business value, no time is wasted developing what is not important.

### 4) Fair time estimates. 

Since the production team is involved in the estimating of the Product Backlog cards, the overall time estimate is fair and square (accurate).

### 5) Self organisation.

The production team is a self-organised unit that works to reach the Sprint Goal on time. A mix of skill sets and skill levels are often ideal to promote a continuous work flow. The ideal Scrum team formation is a subject for another post.

### 6) Transparency. 

Scrum promotes transparency: the client knows what is going to be delivered in the sprint, since he/she has prioritised the Product Backlog. There is also a great deal of transparency within the production team during the Sprint. The entire sprint backlog is available to all team members.

These are the reasons why Scrum works so well for us. Don't hesitate to contact me if you would like to know more about Agile and Scrum.]]></description><link>http://clock.co.uk/project-management/why-scrum-simply-works</link><guid isPermaLink="true">http://clock.co.uk/project-management/why-scrum-simply-works</guid><dc:creator><![CDATA[Francisco Baptista]]></dc:creator><pubDate>Thu, 10 Jan 2013 00:00:00 GMT</pubDate></item><item><title><![CDATA[Clock Week in Pictures 04/01/2013]]></title><description><![CDATA[<p><i>Hello and welcome to the first WIP of 2013. We hope Santa brought you everything you asked for, and that you didn't spend all of New Year's Day in bed recovering from the Auld Lang Syne antics the night before – yes, I'm sorry to say that you were embarrassingly out of tune. Don't worry though, in this edition we've got a crop of our festive highlights and none of them are of you singing!</i></p>

<p>First up, we've got a rather impressive panoramic shot from the balcony of our Winter Party suite…</p>

<p><a href="/asset/50e6be3a4936d2b866000004/pan.jpg"><img alt="" src="/asset/50e6be3a4936d2b866000004/pan.jpg" style="cursor: default;"></a><br>
 (Click on this image for a larger one) </p>

<p>If you squint a little, tilt your head to the side, <i>and</i> use a sprinkle of imagination, you might be able to see a bit of clever branding masquerading as champagne flutes:</p>

<p><img alt="" src="/asset/50e6be10840a4cba66000001/clock.jpg" style="cursor: default;"><br>
</p>

<p>Our party had a variety of entertainment, including an Elvis tribute act, a conic dance floor and a pop-up casino. The main hit with us Clockers though was a retro photo booth. Here's a scattering of the resulting photos…</p>

<p><img alt="" src="/asset/50e6be084936d2b866000001/booth.jpg" style="cursor: default;"><br>
</p>

<p>Vaishal's omission of his criminal past from his CV came to light – being sharply dressed and casually wielding a firearm in a way only a true gangstar could…</p>

<p><img alt="" src="/asset/50e6be214936d2b866000003/g.jpg" style="cursor: default;"><br>
</p>

<p>We'll let you into a Clock family secret here. Forget music and alcohol, the ingredients to truly get a party started are lasers and mirrorballs. You heard it here first. A big hat tip to Mr Mirrorball and Lord Laser for bringing sparkles and radiation to both our Winter Party <i>and</i> New Year's at the Nadim residence…</p>

<p><img alt="" src="/asset/50e6be174936d2b866000002/disco.jpg" style="cursor: default;"><br>
</p>

<p>It wasn't all doom and gloom through all that awful wet Christmas period. Even Vince's (very rock and roll) washing up cut managed to smile through it…</p>

<p><img alt="" src="/asset/50e6be31840a4cba66000003/ouch.jpg" style="cursor: default;"><br>
</p>

<p>Neither did the weather manage to prevent Saracens from smashing Bath 22-0, nor the front row spectators from having a blast. You'd have thought "Bath" would have been used to all that running water………hmm…?</p>

<p><img alt="" src="/asset/50e6be40840a4cba66000004/sarries.jpg" style="cursor: default;"><br>
</p>

<p>Finally, we have a sneak preview of an internal Clock project: HUD. I'll just leave you with this little teaser and the assurance that we'll do an in depth blog post when it's released…</p>

<p><img alt="" src="/asset/50e6be28840a4cba66000002/hud.jpg" style="cursor: default;"><br>
</p>

<p>And that's it. Thanks for reading, and hopefully see you back here, same time next week!</p>
]]></description><link>http://clock.co.uk/misc/clock-week-in-pictures-04-01-2013</link><guid isPermaLink="true">http://clock.co.uk/misc/clock-week-in-pictures-04-01-2013</guid><dc:creator><![CDATA[Ben Gourley]]></dc:creator><pubDate>Fri, 04 Jan 2013 11:32:46 GMT</pubDate></item><item><title><![CDATA[Clock Week in Pictures 14/12/2012]]></title><description><![CDATA[
<p>The <i>Week in Pictures</i> is back for a final, increasingly festive rendition before the Christmas break. This week (or the last few weeks, should I say!) sees Sophie get a face full of water, the musical members of the team get together for a jam, and some Christmas-y preparations for tonight's Winter Party.</p>

<p>Some of the team were lucky enough to attend a party hosted by our clients ShortList Media. Though they weren't feeling quite so lucky the morning after, if you know what I mean! Here they are being made to feel special next to a red carpet…</p>

<p><img src="/asset/50caed561a64ba1d1100004e/image.jpg" style="cursor: default;"></p>

<p>Sophie does a spot of white water rafting, and gets snapped mid catastrophe as she's about to get a face load of splash…</p>

<p><img src="/asset/50caeddf1a64ba1d1100004f/rafting.jpg" style="cursor: default;"></p>

<p>Vincent's budding archeologist of a son spots a historic creature in the sky…</p>

<p><img src="/asset/50caee63c21d101f11000037/IMG_20121209_082929.jpg" style="cursor: default;"></p>

<p>Amazon are seen to go the extra mile, making sure your orders arrive in exactly the condition they left the warehouse in. Check out the packaging for this lonely roll&nbsp;of wrapping paper received by Tom G…</p>

<p><img src="/asset/50caeedcc21d101f11000038/IMG_1135.jpg" style="cursor: default;"></p>

<p>The non-tone deaf members of the team got down to West Herts College for a jam in the studio. Now taking bookings for kids parties in the Hunton Bridge area… it's the Clock Band…!</p>

<p><img src="/asset/50caf01c1a64ba1d11000050/photo-copy-2.jpg" style="cursor: default;"></p>

<p>A SwipeStation unit pops up at partner whynot!'s office to show off to their clients…</p>

<p><img src="/asset/50caf0841a64ba1d11000051/photo-copy-3.jpg" style="cursor: default;"></p>

<p>Ema gets into the festive spirit with some shiny nails, and informs us that it's National Christmas Jumper day today. So what are you waiting for? Dig out that abomination your mum knitted you 10 years ago and wear it with pride (if anything, you'll get kudos from your mum and she'll be nice to you over Christmas)…</p>

<p><img src="/asset/50caf1671a64ba1d11000052/photo-copy.jpg" style="cursor: default;"></p>

<p>And finally, somebody has given Sophie the task of bringing the bubbly to our party tonight. Let's hope at least one of the bottles make it, eh…!</p>

<p><img src="/asset/50caf1d61a64ba1d11000053/photo.jpg" style=""></p>
]]></description><link>http://clock.co.uk/misc/clock-week-in-pictures-14-12-2012</link><guid isPermaLink="true">http://clock.co.uk/misc/clock-week-in-pictures-14-12-2012</guid><dc:creator><![CDATA[Ben Gourley]]></dc:creator><pubDate>Fri, 14 Dec 2012 08:55:20 GMT</pubDate></item><item><title><![CDATA[Working from home - Clock's Test]]></title><description><![CDATA[<p>Over the years Clock have (very nearly) always had at least one remote worker and it is something that we have always prided ourselves on offering. Why let a silly thing like a potential employee living in Spain stop you from hiring someone who is right for the job?</p>

<p>However, do we find ourselves forgetting about our remote staff? Does the lack of a physical presence in the office leave them feeling left out? Well, our CTO Paul Serby wanted to find out. After all, you never know when your office might fall down or you can't leave your house due to a sudden zombie invasion (that's right, we carry on working even if that happens).</p>

<p>So began the plans to kick everyone out for the day and see how we got on (Clock have over 30 staff so this is a tall order). This involved making sure everyone would be able to have all the same access from home that they would have in the office, from the basics such a decent internet connection up to the slightly more complicated VPN set-up ensuring everyone was able to access the correct servers. We chose a Friday as our office hours are 9-2 which meant if it was a total disaster the pain would be short lived.</p>

<p>So, for one day only, on the 23 November the entire company got up to take their long commutes to their spare rooms, living rooms or kitchens (!) and joined a rather large Skype text chat at 9am. </p>

<p>This was the first hurdle that we had to overcome, whilst we had wanted to run a quick staff meeting using Google Hangouts or Skype's voice call, neither of these products supported the numbers of people we needed to involve. However, the text chat went ahead and with everyone being told to keep it efficient by only saying what they had to, it actually worked pretty well and we got through it. After this we had planned to break into smaller team chats to cover the daily scrums and any other meetings that we had to get through which enabled people to be a lot more chatty without boring the wrong people.</p>

<p><span style="color: rgb(0, 0, 0); " id="internal-source-marker_0.8433738719083792">Prior to the day we had also spotted an important Skype configuration change that we asked all staff to make. </span><br>
</p>

<p><img style="cursor: default;" src="/asset/50c1eb471a64ba1d11000042/Screen Shot 2012-12-07 at 10.05.05.png"></p>
<br>

<p><span style="color: rgb(0, 0, 0); " id="internal-source-marker_0.8433738719083792">Within Skype’s preferences is the option to set how long it takes to automatically update a Users status from on-line to away. We asked that all staff to set it to 3 minutes as there is nothing more annoying that trying to chat to someone that looks like they are on-line but are in fact off making a cup of tea. (please note, it also important that this setting is applied to tablet and mobile phones).</span></p>

<p>So, after all of these chats had we succeeded in making sure everyone knew what they were supposed to be working on and that no poor soul was left out in the cold, confused and crying? Well I certainly hope so....... although there is a but! If this is something we tried to do more often or even (heaven forbid) full time, would we be this efficient everyday?</p>

<p>For me the short answer is no. Even our full time remote workers come into the office once in a while for meetings, social gatherings and for general catch ups. Having the option to work remotely is fantastic and while I can confirm that our remote working day was a success, trying to do that everyday has the potential to get very difficult and perhaps very lonely.</p>

<p>During the day we asked everyone to take a picture of their remote set-up. The results can be seen below:</p>

<p><span style="color:#000000; background-color:transparent; font-style:normal; " id="internal-source-marker_0.8433738719083792">*oh and you'll be pleased to know that no zombies attacked us :)</span><br>
<span style="color:#000000; background-color:transparent; font-style:normal;"></span><br>
<span style="color:#000000; background-color:transparent; font-style:normal;">Thanks to Rob Arnold for helping with this blog entry and to Dan Wells for editing the photos.</span></p>

<p><img style="cursor: default;" src="/asset/50c9f78e1a64ba1d11000045/desk.jpg"></p>

<p><img style="cursor: default;" src="/asset/50c9f798c21d101f1100002e/fran.jpg"></p>

<p><img style="cursor: default;" src="/asset/50c9f7bcc21d101f1100002f/IMG_0599.jpg"></p>

<p><img style="cursor: default;" src="/asset/50c9f7c2c21d101f11000030/IMG_1051.jpg"></p>

<p><img style="cursor: default;" src="/asset/50c9f7c8c21d101f11000031/IMG_2597.jpg"></p>

<p><img style="cursor: default;" src="/asset/50c9f7cf1a64ba1d11000047/IMG_20121123_105948.jpg"></p>

<p><img style="cursor: default;" src="/asset/50c9f7d8c21d101f11000032/IMG_20121123_113444.jpg"></p>

<p><img style="cursor: default;" src="/asset/50c9f7dd1a64ba1d11000048/IMG_20121123_120103.jpg"></p>

<p>(The above photo belongs to Vince who took working remotely too far and flew to Ireland for the day)</p>

<p><img style="cursor: default;" src="/asset/50c9f8171a64ba1d11000049/jack.jpg"></p>

<p><img style="cursor: default;" src="/asset/50c9f8201a64ba1d1100004a/nina.jpg"></p>

<p><img style="cursor: default;" src="/asset/50c9f8261a64ba1d1100004b/photo (1).jpg"></p>

<p><img style="cursor: default;" src="/asset/50c9f82cc21d101f11000033/Photo 23-11-2012 11 38 44.jpg"></p>

<p><img style="cursor: default;" src="/asset/50c9f833c21d101f11000034/photo.jpg"></p>

<p><img style="cursor: default;" src="/asset/50c9f83cc21d101f11000035/Photo1.jpg"></p>

<p><img style="cursor: default;" src="/asset/50c9f846c21d101f11000036/samc.jpg"></p>

<p><img style="cursor: default;" src="/asset/50c9f8591a64ba1d1100004c/Workstation.jpg"></p>

<p>I saved the best for last....</p>

<p><img src="/asset/50c9f8701a64ba1d1100004d/serby.jpg"></p>

<p><br>
<span style="color:#000000; background-color:transparent; font-style:normal;"></span></p>
]]></description><link>http://clock.co.uk/misc/working-from-home-clocks-test</link><guid isPermaLink="true">http://clock.co.uk/misc/working-from-home-clocks-test</guid><dc:creator><![CDATA[Adam Tomkins]]></dc:creator><pubDate>Thu, 13 Dec 2012 00:00:00 GMT</pubDate></item><item><title><![CDATA[Passing the Zend 5.3 PHP Certification ]]></title><description><![CDATA[<p>The Zend 5.3 PHP Certification is a single exam with the aim to test the applicants knowledge of PHP. It is a formal exam consisting of 70 questions to be answered in 90 minutes.</p>

<p>I had been meaning to take the exam for the last year or so. Finally last month I booked it.</p>
<h2>Revising</h2>

<p>There is very limited material online detailing what the questions are like and how best to revise for the exam. Zend <a href="http://www.zend.com/services/certification/php-5-certification/">list the topics that the exam covers</a> and most blog posts suggest reading the <a href="http://php.net/manual/en/index.php">PHP manual</a> and read the <a href="http://downloads.zend.com/guides/php5.3/PHP_5-3_Study_Guide_v1a.pdf">Zend Study Guide</a>.</p>

<p>Unfortunately the Zend study guide is full of mistakes, missing answers and like PHP, is full of inconsistencies. That said it is helpful as a prompt of what to revise and has questions and answers at the end of each topic.</p>

<p>After some revision I wanted to test my knowledge with some practice questions to gauge how well my revision was going. As I have said already, practice questions are few and far between. With enough searching on Google, I stumbled across a few blog posts, each with a few questions the author had remembered. I also found <a href="http://www.phpriot.com/quiz/">PHP Riot</a> & <a href="http://www.ucertify.com/exams/Zend/200-530.html">uCertify</a> both offering a handful of questions for free, however you needed to pay for more questions. uCertify offers a money back guarantee if you do not pass first time and for $120 (£75) you can have unlimited access to all their questions (over 400). PHP Riot is $5 (£3) for 200 questions. I did not use either of the paid options but if you want more sample questions then I would suggest choosing one of these two options.</p>
<h2>Taking the test</h2>

<p>The test is made up of 70 questions and you have 90 minutes to complete the exam. The questions are in a random order and are mainly multiple choice, with some free text. Questions are in the form of statements, code snippets or best practices.</p>

<p><b>Beware</b> some questions are trick questions, with syntax errors. Some require you to choose 2 or more answers (this is stated in the question though). Others are just poorly worded to attempt to confuse you.</p>

<p><b>Is 90 minutes long enough to answer 70 questions?</b></p>

<p>Yes it is. Some questions take slightly longer to read and understand but others are very straight forward. You will have plenty of time to review your flagged questions / incomplete questions prior to ending the test.</p>

<p><b>What is the pass mark?</b></p>

<p>Zend are very secretive about this and have never confirmed the actual pass mark, but the community believe it to be in the region of 60%</p>

<p><b>Can I find out how well I did?</b></p>

<p>If you fail you are given a print out detailing each section and how well you did on the scale of poor, average & good. If you pass you just get a print out detailing you have passed.</p>

<p>Upon completing the test you are instantly presented with a simple screen with a Zend logo and a statement of whether you have passed or failed.</p>
<h2>My Thoughts</h2>

<p>I see the benefits of the exam from an employers point of view in that they can say their developers are Zend certified and from a recruitment point of view. However personally I feel that the way some questions are geared in terms of remember exact function names and orders of parameters a bit pointless. I always have the PHP manual open in my browser and utilise my IDE's auto complete functionality to prompt me on PHP's built in functions. </p>

<p>Does being able to recall library functions make you a better developer? I think not. A developer who is able to write OO code that is maintainable, scalable and readable is much better than someone whose Mastermind specialist subject is the PHP manual.<br>
</p>
<h2>Resources</h2>

<ul>
	<li><a href="http://www.zend.com/services/certification/php-5-certification/">Exam Topics</a></li>
	<li><a href="http://downloads.zend.com/guides/php5.3/PHP_5-3_Study_Guide_v1a.pdf">Zend Study Guide</a></li>
	<li><a href="http://www.phpriot.com/quiz/">PHP Riot (paid)</a></li>
	<li><a href="http://www.ucertify.com/exams/Zend/200-530.html">uCertify (paid)</a></li>
	<li><a href="http://www.pearsonvue.com/zend/">Booking your test with Pearson Vue</a></li>
</ul>
<p>P.s. If you are interested I passed! :)</p>
]]></description><link>http://clock.co.uk/tech-blogs/passing-the-zend-53-php-certification-</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/passing-the-zend-53-php-certification-</guid><dc:creator><![CDATA[Tom Smith]]></dc:creator><pubDate>Mon, 10 Dec 2012 08:09:35 GMT</pubDate></item><item><title><![CDATA[ALL NEW! Two Weeks in Pictures 23/11/12]]></title><description><![CDATA[<p><i>Welcome to Clock's limited edition TWIP (that's two weeks in pictures)... I would mostly like to congratulate <i>Dr</i> Syd Nadim on his recent honorary Doctorship and applaude the team participating in Movember - a great cause. Only one more week to go guys - get&nbsp;<a href="http://uk.movember.com/team/480789">donating</a>!</i></p>

<p>Congratulations Syd!!&nbsp;</p>

<p><img src="/asset/50af7c141a64ba1d11000039/photo (2).JPG" style="cursor: default;"></p>

<p>Vince meets some rather 'stiff' new friends in Dublin... ahem.</p>

<p><img src="/asset/50af7c7fc21d101f11000028/IMG_20121123_104552.jpg" style="cursor: default;"></p>

<p>While the rest of the team get their grease on at the local Go-Kart track... Go TEAM!</p>

<p><img src="/asset/50af7ca51a64ba1d1100003a/image (1).jpeg" style="cursor: nw-resize;"><br>
</p>

<p>Nina gets artistic at the Hospital Club with this impression of Syd in chalk...</p>

<p><img src="/asset/50af7cd21a64ba1d1100003b/photo (1).JPG" style="cursor: default;"></p>

<p>And we get all teenage and excitable at our new bumper sticker collection!</p>

<p><img src="/asset/50af7cf91a64ba1d1100003c/photo.JPG" style="cursor: default;"></p>

<p>Francisco gets an early Xmas present... (insert creepy growling noise here)</p>

<p><img src="/asset/50af7d171a64ba1d1100003d/image.jpeg" style="cursor: default;"></p>

<p>Loz's Mo-date from last week...&nbsp;</p>

<p><img src="/asset/50af7d4a1a64ba1d1100003e/mo shot.jpg" style="cursor: default;"></p>

<p>And Ben's...</p>

<p><img src="/asset/50af7d6ac21d101f11000029/jpeg-3.jpeg" style="cursor: default;"></p>

<p>Ben also tears up the Isle of Wight with his supremo trials skills... not just a pretty moustache.</p>

<p><img src="/asset/50af7d86c21d101f1100002a/14167_10151185812949773_813211318_n.jpg" style="cursor: default;"></p>

<p>Ashley tears up the studio with his supremo rubicks' skills...</p>

<p><img src="/asset/50af7dad1a64ba1d1100003f/IMG_2579.jpg" style="cursor: default;"></p>

<p>Commercial show us how to do it in style with this awesome panorama of London at the BIMA after party...</p>

<p><img src="/asset/50af7dee1a64ba1d11000040/photo (3).JPG" style="cursor: default;"></p>

<p>And one penultimate look at Ben's Mo before next week's final shot. It's actually growing on him... geddit? heheh</p>

<p><img src="/asset/50af7e43c21d101f1100002b/jpeg-4.jpeg" style=""></p>]]></description><link>http://clock.co.uk/misc/all-new-two-weeks-in-pictures-231112</link><guid isPermaLink="true">http://clock.co.uk/misc/all-new-two-weeks-in-pictures-231112</guid><dc:creator><![CDATA[Ema O'Donovan]]></dc:creator><pubDate>Fri, 23 Nov 2012 13:18:46 GMT</pubDate></item><item><title><![CDATA[Team Building. Meet; the Mycrowave, Ironman, Crapology and the Spidge!]]></title><description><![CDATA[<div>
<p>Two weeks ago, I ran a team building exercise to get the creative juices flowing and have the team work with people they haven't necessarily worked with before.</p>
</div>

<p>Previously I have run the excellent&nbsp;<a href="http://marshmallowchallenge.com/Welcome.html">Marshmallow Challenge</a>&nbsp;which is great fun and interesting - this time round I wanted to create my own team building exercise that would focus on creativity and collaboration. So I found a two hour slot the whole company could attend (which is a task in itself!), booked an event in everyone's diaries and began preparations.<br>
</p>
<div>
<p>Heres a quick summary of what I came up with, how I ran it and the results.</p>
</div>
<div>
<p>I split the entire company (all departments) into 4 teams (I used this online tool: <a href="http://chir.ag/projects/team-maker/)">http://chir.ag/projects/team-maker/)</a><br>
 Then, I told the teams that they had 1 hour to:</p>
</div>
<div>
<p><b><i>"Create a 5-15 minute TV commercial for an ‘improved’ everyday household appliance."</i></b></p>
</div>
<div>e.g. Acme Company presents.. The Cordless Hairdryer.</div>
<div>
<p>More specifically, I asked that within the team, they choose/create a Company Name and Appliance and that the commercial should be either:</p>
</div>

<ul>
	<li>1) Acted</li>
	<li>2) A video commercial</li>
	<li>3) A presentation of ideas</li>
</ul><div>
<p>*(or a mix of each)</p>
</div>
<div>
<p>I stipulated that everyone must speak or take an active role in the presentation/commercial (e.g. Just acting as a extra would not suffice).</p>
</div>
<div>
<p>I informed the teams that after the hour was up, no matter how complete, we'd all watch each teams efforts and individually score the commercial on the following (out of 10)</p>
</div>

<ul>
	<li>Feasibility (is it likely)</li>
	<li>Buyability (would you buy it)</li>
	<li>The Team’s X-Factor (how good was the commercial/presentation)</li>
</ul>
<p><img src="/asset/50ae4eeec21d101f11000023/IMG_2580.jpg" style="cursor: default;"><br>
</p>
<div>
<p>and I promised the winning team…. CHOCS (they could hardly contain their excitement!).</p>
</div>
<div>
<p>The teams organised themselves into separate rooms and began the task, some superbly hilarious product ideas ensued - and for some reason a certain team member was fixated on putting a fish bowl into every product ("How about an iron with a fish swimming in it") - naming no names, Duncan :)</p>
</div>
<div>
<p>After "brainstorming" and then settling on an idea - the teams really set the creativity to full throttle.</p>
</div>

<p>I won't go into too much detail on each product as you had to be there to get the true experience of each pitch.. but a quick summary of each team:</p>
<div>
<p><b>Team #1 - MyCrowave</b></p>
</div>
<div>
<p>A social and cloud enabled (and frankly quite frighteningly powerful) microwave.&nbsp;</p>
</div>
<div><img src="/asset/50ae4f8a1a64ba1d11000037/mycrowave.png" style="cursor: default;"><br>
</div>
<div><b>Team #2 - Ironman</b></div>

<p>A mannequin style ironing experience. Wake up to crisp and perfectly fitted and ironed clothes :) (oh and there is a Ironwoman/child too)</p>
<div><img src="/asset/50ae5133c21d101f11000026/woman.png" style="cursor: default;"><br>
</div>
<div>
<p><b>Team #3 - Healthcheck3000's crapology</b></p>
</div>
<div>
<p>Dr. Sheißenburg's&nbsp;stool sampling device to check you are still healthy. (We never knew about our CTO and IS Director's hidden acting/accent skills!)</p>
</div>
<div><b>Team #4 - Spidge</b></div>

<p>Always getting food on your clothes when trying to get food from the back of the fridge? well fear no more....</p>
<div><img alt="" src="/asset/50ae5d02c21d101f11000027/fridge.png"><br>
</div>
<iframe width="640" height="360" src="http://www.youtube.com/embed/tYXFoN0MBrM" frameborder="0" allowfullscreen=""></iframe>
<p>The 2 hours flew-by and much was gained by all.</p>

<p>....oh and the winning team was Team 1 (The Mycrowave).</p>

<p><b><i>Have you run a team building exercise lately?</i></b></p>
]]></description><link>http://clock.co.uk/misc/team-building-meet-the-mycrowave-ironman-crapology-and-the-spidge</link><guid isPermaLink="true">http://clock.co.uk/misc/team-building-meet-the-mycrowave-ironman-crapology-and-the-spidge</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Thu, 22 Nov 2012 00:00:00 GMT</pubDate></item><item><title><![CDATA[How to create a private npm.js repository]]></title><description><![CDATA[<h1>npmjs.org never goes down</h1>

<p>Or so I thought. </p>

<p>I was going to do some development on my local machine, so I fired up <code>npm install 
&lt;packagename&gt;</code>. Unfortunately, due to a npmjs.org outage, it was not possible for me to get on with my work. So I did what any driven developer would do; I set up a CouchDB replica of npmjs.org. Next time this happens I will be prepared! </p>

<p>As this npmjs.org replica is hosted in the same datacenter as we deploy most of our sites to, it enables a super speedy deployment to testing. </p>

<p>How do we go about this you ask? Well let me tell you. </p>
<h2>Installing CouchDB</h2>

<p><b>Note</b>: These instruction are geared towards Ubuntu 12.04 LTS. But it should be pretty easy to get it up and running on *nix systems, including Mac OS X. </p>

<p>Install the required packages: </p>


<pre><code>sudo apt-get install build-essential autoconf automake libtool erlang libicu-dev libmozjs-dev libcurl4-openssl-dev </code></pre>

<p>Download CouchDB 1.2: </p>


<pre><code>wget http://mirrors.ukfast.co.uk/sites/ftp.apache.org/couchdb/releases/1.2.0/apache-couchdb-1.2.0.tar.gz </code></pre>

<p>Extract, and relax: </p>


<pre><code>tar xfv apache-couchdb-1.2.0.tar.gz </code></pre>

<p>Now time to compile: </p>


<pre><code>cd apache-couchdb-1.2.0
./configure
make
make install 
</code></pre>

<p>After all that is done we now want to check that everything's fine and dandy, and that we get the expected output: </p>


<pre><code>$ couchdb
Apache CouchDB 1.2.0 (LogLevel=info) is starting.
Apache CouchDB has started. Time to relax.
[info] [&lt;0.32.0&gt;] Apache CouchDB has started on http://127.0.0.1:5984/ 
</code></pre>

<p>Sweet! But are we responding to requests? </p>


<pre><code>$ curl -X GET http://localhost:5984
 [info] [&lt;0.361.0&gt;] 127.0.0.1 - - GET / 200
</code></pre>

<p>Boom, we now have a working CouchDB instance! </p>

<p><b>You</b>: But wait kind sir, what if we reboot the server? Wouldn't we have to start CouchDB again? </p>

<p>That's correct, we will be adding CouchDB to our init.d scripts, but first we need to create the correct user, group and permissions: </p>


<pre><code>$ sudo adduser --disabled-login --disabled-password --no-create-home couchdb
Adding user `couchdb' ...
Adding new group `couchdb' (1001) ...
Adding new user `couchdb' (1001) with group `couchdb' ...
Not creating home directory `/home/couchdb'.
Changing the user information for couchdb Enter the new value, or press ENTER for the default
  Full Name []: CouchDB Admin 
  Room Number []: 
  Work Phone []: 
  Home Phone []: 
  Other []: 
Is the information correct? [Y/n] Y
</code></pre>

<p>User added, now permissions: </p>


<pre><code>sudo chown -R couchdb:couchdb /usr/local/var/{log,lib,run}/couchdb
sudo chown -R couchdb:couchdb /usr/local/etc/couchdb/local.ini
</code></pre>

<p>We also want CouchDB to use insecure rewrites for a later step. We can turn this off by editing <code>/usr/local/etc/couchdb/local.ini</code> and adding <code>secure_rewrites = false</code> on line 11 in the <code>httpd</code> section.

<pre><code>$ sudo vim /usr/local/etc/couchdb/local.ini
[httpd]
secure_rewrites = false
</code></pre></p>

<p>Ready, set, link, defaults. </p>


<pre><code>sudo ln -s /usr/local/etc/init.d/couchdb /etc/init.d
sudo update-rc.d couchdb defaults 
</code></pre>

<p>Go! </p>


<pre><code>sudo /etc/init.d/couchdb start </code></pre>

<p>YAY! </p>
<h2>Replicating npmjs.org</h2>

<p>Now to replicate the npm registry. </p>


<pre><code>curl -X POST http://127.0.0.1:5984/_replicate -d '{"source":"http://isaacs.iriscouch.com/registry/", "target":"registry", "create_target":true}' -H "Content-Type: application/json" </code></pre>

<p>What this means is that once this is completed your local replication will be an exact copy of the npm registry. However, to ensure we do indeed receive all updates we will add a <code>"continuous":true</code> parameter to the JSON string in our POST request, this utilises CouchDB’s <code>_changes</code> API and will pull any new changes when this API is notified. </p>


<pre><code>curl -X POST http://127.0.0.1:5984/_replicate -d '{"source":"http://isaacs.iriscouch.com/registry/", "target":"registry", "continuous":true, "create_target":true}' -H "Content-Type: application/json" </code></pre>

<p>We are now replicating continuously from npmjs.org to our private CouchDB instance! If you ever want to stop these replications you can easily do this by running the same command as before but add a <code>"cancel":true</code> parameter to the JSON POST data. </p>


<pre><code>curl -X POST http://127.0.0.1:5984/_replicate -d '{"source":"http://isaacs.iriscouch.com/registry/", "target":"registry", "continuous":true, "create_target":true, "cancel":true}' -H "Content-Type: application/json" </code></pre>

<p>And we're almost done! All we need to do now is to set up our own version of the npmjs.org registry and we can relax like the humanoid in the CouchDB logo, or as we do @clock, melt into our beanbags... </p>
<h2>Getting npm to work with our replicated CouchDB</h2>

<p>Most of the steps can be found on isaacs github in the npmjs.org git repositories <a href="https://github.com/isaacs/npmjs.org">README</a></p>

<p>Of course we need to have <code>nodejs</code> and <code>git</code> installed for this: </p>


<pre><code>git clone git://github.com/isaacs/npmjs.org.git
cd npmjs.org
sudo npm install -g couchapp 
npm install couchapp 
npm install semver 
couchapp push registry/app.js http://localhost:5984/registry 
couchapp push www/app.js http://localhost:5984/registry 
</code></pre>

<p>Boom, we now have a working npm repository, to test this we can run the following command. </p>


<pre><code>npm --registry http://localhost:5984/registry/_design/scratch/_rewrite login
npm --registry http://localhost:5984/registry/_design/scratch/_rewrite search
</code></pre>

<p>If you are getting results then everything has gone according to plan! </p>

<p>So we now have your own privately hosted <code>npm</code> registry, that keeps itself updated. Pretty neat, eh? </p>

<p>All you have to get up and running on your own subdomain is to modify the [vhosts] section in <code>/usr/local/etc/couchdb/local.ini</code>. Uncomment the example and restart CouchDB. </p>


<pre><code>$ vim /usr/local/etc/couchdb/local.ini
[vhosts]
example.com = /registry/_design/scratch/_rewrite
</code></pre>

<p>And while we are at it will lock down the application and prevent unauthorised users from deleting our data. </p>


<pre><code>$ vim /usr/local/etc/couchdb/local.ini
[admins]
admin = password
$ sudo /etc/init.d/couchdb restart 
</code></pre>
<h1>Start using your version of npm with the client!</h1>

<p>Straight from the npmjs.org <a href="https://github.com/isaacs/npmjs.org">README</a>, just replace <code>&lt;registryurl&gt;</code> with your registries url, for example: </p>


<pre><code>http://localhost:5984/registry/_design/app/_rewrite</code></pre>

<p>You can point the npm client at the registry by putting this in your <code>~/.npmrc</code> file: </p>


<pre><code>registry = &lt;registryurl&gt;</code></pre>

<p>You can also set the npm registry config property like: </p>


<pre><code>npm config set &lt;registryurl&gt;</code></pre>

<p>Or you can simple override the registry config on each call: </p>


<pre><code>npm --registry &lt;registryurl&gt; install &lt;packagename&gt;</code></pre>

<p>Now you can code and install modules even if npmjs.org is down, or if you want to push the boat even further have this running on your local machine and have an up-to-date npm registry just before your flight. ;] </p>

<p>Thanks to <a href="https://twitter.com/MikeCronn">@MikeCronn</a> and <a href="https://twitter.com/mjorhimself">@mjorhimself</a> for proof reading this article. </p>

<p>Any questions? Tweet me <a href="https://twitter.com/tomgco">@tomgco</a> or leave a comment below.</p>]]></description><link>http://clock.co.uk/tech-blogs/how-to-create-a-private-npmjs-repository</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/how-to-create-a-private-npmjs-repository</guid><dc:creator><![CDATA[Tom Gallacher]]></dc:creator><pubDate>Tue, 20 Nov 2012 12:56:24 GMT</pubDate></item><item><title><![CDATA[Clock Week in Pictures 09 / 11 / 2012]]></title><description><![CDATA[<p><i>SO. This week we go off with a bang! The teams go head to head in a battle of the minds inventing new home appliances – The Apprentice ain't got nothing on the mighty "Mycrowave". The tech loft get some home comforts, Vince and Syd clash virtual swords in Words With Friends, Luke makes noodle soup, Dan and Ema introduce the all new 'Sofa Meet' and we update you with this week's Mo growth! Ladies control yourselves…</i></p>

<p>Smokey cloud with fiery rain spotted at this years Guy Fawkes celebrations…</p>

<p><img src="/asset/509ceeecc21d101f1100001a/photo(4).jpg" style="cursor: default;"></p>

<p>Rob kicks of a team building exercise at Clock this week. Objective: invent, design and shoot a commercial for a new home appliance. Ladies and gentlemen, meet the inventors of "The Spidge"…</p>

<p><img src="/asset/509cef62c21d101f1100001b/IMG_9505.jpg" style="cursor: default; "></p>

<p>Rocking it in the boardroom are the inventors of "Iron Man" and woman and child…</p>

<p><img src="/asset/509cefc31a64ba1d11000027/IMG_9528.jpg" style="cursor: default; "></p>

<p>Team Spidge get their edit on…</p>

<p><img src="/asset/509cefe5c21d101f1100001c/IMG_9533.jpg" style=""></p>

<p>While proprietors of the outstanding new social technology "Mycrowave" scrum up…</p>

<p><img src="/asset/509cf0141a64ba1d11000028/IMG_9509.jpg" style="cursor: default; "></p>

<p>A sneaky peak into the invention of "Health Checker 3000" aka… Dr Shit.</p>

<p><img src="/asset/509cf045c21d101f1100001d/IMG_9523.jpg" style="cursor: default; "></p>

<p>Rob loses concentration and focuses on Jack's butt momentarily…</p>

<p><img src="/asset/509cf0e31a64ba1d11000029/IMG_9514.jpg" style="cursor: default; "></p>

<p>AND now! To present... Dr Scheizenhausen and Mike the Plumber from Crapologies Ltd.</p>

<p><img src="/asset/509cf1111a64ba1d1100002a/photo(3).jpg" style="cursor: default; "></p>

<p>And the winning team! Mycrowave! Well done guys…</p>

<p><img src="/asset/509cf173c21d101f1100001e/photo(2).jpg" style="cursor: default; "></p>

<p>So back to work... Ema figures out a new approach to scamping</p>

<p><img src="/asset/509cf198c21d101f1100001f/photo (4).jpg" style="cursor: default; "></p>

<p>While the tech loft get cosy… in more ways than one! Erik here showing off his new bag…</p>

<p><img src="/asset/509cf1c0c21d101f11000020/IMG_20121107_161318.jpg" style="cursor: default; "></p>

<p>While Luke gets a little confused with his…</p>

<p><img src="/asset/509cf1e31a64ba1d1100002b/image.jpg" style="cursor: default; "></p>

<p>And Adam just bypasses it altogether and goes straight for the sleeping bag…</p>

<p><img src="/asset/509cf20bc21d101f11000021/IMG_20121107_121402.jpg" style="cursor: default; "></p>

<p>But then gets confused and ends up falling asleep in an actual meeting…</p>

<p><img src="/asset/509cf2241a64ba1d1100002c/IMG_20121106_182207.jpg" style="cursor: default; "></p>

<p>Syd plays SHIT in words and friends…</p>

<p><img src="/asset/509cf2631a64ba1d1100002d/photo (1) copy.jpg" style="cursor: default; "></p>

<p>And Vince comes at him with RAPE... yeesh!</p>

<p><img src="/asset/509cf2841a64ba1d1100002e/photo223.jpg" style=""></p>

<p>Luke invents a new kind of noodle soup…</p>

<p><img src="/asset/509cf2a41a64ba1d1100002f/photo (3).jpg" style="cursor: default; "></p>

<p>Ema and Dan decide the best meet is a sofa meet!</p>

<p><img src="/asset/509cf2e61a64ba1d11000030/Photo on 08-11-2012 at 10.43.jpg" style="cursor: default; "></p>

<p>AND what we've all been waiting for… Our Mo Bro's have an update for us. Ben's looking ever so smug!</p>

<p><img src="/asset/509cf3051a64ba1d11000031/5e62e7762a6411e2a76e22000a9f1968_7.jpg" style="cursor: default; "></p>

<p>And well Loz is just grabbing the bull with both horns (geddit? haha)</p>

<p><img src="/asset/509cf35c1a64ba1d11000032/photo (6).jpg" style="cursor: default; "></p>

<p>So PLEASE please go and <a href="http://uk.movember.com/team/480789">donate</a> for this great cause. Movember is only here for another 3 weeks! Make it count…</p>
]]></description><link>http://clock.co.uk/misc/clock-week-in-pictures-09-11-2012</link><guid isPermaLink="true">http://clock.co.uk/misc/clock-week-in-pictures-09-11-2012</guid><dc:creator><![CDATA[Ema O'Donovan]]></dc:creator><pubDate>Fri, 09 Nov 2012 11:42:32 GMT</pubDate></item><item><title><![CDATA[Clock Week in Pictures 02 / 11 / 2012]]></title><description><![CDATA[<p><i>Welcome welcome. This week's WIP takes us to the World Publishing Expo in Frankfurt, Shoreditch town hall for Glug and a little snooze in the After Dark Club in Reading. PLUS let's not forget Halloween, Movember and getting your exercise in whilst at work… Huzzah!</i></p>

<p>Sam and Vince take us on a tour of the World Publishing Expo in Frankfurt...</p>

<p><img src="/asset/5093cc441a64ba1d1100001e/photo 1 copy.JPG" style="cursor: default;"></p>

<p>Some pretty cool Typography on the escalators…</p>

<p><img src="/asset/5093cc661a64ba1d1100001f/photo 3.JPG" style="cursor: default;"></p>

<p>A grand entrance…</p>

<p><img src="/asset/5093cccdc21d101f11000014/photo 2 copy.JPG" style="cursor: default;"></p>

<p>A little tipple…</p>

<p><img src="/asset/5093cceac21d101f11000015/photo 5.JPG" style=""></p>

<p>And feeling it a little the next day… (aww)</p>

<p><img src="/asset/5093cd0cc21d101f11000016/IMG_20121031_093401.jpg" style="cursor: default;"></p>

<p>Syd manages to find the only human who can fall asleep in a nightclub at the After Dark Club in Reading...</p>

<p><img src="/asset/5093cd4c1a64ba1d11000020/photo (5).JPG" style=""></p>

<p>And catches this corker whilst on the commute… Send captions to @Clock</p>

<p><img src="/asset/5093cd751a64ba1d11000021/photo (4).JPG" style="cursor: default;"></p>

<p>Francisco shows us how to keep trim during office hours…</p>

<p><img src="/asset/5093cdae1a64ba1d11000022/image.jpeg" style=""></p>

<p>And Paul adds a little healthy competition into the mix…</p>

<p><img src="/asset/5093cdc8c21d101f11000017/image_1.jpeg" style=""></p>

<p>Meanwhile Jules gets his Glug on…</p>

<p><img src="/asset/5093cde41a64ba1d11000023/photo 2.JPG" style="cursor: default;"></p>

<p>And we enjoy a talk about Mr Bingo and his Hate Mail…</p>

<p><img src="/asset/5093cdff1a64ba1d11000024/photo 1.JPG" style="cursor: default;"></p>

<p>Syd gets his pumpkin out… Meee -owww!</p>

<p><img src="/asset/5093ce281a64ba1d11000025/photo (3).JPG" style="cursor: default;"></p>

<p>Loz gives us his game face for <a href="http://uk.movember.com/team/480789">Movember</a>…</p>

<p><img src="/asset/5093cf86c21d101f11000018/movember pre shave.jpeg" style="cursor: default;"></p>

<p>While Ben goes ALL out with this before and after…</p>

<p><img src="/asset/5093cfb4c21d101f11000019/Screen Shot 2012-11-01 at 11.06.22.png" style="cursor: default;"></p>

<p>So PLEASE get donating to the <a href="http://uk.movember.com/team/480789">Clock Team&nbsp;</a>for Movember. It's a great cause of which you can read about <a href="http://uk.movember.com/about">here</a>. GO MO!</p>]]></description><link>http://clock.co.uk/misc/clock-week-in-pictures-02-11-2012</link><guid isPermaLink="true">http://clock.co.uk/misc/clock-week-in-pictures-02-11-2012</guid><dc:creator><![CDATA[Ema O'Donovan]]></dc:creator><pubDate>Fri, 02 Nov 2012 13:29:30 GMT</pubDate></item><item><title><![CDATA[Clock Week in Pictures 25 / 10 / 2012]]></title><description><![CDATA[<p><i>What a week! Clock prove there is no such thing as the winter blues as Ben G gets down on the Isle of Wight, Jack's progress with his Halloween Lego Arduino project is coming along nicely, Paul Serby speaks up at #LNUG, we launch <a href="http://www.gothinkbig.co.uk/">Go Think Big!</a> for O2 and Bauer Media, Sophie shows us what's what at Freeze festival whilst showing the boys who rules the rad at Hemel Snow Center, Adam D puts his new GoPro to use, Ema gets up close and with the Scissor Sisters and Syd starts the first ever Clock Band! Hairspray at the ready…</i></p>

<p>Ben Gourley killing it on his trials bike on the Isle of Wight...</p>

<p><img src="/asset/508e6b1ec21d101f1100000c/bg-trials-wip.jpeg" style="cursor: default;"></p>

<p>Jack unwinding with his Halloween inspired Lego Arduino project… pics of the finished article coming sooOOOOooonn…</p>

<p><img src="/asset/508e6b771a64ba1d1100000f/photo.jpeg" style="cursor: default;"></p>

<p>Paul Serby was invited to speak at #LNUG where he covered topics like our award winning Swipestation…</p>

<p><img src="/asset/508e6c311a64ba1d11000010/photo 2.JPG" style="cursor: default;"></p>

<p>Moving on to the transitions of wearable computing…</p>

<p><img src="/asset/508e6c58c21d101f1100000d/IMG_0985.JPG" style="cursor: default;"></p>

<p>The guys enjoyed some pizza and beers with Bowler Cam making an appearance (Wearable computing from Clock)…</p>

<p><img src="/asset/508e6c841a64ba1d11000011/IMG_0982.jpg" style="cursor: default;"></p>

<p>Did I mention there was beer?</p>

<p><img src="/asset/508e6cc1c21d101f1100000e/IMG_0978.JPG" style="cursor: default;"></p>

<p>Not long after the morning after the night before, Adam D donned his new GoPro…</p>

<p><img src="/asset/508e6d5ec21d101f1100000f/photo3.jpeg" style="cursor: default;"></p>

<p>And Sophie, Luke and Tom G joined him on the slopes of Hemel Hempsted…</p>

<p><img src="/asset/508e6d92c21d101f11000010/Screen Shot 2012-10-26 at 11.49.16.png" style="cursor: default;"></p>

<p>Luke showed his steeze…</p>

<p><img src="/asset/508e6dbac21d101f11000011/Screen Shot 2012-10-26 at 11.50.18.png" style="cursor: default;"></p>

<p>Sophie got air…</p>

<p><img src="/asset/508e6dccc21d101f11000012/Screen Shot 2012-10-26 at 11.18.00.png" style="cursor: default;"></p>

<p>And kept the long running feud between Skiers and Boarders alive… (no skiers were hurt in the making of this WIP, she was actually helping them up)</p>

<p><img src="/asset/508e6e1f1a64ba1d11000012/Screen Shot 2012-10-26 at 11.47.34.png" style="cursor: default;"></p>

<p>All this while Clock launched the new <a href="http://www.gothinkbig.co.uk/">Go Think Big!</a> site…</p>

<p><img src="/asset/508e6e801a64ba1d11000013/photo4.jpeg" style="cursor: default;"></p>

<p>Back in the studio Adam D gets a step ladder to help with… well, everything…</p>

<p><img src="/asset/508e6ee01a64ba1d11000014/IMG_0973.JPG" style="cursor: default;"></p>

<p>Ema finds the perfect combination of her love of comic illustration and, well, drinking…</p>

<p><img src="/asset/508e6ff91a64ba1d11000016/photo8.JPG" style="cursor: default;"></p>

<p>In preparation for meeting the Scissor Sisters! Shot taken side stage…</p>

<p><img src="/asset/508e701e1a64ba1d11000017/photo7.JPG" style="cursor: default;"></p>

<p>Party cannons launched!</p>

<p><img src="/asset/508e70351a64ba1d11000018/photo6.JPG" style="cursor: default;"></p>

<p>And the aftermath…</p>

<p><img src="/asset/508e70441a64ba1d11000019/photo5.JPG" style="cursor: default;"></p>

<p>Sophie laid her eyes on this beast at Freeze Festival…</p>

<p><img src="/asset/508e706d1a64ba1d1100001a/batterseaRamp.JPG" style="cursor: default;"></p>

<p>And got in with the Lea Valley white water rafting crew. I see a new hobby developing…</p>

<p><img src="/asset/508e70b1c21d101f11000013/rowRow.JPG" style="cursor: default;"></p>

<p>We round this week's WIP up with the totally amazeballs announcement of the ALL NEW Clock Band! Syd is showing his inner rock star here…</p>

<p><img src="/asset/508e712b1a64ba1d1100001b/photo1.jpeg" style="cursor: default;"></p>

<p>"You Rock Kings Langley!"</p>
]]></description><link>http://clock.co.uk/misc/clock-week-in-pictures-25-10-2012</link><guid isPermaLink="true">http://clock.co.uk/misc/clock-week-in-pictures-25-10-2012</guid><dc:creator><![CDATA[Ema O'Donovan]]></dc:creator><pubDate>Mon, 29 Oct 2012 11:22:43 GMT</pubDate></item><item><title><![CDATA[Clock Week in Pictures 19 / 10 / 2012]]></title><description><![CDATA[
<p>So this week, we bring you&nbsp;<a href="http://www.nodestack.org/">Nodestack</a>&nbsp;all the way from San Francisco, Swipestation gets some love at the Digital Impact awards, &nbsp;Clock goes late night this week and Jack preps for some serious Lego-ing… yes that's a verb.</p>

<p>Presenting…&nbsp;<a href="http://www.nodestack.org/">Nodestack</a>&nbsp;conference!</p>

<p><img src="/asset/508147a3c21d101f11000006/photo 1.jpeg" style="cursor: default;"></p>

<p>Clock CTO Paul Serby speaking at Nodestack with fellow speakers Bryan Cantrill, Aaron Heckmann, Nuno Job and Ben Wen…</p>

<p><img src="/asset/5081489e1a64ba1d11000005/image (1).jpeg" style="cursor: default;"></p>

<p>Winding down in San Francisco with the team…</p>

<p><img src="/asset/50814948c21d101f11000007/photo 2.jpeg" style="cursor: default;"></p>

<p>And a final shout to San Francisco captured by Sam Fresco our Marketing Manager…</p>

<p><img src="/asset/508149721a64ba1d11000007/image.jpeg" style="cursor: default;"></p>

<p>Whilst back in the UK, Swipestation scooped some awards at the Digital Impact Awards in London…</p>

<p><img src="/asset/50814e5a1a64ba1d11000009/photo.jpeg" style="cursor: default;"></p>

<p>The team get spoiled for dinner…</p>

<p><img src="/asset/50814e8f1a64ba1d1100000a/523664_10151290638740522_1570326822_n.jpeg" style="cursor: default;"></p>

<p>And then 'recover' from the celebrations the next morning…</p>

<p><img src="/asset/50814ee41a64ba1d1100000b/431635_10151291487405522_392475575_n.jpeg" style="cursor: default;"><br>
</p>

<p>The creative team get creative with their late night positioning…</p>

<p><img src="/asset/50814ff21a64ba1d1100000d/photo4.jpg" style="cursor: default;"></p>

<p>Jack shows us what he's going to connect to his Arduino kit! Watch this space…</p>

<p><img src="/asset/50815024c21d101f1100000b/photo6.JPG" style="cursor: default;"></p>

<p>And Mikkel's lifeline gets a shout this week all the way from Denmark with Sam C on speed dial… a little office bromance never goes amiss – even if it is long distance :-)</p>

<p><img src="/asset/5081510f1a64ba1d1100000e/foto.jpg" style="cursor: nw-resize;"></p>
]]></description><link>http://clock.co.uk/misc/clock-week-in-pictures-19-10-2012</link><guid isPermaLink="true">http://clock.co.uk/misc/clock-week-in-pictures-19-10-2012</guid><dc:creator><![CDATA[Ema O'Donovan]]></dc:creator><pubDate>Fri, 19 Oct 2012 11:31:20 GMT</pubDate></item><item><title><![CDATA[Clock Week in Pictures 12 / 10 / 2012]]></title><description><![CDATA[
<p>Welcome to this week's edition of the new Clock WIP. The last 7 days has seen us making some serious tea, partying at the BIMA end of summer bash, dieting habits of a coder (pizza / pop) and the dieting habits of the commercial team (dry ice sushi.. ooh er!), snapping fairies in the New Forest, cutting JS calories by omitting semi-colons, Batman infiltrates our site stats and a notepad doodle ghost graces the studio...... oooooOOOOOOOoooooo.</p>

<p>@SydNadim @lozpayne56 and @frescosam get up close and personal with the BIMA End of Summer Bash crew.</p>

<p><img src="/asset/5076aa2120a9442b45000002/8064701263_d72425b78c_c.jpeg" style="cursor: default;"></p>

<p>Clock developers reduce their carbon footprint by banning semi-colons - @bengourley rolls out the new JS Style guide for Clock. You can check it out <a href="https://github.com/bengourley/js-style-guide">here</a>. </p>

<p><img src="/asset/5076acfd8768e6530d000001/Screen Shot 2012-10-11 at 11.11.30.png" style="cursor: default;"></p>

<p>@theredbull catches some serious rays in the wonderland that is the New Forest...</p>

<p><img src="/asset/5076c6a2ef32fd520d000001/IMG_8447.jpg" style="cursor: default;"></p>

<p>@OliverJohnston5 gives us an insight into the diet of a hardcore coder...<br>
</p>

<p><img src="/asset/5077e7c21a64ba1d11000001/IMAG0232.jpg" style="cursor: default;"></p>

<p>Whilst @SydNadim and @emekaiweka show us the diet of the commercial team with this fancy ensemble. Dry ice sushi at Gilgamesh!</p>

<p><img src="/asset/5077e858c21d101f11000001/IMG_20121009_192354.jpg" style="cursor: default;"></p>

<p>@tomgco makes @lukewilde a serious cup of tea...</p>

<p><img src="/asset/5077e8d1c21d101f11000002/IMG_20121001_125745.jpg" style="cursor: default;"></p>

<p>Bruce Wayne AKA The Bat infiltrates the @Clock site stats....</p>

<p><img src="/asset/5077e9121a64ba1d11000002/Screen Shot 2012-10-08 at 14.41.20.png" style="cursor: default;"></p>

<p>@Mae84 gets a shock when she discovers this little guy just came outta nowhere...&nbsp;</p>

<p><img src="/asset/5077e977c21d101f11000003/72e734b8116e11e2a82b22000a1d012e_7.jpeg" style="cursor: default;"></p>

<p>And the @Clock team are holding 3 meetings on the roof of @TheHospitalClub today.. Cold? What cold? Brrrrrrrr....</p>

<p><img src="/asset/5077ea27c21d101f11000004/photo-(1).jpg" style="cursor: default;"></p>

<p>And we get a new pet in the form of the new @trello Doggy! Rarf!</p>

<p><img src="/asset/5077f86d1a64ba1d11000003/Screen Shot 2012-10-12 at 11.57.33.png" style="cursor: nw-resize;"></p>
]]></description><link>http://clock.co.uk/misc/clock-week-in-pictures-12-10-2012</link><guid isPermaLink="true">http://clock.co.uk/misc/clock-week-in-pictures-12-10-2012</guid><dc:creator><![CDATA[Ema O'Donovan]]></dc:creator><pubDate>Fri, 12 Oct 2012 00:00:00 GMT</pubDate></item><item><title><![CDATA[All new Week in Pictures from Clock]]></title><description><![CDATA[<p>So this week we're rocking a double exemption tea game, getting creative with hats, jumping out of planes and popping over to Portugal for the #LXJS conference in @Clock force. Enjoy!</p>

<p><img src="/asset/506ee4c61d692df63d000003/photo 3.JPG" style="cursor: default;"></p>

<p>Double exemption tea game means a whole new set of rules...</p>

<p><img src="/asset/506ee4fd1d692df63d000004/IMAG0230.jpeg" style="cursor: default;"></p>

<p>Ash enjoys a new crown for coding...</p>

<p style="text-align: justify;"><br>
</p>

<p style="text-align: justify;"></p>

<p><img src="/asset/506ee5361d692df63d000006/photo4.jpeg" style="cursor: default;"></p>

<p>Sam C gets some hate mail...</p>

<p><img src="/asset/506ee5741d692df63d000007/MB2U3404.jpeg" style="cursor: default;"></p>

<p>Adam D jumps out of a plane... nothing to do with work of course.</p>

<p><img src="/asset/506ee5a41d692df63d000008/photo 1.JPG" style="cursor: default;"></p>

<p>Loz, Tosin and Sam F get up close and personal with the Olympic Torch..</p>

<p><img src="/asset/506ee5cf1d692df63d000009/photo 2.JPG" style="cursor: default;"></p>

<p>Syd shows off his terrible - sorry Tearable Puns....</p>

<p><img src="/asset/506ee6305cf944f83d000004/A3oNngaCMAAM-fp.jpg" style="cursor: default;"></p>

<p>Paul shows off his new Node Bowler!! Check him out at&nbsp;<a href="http://bowler.clockte.ch/">http://bowler.clockte.ch/</a></p>

<p><img src="/asset/506ee6671d692df63d00000a/image.jpeg" style="cursor: default;"></p>

<p>and rocking it at #LXJS!!</p>

<p><img src="/asset/506ee6a91d692df63d00000b/HWEuO.png" style="cursor: default;"></p>

<p>Bowler Cam takes it's next victim at #LXJS</p>]]></description><link>http://clock.co.uk/social-media-2/all-new-week-in-pictures-from-clock</link><guid isPermaLink="true">http://clock.co.uk/social-media-2/all-new-week-in-pictures-from-clock</guid><dc:creator><![CDATA[Ema O'Donovan]]></dc:creator><pubDate>Fri, 05 Oct 2012 13:43:53 GMT</pubDate></item><item><title><![CDATA[My Favourite Spam]]></title><description><![CDATA[<p>Sometimes a film is so bad that it's actually a much loved 'classic'. I think this also applies to songs once in a while.&nbsp;</p>
<p>Most people know they shouldn't like it, and they perhaps even pretend in public (to save face) that they dislike it - but secretly they love it.&nbsp;</p>
<p>Recently I have started receiving spam emails that I believe fall into this bracket.&nbsp;</p>
<p>The emails are from a Joyo at mk-time.com.<br>
 I can only presume that somehow they decided to mass email all emails containing "clock" in the domain, as I have certainly never visited their site or signed up for a newsletter - or for that matter purchased anything from them. <br />
<br />
 In a very weird way, I'm glad! The emails bring a smile to my face every-time I receive one. Have a look at them: pure genius (make sure to read the text too)!:</p>

<p><img src="/asset/506ea3241d692df63d000001/Screen Shot 2012-10-05 at 10.04.45.png" style="cursor: default; "></p>

<p><img src="/asset/506ea3b95cf944f83d000002/Screen Shot 2012-10-05 at 10.03.18.png" style="cursor: default; "></p>

<p><img src="/asset/506ea4815cf944f83d000003/Screen Shot 2012-10-05 at 10.03.35.png" style="cursor: default; "></p>

<p>Love 'em!</p>

<p>On a more serious note, a good way (provided your email service allows) to find out if you have been subscribed to email you never asked for, is to use a technique called "address tags" or "sub-addressing"</p>

<p>Definition from Wikipedia:</p>

<blockquote style="margin: 0 0 0 40px;">
<p style="margin: 0.4em 0px 0.5em;">Some mail services allow a user to append a tag to their email address (e.g., where&nbsp;<i>joeuser@example.com</i>&nbsp;is the main address, which would also accept mail for&nbsp;<i>joeuser+work@example.com</i>&nbsp;or&nbsp;<i>joeuser-family@example.com</i>). The text of&nbsp;<i>tag</i>&nbsp;may be used to apply filtering and to create&nbsp;<i>single-use</i>&nbsp;addresses.&nbsp;Some IETF standards-track documents, such as&nbsp;<a class="external mw-magiclink-rfc" href="http://tools.ietf.org/html/rfc5233" style="color: rgb(102, 51, 102);">RFC 5233</a>&nbsp;refer to this convention as "sub-addressing".</p>
</blockquote>
<br>

<p>So, assuming your email provider allows, when you register on a site, or sign-up for a newsletter, you can use the site's name to ensure that any email you receive is coming from the site you requested, and that they haven't sold your data to another company.</p>

<p>For example:</p>

<p>Joe Bloggs wants to register on acmecorp.com. His email address is usually joebloggs@example.com, but he signs up with:&nbsp;joebloggs+acmecorp@example.com.</p>

<p>He could then filter all mail to&nbsp;joebloggs+acmecorp@example.com to a sub-folder/tag in his inbox called 'Acme Corp'.</p>

<p>If he receives an email to&nbsp;joebloggs+acmecorp@example.com from another company other than acmecorp.com he knows that either they have sold his data to another company or that someone has email harvested his address.</p>

<p>Anyway, hope you enjoyed the spam from mk-time, have you got any spam that you love?!</p>

<p>Update: Received one moments after posting blog entry :)</p>

<p><img src="/asset/506eb6b61d692df63d000002/Screen Shot 2012-10-05 at 11.27.26.png" style="cursor: default; "></p>]]></description><link>http://clock.co.uk/misc/my-favourite-spam</link><guid isPermaLink="true">http://clock.co.uk/misc/my-favourite-spam</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Fri, 05 Oct 2012 08:55:21 GMT</pubDate></item><item><title><![CDATA[Top Picks of the LXJS Talks]]></title><description><![CDATA[<p>Seven of us Clockers made the trip to Lisbon for LXJS last week. The overall quality of the talks was excellent. There was a great balance of abstract and technical content, and luckily for you (if you didn't make it to the conference, or just want to relive the experience) the organisers have done a great job getting the video live-streamed and already uploaded to YouTube. (Videos by <a href="http://acavideo.com/">ACA Video</a>).</p>

<p>These were the top talks for me:</p>
<h2>James Halliday - Harnessing The Awesome Power Of Streams</h2>

<p>James (aka substack) gave a whistle-stop tour through streams in node.js, showing by insanely fast examples, augmented by hand drawn illustrations, on how and why they should be used.</p>

<p><iframe width="100%" height="315" src="http://www.youtube.com/embed/lQAV3bPOYHo" frameborder="0"></iframe></p>
<h2>Brian LeRoux - Mobile JavaScript</h2>
<p>As part of a great mobile JS state of affairs, Brian gave a great insight into dirty hacks that PhoneGap/Cordova has to do to overcome various device specific problems.</p>

<p><iframe width="100%" height="315" src="http://www.youtube.com/embed/lObZbhhTq5E" frameborder="0"></iframe></p>
<h2>Anthony Ricaud - The Web is the platform</h2>

<p>Anthony talked about how Firefox had brought control of the web away from proprietary implementations, but now the mobile space is controlled by Apple and Google. He introduced Firefox OS, which aims to do to the mobile space, what Firefox did the the browser market. </p>

<p><iframe width="100%" height="315" src="http://www.youtube.com/embed/DOumaOzoQTg" frameborder="0"></iframe></p>

<p>One thing that unfortunately let down a fair few presentations was coding demos not working. Budding presenters: watch Substack's exemplary talk, and notice he didn't <i>actually</i> do any coding, it was all prepared in advance.</p>

<p>We had a great time at LXJS and meeting the Lisbon people. Thanks to the organisers for such an enjoyable event in a great city!</p>]]></description><link>http://clock.co.uk/tech-blogs/lxjs-top-picks</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/lxjs-top-picks</guid><dc:creator><![CDATA[Ben Gourley]]></dc:creator><pubDate>Thu, 04 Oct 2012 11:52:07 GMT</pubDate></item><item><title><![CDATA[Optimise your pngs from the terminal in OSX]]></title><description><![CDATA[As the CTO of Clock, frontend isn't something I do much of, but when I get an email that a site of ours has gone live I always push it through [Google Page Speed](https://developers.google.com/speed/pagespeed/insights). Most of the time the team have done an amazing job to ensure that all images, and other assets, are optimised correctly. Sometimes in a rush to hit a deadline it does get overlooked. Fortunately running the site through Page Speed pushes out a medium level warning saying you could be saving a gzillion bytes if you compressed your images.

If you find yourself in the this position, this single line of commadfu can make things a little better. 

Once you are setup you can run this to shrink all the PNGs in your project.

## Setup

First run terminal using spot light: **cmd+space terminal**

Then you'll need [homebrew](http://mxcl.github.com/homebrew/)

    ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

Once brew is installed, install [optipng](http://optipng.sourceforge.net/)

     brew install optipng

If you are on a Debian flavour of Linux you can do:

     sudo apt-get install optipng

Now you need change your working directory to the base directory of your images

     cd ~/development/MyProject/public/images

## Command Fu

Now use the **find** command to find all the pngs in your project. In my node.js project all the pngs are in the *~/development/MyProject/public/images* directory.

     find . -name "*.png" -exec optipng -o7 {} \;

## Commit

If you have your project in git, make sure you commit your updated pngs

     git commit -am 'Compressing pngs'

That is it!

This doesn't replace the need to produce well optimised assets but is a simple safeguard that any member of your team can do. See [Optimize Images](https://developers.google.com/speed/docs/pss/OptimizeImages) from the Google Page Speed Services for more information about image compression. 

## JPEG

PNGs are lossless so this operation doesn't change how your images look. You can also use a simular tool for jpgs. WARNING: If you start changing the compression level of jpgs you'll get a lot of angry designers on your back.

     brew install jpegoptim

Install on Debian/Ubuntu

     sudo apt-get install optipng

Then you do a dry-run:

     find . -name "*.jpg" -exec jpegoptim -m60 -o -p -n --strip-all {} \;

If you're happy with the dry-run you can run it for real.

     find . -name "*.jpg" -exec jpegoptim -m60 -o -p --strip-all {} \;

## GUI Based

[Imageoptim](http://imageoptim.com)  is a nice GUI tool that chains images through a number of compression tools and does a great job getting the file size down.

Once installed you can either drag images onto the main window, or you can use find again:

     find public -name "*.png" -exec open -a ImageOptim.app {} \;

This tool gives the best compression we have found.

## Automate?

There is debate whether this should be added to the build process. Designers creating the images should be considering image optimisation as part of their workflows and automating means the human attention to detail can be overlooked. I have seen both work but ultimately believe that the teams should self regulate this process.]]></description><link>http://clock.co.uk/tech-blogs/optimise-your-pngs-from-the-terminal-in-osx</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/optimise-your-pngs-from-the-terminal-in-osx</guid><dc:creator><![CDATA[Paul Serby]]></dc:creator><pubDate>Tue, 02 Oct 2012 09:56:51 GMT</pubDate></item><item><title><![CDATA[How to keep data synchronised using Node JS]]></title><description><![CDATA[Here at Clock we recently came across the problem, on one of our latest Node JS projects, of trying to keep the same data stored on two different systems in sync with each other.

Now I thought this would be quite a common problem, and that a simple Google search would reveal plenty of design patterns and code snippets to help solve it. I was wrong. After a couple of hours scouring the web I had found nothing which looked even vaguely like a solution.

So after discussing this problem with our CTO, we sat down and spent an hour coming up with a solution to my problem and [this gist is what we came up with as a first draft](https://gist.github.com/2775473).

This solution makes one fairly large assumption about your data, and that is; every item has some sort of unique identifier to distinguish it from all of the other items. It also relies fairly heavily on the difference and intersection functions available in [Underscore.JS](http://underscorejs.org/) to work its magic.

The way it works is as follows:

First, we get all of our existing data and extract all of the unique IDs into an array. We will refer to this as **A**. We then do the same for our new data, which we will refer to as **B**. 

To begin with, we want to identify all items which need to be removed. Once we have **A** and **B** we can use the [Underscore.JS](http://underscorejs.org/) difference function to work out **C** which is all of the items within our old collection of data that are no longer present within our new collection.

The next step is to work out which items we may need to update. To do this we can use the [Underscore.JS](http://underscorejs.org/) intersection function on **A** and **B** to determine **D** which is all of the items that are present in both collections of data.

The last step in determining our sets of data is to work out which items do not exist within our original collection and therefore need creating. To do this we again use the [Underscore.JS](http://underscorejs.org/) difference function, but this time on **B** and **D**. This gives us **E** which is all of the items which exist in the new collection but are not present in both the old collection and the new collection.

These three calculations can be expressed as:

**C** = **A** - **B**

**D** = **A** ∩ **B**

**E** = **B** - **D**

Where **C** is the IDs of all the items that need to be removed, **D** is the IDs of all the items that may or may not need updating and **E** is the IDs of all the items that need creating.

The last step in this whole process is to actually update our original data. To do this we just loop through each of our three sets and perform the necessary action. This is very simple for our creation and deletion sets, however, for the update set we are still unsure as to which items have actually changed and are in need of being updated. To determine this, whilst looping through the set we pass our existing data item and our new data item off to a comparator function which will then decide whether or not to do the actual update.

So that is the theory behind the our data synchronisation algorithm.

To put this into practice I took the draft that we came up with and have cleaned it up, made it asynchronous and it is now available on my GitHub page and through NPM. 

You can install via NPM using the following command:

    npm install data-sync

For more information and detailed instructions on how to use it, take a look at my GitHub Page:

[https://github.com/aduncan88/data-sync](https://github.com/aduncan88/data-sync)

What we have developed is far from ideal and was done to overcome a specific problem that we were having on one of our projects. It has been designed from the beginning to be as generic as possible with the core principle to reduce the number of reads and writes to and from your data store (database etc), however it does have one disadvantage in the fact that it stores both the old and new collections of data in their entirety in memory. Therefore if you are dealing with very large collections, you may run into low memory issues.]]></description><link>http://clock.co.uk/tech-blogs/how-to-keep-data-synchronised-using-node-js</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/how-to-keep-data-synchronised-using-node-js</guid><dc:creator><![CDATA[Adam Duncan]]></dc:creator><pubDate>Wed, 22 Aug 2012 00:00:00 GMT</pubDate></item><item><title><![CDATA[Git Bisect: Simple Examples and Automation]]></title><description><![CDATA[<h1>Manual Workflow</h1>

<p>As projects and their teams grow, so must the amount of time that is invested into isolating latent errors. If your development team utilises source control it can often be useful to narrow your search down to the specific commit which introduced a given issue. Doing this manually can be a tiresome process, fortunately&nbsp;for our fingers&nbsp;<a href="http://git-scm.com/">Git</a> exposes a way to ferret out offending commits with a technique akin to a <a href="http://en.wikipedia.org/wiki/Binary_search_algorithm">Binary Search</a>.</p>

<p>The simplest use of this tool requires you to undertake a small, manual workflow.</p>

<ol>
  <li>Start git bisect. <code># git bisect start</code></li>
  <li>Give git a bad revision. <code># git bisect bad {insert your bad revision}</code></li>
  <li>Give git a good revision.&nbsp;<code># git bisect good {insert your good revision}</code></li>
  <li>The bisect loop begins.
    <ol>
      <li>Git checks out an alternative commit (Following a Binary Search approach).</li>
      <li>You build and test your application.</li>
      <li>Tell git if the issue is present or not. <code> # git bisect good</code> or <code># git bisect bad</code></li>
      <li>Git narrows it's search and performs another search.</li>
    </ol>
  </li>
  <li>Eventually git will arrive at the git which introduced the issue.</li>
</ol>
<p>Voilà! You have located the offending commit; the volume of code you need to inspect has been drastically shortened.&nbsp;(You can check the contents of a given commit using <code>git show {insert commit ref}</code>).</p>

<p>The procedure above is great for locating a bug on a page of a web application for example. But if the output your testing is displayed in the console (Such as status from a build process or unit test), then we can get Git bisect to automate this workflow it's self.</p>
<h1>Basic Automation</h1>

<p>If you're bisecting to find the introduction of a failed unit test or build of your application, running and waiting for the associated commands to complete can consume a lot of your time. Luckily for our patience, Git bisect can take a command to run against each commit and looks at the command's <a href="http://tldp.org/LDP/abs/html/exit-status.html">exit code</a> automatically determine the success of the revision.</p>


<pre>
# git bisect start {bad revision} {good revision}
# git bisect run {command to run unit tests or build your project}
</pre>

<p>Nice! This works for a good number of cases but if you want to preform a more precise tests on your output, you can enlist the assistance of a small Shell script.</p>
<h1>Custom Automation</h1>

<p>The main thing you'll need to be successful in writing your own scripts is a basic understanding of <a href="http://tldp.org/LDP/abs/html/exit-status.html">Shell exit codes</a>. At the most basic level an exit code of '0' is for success and anything else denotes an error. As you've probably guessed Git will look to these codes to determine the success of your build script. By <a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?grep">grepping</a> the output of my build process I can test for the occurrence of a given string then close my Shell script with an exit code pertaining to the result.</p>


<pre>
#!/usr/bin/env bash

# Build and grep for failure output. Replace with your own command.
maiden setup development 2>&1 | grep '\"reload\" failed'

# Retrieve the exit code of the grep.
if [ "$?" -eq "0" ]; then
    # echo "Text found."
    exit 1
else
    # echo "Text not found."
    exit 0
fi
</pre>

<p>Now that we've written our test logic, you'll want to put it somewhere <b>outside</b> of your repository, this is to prevent git reacting to your script as an untracked file. This script is one I will&nbsp;(probably)&nbsp;make use of again, so I've gone ahead and put it in a scripts directory setup on my user's path.&nbsp;<br>
</p>

<p>Now we're ready to run:</p>


<pre>
  # git bisect start {bad revision} {good revision}
  # git bisect run {path to your script}
</pre>

<p>Git will now perform the binary search based on output provided by your script. This approach can of course be used alongside time intensive unit tests, enabling you to play detective in the background.</p>
<h1>Further Reference</h1>

<ul>
  <li><a href="http://www.kernel.org/pub/software/scm/git/docs/git-bisect.html">http://www.kernel.org/pub/software/scm/git/docs/git-bisect.html</a> - GIt Bisect manual</li>
  <li><a href="http://en.wikipedia.org/wiki/Binary_search_algorithm">http://en.wikipedia.org/wiki/Binary_search_algorithm</a> - Binary Search</li>
  <li><a href="http://tldp.org/LDP/abs/html/exit-status.html">http://tldp.org/LDP/abs/html/exit-status.html</a> - Shell exit codes</li>
  <li><a href="http://superuser.com/questions/71428/what-does-21-do-in-command-line">What was the 2>&1 in the above script?</a></li>
</ul> With thanks to <a href="https://twitter.com/rnoake">@rnoake</a> &amp; <a href="https://twitter.com/ajduncan88">@ajduncan88</a>.]]></description><link>http://clock.co.uk/tech-blogs/git-bisect-simple-examples-and-automation</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/git-bisect-simple-examples-and-automation</guid><dc:creator><![CDATA[Luke Wilde]]></dc:creator><pubDate>Sun, 19 Aug 2012 13:59:11 GMT</pubDate></item><item><title><![CDATA[Use jQuery Events on Plain JavaScript Objects]]></title><description><![CDATA[<p>Did you know that you can use jQuery events on non-DOM-related objects? Just wrap up the object in the jQuery function, and you can use <code>on</code>, <code>off</code> and <code>trigger</code>.</p>


<pre>// Create a plain object
var o = {}

// Bind an event handler
$(o).on('bump', function () {
  alert('ouch')
})

// Trigger an event
$(o).trigger('bump')

// Unbind event handlers
$(o).off('bump')</pre>

<p>For some reason, this feature isn't documented, but it's really useful when you want an event listener mixin for your objects and you've already got jQuery on the page. It may not be the most performant event engine out there, but unless you've got hoards of events flying about, this solution is nice because you don't add any page bloat.</p>]]></description><link>http://clock.co.uk/tech-blogs/use-jquery-events-on-plain-javascript-objects</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/use-jquery-events-on-plain-javascript-objects</guid><dc:creator><![CDATA[Ben Gourley]]></dc:creator><pubDate>Wed, 25 Jul 2012 00:00:00 GMT</pubDate></item><item><title><![CDATA[Automated Cross Browser Testing: The Holy Grail]]></title><description><![CDATA[<p><b>Update: </b>One of the authors of Buster.js helpfully responded to this article on Twitter, pointing out that a new version had been released since I'd tried it. This new version addresses IE support, which was one of my major qualms as mentioned later in the post.</p>
<p>When writing <a href="http://github.com/bengourley/module.js">module.js</a>, I wanted to set up some automated cross-browser testing. Firing up VMs is tedious and slow, but for a front-end JavaScript library, making sure it works in all the browsers you intend to support is paramount.</p>

<p><i>It's probably worth saying now that I'm focussing on functional testing here, not the inspection of styles. As far as debugging your CSS is concerned, I'm afraid my best suggestion is still to fire up a VM or use service that does that for you and lets you interact (i.e. <a href="http://www.browserstack.com/">BrowserStack</a>, <a href="https://browserling.com/">Browserling</a>).</i></p>

<p>Testing by hand (i.e just running code and inspecting that it did what was expected) is a start, but after every tiny change to your front-end JavaScript, can you honestly have the discipline (and the time) to fire it up in <b>every</b> browser and fully test its functionality? If you do, I congratulate you, and apologise because the rest of this article might bore you.</p>

<p><i>Unit</i> and <i>acceptance</i> tests help to catch regressions – bugs that are introduced by changes to the code: adding features, fixing other bugs or refactoring. They help to sanity check that your program does what it is intended to do. They mean that you as the author have to use your program, casting scrutiny over its API.</p>

<p>Importantly for open source projects, tests promote trust in your program – their existence alone is added assurance for most users, while the ability to run them enables the more sceptical user to verify that your program fulfils its claims. If you're releasing your OS project on GitHub, hoping for community input, then tests can help make sure pull requests don't break things. Also, well written tests can provide great example usage for your code, augmenting any documentation, readme and examples you might write.</p>

<p>Now that I've convinced you that testing is a good idea, and that opening up different browsers is a pain, hopefully now you can share my desire for <b>automated cross-browser testing</b>.</p>

<h3>Testling</h3>

<p>My first port of call was a service called <a href="http://testling.com/">Testling</a> by StackVM. StackVM's main product (it seems) is Browserling: a service which lets you operate different browsers from within your own. Testling is Browserling's little brother – a service which sits on HTTP, allowing you to send a payload of tests to run in the selection of browsers that you specify.</p>

<p>Let me say now, that if Testling had worked for me, it would have been the holy grail (and this article would be called something 'TDD: Testling Driven Development', or some other witty pun).</p>

<p>However, I was fraught with silent hanging tests (Had they failed? Why? Had they not failed? Why were they taking so long?). These munched up my minutes, of which Testling's free tier gets you 30/month, and I wasn't ready to jump to $20/month for something that wasn't yet working for me. Another show-stopping issue that occurred when asking Testling to run tests files with more than two or three tests in various versions of IE was 'Failed to compile – Instrumentation may have failed'. There is an option to switch instrumentation off, so I did, resulting in a terse message of 'Syntax error' – leaving me baffled, since running the same file in different browsers worked, and each of the tests alone worked in IE. Anyway, I digress–I'd love to hear that I'm doing something wrong, but unfortunately I think these problems are a sign of Testling being a young and fledgling service. Again, let me re-iterate: <b>I believe that a mature Testling would be the ideal solution</b>. For now though, it's frustratingly close.</p>

<h3>BusterJS</h3>

<p><a href="http://busterjs.org/">Buster</a> is another new, 'beta' labelled approach to cross browser testing. Currently Buster requires that you start a server on your local machine, fire up all of the browsers that you want to test in (including from within VMs) and have them 'captured'. Once captured, a browser becomes a 'slave' to the Buster server, and they can be used to repeatedly run your tests. This is a pretty laborious thing to do compared with Testling, plus you have to stock up on your own array of VMs and browsers. However, in their roadmap, the team behind Buster aim to hook up with the <a href="http://www.browserstack.com/automated-browser-testing-api">BrowserStack API</a> (currently in beta) so that you can leave the nitty-gritty of browser acquisition and OS virtualisation up to the experts, and concentrate on running your tests.</p>

<p>Getting up and running with Buster was pretty straightforward (especially being a Node developer – as the Buster server is a Node module); things were going swimmingly. Then the major blocker was discovered: the browser capture feature <i>doesn't</i> work in &lt; IE8. Reading up on the issue tracker, it seems they are keen to deliver good browser support, but it's just not been achieved yet. An alternative 'static' server is offered, which instead of capturing the browser, will just serve up the tests to run within the browser. This works in said browsers, but requires manually navigating to the page and hitting refresh–that doesn't sound automated to me! Once Buster integrates with BrowserStack, I think it'll be a real rival for Testling (though I think as a CLI junkie I'd prefer Testling) but for now, no cigar.</p>

<h3>Next…</h3>

<p>My next port of call will be to try the vanilla&nbsp;<a href="http://www.browserstack.com/automated-browser-testing-api">BrowserStack API</a>&nbsp;for myself, as the kind people there have given me Beta access.</p>

<p>This is where I need you. Have you solved this problem for yourself? If so, share the wisdom so fellow developers like myself can achieve enlightenment! Thanks for reading, and I look forward to responding to your comments.</p>
]]></description><link>http://clock.co.uk/tech-blogs/automated-cross-browser-testing-the-holy-grail</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/automated-cross-browser-testing-the-holy-grail</guid><dc:creator><![CDATA[Ben Gourley]]></dc:creator><pubDate>Thu, 12 Jul 2012 00:00:00 GMT</pubDate></item><item><title><![CDATA[My top picks from D&AD New Blood]]></title><description><![CDATA[<p><img src="https://p.twimg.com/AwZudPwCQAE_ffZ.jpg:large" width="619px" /></p>

<p>
</p>

<p>Some really interesting work to see last night at the D&amp;AD New Blood
 exhibition. My highlights below, in no particular order (well the order
 their business cards fell out of my pocket).</p>

<p>The standard was pretty high and I'm sure I have missed some great 
talent, anyone I couldn't easily get a card from or didn't have
 a website I've not included. Enjoy.<br>

<br>

<a href="http://sophiekemp.com/">http://sophiekemp.com/</a> <br>

<a href="http://www.abigailburch.co.uk/">http://www.abigailburch.co.uk/</a> <br>

<a href="http://www.behance.net/stephaniebonner">http://www.behance.net/stephaniebonner</a> <br>

<a href="http://risottostudio.com/">http://risottostudio.com/</a> <br>

<a href="http://cargocollective.com/suziemoloney">http://cargocollective.com/suziemoloney</a> <br>

<a href="http://birdandcroft.com/">http://birdandcroft.com/</a> <br>

<a href="http://www.behance.net/joelpascual">http://www.behance.net/joelpascual</a> <br>

<a href="http://cargocollective.com/rikdasillustration">http://cargocollective.com/rikdasillustration</a> <br>

<a href="http://cargocollective.com/girlswithballs">http://cargocollective.com/girlswithballs</a> <br>

<a href="http://terryhearnshaw.co.uk/">http://terryhearnshaw.co.uk/</a> <br>

<a href="http://jamesmeacock.blogspot.co.uk/">http://jamesmeacock.blogspot.co.uk/</a> <br>

<a href="http://www.behance.net/james-alexander">http://www.behance.net/james-alexander</a> <br>

<a href="http://petesmart.co.uk">http://petesmart.co.uk</a> <br>

<a href="http://cargocollective.com/kevingartland">http://cargocollective.com/kevingartland</a><span id="pastemarkerend">&nbsp;</span></p>]]></description><link>http://clock.co.uk/creative-blogs/my-top-picks-from-dad-new-blood</link><guid isPermaLink="true">http://clock.co.uk/creative-blogs/my-top-picks-from-dad-new-blood</guid><dc:creator><![CDATA[Sam Chatwin]]></dc:creator><pubDate>Wed, 27 Jun 2012 14:02:38 GMT</pubDate></item><item><title><![CDATA[Sprint Planning & Success]]></title><description><![CDATA[<p>A lot has been said about Scrum, so I will try not to repeat too much ground.</p>

<p>In short, Scrum is a great framework that underlines a very simple process with an emphasis on adaptability and retrospection.</p>
<p><img src="http://f.cl.ly/items/0D0u1M1p0E3P1K1V1J2W/Image%202012.07.17%2015:52:50.png"></p>

<p>Here at <a href="http://www.clock.co.uk/">Clock</a>, Agile and Scrum allow us and our clients to quickly inspect the work in progress and quickly spot things going wrong before it's too late.</p>

<p>Scrum on its own, doesn’t resolve problems. When exercised properly by a talented and committed team, and when combined with good software development practices, it can almost be the silver bullet.</p>

<p>A great deal of Scrum’s success depends on a skilled and dedicated Product Owner to follow and support the project development.</p>

<p>Enough said! This article will focus on a particular portion of Scrum, the ‘Sprint Planning’ section and to demonstrate how best, and to what degree the team should commit to in a sprint.</p>

<p>‘Sprints’ or otherwise know as ‘Iterations’, which if you come from a Lean approach, is a list of tasks that the team commits to execute in a boxed time.</p>

<p>To plan a sprint, the team will choose the tasks from the ‘Product Backlog’. The Tasks are then broken down into smaller, individual cards, thus creating the ‘Sprint Backlog’.</p>

<p>During the Sprint planning, two opposed interests can come into play which are:</p>


<ul>

	<li>The ‘Product Owner’ wants the team to pick more cards and deliver more value;</li>

	<li>The ‘Team’ can be interested in challenging tasks and avoid committing to too much.</li>
</ul>

<p>The following diagram illustrates the scenario.</p>

<p><img src="http://f.cl.ly/items/432j3W1o3v3B3L023Q2U/Image%202012.07.17%2015:54:16.png" unselectable="on" style="cursor: default; "></p>

<p>Note that challenging tasks doesn’t necessarily mean complex nor complicated. A complicated task is one with many parts or lots of dependencies, whilst a complex task is one with an outcome the team cannot fully predict, or understand how to build during the planning session.</p>

<p>Be aware that complexity can lead to anarchy. Too many complex tasks on a product backlog often means the technical plan was not detailed enough in the first place.</p>

<p>This diagram below illustrates the process.</p>

<p><img src="http://f.cl.ly/items/0t3g2G3N161v0n2y3q3m/Image%202012.07.17%2015:55:58.png" unselectable="on" style=""></p>

<p>It’s the ‘Scrum Master’s’ job to mitigate and facilitate both parties interests into common ground.</p>

<p>How should one decide how much to commit to in the sprint?</p>

<p>Sprint velocity is a good indicator of how much the Team should/can commit to. The velocity is the result of the total amount of points the team is able to do in a Sprint. It often takes two sprints to establish the Team's velocity.</p>

<p>Ideally, it is best to avoid the idea that the number of points is equal to the degree of success. This could translate into a team death march. The result of a Sprint could be that the team wasn’t able to deliver all of the story points.</p>

<p>In a similar situation we have heard Product Owners saying:</p>

<p>"If the team committed to 30 points, they must get it done, even if it rains frogs."</p>

<p>In order to avoid this misunderstanding on Sprint success, we introduced a ‘Sprint Goal’.</p>

<p>A ‘Sprint Goal’ is easily understood by the Product Owner (client) and by the team.</p>

<p>A Sprint Goal can be, for example:</p>


<ul>

	<li>Writing and publishing articles;</li>

	<li>Users login.</li>
</ul>

<p>So committing to a Sprint Goal will avoid non-constructive meetings where the Scrum Master has to explain to the Product Owner where and why the team did not meet the agreed stories or story points.</p>

<p>A Sprint Goal is a much better and clearer measure of Sprint success. This has proved to us that our clients are much happier during the project development when they know what to expect.</p>
]]></description><link>http://clock.co.uk/agile/sprint-planning-success</link><guid isPermaLink="true">http://clock.co.uk/agile/sprint-planning-success</guid><dc:creator><![CDATA[Francisco Baptista]]></dc:creator><pubDate>Tue, 26 Jun 2012 16:01:19 GMT</pubDate></item><item><title><![CDATA[iOS & JavaScript event response time optimisation]]></title><description><![CDATA[<title>Title of the document</title>
<p>When developing HTML5 applications with JavaScript, iOS click and touch response times are infamously slow. With speed in mind, here's some advice from down in the trenches at <a target="_blank" href="http://www.clock.co.uk">Clock</a> on how to improve the responsiveness of your applications.</p>

<h2>Don't listen to <i>Click's</i></h2>

<p>After a user taps their device, the iOS browser will wait roughly 300ms to decide if the user performing a click or a more elaborate swiping gesture. To liberate your application from this delay you can instead listen to the immediately triggered <i>touchstart</i> event.
To detect when this is available and utilise it along side your traditional click event you can perform the following test as you bootstrap your 
application:</p>


<pre>var eventName;
if ('ontouchstart' in document) {
&nbsp;&nbsp;eventName = 'touchstart';
} else {
&nbsp;&nbsp;eventName = 'click';
}
$('.button').on(eventName, function(event) {
  alert('ding');
}
</pre>

<p>NB: you might also be interested to know you can also listen for the verbosely named <a target="_blank" href="http://developer.apple.com/library/ios/#DOCUMENTATION/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html"><i>touchmove</i></a>.</p>

<h2>Decapitate your DOM</h2>

<p>Still finding our button actions to be&nbsp;unacceptably&nbsp;delayed, we recognised a distinct link between these response times and the amount of HTML rendered onto the DOM. For us, this was key.
The application we were building consisted of one HTML document which, using CSS3 animations, took the user through a number of different pages/views. Given our situation, the technique which offered the most substantial benefit was to hide the HTML from the browser untill it was needed. We achieved this by housing markup in <code><script type="text/html"></script></code> tags and appending it to the DOM only when required.</p>


<pre>
&lt;script id=&quot;panel-template&quot; type=&quot;text/html&quot;&gt;
  &lt;p&gt;
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim,
    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo.
  &lt;/p&gt;

&lt;/script&gt;
</pre>

<p>As we were only substituting static text and markup we decided not to use any specific templating technology, Instead enlisting <a target="_blink" href="http://jquery.com/">jQuery</a> to retrieve and append our templates.</p>


<pre>
&lt;script type=&quot;text/javascript&quot;&gt;
  $(function() {
    $('body').on(&quot;click&quot;, function() {
      $(&quot;body&quot;).append($('#panel-template').html());
    });
  });
&lt;/script&gt;
</pre>

<p>A number of JavaScript frameworks will manage this process for you (we're rather fond of <a target="_blank" href="http://www.sencha.com/">Sencha</a>). However, these framework can themselves impose their own performance overheads, which can be in turn exacerbated by use of <a target="_blank" href="http://phonegap.com/">PhoneGap</a></p>

<h2>Flatten your DOM</h2>

<p>Even with the DOM heavily truncated our application still demanded better performance. To attain better results we had to sacrifice the verbosity of our markup. Our designers, to their dismay, were consequently required to flatten down images which were previously layered on different z-index's. This helped reduce the nesting &amp; complexity of elements and lower the application's memory footprint. Aside flatting markup, our designers were repeatedly compressing assets into ever smaller and smaller files.</p>

<p>(<a target="_blank" href="http://css-tricks.com/css-sprites/">Sprites</a> deserve a mention here)</p>

<p>By this point, developing our application bared striking resemblances to optimizing a game. While our application made high demands of the hardware available on our list of supported devices, we were able to get performance up to a satisfactory level.</p>]]></description><link>http://clock.co.uk/tech-blogs/ios-javascript-event-response-time-optimisation</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/ios-javascript-event-response-time-optimisation</guid><dc:creator><![CDATA[Luke Wilde]]></dc:creator><pubDate>Tue, 19 Jun 2012 21:36:09 GMT</pubDate></item><item><title><![CDATA[A Simple Website in Node.js with Express, Jade and Stylus]]></title><description><![CDATA[<p>
Do you feel like you've missed the boat on Node? Perhaps you're not a superstar web app developer, but a humble builder of websites. Maybe you're a fledging front-end developer: you've got your head around JavaScript and you want to build a site yourself, but you don't know PHP, Python or Ruby. Fear not. This post will use the popular
<a href="http://expressjs.com">
Express
</a>
 framework to show you how you can build simple websites in Node. If you're looking for real-time webapp action, then take your hipster boots and move along… this is a <i>websites in Node</i> 101.
</p>

<p>
In this post we will:
</p>


<ul>

	<li>
Download and install Node and npm
</li>

	<li>
Create a basic website
</li>
</ul>

<h2>
Getting started
</h2>

<p>
First of all, we need Node. Get pre-compiled binaries for Mac & Windows from
<a href="http://nodejs.org/#download">
http://nodejs.org/#download
</a>
. (If you run Linux, you'll need fly solo for a bit and compile it yourself). Node comes with a package manager called 'npm', which is used to install modules. From here on in, I am going to write from the point of view for a Mac user, simply because that is what I use. The process on Linux should be near identical. It will be a similar process on Windows as Node and npm have a consistent interface, but things will definitely vary. Hopefully you can still follow along.
</p>

<p>
Open up a terminal and type
<code>node -v</code> and <code>npm -v</code> to ensure it's installed ok.
</p>

<h2>
Creating project skeleton
</h2>

<p>
Create a folder anywhere you like, and call it anything you like, e.g.:
</p>


<pre>cd ~/Projects
mkdir MySite
cd MySite
</pre>

<p>
Make sure you're inside this folder. This will house all of our files. Create a file called <code>package.json</code> with the following contents:
</p>


<pre>{
  "name": "MySite",
  "version": "0.0.1",
  "private": "true",
  "dependencies": {
    "express": "3.0.0alpha4",
    "jade": "*",
    "stylus": "*",
    "nib": "*"
  }
}
</pre>

<p>
This file tells npm about your project. If you then do <code>npm install</code> in the project root, it will install the dependencies that are listed. The dependencies are listed by name and version. In proper projects, it is good to specify a version, however, the '*' means that any version will do and npm will retrieve the latest; this is ok for now. Npm installs modules locally in a folder called 'node_modules'. The <code>private</code> flag ensures that our site doesn't get accidentally published to the npm directory.
</p>

<p>
Here's a little info about our dependencies:
</p>

<h3>
Express
</h3>

<p>
<a href="http://github.com/visionmedia/express">
Express
</a>
 is a web framework, inspired by the Ruby project 'Sinatra'. It's one of many web frameworks in Node, but is the the most popular, and in my opinion the most easy to learn. Other frameworks that are worth checking out once you have got to grips with Node include: Flatiron, Geddy, and Taco.
</p>

<h3>
Jade
</h3>

<p>
<a href="http://github.com/visionmedia/jade">
Jade
</a>
 is a tempting engine. It is a language that compiles to HTML. It's a really great way of separating your logic from your markup. If you've dabbled in PHP, you'll know the problem I'm talking about. Jade is awesome. Some people are put off its whitespace-significant syntax, but I recommend giving it a go. It's very clean, and you'll never write a malformed HTML document again! (You'll never have to type angle brackets ever again).
</p>

<h3>
Stylus
</h3>

<p>
<a href="http://github.com/learnboost/stylus">
Stylus
</a>
 is a CSS-preprocessor. If you're familiar with LESS or SASS, Stylus does very much the same job (if not, Stylus is a language which compiles down to CSS for the browser; it adds new features that make CSS easier to work with). In my opinion, Stylus trumps the other pre-processors out there. It doesn't force a certain syntax upon you (you can use plain CSS syntax if you like, but I prefer the colon, semi-colon and curly brace free option). For more info on what Stylus can do, see the
<a href="http://learnboost.github.com/stylus">
website
</a>
 and a
<a href="http://bengourley.co.uk/using-stylus">
blog post of mine
</a>
 on some of the lesser-know, but very useful features.
</p>

<h3>
Nib
</h3>

<p>
<a href="http://github.com/visionmedia/nib">
Nib
</a>
 is a set of utilities for Stylus. Among other things, it enables going vendor-prefix free, which in my eyes makes it worthwhile alone.
</p>

<h2>
Getting up and running with Express
</h2>

<p>
Express comes with a utility for creating a site skeleton. However, since we're in the business of learning, we'll create everything from scratch.
</p>

<p>
Create a file called <code>app.js</code> in the project root, and open it up in your favourite text editor. First things first, we need to require our modules that we installed with npm:
</p>


<pre>/*
 * Module dependencies
 */
var express = require('express')
  , stylus = require('stylus')
  , nib = require('nib')
</pre>

<p>
Next, we want to fire up Express, tell it to use Jade and Stylus, and some other basic functionality:
</p>


<pre>var app = express()
function compile(str, path) {
  return stylus(str)
    .set('filename', path)
    .use(nib())
}
app.set('views', __dirname + '/views')
app.set('view engine', 'jade')
app.use(express.logger('dev'))
app.use(stylus.middleware(
  { src: __dirname + '/public'
  , compile: compile
  }
))
app.use(express.static(__dirname + '/public'))
</pre>

<p>
The <code>app.set()</code> directives tell Express that we want to use Jade, and where we will keep our views. On that note, let's create a folder called 'views' in the project root where we will put our Jade files.
</p>

<p>
The <code>app.use()</code> calls pass 'middleware' functions for Express to use. Middleware are simply functions that have the signature fn(req, res, next). They take the request object, the response object and <code>next</code>, which will call the next piece of middleware. Express executes them in the order in which they are passed, and any of them may send a repines, preventing the execution of any remaining in the series (by not calling <code>next()</code>).
</p>

<p>
The first piece of middleware we apply is the Express logger in 'dev' mode. This will simply log incoming requests to the console. Next, the Stylus middleware is applied, which will compile our
<code>.styl</code> files to CSS. In order to use nib, we pass in a custom compile function to the Stylus middleware. After that it's the Express static middleware, which is used for serving static files (we tell it that our static files will live in a folder called 'public', so lets create that in the project root now). You might be wondering why we need this. Unlike Apache, the Express server doesn't mimic the filesystem to the visitor. This allows great flexibility for the url structure of your site, but it's quite a useful feature for serving static assets, so the static middleware does exactly this on the directory that we pass. A file 'pic.jpg' in a folder 'images' within 'public' will be available to the client at '/images/pic.jpg'.
</p>

<p>
By now, you might be eager to run something. Finish off app.js with the following code:
</p>


<pre>app.get('/', function (req, res) {
  res.end('Hi there!')
})
app.listen(3000)
</pre>

<p>
This creates a 'route', simply a function which takes the request and response object, and sends the plain-text response 'Hi there!'. We then tell the Express application to listen on port 3000.
</p>

<p>
If you run <code>node app.js</code> in the terminal, then navigate to <a href="http://localhost:3000/">http://localhost:3000/</a> in your browser, you should see the plain-text response.
</p>

<h2>
Creating some content
</h2>

<p>
Now for some actual web content. First up, lets create a template with our site's markup skeleton. Create a file called 'layout.jade' inside the views directory. Open it up and fill it with the following contents:
</p>


<pre>!!!5
html
  head
    title #{title} - My Site
    link(rel='stylesheet', href='/stylesheets/style.css')
  body
    header
      h1 My Site
    .container
      .main-content
        block content
      .sidebar
        block sidebar
    footer
      p Running on node with Express, Jade and Stylus
</pre>

<p>
Even if you're not familiar with Jade, hopefully you'll be able to get an idea of what's going on here. Firstly, the
<code>
!!!5</code> part tells Jade to output the HTML5 doctype
. Then, each word beginning a line represents a tag. Indentations after that line denote the tag's content, so rather than having to close a tag, you just stop indenting lines. Within the
<code>
head</code> tag we output the contents of a title variable with
<code>
#{title}</code> -- you'll see later on where this gets defined. We are also linking to the place we expect our compiled Stylus to be. The only thing left to explain here is
<code>
block</code>. Since we won't be filling in this file with our page contents, we can denote
<code>
blocks</code>. Templates which inherit from this one can define their own content to be output within these blocks.
</p>

<p>
If you're feeling a bit confused or just want to know more about Jade, then head over to the
<a href="http://github.com/visionmedia/jade">
docs
</a>
.
</p>

<p>
Next we want to fill in these blocks with some content. Create a file named 'index.jade' inside 'views'. Populate it with this:
</p>


<pre>extend layout
block content
  p
    | Vivamus hendrerit arcu sed erat molestie
    | vehicula. Sed auctor neque eu tellus
    | rhoncus ut eleifend nibh porttitor. Ut in.
  p
    | Donec congue lacinia dui, a porttitor
    | lectus condimentum laoreet. Nunc eu
    | ullamcorper orci. Quisque eget odio ac
    | lectus vestibulum faucibus eget in metus.
    | In pellentesque faucibus vestibulum. Nulla
    | at nulla justo, eget luctus tortor.
block sidebar
  .widget
    h1 Widget
    p
      | Sed auctor neque eu tellus rhoncus ut
      | eleifend nibh porttitor. Ut in nulla enim.
    p
      | Vivamus hendrerit arcu sed erat molestie
      | vehicula.
</pre>

<p>
You can see that the first thing we are doing is extending<code>layout</code>. This will output all of the content of <code>layout.jade</code>, and allow us to define content to be output in place of the blocks that we defined.
</p>

<p>
Lastly we want to hook up our stylesheet. Create a folder called 'stylesheets' within 'public', and create a file called 'style.styl'. The Stylus middleware will compile it into a CSS file of the same name, in the same directory.
</p>

<p>
Feel free to freestyle on this bit, and style up the content yourself. Otherwise grab the contents of
<a href="https://github.com/clocklimited/BasicExpressSite/blob/master/public/stylesheets/style.styl">
my stylesheet
</a>
, which has some comments about the Stylus features it's using.
</p>

<p>
So now we have our view and stylesheet in place, let's revisit 'app.js' and tell it what to render.
</p>

<p>
Replace the <code>app.get('/', …)</code> part with this:
</p>


<pre>app.get('/', function (req, res) {
  res.render('index',
  { title : 'Home' }
  )
})
</pre>

<p>
There's that <code>title</code> variable we talked about earlier on. The function<code>res.render()</code> is provided by Express and takes the name of the view to render, followed by an object whose properties the view will have access to (the properties of this object are sometimes known as 'locals').
</p>

<p>
Now run the app again, using <code>node app.js</code>. If it's still running from before, quit it with ctrl-c. It's worth mentioning here that any change to JS files that Node will run will require a restart of the app. When in development, we use
<a href="http://github.com/remy/nodemon">
nodemon
</a>
 which will watch for changes and restart the app for us.
</p>

<p>
If you used my stylesheet, navigating to
<a href="http://localhost:3000/">
http://localhost:3000/
</a>
 should result in something like this:
</p>

<p>
<img style="max-width: 100%; " src="http://f.cl.ly/items/1y3n2J2T0L2u0o2Q1N0X/Image%202012.06.03%2000:34:22.png" alt="What the site should look like…" title="" unselectable="on">
</p>

<p>
So there we have it. A simple website in Node. Hopefully you've been able to follow along, and were able to get the site running. If not, this project is
<a href="https://github.com/clocklimited/BasicExpressSite">
over on GitHub
</a>
. You can check that out, run it and have a poke around. In a future blog post, we'll look at the various options for deploying and hosting Node sites. If you have any questions, then give me a shout in the comments.
</p>
]]></description><link>http://clock.co.uk/tech-blogs/a-simple-website-in-nodejs-with-express-jade-and-stylus</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/a-simple-website-in-nodejs-with-express-jade-and-stylus</guid><dc:creator><![CDATA[Ben Gourley]]></dc:creator><pubDate>Mon, 11 Jun 2012 00:00:00 GMT</pubDate></item><item><title><![CDATA[10 Years of University Interns]]></title><description><![CDATA[<p>For the last 10 years Clock has been
hiring university students as Interns to allow them to fulfill their degree.
During this time we have employed over 20 students. The intern scheme at Clock
is a pipeline for hiring staff and it helps the business grow.</p>

<p>A lot of university degrees require
students to undertake a 40 week internship in an industry relevant to their
degree. This allows students to put their skills into&nbsp;practice and help
them find work when they graduate (as they have some experience of the real
world).</p>

<p>The benefits of intern schemes to both
students and companies are unbelievable.&nbsp;</p>

<p>Students benefit from the experience
gained from CV writing and being interviewed, but mainly from working in the
real world- plus the added bonus of earning some money!&nbsp;</p>

<p>Companies benefit from a relatively
cheap resource, and when nurtured students have the potential to become a key
member of any team. Most interns have little to no experience of working in the
real world, so the employer has the opportunity to mould the student in to an
ideal employee. With new students every year bringing their own views
and&nbsp;opinions&nbsp;it keeps the company fresh and exciting.</p>

<p>At Clock we love our interns. Each year
they surpass all our expectations, always
showing&nbsp;excitement&nbsp;and&nbsp;enthusiasm&nbsp;regardless&nbsp;of the
task put in front of them. We feel that an intern should have a say in the
direction of their time with us, so if they want to pursue a particular area or
technology, then we support them. An internship is not just about the company
but about the individual.</p>

<p>After 40 weeks or more of working for us,
our interns are invaluable and they are missed when they return to university.
They understand how we work, and the way we work, so some want to carry on
working for us. We are often keen to hire them when they graduate.</p>

<p>If you are a small company with limited
resources then having an internship scheme to aid growth and provide extra
resource is very beneficial.</p>

<p>Clock have hired 8 interns after
graduating, (including me) all of which have key roles within the company. A
couple have left for pastures new, but the rest still remain.</p>

<p>We have a relationship with lots of Universities but here are some of
the ones with websites on internships:
</p>


<ul>

	<li><a href="http://studentportal.bournemouth.ac.uk/career/ges/index.html">Bournemouth University</a>&nbsp;<br>

</li>

	<li><a href="http://www.brighton.ac.uk/bbs/placements/employers.php?PageId=5">Brighton University</a>&nbsp;<br>

</li>

	<li><a href="http://www.herts.ac.uk/more/graduate-futures/support-for-employers/home.cfm">Hertfordshire University</a>&nbsp;<br>

</li></ul>
]]></description><link>http://clock.co.uk/misc/10-years-of-university-interns</link><guid isPermaLink="true">http://clock.co.uk/misc/10-years-of-university-interns</guid><dc:creator><![CDATA[Tom Smith]]></dc:creator><pubDate>Wed, 06 Jun 2012 08:23:56 GMT</pubDate></item><item><title><![CDATA[Clock Embracing Next-Generation Internet]]></title><description><![CDATA[<p>We are official participants of <a href="http://www.worldipv6launch.org/">World IPv6 Launch</a>, a coordinated adoption of the next-generation Internet protocol. On 6th June 2012, along with many leading hosting providers, network operators and router vendors, we will be permanently enabling native IPv6 support on our corporate web site. Additionally, for our clients, we will be offering and pushing our ability to host over IPv6 wherever possible.<br>
<br>
 This essential upgrade offers <a href="http://en.wikipedia.org/wiki/IPv6#Comparison_to_IPv4">several advantages</a> over the old (IPv4) Internet. The most critical however, relates to the fact that the world has now <a href="http://www.nro.net/news/ipv4-free-pool-depleted">officially exhausted</a> the capacity of the current Internet protocol. All of the 4 billion addresses have been assigned, and the switch to IPv6 is the only way to ensure that the Internet can continue to grow.<br>
<br>
 In this video by Google, Vint Cerf (one of the founding inventors of the Internet) explains why the upgrade is so important:<br>
<br>
<span id="pastemarkerend"><iframe src="http://www.youtube.com/embed/-Uwjt32NvVA" allowfullscreen="" frameborder="0" width="100%" height="378"></iframe><span id="pastemarkerend">&nbsp;</span></span><br>
</p>]]></description><link>http://clock.co.uk/tech-blogs/clock-embracing-next-generation-internet</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/clock-embracing-next-generation-internet</guid><dc:creator><![CDATA[Michael Cronnelly]]></dc:creator><pubDate>Wed, 06 Jun 2012 08:09:36 GMT</pubDate></item><item><title><![CDATA[Doctrine ORM Associations]]></title><description><![CDATA[<h2>Doctrine ORM Associations</h2>

<p>Doctrine is a set of  PHP libraries focused on providing persistence services. Doctrine uses an object relation mapper and database abstraction layer to provide the functionality it offers. See the <a href="http://docs.doctrine-project.org/en/latest/index.html">Doctrine homepage</a> for more general information.</p>

<p>One of the key aspects of Doctrine's ORM is its ability to manage associations between entities. I.e one-to-many, one-to-one, many-to-one, many-to-many. See the <a href="http://docs.doctrine-project.org/en/latest/reference/annotations-reference.html#manytoone">associations reference library</a>.</p>

<p>This post will assume a reasonable understanding of relational databases and PHP. As well as a basic understanding of Doctrine.</p>

<p>To help understand how each of the associations are defined a <a href="https://gist.github.com/2817892#file_student_doctrine_orm_example.php">common example of students</a> will be used throughout.</p>

<h3>One To one</h3>


<pre>/**
 * @OneToOne(targetEntity="Address")
 */
protected $address;
</pre>

<p>Simply specify the TargetEntity on the owning side (in this example this is the Student Entity) and the association is setup. A student has one address. Optionally you can describe the join columns. See <a href="http://docs.doctrine-project.org/en/latest/reference/annotations-reference.html#onetoone">@OneToOne</a></p>

<h3>One To Many</h3>


<pre>/**
 * @OneToMany(targetEntity="Year", mappedBy="students", cascade={"all"})
 */
protected $year;
</pre>

<p>This is defined in the entity that contains a single item. So in the example a student belongs to only one year. Optionally you can describe the join columns. See <a href="http://docs.doctrine-project.org/en/latest/reference/annotations-reference.html#onetomany">@OneToMany</a></p>

<h3>Many To One</h3>


<pre>/**
 * @ManyToOne(targetEntity="Student", cascade={"all"})
 */
protected $students;
</pre>

<p>This is defined in the entity that contains multiple items. So in the example a year has many students. See <a href="http://docs.doctrine-project.org/en/latest/reference/annotations-reference.html#manytoone">@ManyToOne</a></p>

<h3>Many To Many</h3>

<p> With Many to Many relationships there is an owning side and an inverse side. It doesn't matter which entity is the owning side and which is the inversed side. The owning side defines the join table and columns and the inversed side references the owning side.</p>

<p> A student has many classes and a class has many students. If you are storing more information in the join table besides the relationship then a combination of Many to One and One to Many should be used instead using a link entity.
</p>
<h4>Owning Side</h4>


<pre>/**
 * @ManyToMany(targetEntity="Class", inversedBy="students")
 * @JoinTable(name="student_to_class",
 *      joinColumns={@JoinColumn(name="student_id", referencedColumnName="id")},
 *      inverseJoinColumns={@JoinColumn(name="class_id", referencedColumnName="id")}
 *      )
 */
protected $classes;
</pre>

<h4>Inversed Side</h4>


<pre>/**
 * @ManyToMany(targetEntity="Student", mappedBy="classes")
 */
protected $students;
</pre>
]]></description><link>http://clock.co.uk/tech-blogs/doctrine-orm-associations</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/doctrine-orm-associations</guid><dc:creator><![CDATA[Tom Smith]]></dc:creator><pubDate>Mon, 28 May 2012 08:07:18 GMT</pubDate></item><item><title><![CDATA[Scaling Node.js and MongoDB on Joyent Cloud]]></title><description><![CDATA[<p>Here at Clock, we recently deployed a large Node.js and MongoDB application for a client to <a href="http://www.joyentcloud.com/">Joyent's cloud platform</a>, designed for horizontal scalability. This document gives a brief overview of the configuration, and observations in the setup.</p>
<p>We are not explaining how to design a scalable application; it's assumed that any Node instance can correctly handle any request at any time, and therefore sessions (or any other shared data) are available to all of them. We store the session data in the MongoDB replica set to achieve this.</p>
<p>All deployments are on SmartMachine appliances at the same data centre. These are instances of <a href="http://smartos.org/">SmartOS</a>, which is a fork of OpenSolaris. As a Linux house, there was some frustration getting used to the Solaris commands, but resources such as the <a href="http://bhami.com/rosetta.html">Rosetta Stone for Unix</a> proved useful.</p>
<h2>Security/Firewalling</h2>
<p>Within Joyent's cloud, there is a  possibility that other clients will have access to the private  interfaces of your instances. Therefore it's critical that they are  correctly firewalled, and this should of course be done first. Joyent provide <a href="http://wiki.joyent.com/display/jpc2/Securing+your+SmartMachine"> documentation for configuring the firewall</a><a href="http://wiki.joyent.com/display/jpc2/Securing+your+SmartMachine"></a>. On each server, after initial setup of the ipfilter service, we configured /etc/ipf/ipf.conf as follows:</p>
<p>1 line per server in the cluster like this:</p>
<pre>pass in quick from &lt;remote private IP&gt; to &lt;this machine's private IP&gt;</pre>

A final line to block all other IPs:
<pre>block in from any to &lt;this machine's private IP&gt;</pre>

Then a final command to enable the new rules:
<pre>svcadm restart ipfilter</pre>

This is clearly a poor (long-winded, error-prone, etc.) way to configure firewall rules, and we are actively looking into ways to manage them better.
<h2>Node.js deployment</h2>

The application is deployed and hosted on instances of the "Node.js SmartMachine", version 1.3.3. This comes with git-deploy and Node.js v0.6.8. Once <a href="http://wiki.joyent.com/display/jpc2/Joyent+Node.js+SmartMachine">setup</a>, deployment boils down to a simple "git push". Their git hooks will then clone the repo into a timestamped directory under /home/node/node-service/releases/, compile any npm modules (if they haven't been compiled before) and start the application. If anything fails, it will roll-back to the previous deployment.

We've found the process to be effective and straightforward.
<h2>MongoDB configuration</h2>

We set up multiple instances of the "MongoDB SmartMachine Database Appliance", version 1.0.6. These are SmartOS instances which come preconfigured with MongoDB 2.0.1.

MongoDB is, of course, delightfully simple to configure in a replica set. There is <a href="http://www.mongodb.org/display/DOCS/Replica+Sets">good documentation</a>, but this is an overview of the observations and changes we made to the Joyent appliances:
<ul>
<li>The whole of MongoDB (including config) is installed in /mongodb.</li>
<li>The database is configured to start automatically and run as the “mongodb” user.</li>
<li>/mongodb/mongodb.conf was edited to add or amend these lines:</li>
</ul>
<pre>bind_ip = 127.0.0.1,&lt;this machine's private IP&gt;
replSet = &lt;your set name&gt;
rest = true</pre>
<ul>
<li>Restart the service with "sudo svcadm restart mongodb".</li>
</ul>

And that's it!
<h3>MongoDB arbiter</h3>

A minimal MongoDB replica set ideally needs 3 servers (for promotion to primary in the case of failure). If you start with only 2 Mongo appliances, the 3rd can be configured as an <a href="http://www.mongodb.org/display/DOCS/Adding+an+Arbiter">arbiter</a> on one of the web nodes. Joyent provide simple <a href="http://wiki.joyent.com/display/node/Installing+MongoDB+on+a+Node.js+SmartMachine">instructions</a> to install MongoDB on a Node.js SmartMachine. However, presently, the install script leaves you with MongoDB running as root (!). To avoid that, add a new user, and edit the SMF manifest which is embedded in mongodbnode.sh before running it.

To enable the arbiter to be part of the replica set, we replaced the following line in the SMF manifest within the mongodbnode.sh:
<pre>&lt;exec_method  name='start' type='method' exec='/root/local/bin/mongod
  --bind_ip=127.0.0.1,&lt;this machine's private IP&gt; --replSet=&lt;your set name&gt; --journal
  --dbpath  /root/local/var/mongodb &' timeout_seconds='60'/&gt;</pre>
<p>It's worth noting that the script strangely installs Mongo in /root/local. To run the shell you need to specify the full path: /root/local/bin/mongo.</p>
<h3>Final configuration</h3>
<p>Now the cluster is at a stage where the replica set can be initialised by following 10gen's <a href="http://www.mongodb.org/display/DOCS/Replica+Sets+-+Basics">documentation</a>.</p>
<h2>Load-balancing the Node.js instances</h2>
<p>Joyent offer a range of <a href="http://www.joyentcloud.com/products/appliances/zeus-smartmachine/">Zeus SmartMachine</a> appliances for load-balancing, which are <a href="http://wiki.joyent.com/display/jpc2/Joyent+Zeus+SmartMachine">well documented</a> on their site.</p>
<h2>Node.js code changes</h2>
<p>We use Christian Kvalheim's <a href="https://github.com/christkv/node-mongodb-native">MongoDB Native Node.js Driver</a>, which already has replica set support. From the <a href="https://github.com/christkv/node-mongodb-native/blob/master/docs/replicaset.md">documentation</a> you can see that it's very simple to use, so switching from a single Mongo instance is trivial. Be sure to enable the "read_secondary" option to take advantage of reading from all servers. (This option is referred to as <a href="http://www.mongodb.org/display/DOCS/Querying#Querying-slaveOk%28QueryingSecondaries%29">slaveOk</a> by Mongo itself.)</p>
<p>For coders, it's useful to develop against a test replica set. To aid this, we wrote <a href="http://github.com/cronnelly/mongo-replset-test">mongo-replset-test</a>, a simple bash script to create throw-away replica sets on the local machine.</p>
<h2>Conclusion</h2>
<p>As you can see, on the whole we've found the configuration of this site on Joyent's SmartMachines fairly easy and straightforward. In terms of fail-over, failure of either MongoDB or Node.js instances  should not impact the running of the cluster. However it's worth  understanding the location of the servers. When you create a SmartMachine, Joyent's algorithm will try to locate the new instance in a cabinet not shared by your other servers. If it can't, then it will try to ensure that it's on a different server. If that still can't be achieved, you could find two of your instances running on the same physical server. That last case is unlikely but clearly undesirable, in terms of fail-over. The only way to verify the location of your instances is to raise a support ticket, and a Joyent technician will confirm for you.</p>
<p>In regard to expanding the site's capacity, we can now horizontally scale the web nodes by adding more instances. It's a very quick process, but the firewalling setup is an ongoing issue which we need to address.</p>
<p>The MongoDB replica set can also be scaled easily in terms of database <em>reads</em>. All writes must go through a single server (which is dynamically elected by the cluster, and automatically recognised by the Node.js driver). If this is a limitation, a <a href="http://www.mongodb.org/display/DOCS/Sharding">sharding</a> configuration is required to scale further.</p>]]></description><link>http://clock.co.uk/tech-blogs/scaling-nodejs-and-mongodb-on-joyent-cloud</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/scaling-nodejs-and-mongodb-on-joyent-cloud</guid><dc:creator><![CDATA[Michael Cronnelly]]></dc:creator><pubDate>Wed, 29 Feb 2012 20:12:00 GMT</pubDate></item><item><title><![CDATA[PHP Conference 2012]]></title><description><![CDATA[<p><img class="alignright" style="margin-left: 15px; margin-right: 15px;" title="PHP 2012" src="http://www.phpconference.co.uk/uploads/PHPUKConference2012.png" alt="" width="350" height="86" /></p>
<p>Today is Clock's 5th annual trip to the PHP Conference and generally speaking, it gets better each year.</p>
<p>The keynote this year is by Rasmus Lerdorf entitled "A look at PHP in 2012", and as the PHP conf site tells us, Rasmus is:</p>
<blockquote><p>Best known for having gotten the PHP project off the ground in 1995. He then went on to be infrastructure architect at Yahoo! for more than 7 years and most recently has been advising start-ups including WePay, Etsy, and Room77. Rasmus will give insight on PHP as he sees it in 2012 - from PHP's humble beginnings as the Personal Homepage project up to what is new in PHP 5.4 and beyond.
<a href="http://www.phpconference.co.uk/">http://www.phpconference.co.uk/</a></p></blockquote>
<p>We'll be live blogging and tweeting throughout the day. You can see our thoughts on the talks we attend, by either refreshing this blog or following:</p>
<ul>
<li><a href="https://twitter.com/#!/clockdevops">Clock Dev Ops</a> - Which is an aggregation of links and tips by <a rel="nofollow" href="https://twitter.com/#!/clock">@<strong>clock</strong></a>'s tech team (RSS here: <a href="http://bit.ly/rIQgd4">http://bit.ly/rIQgd4</a>)</li>
</ul>
<p>Or individually follow some of our tech members:<a href="http://blog.clock.co.uk/wp-content/uploads/2012/02/IMG_1981.jpg"><img class="alignright size-medium wp-image-1487" title="IMG_1981" src="http://blog.clock.co.uk/wp-content/uploads/2012/02/IMG_1981-300x300.jpg" alt="" width="300" height="300" /></a></p>
<ul>
<li><a href="https://twitter.com/#!/PabloSerbo">PabloSerbo</a> (Clock's CTO)</li>
<li><a href="https://twitter.com/#!/clockarniie">ClockArnIIe</a></li>
<li><a href="https://twitter.com/#!/tomboa">tomboa</a></li>
<li><a href="https://twitter.com/#!/lukewilde">lukewilde</a></li>
<li><a href="https://twitter.com/#!/domharrington">domharrington</a></li>
<li><a href="https://twitter.com/#!/rnoake">rnoake</a></li>
</ul>
<h2>Live Feed</h2>
<p>*A few notable tweets and a dump of data from the talks (to be formatted and summarised later!):</p>
<p><strong>16:50 - Now the final talk, but this one is a panel session about 'PHP at scale' with Ian, Nikolay, Rasmus and Hugh Williams</strong></p>
<p>This is going to be fast, so I'll summarise later!</p>
<p>Update: The panel had some great discussions and answered as much as they could. Topics included:</p>
<ul>
<li>Scaling a team</li>
<li>Scale becomes an architecture question not a language one</li>
<li>Don't just throw encrypted data at new cookies, avoiding session issues won't last long using a cookie method</li>
<li>Most startups don't need to worry, there aren't that many Facebooks in the world, you can tackle it later.</li>
</ul>
<p><strong>16:00 - Teaching your machine to find fraudsters by Ian Barber</strong></p>
<p>Ian starts with "Fraud is a big problem"</p>
<p>Some small numbers:</p>
<p>.1% a large retailer can expect to be fraudulent, 8% is the level of "Suspected" fraud.</p>
<p>If we had a 99% successful fraud system, we'd likely be 90% wrong on the suspected frauds.</p>
<p>Can already see that Ian is a great speaker, good pace and great content.</p>
<p>Tweet by <a href="https://twitter.com/#!/carshann">@carshann</a> - "Fraud Prevention/Detection talk the most solid and informative I've seen all day. Recommended! <a title="#phpuk2012" href="https://twitter.com/#!/search/%23phpuk2012"><strong>#</strong><strong><strong>phpuk2012</strong></strong></a> <a title="https://joind.in/4949" rel="nofollow" href="https://t.co/3a9Dzfhu" target="_blank">https://joind.in/4949</a>"</p>
<p>Detection techniques</p>
<ul>
<li>Anomaly Detection (using standard deviation and historical data window to detect anomalies - need to factor in other factors "Sickness Availability")</li>
<li>Building scores on details (email address vs name, geo-ip of billing vs shipping, re-sale value of item, card to addresses, previous purchase data)</li>
<li>SVM (Support Vector Machines)</li>
</ul>
<p>Really enjoyed listening to Ian, he made great sense and gave good insight, not sure how to use the info immediately, but when dealing with eCommerce the lessons shown will be really valuable, and I am confident the abstract ideas can be used in other areas.</p>
<p>The last three talks have been well structured and kept good pace.</p>
<p><strong>14:50 - Distribute the Workload by Helgi Þorbjörnsson</strong></p>
<p>Helgi promises to lead us through the world of distributed systems and scalability and how to counter a sudden rush of popularity.</p>
<p>Refreshing start by Hegli! Starts with humor... then straight into the meat: Why Distribute?</p>
<p>Answer.. Efficiency, Budget and Perception.</p>
<p>10 small servers &gt; 1 big server
Google and Amazon have throw away boxes. Commodity hardware.</p>
<p>Flickr is a good example of Perception, the service gives instant feedback and "Defers intensive processes" - Users can basically keep browsing whilst lots and lots of small servers handle the requests. Ants work exactly like this, natures perfect example of distributed systems working together to achieve a common goal.</p>
<p>Helgi moves onto</p>
<ul>
<li>Decoupling (Twitter has API issues, ok lets add a new API box as the rest of the application is running fine - decoupling logic and sections helps when scaling)</li>
<li>Elasticity, Load balancing (using low TTL on DNS to remove some single point of failure issues).</li>
</ul>
<p>We get into a Q&amp;A about if the Load Balancer becomes the machine that you have to beef up? Simple answer yes, but load balancers are just passing data rather than processing so it isn't so much of an issue. Also someone points out that TTL's aren't always observed by ISP's so a better mechanism is Virtual IPs.</p>
<p>Monitoring becomes very important, as how do you know when and what to scale. Also Keeping records means you can look at trends and counter them.</p>
<p>Being able to monitor real-time and then using elasticity, adding and removing servers, becomes and really nice model to allow the system to become self-aware.</p>
<p>Helgi starts to discuss Skynet and I wonder if the "Singularity" discussion might ensue, it doesn't which is likely a good thing. Ray Kuzweil fans/critics might be sat in the conf!</p>
<p><strong>Great talk by Helgi and nicely light hearted. Good speaker and handled the questions well.</strong></p>
<p><strong>13:55 - Waiting with anticipation for "To a thousand servers and beyond" by Nikolay Bachiyski </strong></p>
<p>Nikolay is a long-time Wordpress contributor and will be discussing scaling a massive PHP application. Apparently he has a bear, or so it says in his bio!</p>
<p>Nikolay has seen Wordpress scale from 65million to 800million requests per month.</p>
<p>Nikolay starts with a funny story about a pig that deheads beers, and works out that understanding how foam is generated helps him with his job</p>
<p><strong>The moral is... Get to know the abstraction below</strong></p>
<p>One of the abstractions we face is the servers, if a site has a single server and it dies, we have a problem - we add multiple web-servers and so we add a load balancer, and the problem eventually moves somewhere else (db servers).</p>
<p>What happens when the data is too big for the Database?
We partition the data. (which likely means no sql joins!)</p>
<p>HyperDB allows us to solve the issue that we don't know where to send the sql query, by using parameters to state the partition type (e.g please use the 'User' table please). HyperDB also handles failover, replication lag etc.</p>
<p>Next issues are load, servers bringing down database servers etc, so WordPress add caching (e.g memcache).</p>
<p>Ok, so Nikolay starts talking about bigger issues, imagine the servers are in a single data-centre... if the DC fails we have another "Single point of Failure"
We can add more DC's and it will help, but caching becomes a problem (how do we stop the stale of cache across DC's)?</p>
<p>Nikolay also cites deployment as an interesting element when dealing with multiple DC's. WP commit changes approx 100 times a day, by commiting they deploy to a 1000 servers and so the commit button becomes the "button of doom!" and they have made it super fast (8 seconds).</p>
<p>Users don't care about commits, they just want "Publish Immediately" to mean exactly that; immediately!</p>
<p>But that means sorting spam, indexing, quickly, and it was slow, so WP employed AJAX to handle post-processing. And it turns out async jobs become very, very useful.</p>
<p><img class="size-medium wp-image-1510 alignnone" style="border-style: initial; border-color: initial;" title="IMG_1984" src="http://blog.clock.co.uk/wp-content/uploads/2012/02/IMG_1984-300x224.jpg" alt="" width="300" height="224" /></p>
<div>Moving cronjobs to web scripts mean you also remove another single point of failure, as often cronjobs become messy and sit on single server instances.</div>
<div><strong>Great talk by Nikolay, he summarises by saying that if you want to get better at something, try to understand the abstraction below.. you'll likely learn something.</strong></div>
<div>
<p>&nbsp;</p>
<p><strong>13:00 - Lunch!</strong></p>
<p><strong><a href="http://blog.clock.co.uk/wp-content/uploads/2012/02/IMG_1983-e1330090808690.jpg"><img class="alignnone size-medium wp-image-1491" title="IMG_1983" src="http://blog.clock.co.uk/wp-content/uploads/2012/02/IMG_1983-e1330090808690-300x224.jpg" alt="" width="300" height="224" /></a>
</strong></p>
<p><strong>12:00 - 'PHP 5.4: the new bits by Davey Shafik'</strong></p>
<p>The synopsis reads: 5.4 is about to be unleashed into the world, bringing some of the most exciting changes to the PHP language to date. Let's hope for an inspiring and insightful talk! Expecting to cover:</p>
<ul>
<li>Traits (as Rasmus puts it: Compiler-assisted Copy and Paste)</li>
<li>Array Dereferencing</li>
<li>Closures</li>
</ul>
<p>Aha, Davey Shafik I read the study guide book! Suddenly dawns on me I have read and used this guys stuff!</p>
<p>Great start by Davey, and we begin with a slide entitled "The Small Stuff".</p>
<ul>
<li>Sessions have been improved - SessionHandlerInterface now lets us interface session and have greater control</li>
<li>Notice on Array to String to conversions (Rasmus talked about this and we'll detail later) &amp; new array syntax saves 5 characters.</li>
<li>Dynamic Method Calls</li>
<li>Improvements to Closures and Callbacks</li>
<li>New 'callable' type hint</li>
<li>Rebinding $this (or How to break the object model!)</li>
</ul>
<p>We're moving fast paced, but other than the obvious fixes or improvements (or items that I can't quite comprehend the power of yet) we haven't yet got to the compelling stuff... awaiting slide entitled "The Big Stuff" :)</p>
<p>Tweet by <a href="https://twitter.com/#!/zegenie">@Zegenie</a> [12:27] - Traits is the single most awesome feature of php 5.4</p>
<p>Now we move onto 'Built-in CLI Server', this sounds exciting.</p>
<pre>php -S</pre>

is the command we will use.

Davey shows us a simple phpinfo() example running on localhost:8080. Rasmus explained earlier (when questioned) this is not a step to replace Apache, it's simply a test server for us to develop on.

Useful quick check:
<pre>//Check if we're using cli-server
if (PHP_SAPI == 'cli-server') {</pre>
<p>Great to have and can really see this being useful, again stressing that it is not to be used as production server (one wonders how many bedroom devs will start using this as their web server - oh dear!).</p>
<p>Davey thinks this will be the smoothest PHP upgrade thus far, citing only one "seg fault" gotcha that he thinks was his code fault anyway.</p>
<p>20% speed improvement cited on the synthetic benchmarks, but even a 1% increase would be useful Davey thinks.</p>
<p>Laughter erupts when questioned on Drupal test issues, and Davey replies: "Drupal is broken, and they need to fix their stuff"</p>
<p><strong>11:00 - Up next 'Big Data by James Littlejohn'</strong></p>
<p>The web continues it social drive forward, more sharing = more content, more content = more sharing. BIG Data!</p>
<p>Solutions... Economic free cloud and applied "data" science.</p>
<p>Data Science combines three areas; engineering ,mathematics and communication.</p>
<p>So to utilise the data, we must first cleanse (removing CMS tags, markup etc), this is called "Data Conditioning". Next we want to apply some intelligence: "Data Science".</p>
<p>Lots of sites find themselves with incredible amounts of data (think of ebay, amazon et cetera). James talks about interesting companies looking at providing intelligence on this data as SaaS.</p>
<p>Tweet by <a href="https://twitter.com/#!/domharrington">@<strong>domharrington</strong></a> [11:09] - The Big Data talk looks like a PowerPoint presentation from 1995. <a title="#phpuk2012" href="https://twitter.com/#!/search/%23phpuk2012"><strong>#</strong><strong><strong>phpuk2012</strong></strong></a> <a rel="nofollow" href="https://twitter.com/#!/PHPUKConference">@<strong>PHPUKConference</strong></a></p>
<p><strong>There will be no shortage of data, it is what you want to do with it - curiosity will be the key. </strong></p>
<p>James now moves his talk to think about starting points, what is your perspective? what is your granularity starting point?</p>
<p>James is attempting to use API services to provide intelligence on his blog to categorise and provide statistics and provide hint style linking to find similar blogs to his - matching content in new ways.</p>
<p>Using 'me' data such as 23andme to add new level of data. Using the "crowd source" the answers - but inherent is finding clarity from sourced answers.</p>
<p>The talk is ok, but unstructured - and leaves the audience feeling a but dissappointed and confused. The subject matter seems to big!
We move onto a demo about using a keword lookup and using wiki style API's to find similar words, the results are unyieldly.. not sure where James is heading now, hopefully towards some sort of conclusion, and how we can harness this data and how to strip the useless "similar words".</p>
<p>He begins towards this route talking about scoring the data and frequency counts - but as yet provides no real answer to the problem of Big Data and how to harness for effective results. Not much talk of PHP either! in fact NodeJS is mentioned rather than any PHP usage.</p>
<p>Tweet by <a href="https://twitter.com/#!/gbtekkie">@gbtekkie</a> [11:29] - "there are so many interesting things on data mining, but this presentation has not covered anything theoretical yet"</p>
<h3>Keynote<a href="http://blog.clock.co.uk/wp-content/uploads/2012/02/IMG_1982.jpg"><img class="alignright size-medium wp-image-1486" title="IMG_1982" src="http://blog.clock.co.uk/wp-content/uploads/2012/02/IMG_1982-300x300.jpg" alt="" width="300" height="300" /></a></h3>
<p>So just finished listening to keynote by Rasmus, some very exciting updates to come.</p>
<p>Notably:</p>
<ul>
<li>5.4 is basically faster, better and stronger</li>
<li>LibEvent + ZeroMQ - Event Driven Server, could we get some of the advantages Node.js brings us? Can't wait to find out</li>
<li>Built in Web Server for testing on</li>
<li>much more that we'll blog later</li>
</ul>
<p>Some parts of the talk were very entertaining including:</p>
<p>"y2k_compliance setting removed in PHP 5.4. What did it do? Nothing, aside from make people feel more comfortable ahead of Y2K <a title="#phpuk2012" href="https://twitter.com/#!/search/%23phpuk2012">#<strong>phpuk2012</strong></a>" (as tweeted by <a href="https://twitter.com/#!/RightsterDev">@RightsterDev</a>)</p>
<p>When asked about moving to Strictly Typed Language, Rasmus demonstrated why PHP is not. Web requests are basically strings, if you want to check the type, do it, you have the tools to do so.</p>
<p>When asked about highlights in his 18 years, he said that really he was just fortunate, but being first to the party doesn't always mean much - in fact being first to a party can be lame!</p>
<p>He also did a call to arms, to get PHP devs contributing and tackling the many (mostly non-releavant or actual) bugs. In a real time demo, it took 4 attempts to find a non-windows bug!</p>
<p>PabloSerbo [07:51] "On 07:49 train from <a title="#berkhamsted" href="https://twitter.com/#!/search/%23berkhamsted">#<strong>berkhamsted</strong></a> to <a rel="nofollow" href="https://twitter.com/#!/PHPUKConference">@<strong>PHPUKConference</strong></a><a rel="nofollow" href="https://twitter.com/#!/changelogshow">@<strong>changelogshow</strong></a> 0.7.1 in my ears, tests for a new <a title="#nodejs" href="https://twitter.com/#!/search/%23nodejs">#<strong>nodejs</strong></a> app on my air. <a title="#geekbliss" href="https://twitter.com/#!/search/%23geekbliss">#<strong>geekbliss</strong></a>"</p>
<p>ClockArnIIe - [06:39] "Leaving for London Paddington! Looking forward to a great conference"</p>
<p>&nbsp;</p>
</div>

]]></description><link>http://clock.co.uk/tech-blogs/php-conference-2012</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/php-conference-2012</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Fri, 24 Feb 2012 06:42:40 GMT</pubDate></item><item><title><![CDATA[versionator - Static content versioning in node.js using express]]></title><description><![CDATA[<p>versionator was built to solve the problem of static assets getting stuck in browser and proxy caches when new versions of the assets are deployed.</p>
<p>Without versionator this is what can happen:</p>
<p>You set your static content to be cached and expire in 30 days time.</p>
<pre><code> express.static(__dirname + '/public', { maxAge: 2592000000 })
</code></pre>

This gives you more capacity on your web servers and a better rating on Google Pagespeed and ySlow.

You deploy your site and all is good.

Then you need to make a change to sprite.png or app.js

You make your changes and redeploy. The trouble now is that everyone who has looked at your site already has the old version in their browser cache. Not only that, any upstream proxies will also have a copy.

A possible solution is to rename your static assets every time you change them, but that is impractical as you also have to update all the references each time they change. If you have a single CSS sprite then this is a real pain.

A better solution is to use versionator!
<h2>Installation</h2>
<pre><code>  npm install versionator
</code></pre>
<h2>Usage</h2>
<h3>Basic Middleware</h3>

The simplest way to use versionator is to use the basic middleware which looks for the given version number in a url path and strips it out.

Add versionator into your middleware stack before the static middleware:
<div>
<pre>app.version = '0.1.0';
var basic = require('versionator').createBasic(app.version);

app.configure(function() {

app.use(basic.middleware('v' + app.version))
  ....
  .use(express.static(__dirname + '/public', { maxAge: 2592000000 }));

});</pre>
</div>

Public folder:
<pre><code>public/js/app.js
</code></pre>

In your HTML,CSS,JS add the version as an extra path.

e.g.
<h3>HTML</h3>
<pre><code>  &lt;script src='/js/v0.1.0/app.js' /&gt;
</code></pre>

There is also a URL versioning helper that will convert paths for you. You can expose as a helper like so:
<div>
<pre>app.configure(function() {

// This exposes the helper to the views
  app.helpers({
    versionPath: basic.versionPath
  });

});</pre>
</div>
<h3>Jade</h3>

This can then be used in Jade like so
<pre><code>  script(src=versionPath(/js/app.js))
</code></pre>
<h3>Middleware</h3>

versionator middleware will strip URL path names containing the version string. req.url is then modified for all other middleware.

e.g.
<pre><code> req.url = '/js/v0.1.0/app.js'
</code></pre>

will become:
<pre><code> req.url = '/js/app.js'
</code></pre>

Now all you need to do is increment app.version each deployment (We keep ours inline with our git tags using cake, the coffee-script build tool) then sit back and let your users enjoy the freshness.

An example of how to use versionator with connect and express can be found in the examples folder.
<h3>Mapped Middleware</h3>

You can also use versionator to add a hash, based on the content of the file, to the url path. This way the url path will only change if the file has changed.

To do this you must first create a hash for all the files in the public folder. This can be done as the application starts or read from a file that is created on deployment.
<div>
<pre>versionator.createMapFromPath(__dirname + '/public', function(error, staticFileMap) {

var mappedVersion = versionator.createMapped(staticFileMap);

app.configure(function(){

// This exposes the helper to the views
    app.helpers({
      versionPath: mappedVersion.versionPath
    });

app
      .set('views', __dirname + '/views')
      .set('view engine', 'jade')
      .use(express.bodyParser())
      .use(express.methodOverride())
      .use(mappedVersion.middleware)
      ....
  });

....
});</pre>
</div>

If you use the helper you can switch methods without any changes to your view code.
<h3>Live map updates</h3>

You can modify the map at runtime, say if during development you want to do a live reload of a resource. First, get the hash map for the modified files by passing a list of files as a <code>fileList</code> parameter. This should be full file paths and the files should be in the original public directory. The directory is passed in as well. Then pass the the new hash map to the middleware via <code>modifyMap</code>. Then push the new url to the client and update the resource tag to cause a reload.
<div>
<pre>    var mappedVersion = versionator.createMapped(originalFileMap);
    ...
    // modify resource files. put full file path(s) in a list.

versionator.createMapFromPath(__dirname + '/public',  {'fileList': fileList}, function(error, modifiedFileMap) {
        mappedVersion.modifyMap(modifiedFileMap);
    )};

// send new hashed path to client
    hashedpath = mappedVersion.versionPath(path)
    ...</pre>
</div>
<p>&nbsp;</p>
<p>Versionator on github: <a href="https://github.com/serby/versionator">https://github.com/serby/versionator</a></p>
]]></description><link>http://clock.co.uk/tech-blogs/versionator---static-content-versioning-in-nodejs-using-express</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/versionator---static-content-versioning-in-nodejs-using-express</guid><dc:creator><![CDATA[Paul Serby]]></dc:creator><pubDate>Fri, 17 Feb 2012 15:17:49 GMT</pubDate></item><item><title><![CDATA[Upstart and Node.js]]></title><description><![CDATA[<p>One issue that we have had with Node.js projects is how to allow our developers to assume the role of devops for the various different sites a machine may be running - i.e. to restart node sites without incurring a large overhead in server configuration.</p>
<p>To date we have been running our node sites out of the Upstart system in Ubuntu Linux, and are using one upstart script per site.  With a server running several sites, this would translate to a lot of these scripts, all pretty much identical apart from some variables.</p>
<p>My solution to this is as follows....</p>
<p>First of all, there are a few dependencies to mention.</p>
<ul>
<li>The first is that we are dependent on Upstart.  Other than Ubuntu, there are a few recent distributions that also use the system.  Redhat Enterprise 6 and Fedora 6 are listed as supporting it on the wikipedia page for Upstart.</li>
<li>The next is of course Node.js.  This method could however be transferable to other services that run lots of individual instances.</li>
<li>Lastly, we need a way of maintaining the right version of node for each instance, and we use n (npm install -g n) for this purpose.</li>
</ul>
<p>The solution comes in two parts.  One upstart script to start each node instance, the second to start them all on boot.</p>
<p>&nbsp;</p>
<p><strong>Part One: node.conf</strong></p>
<pre>description 'node upstart script'
author 'iain'

start on (local-filesystems and net-device-up)
stop on shutdown

instance "Node - $NAME"

respawn
respawn limit 5 60

script
        . /etc/node/$NAME.conf
        exec sudo -u node NODE_ENV=${NODE_ENV} /usr/bin/n use ${NODE_VERSION} ${NODE_PATH} &gt;&gt; ${LOG_PATH} 2&gt;&amp;1
end script</pre>

The key to running multiple instances is in the 'instance' keyword above, and we pass in the NAME variable on the command line to specify which instance we are operating on.

Another thing that you'll notice is that we are sourcing a configuration file, this is so that we can populate the rest of the script with variables, so the next step is to create this directory and set the variables for one application.

For my test node app, I've very creatively called it test, and have decided it's running in a production environment.  Therefore my config file is /etc/node/test-production.conf and contains:
<pre>NODE_VERSION="0.6.5"
NODE_PATH="/var/application/test/app.js"
LOG_PATH="/var/log/node/test.log"
NODE_ENV="production"</pre>

Starting this node instance is easy, we run:
<pre># start node NAME=test-production</pre>

And as output we get:
<pre># start node NAME=test-production
node (Node - test-production) start/running, process 1562</pre>

All is good, we can stop/start/restart/respawn this service, but it won't start automagically on boot.  For this we need....

&nbsp;

<strong>Part Two: nodeSites.conf</strong>
<pre>description 'Start all node instances at boot'
author 'iain'

start on (local-filesystems and net-device-up)

task

script
  for file in `ls /etc/node/*.conf` ; do
    filename=`basename ${file%.*}`
    start node NAME=$filename
  done
end script</pre>
<p>As you can see, this script will cycle through all config files in /etc/node and start a node instance for each based on the name of the file (minus path and extension for those unfamiliar with the `basename ${file%.*}` line).</p>
<p>The key thing to mention about this script is the task keyword.  It is this that makes this upstart script a short lived process - it does its thing then dies off.</p>
<p>&nbsp;</p>
<p><strong>More information on the technologies mentioned can be found at....</strong></p>
<p>NodeJS - <a href="http://nodejs.org">http://nodejs.org</a></p>
<p>NPM module n by TJ Holowaychuk - <a href="http://github.com/visionmedia/n">http://github.com/visionmedia/n</a></p>
<p>Upstart Cookbook - <a href="http://upstart.ubuntu.com/cookbook/">http://upstart.ubuntu.com/cookbook</a></p>
<p>Ubuntu - <a href="http://ubuntu.com">http://ubuntu.com</a></p>
<p>Bash Manual - <a href="http://www.gnu.org/software/bash/manual/bashref.html">http://www.gnu.org/software/bash/manual/bashref.html</a></p>
<p>&nbsp;</p>
]]></description><link>http://clock.co.uk/tech-blogs/upstart-and-nodejs</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/upstart-and-nodejs</guid><dc:creator><![CDATA[Iain Grant]]></dc:creator><pubDate>Mon, 06 Feb 2012 11:28:08 GMT</pubDate></item><item><title><![CDATA[Zsh: [Ctrl + left arrow] outputting '5D'?]]></title><description><![CDATA[<p>If you've recently started using Zsh as your shell of choice and have noticed that some key bindings are not working or are now outputting unusual characters, you need to update your <em>.zshrc</em>.</p>
<p>I noticed the issue on a virtual machine running Ubuntu Server, however, other systems vary and output slightly different key codes (i.e, '<code>;5D</code>' and '<code>^[[5D</code>') if so, you'll have to adjust the commands below to suit the output you're seeing.</p>
<p>If you're affected by the above example you'll likely need to amend the <em>skip word forward</em> behaviour as well. To amend these issues, append the following to your .zshrc (located at <code>/home/{username}/.zshrc</code>):</p>
<pre>bindkey '5D' emacs-backward-word
bindkey '5C' emacs-forward-word</pre>

Another tip; if your newly found shortcuts are not stopping at punctuation you'll also need to append:
<pre>export WORDCHARS=''</pre>
<p>Having more issues with key bindings? See the <a title="Keybindings at zshwiki.org" href="http://zshwiki.org/home/zle/bindkeys" target="_blank">Zsh website</a> for more information.</p>
]]></description><link>http://clock.co.uk/tech-blogs/zsh-ctrl-left-arrow-outputting-5d</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/zsh-ctrl-left-arrow-outputting-5d</guid><dc:creator><![CDATA[Luke Wilde]]></dc:creator><pubDate>Wed, 11 Jan 2012 11:51:38 GMT</pubDate></item><item><title><![CDATA[and now... Will the fat lady sing?]]></title><description><![CDATA[<p><a href="http://blog.clock.co.uk/2011/12/01/from-firefox-to-chrome/">As discussed</a>, I am trialling new browsers - to enrich and broaden my horizons.</p>
<p>I ended up using Chrome for longer than I intended and with good reason, I found it to be the best browser I had used. Previously I was an adherent Firefox fan.</p>
<p>So, how does Opera fare? With more than <strong>220 million</strong> users worldwide - surely pretty good?</p>
<p>On installing it and firing it up I was immediately loving some* of the things I could see straight away:</p>
<h2><a href="http://blog.clock.co.uk/wp-content/uploads/2012/01/Screen-Shot-2012-01-06-at-11.31.47.png"><img class="alignright size-medium wp-image-1318" title="Screen Shot 2012-01-06 at 11.31.47" src="http://blog.clock.co.uk/wp-content/uploads/2012/01/Screen-Shot-2012-01-06-at-11.31.47-300x145.png" alt="" width="300" height="145" /></a>Turbo? Faster on slow connections? You've got my interest.</h2>
<p>I could already see that it was lightening quick to load pages, I don't have the stats to hand but I already knew, from the articles that spawned my interest in the different browser nuances, of Opera's reputation at being a speed freak - and it is true - it is super quick. So what was all this talk of Turbo?</p>
<p>Their blurb sums it up, and I can't argue with that - great thinking:</p>
<blockquote><p><strong>How we squeeze out all that speed</strong>
When Opera Turbo is enabled, webpages are compressed via Opera's servers so that they use much less data than the originals. This means that there is less to download, so you can see your webpages more quickly.
Enabling Opera Turbo is as simple as clicking the Opera Turbo icon at the bottom-left of the Opera browser window. When you are on a fast connection again and Opera Turbo is not needed, the Opera browser will automatically disable it.</p></blockquote>
<h2>Quick search parameters by default... Like it a lot</h2>
<p><a href="http://blog.clock.co.uk/wp-content/uploads/2012/01/Screen-Shot-2012-01-06-at-11.33.57.png"><img class="alignright size-medium wp-image-1319" title="Screen Shot 2012-01-06 at 11.33.57" src="http://blog.clock.co.uk/wp-content/uploads/2012/01/Screen-Shot-2012-01-06-at-11.33.57-300x204.png" alt="" width="300" height="204" /></a>Clock's CTO has always taught me that the best thing to do when getting new software is to look at every menu and advanced option before using - it is a great tip, it teaches you immediately the flexibility and features that you might not otherwise appreciate.</p>
<p>I love using Alfred as my override for "Spotlight Search" and have always loved the ability to custom create my own shortcuts (does have its disadvantages when using other people's machines though), so when I saw that Opera comes bundled with some pre-installed Search Keywords and ability to do my own, it made me smile.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2>Add-ons, Extensions.. what ever you want to call them!</h2>
<p>Asking around the office no-one uses Opera as their default browser, so I didn't have a head start of knowing which add-ons to install (like I did with the switch to Chrome). I'll be trialling these add-ons, if you happen to be an Opera user and know of decent add-ons please let me know in the comments section</p>
<ul>
<li><a href="https://addons.opera.com/en/addons/extensions/details/snap-links/1.7/">Snap Links</a> - Select an area containing links and have them open all at once.</li>
<li><a href="https://addons.opera.com/en/addons/extensions/details/yslow/3.0.5/?display=en">YSlow</a> - YSlow analyses web pages and suggests ways to improve their performance based on a set of rules for high performance web pages.</li>
<li><a href=" https://addons.opera.com/en/addons/extensions/details/the-developer-briefcase/1.1/?display=en">The Developer Briefcase</a> - Various tools to help web developers and designers.</li>
<li><a href="https://addons.opera.com/en/addons/extensions/details/html-color-coder/1.0.1/?display=en">HTML Color Coder</a> - Colour picker</li>
</ul>
<p>Again I got myself acquainted with the inspector, seems as good as Chrome's - but not put it to any mean tests yet.</p>
<p>And now for some Negatives:</p>
<h2>Why is Chrome not on the import list? <a href="http://blog.clock.co.uk/wp-content/uploads/2012/01/Screen-Shot-2012-01-06-at-11.44.42.png"><img class="alignright size-medium wp-image-1323" title="Screen Shot 2012-01-06 at 11.44.42" src="http://blog.clock.co.uk/wp-content/uploads/2012/01/Screen-Shot-2012-01-06-at-11.44.42-300x127.png" alt="" width="300" height="127" /></a></h2>
<p>I ended up having to look for a tutorial to do this, that is not ideal ... I really don't get why Chrome is missing from the list.. definitely not as good as Chromes import (for my use case)</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2>I prefer Chrome page search<a href="http://blog.clock.co.uk/wp-content/uploads/2012/01/Screen-Shot-2012-01-06-at-12.19.48.png"><img class="alignright size-medium wp-image-1331" title="Screen Shot 2012-01-06 at 12.19.48" src="http://blog.clock.co.uk/wp-content/uploads/2012/01/Screen-Shot-2012-01-06-at-12.19.48-300x136.png" alt="" width="300" height="136" /></a></h2>
<p>Whilst Opera's page search is pretty good - it lacks one thing that Chrome has managed... to show the rest of the results on the scrollbar. Not a major flaw but I still enjoyed using Chrome's page search more.</p>
<p>&nbsp;</p>
<h2>Is bing really the default SE?</h2>
<p><a href="http://my.opera.com/chooseopera/blog/2010/06/17/bing-in-opera">I'm likely criticising without knowing full detail</a>, but is the default search engine really bing? I hope it would have asked me on install or rotated through them by default. Anyway, at least I could delete it and use my personal favourite.. Google!</p>
<p>&nbsp;</p>
<h2>I want to be able to re-open closed tabs</h2>
<p>Sometimes through a mistake or just wanting to pull up a previously read web-page, I can close a tab and want to quickly re-open the tab. Chrome &amp; Firefox (through TabMixPlus) lets me do it, why can't Opera? certainly wasn't there as a menu option.. I enjoy this feature from Chrome and I don't want to have to hunt for an extension</p>
<p><strong>--UPDATE 9/01/12</strong></p>
<p><strong>This was unfair, as pointed out by a couple of colleagues - Opera has a closed tab option that shows closed pages (and you can also use the shortcut cmd+shift+t to reopen closed tab) </strong></p>
<h2>Overall</h2>
<p>I have only been using it a few days, I'll be sure to detail more once I have given it a good go, then it is decision time:</p>
<p>Chrome, Firefox or Opera as my default browser... sorry IE, I just can't bring myself to even try!</p>
]]></description><link>http://clock.co.uk/misc/and-now-will-the-fat-lady-sing</link><guid isPermaLink="true">http://clock.co.uk/misc/and-now-will-the-fat-lady-sing</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Fri, 06 Jan 2012 12:41:59 GMT</pubDate></item><item><title><![CDATA[Secret Santa app]]></title><description><![CDATA[<div class="mceTemp mceIEcenter">
<dl>
<dt><a href="http://blog.clock.co.uk/wp-content/uploads/2011/12/secret-santa1.png"><img class="aligncenter size-full wp-image-1303" src="http://blog.clock.co.uk/wp-content/uploads/2011/12/secret-santa1.png" alt="" width="591" height="797" /></a>
</dt>
</dl>
</div>
<p>&nbsp;</p>
<p style="text-align: left">The ‘Secret Santa’s Tombola’, is a new free iPhone web app from digital agency Clock Limited to help you find that perfect Secret Santa gift.</p>
<p style="text-align: left">The Secret Santa app, developed in-house at Clock, guides you through various choices about the recipient before helping you find them the perfect gift, all of which were hand-picked by the Clock team and available to purchase through Amazon.</p>
<p style="text-align: left">Clock was founded with a loan from The Prince's Trust and all Amazon's referral fees from the Secret Santa iPhone app will be donated straight back to the charity. HO! HO! HO!</p>
<p style="text-align: left">Simply give it a go here <a href="http://secretsanta.me">www.secretsanta.me</a></p>
<p style="text-align: left"><a href="http://secretsanta.me"></a>Have a brilliant Christmas
and a Happy New Year!</p>
<p style="text-align: center"><em>
</em></p>
<p style="text-align: center">&nbsp;</p>

]]></description><link>http://clock.co.uk/creative-blogs/secret-santa-app</link><guid isPermaLink="true">http://clock.co.uk/creative-blogs/secret-santa-app</guid><dc:creator><![CDATA[Jake Allnutt]]></dc:creator><pubDate>Thu, 15 Dec 2011 14:08:11 GMT</pubDate></item><item><title><![CDATA[The Rise and Rise of Game Mechanics]]></title><description><![CDATA[<p>We all like games. They are fun, social and as it turns out tremendously useful in real life. (See my previous post on that subject <a title="What World of Warcraft taught me about Project Management" href="http://blog.clock.co.uk/2011/05/06/what-world-of-warcraft-taught-me-about-project-management/" target="_blank">here</a>. Read it? Good, then welcome back!)</p>
<p><span style="font-size: 20px;font-weight: bold">How did it start?</span></p>
<p>So lately, the world of gaming has started to spill out from the realm of hardcore gamers to, well... the realm of everyone else; those we call 'casual gamers'. In a similar fashion, the concept of 'instant rewards' that are found in games has also begun spilling over it's boundaries and into the 'real world', becoming  an incentive concept for actual life tasks. This movement is known as <em>gamification</em>. But where does this all come from?</p>
<p>Back in the day a company called Blizzard create a game called Diablo. It became huge and the reason for this was a very simple mechanic. You run around the game killing things and getting rewards for it. The more things that you killed, the more rewards you got and the more 'badass' the thing you killed, the better the class of reward you got. So gamers that played Diablo got addicted to the concept of running around a magical world, killing things and completing quests just to see what reward you could get next. Pretty simple really; dangle a carrot, perform a task, win the carrot.</p>
<p>As the science of <a title="All about Pavlov" href="http://en.wikipedia.org/wiki/Ivan_Pavlov" target="_blank">Pavlov's experiments</a> demonstrates, any creature can be conditioned to repeat set tasks to deliver set reward, including humans. Thus game mechanics in real life, outside of games, relies on providing people groups such as consumers, employees and managers instant rewards for tasks accomplished on a scale of economics that allots you more each time the more you do - creating a meritocracy with instant rewards as opposed to deferred rewards and doing it all in a fun, competitive and driven manner.</p>
<p>Confused? And so you should be! Bring on the infographic.</p>
<p>[caption id="attachment_1271" align="alignleft" width="300" caption="Gamification in stick figures"]<a href="http://blog.clock.co.uk/wp-content/uploads/2011/12/infographic.jpg"><img class="size-medium wp-image-1271 " src="http://blog.clock.co.uk/wp-content/uploads/2011/12/infographic-300x225.jpg" alt="Gamification" width="300" height="225" /></a>[/caption]</p>
<p><span style="font-size: 20px;font-weight: bold">What is changing?</span></p>
<p>The introduction of game mechanics and the wide appeal it has to a large following of adults is introducing radical changes in the way we approach company tasks and the way in which employee rewards are being considered for the next generation of adults. Instead of spending 10 years in a company for a meagre share offering as a reward for all your hard work, companies are introducing fast turnaround rewards for its employees and its customers that allow them to reap proportional rewards quickly - for results achieved or goods and services bought. Genius. Because as we know, man is not a patient species nor does it plan for its future. The here and now is the way to go when incentivising a person to get anything done.</p>
<p>Therefore, the trick is to also do this publicly. Not only do you incentivise people for fast returns but you also introduce a competitive edge to the performance by comparing your results with your co-workers or other consumers creating the drive to be better than the next guy. Now we know humans like being better than the next guy - so this is a no brainer. Nothing like a bit of friendly public humiliation to get those slackers to perform better.</p>
<p>So lets take an example of how this is working for one of our clients (who will remain unnamed for a variety of reasons).</p>
<p><strong>The Problem</strong>:</p>
<p>The company, a traditional business, was having difficulty motivating its' managers to use Facebook. Nothing worked, not even training.</p>
<p><strong>The Solution</strong>:</p>
<p>We created a tool that allowed the parent company to create an aggregated list of the best performing managers, based on posts made, images uploaded and comments made to each of their corporate Facebook pages. That list was circulated among the managers, publicly showcasing the top performers and the poor performers.</p>
<p><strong>How it worked out</strong>:</p>
<p>With the added incentive of wanting to 'beat' their fellow managers in this ficticous ladder of competition, the stage was set for the low performing managers to find ways to improve their ranking so they were rewarded better and looked better in the eyes of their peers.</p>
<h2>The role of agencies in driving game-to-ROI value</h2>
<p>Agencies play a vital role in bringing great user experiences and strategies to companies. The trick is to ensure that the 'gamified' strategy delivers a real return to the customer. But how do you approach this?</p>
<p><strong>Discover the business value</strong></p>
<p>Never rush into a social strategy. Stop and think - what is it that the client needs? Where will he get value? There are both soft values and hard values to consider and your strategy for a gamified social experience should include both. Engage the viewer with fun and deliver a result that has real value to that company.</p>
<p><strong>Find the lever</strong></p>
<p>In every successful game franchise in history there is a lever, a hook, that keeps people coming back to it. Discover what that lever is for your client's audience. Naturally, you can't start your execution until you know exactly what this is.</p>
<p><strong>Don't forget the fun factor</strong></p>
<p>Games are fun. So should your gamified strategy be. Engage the user with visual splendour, a competitive factor and a measurable fast return.</p>
<p>Let's take a look at a prototype idea for a gamified concept developed by a research group at MiT.</p>
<p>The team was attempting to harness the appeal of massive multiplayer gaming to obtain ideas about solving the energy problem. If we run out of fuel what will we do? To answer this they created an open-ended world where players played as corporations and has access to all the natural resources that currently exist on the planet in some form. Then they challenged the players to create viable company models within the fictive economy to see what the thousands of people playing the game would come up with regarding commercially viable strategies for alternative energy sources. So not far off a larger version of Sim City but with a micro managed economy under the players control.</p>
<p>This game utilised modern gaming graphics and engines together with the collective thinking power of thousands of gamers to see if a viable method of having a replenishable energy could be commercially utilised in a controlled economic environment. This exercise at MiT did not yield the solution to our energy crisis. However, it certainly is one of the best examples of advanced gaming technology and mass collective problem solving that I have found to date.</p>
<p>Do you know of any good gamified examples? Post below in the comments and let us know!</p>
]]></description><link>http://clock.co.uk/misc/the-rise-and-rise-of-game-mechanics</link><guid isPermaLink="true">http://clock.co.uk/misc/the-rise-and-rise-of-game-mechanics</guid><dc:creator><![CDATA[Kosala Ubayasekara]]></dc:creator><pubDate>Thu, 15 Dec 2011 12:14:26 GMT</pubDate></item><item><title><![CDATA[Facebook - are we asking the wrong questions?]]></title><description><![CDATA[<h2><strong>Where is my money?</strong></h2>
<p>The above is a question. Not a dramatic question just yet. It doesn't have any context, no real point, no drama. But we can work on that.</p>
<p>Yesterday I was watching the BBC documentary "Inside Facebook", featured in it was a short interview with the ever elusive Mark Zuckerberg. Other people were also interviewed, mostly people I had never heard of but one particular interview was with a CEO of an agency that helped his clients with Facebook advertising; the interview discussed the new 'sponsored story' implemented on Facebook.</p>
<p>For those that don't know, Facebook recently introduced advertisements into their timeline. In order to fool us into thinking they were not advertising, they called them "stories". Then they take advertisements on Facebook that you have LIKE'd and show those advertisements in your friend's timeline - and dub them "sponsored stories". Sponsored by you - because <em>you </em>LIKE'd them. Now to ask the all important question...</p>
<h2><strong>Where is my money?</strong></h2>
<p>The guy being interviewed was saying that implicitly by LIKE-ing something on the Facebook platform you are endorsing it and that made it OK for Facebook to advertise that to your friends and charge a company to make that happen. The BBC reporter asked 'why is my LIKE showing up as an advert?' Just because I like something does not mean I am advertising it does it? This was the wrong question. The right question is:</p>
<h2><strong>Where is my money?</strong></h2>
<p>The right question has been asked before by pundits, internet experts, news casters, reporters and many others. The reasoning behind the question is this:</p>
<p>I am endorsing things that charge money <em>from</em> advertisers to be shown to <em>my</em> friends and the content on Facebook exists purely because us, the users, are present online and are uploading content -  then should <em>we</em> not be getting a cut?</p>
<p>Once again...</p>
<h2><strong>Where is my money?</strong></h2>
<p>Can you see where I'm heading with this?</p>
<p>Before we jump to the conclusion that a billion dollar corporation owes us money because they are using our content, let's take a look at a precedent. YouTube started sharing revenue from its adverts with content creators a long time ago. And they reward channel uploaders for acquiring followers, for uploading content and for distributing their content. So why doesn't Facebook pay me for my content if its making money from it? Hold on to your hats ... in the midst of this analysis the question has suddenly changed. It is now this.</p>
<h2><strong><em>Should</em> I be making money?</strong></h2>
<p>And now for some light number tossing...</p>
<p>Facebook has 500 million users. It exists <em>because</em> of its users and because of the content that we upload. Content that the users own and content that the users create. Facebook is about to go public at a valuation of $10BN (or £6.3BN), with ad revenues of over $1.8BN in 2010; for argument's sake so let's call that  a cool $2BN for 2011. Bring on the equation!</p>
<p>Direct value of a Facebook user &gt;&gt; $ 10 000 000 000 / 500 000 000 users = $20 / user (...we ain't that valuable)</p>
<p>Income to Facebook per user &gt;&gt; $2 000 000 000 / 500 000 000 users = $4 / user / year (...a revenue share of that would be negligible)</p>
<p>So there we have it. On our own, each user is actually not worth much at all. We only matter as a collective. The value we get off of Facebook is not, and never will be, monetary as a user - it is about sharing and the need to share.</p>
<p>For Facebook to exploit that volume of users to engage in a commercial enterprise with our data to make money is a fair capitalist exchange of a service for wealth generated from it - the wealth is just coming from someone other than us. So we can all relax, as can the press, the pundits, the internet experts, the news casters and the reporters... it turns out... Facebook doesn't owe any of us any money as in actual fact...</p>
<p><strong>There is no question.</strong></p>
]]></description><link>http://clock.co.uk/social-media-2/facebook---are-we-asking-the-wrong-questions</link><guid isPermaLink="true">http://clock.co.uk/social-media-2/facebook---are-we-asking-the-wrong-questions</guid><dc:creator><![CDATA[Kosala Ubayasekara]]></dc:creator><pubDate>Tue, 06 Dec 2011 12:48:19 GMT</pubDate></item><item><title><![CDATA[Compiling ActionScript 3.0 with Sublime Text 2]]></title><description><![CDATA[<p>At Clock we typically spend our time developing JavaScript and PHP, however, occasionally Flash presents itself as the most suitable platform for certain components.  To avoid the need of installing a separate authoring environment (and even the license fees associated with some of the official Adobe IDE's) I sought to empower my text editor <a title="Sublime Text 2 download page" href="http://www.sublimetext.com/2" target="_blank">Sublime Text 2</a> with the ability to compile SWF's.</p>
<p>Choosing to use a minimalist development environment is invariably going to bring about some limitations, of these I find the most noticeable to be the lack of debugging tools. While I will suggest some means to allow you to receive trace statements to debug your application, if you're developing large and complex applications you may want to consider some other free alternatives: <a href="http://www.flashdevelop.org/wikidocs/index.php?title=Main_Page">Flash Develop</a>.</p>
<p><span style="font-size: 15px;font-weight: bold">Download Flash Compiler and .swf viewing Software </span></p>
<p>If you don't have any kind of flash authoring environment installed, you're going to need to download some software:</p>
<ul>
<li>A version of the <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4.5" target="_blank">Flex SDK</a> is needed to compile your application (Version: if you're not sure, the <em>Adobe</em> Flex SDK is likely to be appropriate)</li>
<li>You'll probably want an <a href="http://www.adobe.com/support/flashplayer/downloads.html" target="_blank">SWF debug projector</a> to enable you to run your SWF's on the desktop and provide stack trace output.</li>
<li>Additionally one of the <a href="http://www.adobe.com/support/flashplayer/downloads.html" target="_blank">Plugin content debuggers</a> will be useful for access stack traces in the browser.</li>
</ul>
<p>You'll notice that the first two of these applications don't come with any kind of installer, it's up to you where you want them, (as a Windows 7 user) I extracted them both into <code>C:\Program Files (x86)\Flex SDK\</code></p>
<p><span style="font-size: 15px;font-weight: bold">Configuring MXMLC as a Build System in Sublime Text 2</span></p>
<p>Now you've got your Flex SDK extracted you'll want to set it as what's known in Sublime Text as a <em>build system</em>.</p>
<p>In Sublime's menu, access: <code>Tools &gt; Build System &gt; New Build System…</code></p>
<p>Replace the default build script with the following:</p>
<pre>{
	"cmd": [
		"C:\\Program Files (x86)\\Flex SDK\\bin\\mxmlc.exe",
		//"-o", "${project_base_name}.swf",
		"${file}"
	],
	"selector": "source.actionscript"
}</pre>

Save this file in Sublime's ActionScript package directory, which for Windows 7 users will be located in <code>C:\Users\[username in here]\AppData\Roaming\Sublime Text 2\Packages\ActionScript\</code>, and restart Sublime.

You should now be able to build your flash projects using <code>F7</code> or <code>Ctrl + b</code> and using the aforementioned SWF projector you'll be able to launch your fresh SWF from your file system.
<h4>Sublime's Build System Notes</h4>

The <code>selector</code> option will make sublime choose our new build system automatically when you build directly from the source view of an ActionScript file.

In the example above you'll see that my Windows file system requires me to escape the directory separator. You'll have to modify this path if you're on a different Operating System or you selected a different place for your Flex SDK to live.

One thing which caught me out was providing additional command line parameters to Sublime, they must be provided as per the -o option above. Individual option flags and their attribute must be placed into separate elements in the <em>cmd</em> array for Sublime to execute them correctly. I've left in the above example as a reference to this.
<h4>Hello World</h4>

As requested, here is a little <em>Hello World</em> to test your compiling powers:
<pre>package {
	import flash.display.Sprite;
	import flash.text.TextField;
	// import flash.external.ExternalInterface;

public class HelloWorld extends Sprite {

public function HelloWorld () {

// ExternalInterface.call("console.log('ding')");
			var mytextfield:TextField = new TextField();
			mytextfield.text = "Hello World!";
			addChild(mytextfield);
		}
	}
}</pre>
<h4>Debugging Your Flash Applications in a JavaScript Console</h4>
<p>Now we've cut the Flash IDE out of the equation, you've actually lost your Flash console meaning your <code>trace()</code> statements aren't going to get shown anywhere, even the <em>flash player debuggers</em> can only output stack traces. The most suitable way I found to output debugging information was by embedding my .swf in a webpage and outputting data to the browsers console. By utilising Flash's <a title="AS3 API Reference" href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html" target="_blank">ExternalInterface</a> class you're able to invoke javascript functions, more specifically in Firefox the <a title="Download FireBug for Mozilla Firefox" href="https://addons.mozilla.org/en-US/firefox/addon/firebug/" target="_blank">FireBug</a> console, or Chrome's native javascript console.</p>
<p>After importing the class into your application you can simply call the console like so:
<code>ExternalInterface.call("console.log('ding')");</code></p>
<p>This does, however, rely on the fact that you're running your SWF in a browser and importantly that your console is loaded before you call it (Embedding using <a href="http://code.google.com/p/swfobject/" target="_blank">SWFObject</a> will help avoid errors relating to this).</p>
<p>If you're Debugging needs go very far beyond this, then its probably time to install a more integrated development environment with native debugging and profiling support.</p>
<h4>Refrences and Recommended IDE's</h4>
<ul>
<li><a href="http://sublimetext.info/docs/en/reference/build_systems.html">http://sublimetext.info/docs/en/reference/build_systems.html</a> - Sublimes Build Properties</li>
<li><a href="http://www.arulraj.net/2010/08/flash-player-debugger-in-ubuntu.html">http://www.arulraj.net/2010/08/flash-player-debugger-in-ubuntu.html</a> - Installing the Plugin content debugger on Ubuntu</li>
<li><a href="http://www.flashdevelop.org/wikidocs/index.php?title=Main_Page">http://www.flashdevelop.org/wikidocs/index.php?title=Main_Page</a> - Flash Develop IDE</li>
<li><a href="http://fdt.powerflasher.com/">http://fdt.powerflasher.com/</a> - FDT, Eclipse based IDE</li>
</ul>

]]></description><link>http://clock.co.uk/tech-blogs/compiling-actionscript-30-with-sublime-text-2</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/compiling-actionscript-30-with-sublime-text-2</guid><dc:creator><![CDATA[Luke Wilde]]></dc:creator><pubDate>Mon, 05 Dec 2011 16:41:07 GMT</pubDate></item><item><title><![CDATA[From Firefox to Chrome]]></title><description><![CDATA[<p>This post is a follow-up to my <a href="http://blog.clock.co.uk/2011/11/02/my-browser/">original blog regarding browsers</a></p>
<p><a href="http://blog.clock.co.uk/wp-content/uploads/2011/11/Screen-Shot-2011-11-08-at-09.30.32.png"><img class="alignright size-medium wp-image-1150" title="Screen Shot 2011-11-08 at 09.30.32" src="http://blog.clock.co.uk/wp-content/uploads/2011/11/Screen-Shot-2011-11-08-at-09.30.32-300x196.png" alt="" width="300" height="196" /></a>So, I made the leap from my trusty Firefox to Google Chrome, and it was a lot easier and efficient than the last time I tried it.</p>
<p>I used the handy 'Import Bookmarks and Settings' menu option and it pulled my stuff across pretty quickly, it did lose my bookmarked rss feeds - but I can live with that, took a few minutes to grab them again.</p>
<p>Next task was to make Chrome my default browser, which is simple enough (menu option within preferences).</p>
<p>The next thing I wanted to do was grab the same extensions other Clock Chrome users found useful:</p>
<ul>
<li><em><strong>Chrome Sniffer</strong></em> 0.2.11 - Detect web applications and javascript libraries run on browsing website</li>
<li><em><strong>REST Console</strong></em> 4.0.2 - REST Console is an HTTP Request Visualizer and Constructor tool, helps developers build, debug and test RESTful APIs.</li>
<li><em><strong>Web Developer</strong></em> 0.3.1 - Adds a toolbar button with various web developer tools. The official port of the Web Developer extension for Firefox.</li>
</ul>
<p>I also got myself familiar with the inspector, the replacement for Firebug and found that it was not nearly as memory hungry.</p>
<p>Tab Mix Plus for Firefox is a fantastic plug-in, and despite a good 15-20 minutes scouring the web, nothing is seemingly comparable on the Chrome extensions webstore.
TMP allows a user to open new tabs whenever a bookmark, url or specific content is clicked/used. It does much, much more and is highly configurable - and my first few days using Chrome meant that my navigation of webpages was a bit clunky. I'd become lazy with TMP and now I'd have to remember to click 'cmd+t' to open a new tab each time.</p>
<p>If you are a Firefox user, I highly recommend Tab Mix Plus - tabbed browsing with a boost.</p>
<p>Now everything was set-up, I was ready to see the benefits.. and there are plenty.</p>
<h2>Speedy</h2>
<p>I love the speed of page rendering, especially given that when you type in the address bar (omnibox) it shows you the page you are about to navigate to. It didn't feel natural at first, as I just wasn't used to it - but I soon realised the advantages of it.</p>
<h2>Clean</h2>
<p>I was again impressed with how clean the browser felt, not vying for screen space. The menu options are clear and to the point.</p>
<h2>Sturdy</h2>
<p>In the last 3 weeks that I have been using it, it hasn't crashed once.
I do tend to overload with tabs - and Firefox has certainly taken issue with me for that approach in the past - occasionally crashing the entire browser.</p>
<p><img class="alignright size-medium wp-image-1217" title="Screen Shot 2011-11-22 at 16.47.12" src="http://blog.clock.co.uk/wp-content/uploads/2011/11/Screen-Shot-2011-11-22-at-16.47.12-300x204.png" alt="" width="300" height="204" /></p>
<h2>Features</h2>
<p>I love the fact that page search highlights on the scrollbar, very handy and I've not seen this on any other browser.</p>
<h2>Overall</h2>
<p>There are more and more features that I am discovering each day. So far very impressed, I'll give it another month and then trial Opera and detail the results.</p>
<p>&nbsp;</p>
]]></description><link>http://clock.co.uk/misc/from-firefox-to-chrome</link><guid isPermaLink="true">http://clock.co.uk/misc/from-firefox-to-chrome</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Thu, 01 Dec 2011 09:55:14 GMT</pubDate></item><item><title><![CDATA[and in the red corner!!!]]></title><description><![CDATA[<p>and in the red corner!!!</p>
<p><a href="http://blog.clock.co.uk/wp-content/uploads/2011/11/blog-post.png"><img class="aligncenter size-full wp-image-1184" src="http://blog.clock.co.uk/wp-content/uploads/2011/11/blog-post.png" alt="html5 vs flash" width="591" height="839" /></a></p>]]></description><link>http://clock.co.uk/creative-blogs/and-in-the-red-corner</link><guid isPermaLink="true">http://clock.co.uk/creative-blogs/and-in-the-red-corner</guid><dc:creator><![CDATA[Jake Allnutt]]></dc:creator><pubDate>Thu, 10 Nov 2011 16:55:38 GMT</pubDate></item><item><title><![CDATA[How To Set-up Your Company's Google+ Profile]]></title><description><![CDATA[<p>Google has <strong>finally </strong>rolled out branded pages for Google+!</p>
<p>Whereas G+ Profiles was purely aimed at connecting people, it now empowers everyone from local businesses to global brands to build your online relations with G+ Pages.</p>
<p>Using the same style and layout as your Google+ Profiles, your Page is almost the same except for a small﻿ ﻿﻿square icon next to your company's name which denotes you're on a page, not a profile. See <a href="https://plus.google.com/100412066008205838197">our page</a> for example.</p>
<p>Firstly, you're going to need a Google Account. If you don't have one yet, <a href="https://accounts.google.com/NewAccount?service=oz&amp;continue=https://plus.google.com/?gpcaz%3Dbe525209&amp;followup=https://plus.google.com/?gpcaz%3Dbe525209&amp;hl=en-GB">create an account</a> through this link.</p>
<p>Once your set-up there, you can head over to <a href="http://plus.google.com/pages/create">plus.google.com/pages/create</a> to get started.</p>
<p>Here you sign-in with your Google Account.</p>
<p style="text-align: center;">﻿﻿﻿﻿<a href="http://blog.clock.co.uk/wp-content/uploads/2011/11/Capture2.png"><img class="size-medium wp-image-1155 aligncenter" title="Google+ Signup Page" src="http://blog.clock.co.uk/wp-content/uploads/2011/11/Capture2-300x186.png" alt="" width="300" height="186" /></a></p>
<p>Punch in your Gender, Date of Birth yada-yada and you <em>can </em> upload your profile picture if you so wish, there is also another chance for that later on too so don't worry too much.</p>
<p>Remember you're still in your own profile; there are few differences between a Google+ Profile and a Google+ Page. Google+ pages can’t +1 other pages and unlike Facebook, it doesn’t support notifications. Also, Google+ Page admins can’t add people to circles until the page is added first or mentioned.</p>
<p><em>Anyway</em>, next Google will check emails/networks for you to 'Add people you Know'. This IS important as later on sharing the page you create will come from these contacts, so when you go to share your new page, it will ask your profile account to send using your contacts. Clear as mud. But it's important, in a nutshell - your page is promoted via your profile.</p>
<p>We continue along and our next option is to 'Follow public posts from interesting and famous people', good to fill up the stream a bit -  give yourself a better feel for the platform.</p>
<p>SO - we're now on your rather bare looking <em>profile, </em>time to set-up a company <em>page</em>. (SEE IMAGE)</p>
<p style="text-align: center;"><a href="http://blog.clock.co.uk/wp-content/uploads/2011/11/Capture5.png"><img class="size-medium wp-image-1156 aligncenter" title="Google+ page setup" src="http://blog.clock.co.uk/wp-content/uploads/2011/11/Capture5-300x221.png" alt="" width="300" height="221" /></a></p>
<h2>RIGHT, now on to the good stuff.</h2>
<p>Here, you pick the category of your business - this bit you'll have to chose for yourself. As far as I can see your choice makes little difference but just helps Google get the options a bit more specific and categorise you a bit better (correct me if i'm wrong)...</p>
<p>For me and many of you, I'm going to go ahead and create a "<strong>Company, Institution or Organisation</strong>".</p>
<p>So, page name, your site, sector, age appropiate for... and tick boxes then 'Create'.</p>
<p><span style="text-decoration: underline;">Now we have your tagline (10 words), here's some inspiration from other G+ Pages:</span></p>
<p>PEPSI - Pepsi and the evolution of digital consumer engagement
TOYOTA - We will lead the way to the future of mobility
VODAFONE - Power to You on Google+ too
MASHABLE - The latest in digital, social media, business, tech, entertainment and mobile news</p>
<h2>Lovely. Now time for your profile picture.</h2>
<p>Dimenions for profile pictures are largest at:</p>
<p><strong>200 x 200px</strong>
(Main profile picture - and below is a rather fantastic example)</p>
<p style="text-align: center;"><a href="http://blog.clock.co.uk/wp-content/uploads/2011/11/clock-googleplus.jpg"><img class="size-full wp-image-1158 aligncenter" title="clock-googleplus" src="http://blog.clock.co.uk/wp-content/uploads/2011/11/clock-googleplus.jpg" alt="" width="200" height="200" /></a></p>
<p>&nbsp;</p>
<p>As normal, this will be shrunk to <strong>48 x 48px </strong>for use around the site.</p>
<p>Google does also throw in a chance for you to get creative and utilise the top 5 banner pictures.</p>
<p>They are at <strong>150 x 150px</strong> and can be used quite ingeniusly. Haven't spotted anything game-changing as yet (so please post if you do see and will update) But for now, an <em>average </em>example of creativity, check out <a href="https://plus.google.com/110937137992985950150/posts">Toyota's new page</a> and you'll see what I mean.</p>
<p><strong>INTERESTINGLY</strong>, a trend already emerging appears to be a call-to-arms, "Add us to your circle" text (like we've done) and sometimes Google circle icons. Check out our <a href="https://plus.google.com/u/0/100412066008205838197">Clock page</a> and also <a href="https://plus.google.com/101502056223282249599/posts">T-Mobiles</a> page for examples.</p>
<p>Finish up here and we're all good to go.</p>
<p>As Google will politely tell you, top-right drop down switches between page and profile much like the Facebook interface. (Also here to manage other Page accounts)</p>
<p>What is great about setting up your page is that G+ provides you with great tools to get promoting. From G+ icons for your site, to your public profile link everythings ready for you. [The +1 button is a really great one for SEO so I read...]</p>
<h2>Wait, there's more</h2>
<p>A 'cherry on the icing' for page admins is a new feature that more are beginning to learn and love, and that is the <strong>Google+ Direct Connect </strong>feature. This allows a direct link to your Google+ page (and even add that page to your circles) through Google Search itself. <em>For example</em>, if you searched for the query '+youtube' or '+pepsi,' you could be immediately taken to the YouTube Google+ page, or the Pepsi Google+ page, and given the option to add the page to your circles.</p>
<p><a href="http://www.youtube.com/watch?feature=player_embedded&amp;v=NY8L_SzNr70" target="_blank">[VIDEO] Google+: Direct Connect</a></p>
<p>A final innovative feature of Google+ Pages is that you can create circles which can then be selected as the viewers of a particular post. At the moment, G+ provides ready-made circles with the titles 'VIPs', 'Customers', and 'Team members'. Naturally, this leads to a comparison with Facebook pages - so here are a few differences:</p>
<p>[As noted on <a href="http://www.crazyengineers.com/create-google-page-for-your-brand-use-direct-connect-1251/" target="_blank">Crazyengineers.com</a>]</p>
<p>1. Followers can’t post directly to the wall of a Google+ Page.
2. If a follower mentions a page in his/her update, it wont be updated on the Google+ page.
3. Followers can not start discussions, the way they do on Facebook pages
4. Google+ Page has no facility right now for a separate landing page that appeals users to add them to their circles.</p>
<h2>So</h2>
<p>That should be more than enough to get you up and running, so have fun and knock yourself out. Always on the look-out for inspiration/creativity be it images or stories so comment below and I'll be dropping the best examples in.</p>
<p>RIGHT NOW: I'm just finishing the final touches to <a href="https://plus.google.com/100412066008205838197">Clock's Google+ Page</a>, have a look how I'm doing.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></description><link>http://clock.co.uk/social-media-2/how-to-set-up-your-companys-google-profile</link><guid isPermaLink="true">http://clock.co.uk/social-media-2/how-to-set-up-your-companys-google-profile</guid><dc:creator><![CDATA[Sam Fresco]]></dc:creator><pubDate>Tue, 08 Nov 2011 13:24:10 GMT</pubDate></item><item><title><![CDATA[My Browser]]></title><description><![CDATA[<p><a href="http://blog.clock.co.uk/wp-content/uploads/2011/10/mergerbrowser.png"><img class="alignright size-full wp-image-1096" style="margin: 5px;" title="mergerbrowser" src="http://blog.clock.co.uk/wp-content/uploads/2011/10/mergerbrowser.png" alt="" width="244" height="241" /></a>About a month ago, my colleague Mike shared a fascinating read, <a href="http://lifehacker.com/5844150/browser-speed-tests-firefox-7-chrome-14-internet-explorer-9-and-more">browser speed reports on LifeHacker,</a> and in the article it overtly stated that Opera 11.51 had taken the title as speediest browser.</p>
<p>Like a lot of people I suspect, I have pretty much stuck with the same browser for a number of years; that browser being Mozilla Firefox.
On occasion, I have trialled both Opera and Chrome at various points, but never really gave either of them a real chance as I always had my trusty FF to revert back to.</p>
<p>[Although interestingly, as an Iphone user I have remained with Safari for all my mobile browsing needs, simply because I have never really had the <em>need </em>to switch.]</p>
<p>After a few "heated" discussions in the office regarding browser of choice, it became very clear that techies hold their browser choice dearly and will argue the merits of their personal set-up until every aspect has been fully exhausted.</p>
<p><strong>And this is what has got me thinking...</strong> if people really will argue the merits of other browsers so passionately, perhaps I am being too stubborn. Or perhaps it's just laziness?</p>
<p>Perhaps I should really give the other browsers a fair shot. To date, my excuses tend to be my beloved extensions that I have come to love and fear life without, namely; Firebug, Web Developer Toolbar and Screengrab - all of which, have been too good to sacrifice.</p>
<p>Admittedly, Chrome has <em>very</em> similar extensions now - and quite likely, more that I haven't even tried.</p>
<p>I guess I have always felt safe in the gold Fox's hands, but I admit that such loyalty has meant that I have missed out on the wide and varied browser experiences available; after all, variety is the spice of life!</p>
<p>Now, I believe that more than ever and I'm ready to embrace the other tools out there...</p>
<p>I am lucky enough that Clock has purchased me a brand spanking new MacBook Air (see 'Tools for the Job' section on Kos' blog post "<a href="http://blog.clock.co.uk/2011/06/24/the-web-agency-boilerplate/">The Web Agency Boilerplate</a>") and I really have reaped the rewards, having previously spent 15+ years of my life on Windows/PC set-up, I absolute adore my laptop - it has forced me to question my original working practices and social use of the computer.</p>
<p>Thus, I fundamentally believe that my perfect browser would be a pure mix of all the browsers, therefore giving me the following benefits:</p>
<ul>
<li>Speed (Opera as per the Lifehacker article)</li>
<li>Safety (Never knowingly compromised on any of them)</li>
<li>Add ons (Firefox and Chrome win for me)</li>
<li>Menu layout (all fine except IE)</li>
<li>Look and feel (Chrome and Firefox win for me)</li>
</ul>
<p>Menu layout seems an odd criteria choice you might think - but I often find myself wanting to be able to guess where the menu options will be, and to be able to get it right within a few clicks.
IE's menu layout has always infuriated me, not always finding the advanced option within a few guesses. It sounds petty, but when you spend your life on a browser these small things become big time wasters.</p>
<p>With this article in mind, I am going to try switching to Chrome for a month, then Opera and see/document what I find out.</p>
<p>Let me know your favourite browser is and why...And stay tuned to find out how I get on!</p>
]]></description><link>http://clock.co.uk/misc/my-browser</link><guid isPermaLink="true">http://clock.co.uk/misc/my-browser</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Wed, 02 Nov 2011 12:14:42 GMT</pubDate></item><item><title><![CDATA[Our blog incentive scheme]]></title><description><![CDATA[<p>At Clock we have introduced a blog incentive scheme, and I thought I'd share it with you - in case you might want to do something similar, or just in case you are interested.</p>
<p>It is a 6 monthly prize allocation system, and the prizes are worked out via the following metric:</p>
<p>The most popular blog post (by unique views for each month) gets 5 points, the second most popular gets 3 points and the third 1 point.</p>
<p>The blog post can only claim points for one month, so if it starts life in the first month in third place but gets increasingly popular as the months go by - unfortunatelty it will only get the solitary point.
We decided upon this rule as otherwise very popular posts would take the points each month and it would result in people thinking they cannot compete - we want to incentivise blogging.</p>
<h2>and so, the prizes</h2>
<p>After 6 months, the points are tallied, and in the monthly company meeting the prizes are allocated as follows:</p>
<ul>
<li>The author with the most points gets £250</li>
<li>2nd: £200</li>
<li>3rd: £150</li>
<li>4th: Bottle of wine (choice of red or white)</li>
<li>5th: Bottle of wine</li>
</ul>
<p>If multiple people have the same number of points, the prize is split accordingly... except the wine of course, which will simply result in more bottles of wine being handed out.</p>
<p>Tactics may vary, so the winner come the end of February could be someone that simply posted 2 or 3 very popular posts or it could be someone that posts every month but isn't quite seeding the posts in the right manner or perhaps leaving the marketing of the post as an organic process.</p>
<p>Do you have your own scheme? We'd love to hear what you think of ours..</p>
<p>&nbsp;</p>
]]></description><link>http://clock.co.uk/misc/our-blog-incentive-scheme</link><guid isPermaLink="true">http://clock.co.uk/misc/our-blog-incentive-scheme</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Thu, 20 Oct 2011 15:18:53 GMT</pubDate></item><item><title><![CDATA[How to interview for a Front-End Developer (and what any decent applicant should know)]]></title><description><![CDATA[<p>A friend of mine (who's just started his own digital agency) got in touch the other day to ask the question:</p>
<p>"We're interviewing for a front-end developer this week and [not being a front-ender] I was wondering if you could give me some tips on what topics we should cover?"</p>
<p>Not a problem at all, I said. Having recently been interviewing for similar positions here at Clock I knew what I would look for so it was no trouble in the slightest.</p>
<p>Afterwards it became apparent that there's not actually that much out there to help in these situations, so he suggested I write something for other people in the same situation. When I got a spare few minutes I did just that...</p>
<p>First and foremost you want to look for someone who is enthusiastic about what they do. Of course their knowledge is important but you get a real sense of how good and motivated someone is by the manner in which they talk about their profession. It's important that they'll fit into your team, and (depending on the level you are looking for) bring extra knowledge and energy to the workplace.</p>
<p>Next up it's always good to see how up-to-date their knowledge is of the front-end world. I think we can all agree the industry moves forward at a considerable rate, so it's always good to get their opinion on the state of things like <a href="http://en.wikipedia.org/wiki/HTML5">HTML5</a>, <a href="http://www.w3.org/TR/CSS/">CSS3</a> and any latest additions there might be to the working specification drafts. Also, it's no good asking questions like <em>'are you familiar with HTML5?'</em> - that's a question anyone can say yes to. You need to delve a bit deeper, ask questions that require them to show a bit of knowledge, like <em>'what's your favourite aspect of HTML5?'</em> - that's a question they actually have to answer.</p>
<p>It's always great if they can show you some work and describe what they did on it. Make sure you keep the links so you can have a look back at the code quality and structure later on. If they can't demonstrate any latest techniques such as <a href="http://www.alistapart.com/articles/responsive-web-design/">responsive / adaptive design</a>, then cover topics like <a href="http://www.w3.org/TR/css3-mediaqueries/">Media Queries</a> and how to use them, how they go about establishing suitable break-points for different screen sizes, and try and get a sense of their general opinion on cross-platform production. What can they tell you about different mobile frameworks (<a href="http://jquerymobile.com/">jQuery Mobile</a>, <a href="http://jqtouch.com/">JQ Touch</a>, <a href="http://www.kendoui.com/">Kendo UI</a>, <a href="http://spinejs.com/mobile">Spine Mobile</a> to name a few) as well? If familiar with them, what do they think are the benefits and pitfalls within the products? This level of mobile development may not be directly applicable to the position but it's always good to get a specific idea of their knowledge and passion - and who knows, they might even bring something new and unexpected to your team.</p>
<p>Unfortunately the age-old issue of IE6 still exists. Some people <a href="http://ie6funeral.com/">choose not to support it any more</a> - unfortunately some of our biggest clients still wish to continue support, so it's something we have to provide for. Even if you're lucky enough not to though, ask how your applicant would cater for older browsers. It's another question that they need to show opinion on, and it's great to hear a solution that includes JavaScript failover, or doesn't rely on JS in order to work best. The better someone is, the more they'll know about these topics, and the more they can talk about solving these problems the more they're selling themselves to you.</p>
<p>I personally enjoy it when someone starts talking about <a href="http://www.alistapart.com/articles/understandingprogressiveenhancement">progressive enhancement</a> as it then helps the conversation flow nicely into subjects like the browser market, to what extent they embellish products with CSS3, what browser tools they like to use, which is their browser of choice, and why.</p>
<p>Discussion that revolves around browsers means you can easily talk about HTML5 compatibility. Similar to when talking about IE6 support, how would the applicant get older browsers to cater for HTML5? There are a couple of different options out there - Paul Irish's <a href="http://html5boilerplate.com/">HTML5 Boilerplate</a> being a great example of a thorough, well-produced template for this kind of development. One thing I particularly like about the Boilerplate is the fantastic description of what's in there, and why. Anyone who talks me through the inner-workings of something like this, stands a great chance of getting the job.</p>
<p>The Boilerplate's developed on <a href="https://github.com/">GitHub</a>, which brings us to version control. Social coding and code control is another topic that is great for a potential employee to talk about - any knowledge about <a href="http://en.wikipedia.org/wiki/Apache_Subversion">subversion</a> or Git means that they know the importance of having continual, stable development stages that you can roll back to should it be needed. The benefits of branching a project and when it's appropriate, merging and resolving conflicts - the more they can talk about this subject matter, the better it is all round.</p>
<p>All this and not even a real mention of JavaScript yet. These days most applicants I meet tend to use <a href="http://jquery.com/">jQuery</a>, which is fine. There are other libraries out there, and it's always interesting to hear why someone might use one over another, so that's another nice topic to cover. The more they can talk about writing their own JavaScript though, the better.</p>
<p>In the last few months we've been developing using <a href="http://nodejs.org/">Node.js</a>, and one of its major benefits for front-end production is the utilisation of <a href="jade-lang.com">Jade</a> and <a href="http://learnboost.github.com/stylus/docs/js.html">Stylus</a>. Both are fantastic packages for writing efficient, well-organised and valid markup, which helps maintain high coding standards. I'm not going to go into everything they can do, but similar packages are available - and again it's great to compare the benefits of one over another - if they know more about <a href="http://lesscss.org/">Less</a> or <a href="http://sass-lang.com/">Sass</a>, for example.</p>
<p>Now I'm not saying I would expect more junior applicants to know everything I've mentioned here, but I would want to see a passion for the industry, combined with sound knowledge of some of the more basic topics covered here. Obviously the higher up the position, the more I'd want demonstrated.</p>
<p>I hope that you've found the article helpful, and if there's anything you think I've missed then feel free to add a comments below.</p>
<p>I'd be very interested to hear what you have to say - good luck recruiting!</p>
]]></description><link>http://clock.co.uk/tech-blogs/how-to-interview-for-a-front-end-developer-and-what-any-decent-applicant-should-know</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/how-to-interview-for-a-front-end-developer-and-what-any-decent-applicant-should-know</guid><dc:creator><![CDATA[Andrew Devlin]]></dc:creator><pubDate>Thu, 13 Oct 2011 09:52:33 GMT</pubDate></item><item><title><![CDATA[The sad news about Steve Jobs this morning got me thinking...]]></title><description><![CDATA[<p>Incredibly  sad news to wake up to about Steve Jobs this morning. In so many ways,  he was an inspirational figure. I guess only time will tell if he will  be as influential as Einstein in the bigger picture, but he won't be far off I think. The technology revolution will be far more wide-reaching than the  Industrial revolution was and Steve Jobs was certainly one of the pioneers of the movement. There will be a huge amount of material and  analysis on just how great he was over the next few weeks - all of which  we will no doubt agree with. In my mind, his greatest achievement was  to 1. start a culture within a business and then 2. burst this out from  the confines of his business to the broader global community. There is a  great speech you can see here:  <a href="http://www.ted.com/talks/simon_sinek_how_great_leaders_inspire_action.html">Simon Sinek: How great leaders inspire action</a>' , which when broken down - focuses on the 'Why we exist' question which underpins all companies (consciously or unconsciously in many cases). To my mind, this was essentially written with Steve Jobs in mind.</p>
<p>It  did get me thinking though....who can we compare this man to? I then  wondered if Bill Gates would get the same level of empathy and  recognition?</p>
<p>I  think we know the answer (a likely no maybe?), but I tried to  understand why. His impact on how human-kind interacts with technology  today is on a par (if not greater) than Steve Jobs. He may have 'copied'  Steve Jobs with the concept of a desktop computer, but he managed to  package the product and market it to the masses far more effectively  (until very recently of course). Anyone can have an idea, its 'how you  execute it' is something I read over-and-over again through the various  start-up community material. Lest us not forget, The Bill Gates  Foundation is the largest philanthropic organization in the world,  donating a quite mind boggling amount of money to good causes every  year. Warren Buffett (the richest man in the world) is due to give the  majority of his fortune to the Foundation once he passes away. Bill  Gates once again had to package something up, make it attractive and get  buy in from people.</p>
<p>So  in every way, it just doesn't make sense. The only conclusion I could  make is this - PR. Our perception of Steve Jobs is vastly different to  that of Bill Gates (greater good vs. capitalist I would say, I maybe  wrong). This has mainly been driven by the advertising and messaging  relating to the products we buy from his companies. Which takes me back  to my first point - the culture he created within his company truly is  greater than the sum of the parts in his products which is absolutely  incredible. There's saying "It's not what you say, it's how you say it"  and I think this applies here.</p>
<p>I'm sure this will divide opinion. Be interested to hear your thoughts - who has had the greatest impact on how we use technology today?</p>
]]></description><link>http://clock.co.uk/misc/the-sad-news-about-steve-jobs-this-morning-got-me-thinking</link><guid isPermaLink="true">http://clock.co.uk/misc/the-sad-news-about-steve-jobs-this-morning-got-me-thinking</guid><dc:creator><![CDATA[Andrew Sharland]]></dc:creator><pubDate>Thu, 06 Oct 2011 13:56:15 GMT</pubDate></item><item><title><![CDATA[Code readability: The 5 minute explanation test.]]></title><description><![CDATA[<p>As the great man, Albert Einstein, once reportedly said:</p>
<blockquote><p>"If you can't explain it simply, you don't understand it well enough."</p></blockquote>
<p>I was reading an article by Alberto Gutierrez on <a href="http://www.makinggoodsoftware.com">makinggoodsoftware.com</a> and within the article he touches upon a technique that we *sometimes-but-not-often-enough* take.</p>
<p>He explains the 5 minute explanation test, as:</p>
<ol>
<li>Grab a fellow programmer, who can spare some time, to review your code</li>
<li>Walk him through your code, just a high level introduction.</li>
<li>Ask him if he understood your code.</li>
</ol>
<p>After following the 3 steps you can evaluate how readable your code  is based on how much effort &amp; time it took you to explain it. Alberto says:</p>
<blockquote><strong>"as a rule of thumb if it takes more  than 5 minutes for the other programmer to have a high level idea of the  design, assume that the code is not readable."</strong></blockquote>
<p>A good example of the 5 minute test often occurs when the code is broken  and you seek help from colleagues (rather than presenting your most polished code). This can be a true test of your  general coding style.</p>
<p>Conducting the approach does throw up some instant (and perhaps obvious) questions.</p>
<p>1. How much commenting is overkill?</p>
<p>2. Is the code complex for complex sake, or include tricks?</p>
<p>3. How much abbreviation should be allowed?</p>
<p>4. Does it follow a set standard</p>
<p>Of course the answer to these questions is debatable, and you will find many blog posts and articles arguing the detail.</p>
<p>For us, it comes down to common sense and common ground. If people disagree and it leads to debate amongst the tech team, then that is a good thing, and provided a consensus is met - then we have progressed. We may not have the golden bullet approach (does one exist?), but it should allow for people to pick up our code and get going without too much head scratching.</p>
<p>I don't want to preach in this post, as lord knows - I have written poor  code in my past (you'd be a liar if you (are a programmer) said you  hadn't). But I found a piece of freelancer code from a long, long time ago that allows me to tackle most of the above points.</p>
<blockquote>/**</p>
<p>* Really sorry for this, I need to refactor it but I haven't got time now</p>
<p>**/</p>
<p>function reOptInCallBack($param) {</p>
<p>$urls = array(); //Create an empty array</p>
<p>for ($i = 1; $i &lt;= 5; $i++) {  //Loop 5 times</p>
<p>$urls[] = $this-&gt;getCBUrls($param); //Get CB Urls to return</p>
<p>}</p>
<p>return $urls;</p>
<p>}</p>
<p>&nbsp;</blockquote>
<p>There are so many things wrong with this code that I am not going to be able to cover them all. In an attempt to relate them to the above questions I'd say the following:</p>
<p>The first comment explaining the function is simply ridiculous. I think I'd almost rather have no comment - as it simply infuriates, rather than puts the developer at ease, as an apology.
If you don't have time, don't commit it. Or at the very least make some effort to explain what you intend to fix and change, so that I have something useful as a starting place.</p>
<p>The next comments are equally useless. Thanks for telling me what array() and "for" does! If I don't know the language constructs etc then I won't likely be trying to do something with it.
If comments are necessary then tell me why the number 5 and why you have to loop, not how the code is doing it, but why.</p>
<p>The other comment (Get CB Urls to return) - this is just repeating the function call. In fact it gives me 0 extra information.
I also detest of abbreviation like this. I can guess (although why should I have to?) that CB stands for CallBack as it is mentioned as the function name, but why not stay consistent and call it getCallBackUrls?</p>
<p>I have no idea what "re" does on reOptInCallBack, so maybe the chance to explain it would have been useful instead of the rubbish apology.</p>
<p>I could go on all day about how bad this code is. It has failed almost every question raised, the developer who wrote it certainly would have failed the 5 minute explanation test if they had run it by me (or any other self respecting coder).</p>
<p>The item that peeves me the most is the comments, and I think Ryan Campbell has a nice quote about commenting code:</p>
<blockquote>"Commenting your code is like cleaning your bathroom—you never want to  do  it, but it really does create a more pleasant experience for you and   your guests"</blockquote>
<p>This bathroom in-particular was smelly, in need of refurbishment and broken!</p>
<p>I truly believe that if we all wrote code that considered future developers our solutions would be vastly more elegant and friendly.</p>
<p>&nbsp;</p>
]]></description><link>http://clock.co.uk/tech-blogs/code-readability-the-5-minute-explanation-test</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/code-readability-the-5-minute-explanation-test</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Tue, 04 Oct 2011 10:31:18 GMT</pubDate></item><item><title><![CDATA[Getting To Grips With Social Media Marketing]]></title><description><![CDATA[<p>Starting at <a href="http://www.clock.co.uk/">Clock Limited</a> a few weeks ago, I began my voyage into the murky realms of Social Media from a professional perspective.</p>
<p>Naturally, my first handful of tweets were shaky and this was demonstrated through my initial (and unfounded) ‘nice to meet you’ tweet to what turned out to be an ex-employee.</p>
<blockquote><p>Lesson 1: don’t speak on behalf of your company, you’re only their voice.</p></blockquote>
<p>So seeking assistance, I enlisted help from Clock’s friends over at <a href="http://www.gloople.co.uk/">Gloople</a> (@Gloople) who have been doing fantastically from their online presence and social media use.</p>
<p>Their MD and co-founder, <a href="http://www.warrenknight.co.uk/">Warren Knight</a> (@wvknight), let me sit in on a client demonstration so I could grasp the ‘end game’ of what their online marketing efforts would eventually lead towards. He then took me in to the conference room and unleashed a whirlwind of handouts, links, tips and secrets for becoming a great social-media marketeer.</p>
<p>Firstly, it became quite clear how important grasping the concept of social media is – which not everyone does. Utilised in the proper fashion, the online space can provide an opportunity to generate excitement, interest and ultimately; engagement. It’s that ‘online buzz’ that we’re striving for and the secrets lie somewhere between good monitoring, relevance, quality of content and knowledge of the industry in question.</p>
<p><strong>So far all pretty obvious right?</strong> That’s what I thought - but the complicated part comes in bridging that gap between a Facebook ‘like’ or a retweet and recruiting a shiny, talented new web developer or attracting that all-important interest from a prospective client. In this respect, using social media in a professional capacity is comparable to incepting an idea; it’s putting yourself (your company) on show for the world; showing what excites you, what you’re up to and what interests you and ‘hoping’/dropping the right SEO keywords, to be found at the right times by the right people. Currently, there is an abundance of information about ‘how’ to twitter <em>effectively</em> and it seems that every average Joe and his dog has become an expert from just a year or so of experience. But the reality is that it’s such a fresh and rapidly evolving channel that there really are no professionals and physically can’t be for some years to come.</p>
<p style="text-align: left">Nevertheless, there are those 'better' and those 'worse'; and my lesson was coming from a man with ten-thousand-something followers blowing my four-hundred-something out the water quite significantly. Crucially it became apparent that effective web monitoring is half the battle, the other half being publishing new tweets/posts/blogs that are vital to the maintenance of a healthy online profile. And this is what stumps a vast amount of users – <em>what</em> to say. Because posting doesn’t have to be what you had for breakfast, it can (and should) be used for initiating an age-old art; conversation.</p>
<p>For example, here at Clock we are establishing ourselves as a go-to agency for the new technology, <strong>Node.js</strong>, after our successful work for The Sun with Sunperks.com. So after promoting the link on the day of launch, the activity on our feed naturally died down. What’s important here is continuing the ‘buzz’ – so good monitoring of tweets mentioning ‘#node’ involved opening the floor for a polite introduction such as:</p>
<blockquote>‘Hey – great to see you’re using #node too! We’ve just built Sunperks.com with it and are really pleased with the results. How are you finding it?’</blockquote>
<p>Yes this response infringes on overly-friendly and treads on the tip toes of self-promo territory. But critically it achieves two things; it gets us out and about whilst initiating a relevant conversation in front of the world, an ‘in-it-to-win-it’ approach. Thus, if this technique is applied to monitoring and then escalating a handful of concepts we specialise in to a conversation, suddenly the workload increases tremendously.(Although naturally it’s important to bear in mind the balance between being courageously ‘in-it-to-win-it’ and annoying).</p>
<p><strong>Overall</strong>, the introduction opened my eyes to aspects of social media I usually glaze over. It highlighted the importance of keeping organised with simple tools such as spreadsheets and weekly/monthly strategies to ensure you’re marketing with social media effectively. There is a lot that can be done in the social media world and it’s on the verge of its boom (if you argue it hasn’t already). So it’s an exciting time to push the boundaries and see what can happen, particularly as there are <em>no experts</em>.</p>
<p>Looking forward to hear your thoughts,</p>
<p>- Sam.</p>
<p><sub> </sub></p>
<p>&nbsp;</p>
]]></description><link>http://clock.co.uk/misc/getting-to-grips-with-social-media-marketing</link><guid isPermaLink="true">http://clock.co.uk/misc/getting-to-grips-with-social-media-marketing</guid><dc:creator><![CDATA[Sam Fresco]]></dc:creator><pubDate>Wed, 28 Sep 2011 15:46:36 GMT</pubDate></item><item><title><![CDATA[Deleting a git commit]]></title><description><![CDATA[<p>When working with Git you will find that sometimes commits need to be removed as they have introduced a bug or need to be reworked.</p>
<p>If it is the last commit this is very straight forward. Simply run:</p>
<p><code>git reset HEAD</code></p>
<p>This will pop off the latest commit but leave all of your changes to the files intact.</p>
<p>If you need to delete more than just the last commit there are two methods you can use. The first is using <strong>rebase</strong> this will allow you to remove one or more consecutive commits the other is <strong>cherry-pick</strong> which allows you to remove non consecutive commits.</p>
<h2>Example git log</h2>
<table class="data-entity" border="0" cellspacing="0" cellpadding="0" width="682" height="130">
<tbody>
<tr>
<th width="68">Number</th>
<th width="74">Hash</th>
<th width="366">Commit Message</th>
<th width="108">Author</th>
</tr>
<tr>
<td width="68" valign="middle">1</td>
<td width="74" valign="middle">2c6a45b</td>
<td width="366" valign="middle">(HEAD) Adding public method to access protected method</td>
<td width="108" valign="middle">Tom</td>
</tr>
<tr>
<td width="68" valign="middle">2</td>
<td width="74" valign="middle">ae45fab</td>
<td width="366" valign="top">Updates to database interface</td>
<td width="108" valign="top">Contractor 1</td>
</tr>
<tr>
<td width="68" valign="top">3</td>
<td width="74" valign="top">77b9b82</td>
<td width="366" valign="top">Improving database interface</td>
<td width="108" valign="top">Contractor 2</td>
</tr>
<tr>
<td width="68" valign="top">4</td>
<td width="74" valign="top">3c9093c</td>
<td width="366" valign="top">Merged develop branch into master</td>
<td width="108" valign="top">Tom</td>
</tr>
<tr>
<td width="68" valign="top">5</td>
<td width="74" valign="top">b3d92c5</td>
<td width="366" valign="top">Adding new Event CMS Module</td>
<td width="108" valign="top">Paul</td>
</tr>
<tr>
<td width="68" valign="top">6</td>
<td width="74" valign="top">7feddbb</td>
<td width="366" valign="top">Adding CMS class and files</td>
<td width="108" valign="top">Tom</td>
</tr>
<tr>
<td width="68" valign="top">7</td>
<td width="74" valign="top">a809379</td>
<td width="366" valign="top">Adding project to Git</td>
<td width="108" valign="top">Tom</td>
</tr>
</tbody>
</table>
<h2>Using Rebase</h2>
<p>Using the git log above we want to remove the following commits; 2 &amp; 3 (ae45fab &amp; 77b9b82). As they are consecutive commits we can use rebase.</p>
<p><code>git rebase --onto &lt;branch name&gt;~&lt;first commit number to remove&gt; &lt;branch name&gt;~&lt;first commit to be kept&gt; &lt;branch name&gt;</code></p>
<p>e.g to remove commits 2 &amp; 3 above</p>
<p><code>git rebase --onto repair~3 repair~1 repair</code></p>
<h2>Using Cherry Pick</h2>
<p><strong>Step 1:</strong> Find the commit before the commit you want to remove
<code>git log</code></p>
<p><strong>Step 2: </strong>Checkout that commit
<code>git checkout &lt;commit hash&gt;</code></p>
<p><strong>Step 3: </strong>Make a new branch using your current checkout commit
<code>git checkout -b &lt;new branch&gt;</code></p>
<p><strong>Step 4:</strong> Now you need to add the commit after the removed commit
<code>git cherry-pick &lt;commit hash&gt;</code></p>
<p><strong>Step 5:</strong> Now repeat Step 4 for all other commits you want to keep.</p>
<p><strong>Step 6:</strong> Once all commits have been added to your new branch and have been commited. Check that everything is in the correct state and working as intended. Double check everything has been commited:
<code>git status</code></p>
<p><strong>Step 7:</strong> Switch to your broken branch
<code>git checkout &lt;broken branch&gt;</code></p>
<p><strong>Step 8:</strong> Now perform a hard reset on the broken branch to the commit prior to the one your want to remove
<code>git reset --hard &lt;commit hash&gt;</code></p>
<p><strong>Step 9:</strong> Merge your fixed branch into this branch
<code>git merge &lt;branch name&gt;</code></p>
<p><strong>Step 10:</strong> Push the merged changes back to origin.
<strong>WARNING: This will overwrite the remote repo!</strong>
<code>git push --force origin &lt;branch name&gt;</code></p>
<p>You can do the process without creating a new branch by replacing <strong>Step 2 &amp; 3</strong> with <strong>Step 8</strong> then not carry out <strong>Step 7 &amp; 9.</strong></p>
<h3><strong>Example</strong></h3>
<p>Say we want to remove commits 2 &amp; 4 from the repo.</p>
<ol>
<li><code>git checkout b3d92c5</code> Checkout the last usable commit.</li>
<li><code>git checkout -b repair</code> Create a new branch to work on.</li>
<li><code>git cherry-pick 77b9b82</code> Run through commit 3.</li>
<li><code>git cherry-pick 2c6a45b</code> Run through commit 1.</li>
<li><code>git checkout master</code> Checkout master.</li>
<li><code>git reset --hard b3d92c5</code> Reset master to last usable commit.</li>
<li><code>git merge repair</code> Merge our new branch onto master.</li>
<li><code>git push --hard origin master</code> Push master to the remote repo.</li>
</ol>
<h2>Final note</h2>
<p><strong>Git rebase &amp; cherrypick</strong> are dangerous but powerful solutions that should only be used as a last option and only be undertaken by someone who knows what they are doing.  Beware that both solutions could have adverse effects on other users who are working on the same repository / branch.</p>
<p>Finally remember to be careful and good luck!</p>
]]></description><link>http://clock.co.uk/tech-blogs/deleting-a-git-commit</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/deleting-a-git-commit</guid><dc:creator><![CDATA[Tom Smith]]></dc:creator><pubDate>Fri, 09 Sep 2011 12:32:11 GMT</pubDate></item><item><title><![CDATA[Basics: Always send urls]]></title><description><![CDATA[<p>As a rule of thumb we should ensure that we always send URLs to clients / friend / co-workers when instructing them to do something on a website.</p>
<p>Relying on others to know what is meant by 'staging version', 'live version', 'account section', 'sign-up' page is thwart with danger and room for misinterpretation.</p>
<p>Emails like this should be avoided:</p>
<pre>Hi Jo

We've fixed the account page on testing. Can you check it for me?

Regards

Clocker</pre>

I think the following is better:
<pre>Hi Jo

We have added Age and Address to the Account page:

http://testing.dangler.com/account/

Please check and confirm you are happy.

Regards

Clocker</pre>
<p>More on how to write better emails:</p>
<ul>
<li><a href="http://thinksimplenow.com/productivity/15-tips-for-writing-effective-email/">15 Tips for writing effective emails</a></li>
<li><a href="http://iii.bobulate.com/2007/11/second-chance-for-a-last-impression/">Closing Lines</a></li>
</ul>

]]></description><link>http://clock.co.uk/tech-blogs/basics-always-send-urls</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/basics-always-send-urls</guid><dc:creator><![CDATA[Paul Serby]]></dc:creator><pubDate>Mon, 05 Sep 2011 21:17:35 GMT</pubDate></item><item><title><![CDATA[Why you should be using VERP (Variable Envelope Return Path)]]></title><description><![CDATA[<p>You may not have heard of VERP, but it is very important that you find out whether your email campaign software/service uses it.</p>
<p>Variable Envelope Return Path or "VERP" is a technique to enable automatic detection and removal of undeliverable e-mail addresses.</p>
<p>I have previously used email campaign software (mentioning no names) whereby VERP was not utilised.</p>
<p>Let me give you a scenario to highlight why you need to check VERP is being used..</p>
<p>Say you have a newsletter sign-up box on a site. 100 people sign-up but 99 of them are invalid; people move companies, change email addresses, give fake addresses etc all the time (especially if the email address is not validated).
You create and send your email campaign (with a system not using VERP or equivalent) to the theoretical 100 people (actually only 1 person will ever receive it).
That loyal user actually views/reads/clicks the email you sent - you check your campaign stats and it says your email campaign reach was 1% - very disappointing.</p>
<p>If the system used VERP that reach would be accurate and report a 100% reach.. as it has taken into account the Users that never existed (or no longer exist).</p>
<p>On top of this, the next time the campaign is sent, it will only send to the subscribed members (1 person) rather than not learning and resending to the 99 non-existent people.</p>
<p>It sounds obvious but not all email campaign web sites/tools use VERP.</p>
<h2>So how does it work?</h2>
<p>VERP works by using a different return path (also called "envelope sender") for each recipient of a message.
If a *permanent* bounce is received by that unique return path then the system knows it can automatically un-subscribe that user from the list.</p>
<p>Note: It is important to distinguish a permanent bounce from a temporary bounce (out of office, over quota etc).</p>
<p>Example:</p>
<blockquote><p>Email Sent:</p>
<p>Recipient: joe.bloggs@example.com
Envelope Sender: 12345-joe.bloggs@example.com</p>
<p>Bounce Recieved:</p>
<p>Recipient: 12345-joe.bloggs@example.com
Message: Example.com was not able to deliver this email as the recipient joe.bloggs@example.com does not exist.</p>
<p>[joe.bloggs@example.com is unsubscribed from mailing lists, and is no longer sent emails from said software]</p></blockquote>
<p>&nbsp;</p>
<p>At Clock we built an online email and SMS campaign website a number of years ago, called <a title="Clock Up" href="https://www.clockup.co.uk/" target="_blank">ClockUp</a> and we made sure we utilised VERP from the very beginning, we realised during development that the stats we provided to our clients without using VERP would be very wrong.</p>
<p>There are a number of good email campaign sites out there; MailChimp, DotMailer, CampaignMonitor to name a few, I believe they use VERP (or a similar method).. whatever you use, it's worth checking.</p>
]]></description><link>http://clock.co.uk/tech-blogs/why-you-should-be-using-verp-variable-envelope-return-path</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/why-you-should-be-using-verp-variable-envelope-return-path</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Thu, 01 Sep 2011 09:39:38 GMT</pubDate></item><item><title><![CDATA[Using 'Commuting Time' Summary]]></title><description><![CDATA[<p><strong>So what have I learnt from trying to better use my commuting time?</strong></p>
<p>I have learnt that despite limitations, you can actually achieve a fair amount during driving to and from work (or by train).</p>
<p>I found the best use of my time was split into the following sectors:</p>
<h2>- Creative ideas</h2>
<p>I would say that this was the easiest way to spend my time.
Using the free uninterrupted time really allowed my creative juices to get flowing and come up various ideas.. some of which I hope to take forward and build upon (including an idea for my first iPhone/mobile App)</p>
<p>As a result of the things I have thought about, I have forced myself to learn how to:</p>
<ul>
<li>Produce and format a podcast suitable for iTunes</li>
<li>Picked up and starting learning how to build apps via Appcelerator</li>
<li>Enhance my knowledge (and use of) of Spreadsheets</li>
</ul>
<h2>- Experimentation</h2>
<p>During my first few weeks trialling this new 'utilise my commuting time' experiment, I learnt an awful lot about which iPhone apps worked well and which weren't worth using (whilst driving).</p>
<p><strong>Good apps:</strong>
Voice memos  (really useful, but if like me - you hate the sound of your own voice, cringy to play-back!)
iPadio (fantastic for recording phone calls and broadcasting)
Skobbler Lite (a great, free alternative to paid sat navs - and even more promising is the 'Open Street Map' platform Skobbler is built on)
TED (audio and video presentations on a variety of subjects)</p>
<p><strong>Not so-great, apps:</strong></p>
<p>Dragon Dictation and other voice dictation apps (not found anything useful yet)</p>
<h2>- Extending the working day</h2>
<p>You can achieve quite a lot of work when not distracted, and it is rare to find a time whereby you don't find yourself isolated with no-one in eyesight (like remote working from home can be) and yet able to achieve work tasks completely undisturbed (like scribing emails, making and receiving calls, ideas for projects/clients etc)</p>
<p>&nbsp;</p>
<p><em><strong>If you have a suggestion for how to best use commuting time, I'd love to hear it...</strong></em></p>
]]></description><link>http://clock.co.uk/travel/using-commuting-time-summary</link><guid isPermaLink="true">http://clock.co.uk/travel/using-commuting-time-summary</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Wed, 17 Aug 2011 09:24:47 GMT</pubDate></item><item><title><![CDATA[Using Commuting Time: Week 3 – Interview with Syd Nadim, Skobbler and more]]></title><description><![CDATA[<p>To recap, I am on a voyage of discovery - learning how to maximise my commuting time.</p>
<p>In the last few weeks<a title="Using Commuting Time: Week 1 – Interview with Dave Birss, iphone apps and more" href="http://blog.clock.co.uk/2011/07/04/using-commuting-time-week-1-interview-with-dave-birss-iphone-apps-and-more/"></a>, I have discovered:</p>
<ul>
<li><em><strong>Learning #1 </strong></em><em><strong>Just because a Google search doesn’t yield results after 10 or so searches, does not mean it doesn’t exist.</strong></em></li>
<li><em><strong>Learning #2 Dragon Dictation is not adequate for writing emails.. must find other useful voice controlled apps.</strong></em></li>
<li><em><strong>Learning #3 You might not succeed in the  ventures  you  undertake, but as long as you take something from that  experience,   you'll have gained.</strong></em></li>
<li><em><strong>Learning #4 Anything is possible, and whilst it  may be  unlikely that  you'll know how far the idea will spread, you  might be  surprised (e.g  Dave's street poetry and Custom t-shirt ideas)</strong></em><em><strong></strong></em></li>
<li><em><strong>Learning #5 - You can use commuting time to track and record data using voice memos (it's rudimentary - but doable)</strong></em><em><strong></strong></em></li>
<li><em><strong>Learning #6 - Self help tapes are perfect for commuting  time - learning a new language would be a fantastic use of commuting  time</strong></em></li>
</ul>
<p>This week I interviewed Clock's CEO Syd Nadim and this is what he had to say:</p>
<p>[audio src="http://blog.clock.co.uk/wp-content/uploads/2011/07/CommutingPodcast3-SydNadim_20110715080038.mp3"]</p>
<p>Alternatively, listen via ipadio or itunes:</p>
<p><a href="http://www.ipadio.com/phlogs/RobArnold">http://www.ipadio.com/phlogs/RobArnold</a></p>
<p><a href="http://itunes.apple.com/gb/podcast/commuting-podcast/id447751425">http://itunes.apple.com/gb/podcast/commuting-podcast/id447751425</a></p>
<p>I really enjoyed what he had to say, and a completely different use of time from the other 2 interviewees; Dave Birss and Vincent Iweka.</p>
<p>Syd likes to use the time to catch up with phone calls to friends, and where possible watch TED videos on the train - as well as immersing himself in current affairs. I too love TED videos, and have previously listened to the audio tracks via my iphone. One annoying thing about the audio is that sometimes the TED speaker references diagrams and infograms which is totally lost on a listener, but TED is a perfect application for Train commutes.</p>
<ul>
<li><em><strong>Learning #7 TED and other interesting lecture sites can be the perfect antidote to a long commute (rather than the seemingly repetitive radio stations)</strong></em></li>
</ul>
<p>I do believe that following this interview, I should take a leaf out of "Syd's book" and use the time to catch up with more people (maybe even interview them?!).</p>
<p>The other task I set myself this week was to review another app, and a perfect candidate seemed to be <a href="http://www.skobbler.us/">Skobbler (Satellite Navigation)
</a></p>
<p>For a free app, it is absolutely fantastic - the team have done a really good job. I used to have a Tom Tom until it broke, and I was really impressed with how this free application compares. The GUI is easy to use, and more importantly it hasn't let me down with directions (yet). I thoroughly recommend it.</p>
<ul>
<li><em><strong>Learning #8 Skobbler (on the iPhone) really is a suitable alternative to other paid sat nav products
</strong></em></li>
</ul>
<p>On top of this, I believe it has opened my eyes to the <a href="http://wiki.openstreetmap.org/wiki/Main_Page">OpenStreetMap project </a>which I believe could be very useful for future web site and app developments.</p>
<p>If you have any apps that you think would be a good thing to use during commuting time, please get in contact (using comments below).</p>
<p>More interviews, learnings and ideas in a couple of weeks :)</p>
]]></description><link>http://clock.co.uk/travel/using-commuting-time-week-3-–-interview-with-syd-nadim-skobbler-and-more</link><guid isPermaLink="true">http://clock.co.uk/travel/using-commuting-time-week-3-–-interview-with-syd-nadim-skobbler-and-more</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Fri, 15 Jul 2011 14:05:26 GMT</pubDate></item><item><title><![CDATA[My Stylus Mixin for CSS3 Linear Gradients in Node]]></title><description><![CDATA[<p>I've been getting my hands dirty with more Node development recently, and one of the best parts of it as a front-end developer is the utilisation of Stylus.</p>
<p>Stylus, combined with Jade speeds up my output so much. I love the cleanliness of the markup (well, what markup there is) - it's clean, efficient and most importantly, quick once you get your head around it.</p>
<p>I won't go into too much detail about what Mixins are (you can <a href="http://learnboost.github.com/stylus/">find out all about that on GitHub</a>), but one of the things I have found them most useful for is; browser vendor prefixes. As someone who uses TextMate, I use my colleague JackBB's <a href="https://github.com/jackbb/CSSVendorPrefixes-JackBB.tmbundle">excellent bundle</a> to write styles quickly (<a href="https://github.com/jackbb/">he's made a couple</a> that are worth a look), and one of the best things about that is tab-completion of my browser prefixes. With the immediate shorthand he's got going on I end up something like the following:</p>
<pre>border-radius 5px 5px 5px 5px</pre>

And with a quick hit of the dash key, followed by Tab, I get:
<pre>-webkit-border-radius 5px 5px 5px 5px
-moz-border-radius 5px 5px 5px 5px
-ms-border-radius 5px 5px 5px 5px
-o-border-radius 5px 5px 5px 5px
border-radius 5px 5px 5px 5px</pre>

Add this as a Stylus Mixin and by writing 'border-radius 5px' anywhere in the site, my Mixin handles the rest. It's great for all the progressive enhancement we want adding to our site. Lean, efficient CSS3 markup - so far, so good.

Until I wanted to do the same thing with CSS gradients.

Creating a new Mixin in the same format as my others would give:
<pre>vendor(prop, args)
	-webkit-{prop} args
	-moz-{prop} args
	-ms-{prop} args
	-o-{prop} args
	{prop} args

border-radius()
	vendor('border-radius', arguments)

background-image()
	vendor('background-image', arguments)</pre>

The problem is that a CSS gradient is a declaration within the background-image property, and I obviously didn't want my Mixin to have any affect on the other background-image styles on the site. If I left it like this, any background-image reference in my Stylus files would create vendor-prefixed versions, which I didn't want.

So, I created a new Mixin called 'background-linear-gradient' and I wanted to be able to control as many properties as possible from wherever I actually write my style. I wanted to provide fallback for older browsers that don't support CSS gradients, as well as making it suitable for all modern browsers. The Webkit announcement that they now opt for the Gecko syntax makes this easier as it's not totally necessary to provide alternative syntax for these browsers. This is what I came up with:
<pre>background-linear-gradient(startPoint, startColor, startInterval, endColor, endInterval)
	background-color startColor
	background-image -webkit-linear-gradient(startPoint, startColor startInterval, endColor endInterval)
	background-image -moz-linear-gradient(startPoint, startColor startInterval, endColor endInterval)
	background-image -ms-linear-gradient(startPoint, startColor startInterval, endColor endInterval)
	background-image -o-linear-gradient(startPoint, startColor startInterval, endColor endInterval)
	background-image linear-gradient(startPoint, startColor startInterval, endColor endInterval)</pre>

And this is the style declaration in my Stylus file:
<pre>background-linear-gradient(top, #FFFFFF, 45%, #000000, 55%)</pre>

After testing in Firefox, Chrome, Opera and IE10 I was happy. Then I checked it in Safari…and it wasn't working.

Unfortunately Safari 5.1 hasn't been released yet, meaning that my Safari 5.0.5 still requires the old Webkit syntax for gradients. I want it to work in the latest versions of Safari, so I decided to tweak my Mixin to allow additional support for optional deprecated Webkit syntax:
<pre>background-linear-gradient(startPoint, startColor, startInterval, endColor, endInterval, deprecatedWebkitStartPoint = false, deprecatedWebkitEndPoint = false)
	background-color startColor
	if deprecatedWebkitStartPoint &amp;&amp; deprecatedWebkitEndPoint
		background-image -webkit-gradient(linear, deprecatedWebkitStartPoint, deprecatedWebkitEndPoint, color-stop(startInterval, startColor), color-stop(endInterval, endColor))
	background-image -webkit-linear-gradient(startPoint, startColor startInterval, endColor endInterval)
	background-image -moz-linear-gradient(startPoint, startColor startInterval, endColor endInterval)
	background-image -ms-linear-gradient(startPoint, startColor startInterval, endColor endInterval)
	background-image -o-linear-gradient(startPoint, startColor startInterval, endColor endInterval)
	background-image linear-gradient(startPoint, startColor startInterval, endColor endInterval)</pre>

By utilising the Stylus logic within my Mixin, I can state that if no values are set for my Webkit-specific start and end points, then I don't want the old syntax output in my Stylus file. Therefore when I declare my style, I can either stick to:
<pre>background-linear-gradient(top, #FFFFFF, 45%, #000000, 55%)</pre>

Whereby all CSS gradient-enabled versions of Safari below 5.1 will fall back to my plain startColor value, or I can add the extra parameters in:
<pre>background-linear-gradient(top, #FFFFFF, 45%, #000000, 55%, left top, left bottom)</pre>
<p>And we now have full control over the gradients in older compatible browsers, as well as the most modern versions too.</p>
<p>So there we have it - a nice easy-to-use Mixin for the linear gradients you may want to use within your Stylus / Node / Other (delete as appropriate) projects. TJ Holowaychuk has also written an <a href="https://github.com/visionmedia/nib">excellent extension to Stylus</a> which does something similar - but for what I wanted, Nib seemed like quite a few extra files to add to my site, when I really just wanted to use a few lines of code to achieve my objective in this case.</p>
]]></description><link>http://clock.co.uk/tech-blogs/my-stylus-mixin-for-css3-linear-gradients-in-node</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/my-stylus-mixin-for-css3-linear-gradients-in-node</guid><dc:creator><![CDATA[Andrew Devlin]]></dc:creator><pubDate>Thu, 14 Jul 2011 11:15:27 GMT</pubDate></item><item><title><![CDATA[Using Commuting Time: Week 2 – Interview with Vincent Iweka, bad drivers and more]]></title><description><![CDATA[<p>To recap, I am on a voyage of discovery - learning how to maximise my commuting time.</p>
<p><a title="Using Commuting Time: Week 1 – Interview with Dave Birss, iphone apps and more" href="http://blog.clock.co.uk/2011/07/04/using-commuting-time-week-1-interview-with-dave-birss-iphone-apps-and-more/">Last week</a> I discovered:</p>
<ul>
<li><em><strong>Learning #1 </strong></em><em><strong>Just because a Google search doesn’t yield results after 10 or so searches, does not mean it doesn’t exist.</strong></em></li>
<li><em><strong>Learning #2 Dragon Dictation is not adequate for writing emails.. must find other useful voice controlled apps.</strong></em></li>
<li><em><strong>Learning #3 You might not succeed in the  ventures  you undertake, but as long as you take something from that  experience,  you'll have gained.</strong></em></li>
<li><em><strong>Learning #4 Anything is possible, and whilst it  may be unlikely that  you'll know how far the idea will spread, you  might be surprised (e.g  Dave's street poetry and Custom t-shirt ideas)</strong></em></li>
</ul>
<p>This week, I tried a new experiment; to capture information whilst I was driving. I had noticed just how bad and annoying people's driving habits had become, so I decided I wanted to drill a bit deeper and find out who seemed to be the main culprits... I fired up voice memos on my iPhone once more, and started tracking the offenders. You can see the results and details on my <a href="http://arniie.wordpress.com/2011/07/07/and-the-worst-drivers-car-of-choice-is/">personal blog</a></p>
<p>Suffice to say, Black Vauxhalls are surprisingly the car of choice for annoying drivers!</p>
<p><em><strong>Learning #5 - You can use commuting time to track and record data using voice memos (it's rudimentary - but doable)</strong></em></p>
<p>This week I was due to interview my CEO Syd Nadim, but at short notice I had to switch to another colleague Vincent Iweka.
Vincent kindly agreed to the interview - and it was interesting to hear his views considering his commute was a drive between 2 and 3 hours a day, unfortunately he was hung-over from a Channel 4 meetup the night before! - but he had some good insight and he had great idea for how to use the travelling time:</p>
<p>[audio src="http://blog.clock.co.uk/wp-content/uploads/2011/07/CommutingPodcast2-VincentIweka_20110708082338.mp3"]</p>
<p>Alternatively, listen via ipadio or itunes:</p>
<p><a href="http://www.ipadio.com/phlogs/RobArnold">http://www.ipadio.com/phlogs/RobArnold</a></p>
<p><a href="http://itunes.apple.com/gb/podcast/commuting-podcast/id447751425">http://itunes.apple.com/gb/podcast/commuting-podcast/id447751425</a></p>
<p><em><strong>Learning #6 - Self help tapes are perfect for commuting time - learning a new language would be a fantastic use of commuting time</strong></em></p>
<p>Next week, I will be interviewing Syd Nadim and trying a few more ideas.</p>
]]></description><link>http://clock.co.uk/travel/using-commuting-time-week-2-–-interview-with-vincent-iweka-bad-drivers-and-more</link><guid isPermaLink="true">http://clock.co.uk/travel/using-commuting-time-week-2-–-interview-with-vincent-iweka-bad-drivers-and-more</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Fri, 08 Jul 2011 14:07:19 GMT</pubDate></item><item><title><![CDATA[Using Commuting Time: Week 1 - Interview with Dave Birss, iphone apps and more]]></title><description><![CDATA[<p>So... Following on from my quest to <a title="Utilising Dead Commuting Time" href="http://blog.clock.co.uk/2011/06/23/utilising-dead-commuting-time/" target="_blank">utilise my commuting time</a>.<a href="http://blog.clock.co.uk/wp-content/uploads/2011/07/CommutingPodcast.gif"><img class="alignright size-medium wp-image-895" title="CommutingPodcast" src="http://blog.clock.co.uk/wp-content/uploads/2011/07/CommutingPodcast-300x204.gif" alt="" width="300" height="204" /></a></p>
<p>That evening on my drive home, I fired up voice memos on my iPhone and recorded my first thoughts:</p>
<p>[audio src="http://blog.clock.co.uk/wp-content/uploads/2011/06/20110623-180655.mp3"]</p>
<p>Apologies for the repetition, I am driving (you can even hear me indicating!) but hopefully you got the idea... the initial task I set myself was to work out what I can do with commuting time,  first off I wanted to phone interview (whilst commuting) a few colleagues and ask their opinion about it.</p>
<p>So, when I arrived home I started looking for an iphone app for recording conversations....</p>
<p><em><strong>Learning #1 - Just because a Google search doesn't yield results after 10 or so searches, does not mean it doesn't exist.</strong></em></p>
<p>This lesson came about as I did a good hour or so of searching for apps that record phone calls and I simply couldn't find what I was looking for, in fact I was about to blog this:</p>
<blockquote><p><em>....Oh my gosh, Despite Apple's slogan "There's even an app for that" ... there wasn't! or more precisely there isn't a good one for it!</em>
<em> I tried multiple, and they either simply didn't work, were US only, or were subscription model based which didn't appeal to me.</em></p>
<p><em>So <strong>Learning #1</strong>: <strong>Building a decent phone call recorder for an iPhone might be profitable!</strong></em></p>
<p><em> </em></p></blockquote>
<p><em> </em>
<em> The next morning on my way to work I dictated an email </em><em>via an iPhone app 'Dragon Dictation' which was useless (<a href="http://arniie.wordpress.com/2010/08/12/speech-two-tech-dictation/" target="_blank">but then I already knew that!</a>) </em><em>to Dave Birss and Syd Nadim asking them if they would like to be involved in an podcast interview. </em></p>
<p><em><strong>Learning #2 Dragon Dictation is not adequate for writing emails.. must find other useful voice controlled apps.
</strong></em></p>
<p><em><strong>
</strong></em></p>
<p>After a failed recording of an interview with <a href="http://davebirss.wordpress.com/">Dave Birss</a>, I realised it wasn't sufficient or practical to try recording via a laptop in the car.</p>
<p>A few days later, after sitting with Dave and explaining the problem, he promptly fired up Google and searched for an app, and lo-and-behold the first search yielded a decent result.. ipadio.</p>
<p>It did exactly what I wanted (hence the life learning #1), so, on second attempt to interview Dave I managed to record my first ever podcast interview:</p>
<p><em>I apologise for my voice! As you will hear Dave has very melodic tones and is very soothing to listen to - in contrast I am driving, unaware of my volume and not well practised at sound recordings!</em></p>
<p>[audio src="http://blog.clock.co.uk/wp-content/uploads/2011/07/CommutingPodcast1-DaveBirss_20110630180051.mp3"]</p>
<p>Alternatively, listen via ipadio:</p>
<p><a href="http://www.ipadio.com/phlogs/RobArnold/2011/6/30/Commuting-Podcast-1--Dave-Birss">http://www.ipadio.com/phlogs/RobArnold/2011/6/30/Commuting-Podcast-1--Dave-Birss</a> (<a href="http://www.ipadio.com/channels/7ebe06c15e63/rss">Subscribe to podcast RSS</a>)</p>
<p>(Podcast soon to be available on iTunes too)</p>
<p>As you can hear, Dave is a very inspirational figure (and modest about it) - The ventures that he has pursued as a result of maximising his commuting time was exactly the kind of ammunition I was looking for.</p>
<p><em><strong>Learning #3 You might not succeed in the ventures you undertake, but as long as you take something from that experience you'll have gained.</strong></em></p>
<p><em><strong>Learning #4 Anything is possible, and whilst it may be unlikely that you'll know how far the idea will spread, you might be surprised (e.g Dave's street poetry and Custom t-shirt ideas)
</strong></em></p>
<p>Week 2 coming soon!</p>
<p>&nbsp;</p>
]]></description><link>http://clock.co.uk/travel/using-commuting-time-week-1---interview-with-dave-birss-iphone-apps-and-more</link><guid isPermaLink="true">http://clock.co.uk/travel/using-commuting-time-week-1---interview-with-dave-birss-iphone-apps-and-more</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Mon, 04 Jul 2011 09:04:57 GMT</pubDate></item><item><title><![CDATA[The Web Agency Boilerplate]]></title><description><![CDATA[<p>You know what we love in web agencies?...Templates. Boilerplates. Frameworks. Basically stuff that allows us to save time because someone else has done some thinking. I have spent 15 years in 4 agencies across 2 countries, and have noticed one thing in all of these agencies. Basic stuff missing. It's nobody's fault really, it's just people get caught up in doing work and basic stuff just goes missing. It's always the same basic stuff too, weirdly enough. So I have decided to plop on my thinking hat, wear my mojo goggles, put my game face on...and create a boilerplate checklist for agencies - an intellectual white paper if you will, on the subject of efficiency in agencies. So if you are about to start one, already have one, or think you might have one someday...here is a template to follow that might very well save you a headache or two. Perhaps three.</p>
<h3><strong>Tools for the Job</strong></h3>
<p>Buy your staff great up-to-date computers, monitors and software. Use them yourself. I have seen an agency skimp on monitors to save money and have people starting at screens trying to figure out what colour they were using. I have seen a designer working on a 7 year old PC that forced him to wait 3 seconds between each keystroke press. Just nonsense. Don't skimp on the tools, they are what get the job done.</p>
<h3>Whiteboards</h3>
<p>Empty walls are a waste of space. There is no such thing as too many whiteboards. Get boards up, places to scribble, plan and discuss. You won't regret it.</p>
<h3><strong>A Project Plan on the Wall</strong></h3>
<p>List all your running projects, your resources and tasks in a calendar with deadlines, milestones and resource usage. Put it on the wall where everyone can see it. Look at it every day. It will stop you from doing silly things (I promise!)</p>
<h3>The Testing Panel</h3>
<p>Get a cheap PC, Linux machine and Mac and put then next to each other on a spare table or panel. Install every OS version, browser and browser version that you think your work needs to be tested on. Leave those computers as test computers for people to test their sites on - and do nothing else with them. It will stop designers running to each others computers trying to find out who has the latest version of IE installed on it to test their site on. Alternatively...as I have just been pointed out...have VMs running on everyone's machine that successfully emulates each OS and browser combo to be tested.</p>
<h3>Hire PMs/Account Managers</h3>
<p>Do not have designers and developers liaising with clients. Leave the production staff to do production and hire other people to be project/account managers.</p>
<h3>Set a Training Budget</h3>
<p>If your competitors are smarter than you, you will lose. Train yourself and each other regularly. Courses are cheaper than losing customers and they waken the mind to new possibilities.</p>
<h3>Be Agile</h3>
<p>Implement Agile, don't just talk about it, actually do it. Have daily stand ups. Build product backlogs. Follow the Roles and obey the Rules of Agile. It will make your life easier. Don't fight it...it worked for hundreds of companies for decades - it will work for you.</p>
<h3>Avoid Useless Meetings</h3>
<p>This week I sat in a grand total of 12 hours of client meetings that I did not write a single note on, or take away a single action from. That was not because I was being lazy. There just wasn't a single action that came from them. Those meetings should not have happened. Make sure everyone prepares well, comes to a meeting with purpose and then leaves it with things to do. Otherwise you didn't have a meeting, you had a break. Nothing wrong with that...just don't spent 12 hours a week doing it.</p>
<h3>Managers are Staff Too</h3>
<p>If you have set-up a great set of rules and practices that keep your staff working at peak efficiency, make sure you are using those at management level too. No point creating a killer team and a less than killer management structure to lead them.</p>
<h3>Beware the Cloud</h3>
<p>And last but not least...use Cloud services but use them intelligently. If you are adopting a cloud service do it company wide under a company account. People using Google Apps, Basecamp, GIT, Cloud9 etc under personal accounts and sharing to personal email addresses with no oversight of managers and other company staff are going to put you in hot water when any of those people are unavailable or leave the company. Absorb technology well but in a manner that thinks of your customer first..not you first.</p>
<p><strong>Talking Point</strong>: Looking forward to everyone's comments and ideas in the comments below on examples where your work or agency could have been spared problems if you had followed the above ideas!</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></description><link>http://clock.co.uk/misc/the-web-agency-boilerplate</link><guid isPermaLink="true">http://clock.co.uk/misc/the-web-agency-boilerplate</guid><dc:creator><![CDATA[Kosala Ubayasekara]]></dc:creator><pubDate>Fri, 24 Jun 2011 13:22:26 GMT</pubDate></item><item><title><![CDATA[Utilising Dead Commuting Time]]></title><description><![CDATA[<p><a href="http://blog.clock.co.uk/wp-content/uploads/2011/06/Frequent-Traveller-150x150.jpg"><img class="size-full wp-image-848 alignleft" style="margin-right: 10px; margin-bottom: 10px;" title="Frequent-Traveller-150x150" src="http://blog.clock.co.uk/wp-content/uploads/2011/06/Frequent-Traveller-150x150.jpg" alt="" width="150" height="150" /></a>I heard an inspiring and motivational story on BBC Radio 4 on my travels to work this morning.</p>
<p>It was a story about Steve Spiro and how he had created an album entitled '<a href="http://www.amazon.co.uk/gp/product/B004VR6CRI/ref=as_li_qf_sp_asin_tl?ie=UTF8&amp;tag=ar04a-21&amp;linkCode=as2&amp;camp=1634&amp;creative=6738&amp;creativeASIN=B004VR6CRI">Frequent Traveller</a>'.</p>
<p>Within the report it explained how Steve wanted to make use of his 1 hour 'dead' commuting time - so he decided to sample the sounds he heard along his journey.</p>
<blockquote><p>"There's a lovely sound of whirring you can hear....  I thought, it's my precious time - I'm going to write an album on this journey" - Steve Spiro</p></blockquote>
<p>Immediately upon arriving at work, I fired up the dukebox (yes.. dukebox not jukebox... it has fondly been referred to as the 'dukebox of hazzard'!) and I purchased/listened to the album.. I loved it!
It is very ambient and somehow soulful - almost immediately it strikes a sort of connection with my experiences of the journey to and from work (even though I happen to drive now more than train my way to work).</p>
<p>As mentioned, I find the story very inspiring and it makes me want to utilise my commuting time. I do have a great recognistion of the fact that the so called 'dead' time actually allows me to unwind after a hard day at work and resolve (internally) some of the issues of the day - and I would hate to impact on that, but I feel I can do more with my time.</p>
<p>So as a result of this story, my first thoughts are to arm myself with a voice recorder and track some ideas on the way home about what I can do with the commuting time... I hope to embark on a more fruitful journey from now on!</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></description><link>http://clock.co.uk/travel/utilising-dead-commuting-time</link><guid isPermaLink="true">http://clock.co.uk/travel/utilising-dead-commuting-time</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Thu, 23 Jun 2011 10:23:27 GMT</pubDate></item><item><title><![CDATA[Which branch should I be working on?]]></title><description><![CDATA[<p>Here at Clock we have recently switched from svn to git; it is awesome. If you don't already know that you should try it for a month. Git is both powerful and flexible and this allows you to adopt sophisticated branching models which can improve the quality of your development process and alleviate developer headaches. Even before we switched to git we had prescribed to a branching model based on <a href="http://nvie.com/posts/a-successful-git-branching-model/">Vincent Driessen's excellent post</a>. However with the nightmare that is svn merging, we kept our branching reserved for major features. Since switching to git we now have the luxury of creating a branch for the smallest of changes, safe in the knowledge that we can merge it back ready for deployment without losing any hair.</p>
<p>This model works really well but can be quite a daunting process to follow, especially if your team is a mixture of developers, designers, and content editors who are new to git. Thankfully everybody on the Clock team has bought into using git and can see the benefits. But it is a steep learning curve coming from svn where all day-to-day SCM tasks could be performed easily via a gui menu in a developer's IDE. Some training and group learning is definitely required. For Clock I ran a number of workshops to introduce git to the production staff and explain how the svn use cases translated to git. On top of that many team members have spent their own time learning how to tame the vast sheathe of power and flexibility that git affords you. There are great resources out there such as the excellent '<a href="http://gitimmersion.com/">Git Immersion</a>' by <a href="http://edgecase.com/">EDGECASE</a> which are accessible to nearly any level of developer.</p>
<p>I have found that even if you know the the basics of git and understanding the branching model theory, it still isn't always clear what branch developers should be working on. This is compounded by the fact that we develop and maintain many sites; some big with many developers and some small with maybe only one developer responsible for updates. Vincent's branching model is good but it can be an overhead on small projects; so we are happy for the developers on a project on to choose how they manage their repos. As is true with all freedom of choice, the more free reign you allow, the greater the uncertainty that the correct path is being followed. Nobody likes strict rules, but nobody likes uncertainty either (except maybe Schrödinger's cat) so to help with this process I put together a flow diagram which aims to help you choose the correct branch to work on for a given task. It is nothing ground breaking, but I thought that others might benefit from a little insight into how we go about making that decision. Click the image for the <a href="http://blog.clock.co.uk/wp-content/uploads/2011/06/BranchingLogic-2011-06-13.pdf">PDF Version</a>.</p>
<p style="text-align: center;"><a href="http://blog.clock.co.uk/wp-content/uploads/2011/06/BranchingLogic-2011-06-13.pdf"><img class="aligncenter size-large wp-image-829" title="Branching Logic" src="http://blog.clock.co.uk/wp-content/uploads/2011/06/BranchingLogic-711x1024.png" alt="" width="498" height="717" /></a></p>
<p>If you have any feedback or experience with alternative branching models that work well in agency environments please leave a comment.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></description><link>http://clock.co.uk/tech-blogs/which-branch-should-i-be-working-on</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/which-branch-should-i-be-working-on</guid><dc:creator><![CDATA[Paul Serby]]></dc:creator><pubDate>Mon, 13 Jun 2011 23:29:49 GMT</pubDate></item><item><title><![CDATA[My pre-concerns of nodeJS]]></title><description><![CDATA[<p>Recently, our tech team has got well into nodeJS - even recently launching our first project utilising it.</p>
<p>I am (sadly) at the beginning, with hardly any prior knowledge about this strange-mystical-yet-exciting technology.</p>
<p>My concerns with it are:</p>
<ul>
<li>Stability &amp; Security</li>
<li>Support</li>
<li>Having to re-write existing processes/functions</li>
<li>Do I really have to learn a new language?</li>
<li>Advantages it gives in real terms</li>
</ul>
<p>As I pre-empted, my knowledge about this tech is pretty much non-existent, and I believe that I can ask these questions to our tech team and they can blog back the answers to my queries. Thereby opening up what would be an internal discussion we'd be having.</p>
<p>Ok, so:</p>
<h3>Stability &amp; Security<strong>
</strong></h3>
<p>I take our 10 or so years of PHP development (and hosting of) as a huge advantage, we have encountered and overcome many, many stability and security concerns over the years -<em><strong> The simple question is: How stable and secure is NodeJS?</strong></em></p>
<h3>Support</h3>
<p>Many of us on the tech team follow, and have  followed for a number of years, the PHP community - which is vast. When we come to new problems we can usually 1) overcome them using experience and comfort within the language 2) ask our colleagues 3) Use the vast community; from PHP UK/Conference groups we attend - to friends we hold dear within the PHP community. <em><strong>My question would be: Are we in the wilderness with Node?</strong></em></p>
<h3>Having to re-write existing processes/functions</h3>
<p>I think the heading says it all. <em><strong>My question is - do I really have to re-write session management, cookie detection, caching etc etc?</strong></em></p>
<h3><em><strong>Do I really have to learn a new language?</strong></em></h3>
<p><em><strong>I have spent ages learning PHP, do I really need to learn this new language?
</strong></em></p>
<h3>Advantages it gives in real terms</h3>
<p><em><strong>I know that speed will be your first response, but I want details!
Scalability - how will this be better than our incumbent systems?
Give me more.. ?!</strong></em></p>
<p>&nbsp;</p>
<p><em>btw - I am playing devil's advocate - in case you hadn't guessed!!!</em></p>
<p>&nbsp;</p>
<p><em>.......I can feel the overwhelming response coming!!
</em></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><em><strong>
</strong></em></p>
]]></description><link>http://clock.co.uk/tech-blogs/my-pre-concerns-of-nodejs</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/my-pre-concerns-of-nodejs</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Thu, 09 Jun 2011 15:07:31 GMT</pubDate></item><item><title><![CDATA[The Very Best of Clock's Bookmarks]]></title><description><![CDATA[<p>At Clock, we like to keep up to date with what's happening in the industry. One of our key three aims is to be "bleeding edge". Since I stared my placement at Clock back in July 2010, we've been sharing useful and interesting links via email and Delicious. This post contains what I believe are the very best of these links, with a small explanation of what it contains and why it's earnt it's place in this list.</p>
<p>Because of the number of links, they are split into sections as follows</p>
<ol>
<li>Creative</li>
<li>Tech</li>
<li>Just for Fun</li>
</ol>
<p>Set aside some time, prepare yourself. This is one pretty good list!</p>
<h2>Creative</h2>
<h3>The Future of Web Design 404 page</h3>
<p>Best viewed in a webkit browser, this 404 page contains a rotating red earth, created using CSS3.</p>
<p><a href="http://futureofwebdesign.com/404">http://futureofwebdesign.com/404</a></p>
<p>Footnote: Clock is a <a href="partner at FOWD" target="_blank">partner at FOWD</a> this year! Come by our stand, have a chat, leave us a Gawk!</p>
<h3>Email Template Guidelines</h3>
<p>Creating an email template? There are many ways your design could be flagged as spam. Here are some guidelines to avoid that, and some best practice advice too.</p>
<p><a href="http://www.campaignmonitor.com/design-guidelines" target="_blank">http://www.campaignmonitor.com/design-guidelines</a></p>
<h3>CSS in Depth: Floats and Positions</h3>
<p>Personally I still haven't got all the css rules in my head. Although I have made progress in understanding css, reference, overviews and explanations are always helpful. Check over this article where you will learn how to put your HTML in order!</p>
<p><a href="http://spyrestudios.com/css-in-depth-floats-position" target="_blank">http://spyrestudios.com/css-in-depth-floats-position</a>s</p>
<h3>Creative Lab @ Google - 106 Things</h3>
<p>Google make some pretty amazing things, and they also find some pretty amazing things too. The Labs team at Google have put together a list of things they find interesting. If you don't open many of these links, you MUST look at this one. It contains videos, images, web applications, pages using new technology to make exciting and interesting things. Stop, now, go, link.</p>
<p><a href="http://bit.ly/creativeinternet" target="_blank">http://bit.ly/creativeinternet</a></p>
<h3>HTML5 Canvas Cheat Sheet</h3>
<p>If you've done work with HTML5 Canvas, you will appreciate this Canvas cheat sheet. If you haven't worked with Canvas (yet), you will find this a good tool to get you going, and give you a quick overview of some of the features you will be using. Simply put, there is no reason not to enjoy this link, unless you don't do any form of web development. For bonus points, the page even has a playable version of Super Mario as it's background! Save the princess!</p>
<p><a href="http://blog.nihilogic.dk/2009/02/html5-canvas-cheat-sheet.html" target="_blank">http://blog.nihilogic.dk/2009/02/html5-canvas-cheat-sheet.html</a></p>
<h3>Forward Thinking Form Validation</h3>
<p>Going from design to CSS can be difficult, especially when you want forms to be dead simple, yet elegant and give helpful feedback. CSS3 pseudo-classes based on a fields state is possibly one of the lesser known CSS3 tricks. This article explains the problem these pseudo-classes solve, with an explanation and demo. AND, get ready for this, although they only work in new browsers, someone has got busy making some script goodness, allowing you to use them on older browsers such as IE6!</p>
<p><a href="http://www.alistapart.com/articles/forward-thinking-form-validation/" target="_blank">http://www.alistapart.com/articles/forward-thinking-form-validation</a></p>
<h3>Project Harmony (Sketchy Canvas)</h3>
<p>[caption id="" align="alignright" width="489" caption="Sketchy Canvas"]<img class="  " title="Sketchy Canvas" src="http://dl.dropbox.com/u/39393/work/sketchy.png" alt="Sketchy Canvas" width="489" height="229" />[/caption]</p>
<p>Although there is no title on the page, I'm calling this one Sketchy Canvas. Once you give it a try, I think you'll see where I'm coming from. I'm sure many of you remember this as one of the early canvas demo's, showcasing some of the awesome effects you can apply on canvas. Realistically, I could spend ages explaining what it looks like, but here is something I created in about 2 minutes!</p>
<p><a href="http://mrdoob.com/projects/harmony" target="_blank">http://mrdoob.com/projects/harmony</a></p>
<h3>BigImg.It</h3>
<p>Got a big image that needs fitting in a small place and getting bored of those fancy lightbox things that take over your page? BigImg.it offers a javascript based solution, allowing for you to click on the image, and then scroll the image using your mouse and NOT scroll bars. It's a different idea and a real alternative to having a nasty shrunk now pixelated image which grows when clicked on. This one is sort of Tech, but because of how easy it is to implement I've classed it as creative.</p>
<p><a href="http://bigimg.it" target="_blank">http://bigimg.it</a></p>
<h3><img class="alignleft" title="Wowzer" src="http://dl.dropbox.com/u/39393/work/experiments.PNG" alt="" width="418" height="313" />Hakim El Hattab's Experiments</h3>
<p>I have yet to find a part of this website which doesn't blow my mind. Hakim shows off (and rightly so) a few of his award winning HTML5 experiments. Some of it is simple stuff used in a creative way, while other bits are pretty damn complicated and look so pretty! Oh, and this is one of those sites which resizes dynamically based on your browser's window size. I keep clicking on links in the navigation bar JUST to see the pages fall away revealing the next page. *click... click... clickclickclick* Don't be surprised if you find yourself doing the same, following him on twitter, subscribing to his blog, and having a peak at his code! This site sure IS creative, but it also DOES give you a few tech things to look at too!</p>
<p><a href="http://hakim.se/experiments" target="_blank">http://hakim.se/experiments</a></p>
<h3>The Zen of HTML5: London Web meetup Presentation</h3>
<p>Some of us may slightly forget about Opera sometimes, but let's be fair; Opera is helping and have contributed to the HTML5 (in the umbrella sense) spec. This link contains a video and resources from a presentation at the HTML5 London Web meetup about the Zen of HTML5. Actually being at this event and watching this presentation, I was shown some things about HTML5 that I hadn't yet been introduced to, for example the dynamic ways you could interact with the video element. Go watch / at least bookmark for later.</p>
<p><a href="http://my.opera.com/ODIN/blog/2011/01/26/the-zen-of-html5-london-web-presentation" target="_blank">http://my.opera.com/ODIN/blog/2011/01/26/the-zen-of-html5-london-web-presentation</a></p>
<h3>Minimalistic Designs of Consumer Products</h3>
<p>I'm not a designer, I'm a programmer who occasionally dabbles with design tools when others neglect the "Keep out of reach of programmers" label you find on those Adobe boxes. This link contains 10 fairly well known consumer products in three stages of stripped down minimalistic design phases. Maybe I just like minimalism, maybe by making a simpler looking product, it looks like less of a complicated decision; but I know for most of those, I'd pick the one on the right (most minimalistic), EVEN if the content was the same. Makes you think.</p>
<p><a href="http://www.fuelyourcreativity.com/minimalistic-designs-of-consumer-products/" target="_blank">http://www.fuelyourcreativity.com/minimalistic-designs-of-consumer-products</a></p>
<h3>The Photoshop Etiquette Manifesto for Web Designers</h3>
<p>On the subject of being a programmer and not a designer, "Us programmers keep to defined formats and layouts, how about you designer folk?" Turns out someone has put together a manifesto to that effect with regards to Photoshop files. If you work with a reasonable sized creative team, and need a good well thought out set of rules for creative files, this is your list. I'm not sure how often you need someone else to go back and edit, update or review a design or graphic creation, but if a member of the team is out on holiday for a week, and you urgently need to send the client a new updated version... Well, getting everyone to follow the same rules might save you a fair amount of time, and possibly your bacon too.</p>
<p><a href="http://photoshopetiquette.com/" target="_blank">http://photoshopetiquette.com</a></p>
<h3><a href="http://blog.clock.co.uk/wp-content/uploads/2011/05/loading.gif"><img class="alignright size-full wp-image-763" title="loading" src="http://blog.clock.co.uk/wp-content/uploads/2011/05/loading.gif" alt="" width="100" height="100" /></a>Ajax Load(er graphic)</h3>
<p>One of those pesky programmer types pestering you, a designer, for a spinner / progress bar / spiral / loading pacman? Tell them to make it themselves... OR, you could make it the quick way, and take all the credit. Ajax Load makes that dream a reality. You can choose to copy the Apple or Facebook style, or choose from the 37 other loader animations, and then select your foreground and background colour. Click generate. You have a downloadable animated gif exactly as you wanted. The site has a footnote which reads, "Generated gifs are totally free for use". Fantastic. I've used this on the current project I'm tasked to, and expect I will be using it again. Now you have no excuse NOT to have a shiny spinner.</p>
<p><a href="http://www.ajaxload.info/" target="_blank">http://www.ajaxload.info</a></p>
<h3>Holmes.css - The CSS Markup Detective</h3>
<p>Your CSS may pass validity checking, but wouldn't it be nice to give it just that extra final check and polish? Holmes makes that easy by putting borders on any element it sees an issue with, and when you hover, it displays a message explaining itself. Errors, warnings and deprecated CSS beware! One of the nicest features is the ability to run it from a bookmarklet. Give it a go.</p>
<p><a href="http://www.red-root.com/sandbox/holmes/" target="_blank">http://www.red-root.com/sandbox/holmes</a></p>
<h2>Tech</h2>
<h3>Eloquent Javascript</h3>
<p>Javascript reminds me of Java, a lot. My learning language was Java, but if you have the choice of something else, like Javascript, that you will probably end up using more, then here is a free ebook for you. Don't go thinking that because it's free, it's not as good quality as a bought book, because you can actually buy this book in physical form on Amazon, if you're that way inclined.</p>
<p><a href="http://eloquentjavascript.net" target="_blank">http://eloquentjavascript.net</a></p>
<h3>jQuery Templates Plugin</h3>
<p>If you're build something big (or wrong), you can end up with a fair amount of Javascript and HTML muddled in together. Templates, a jQuery plugin aims to separate the HTML DOM from the JS logic, something I'm pretty sure sounds like a good idea. "A template contains markup with binding expressions. The template is  applied to data objects or arrays, and rendered into the HTML DOM." Something we are looking into, but it's still in Beta, so possibly not ready for production.</p>
<p><a href="http://api.jquery.com/category/plugins/templates" target="_blank">http://api.jquery.com/category/plugins/templates</a></p>
<h3>PHP Golf</h3>
<p>Ever wondered what happens when you mix PHP and Golf? PHP Golf of course! There are a number of set challenges you are given, and the idea is to complete them with the least number of characters. Clock primarily provides PHP, and PHP Golf made us work harder and learn more PHP functions. We actually had an internal competition to try and beat the score of our CTO for three challenges: PHPGolf, Rot 13 and Triangular Numbers. If you check the high scores for those three challenges, you can still see some of ours pretty near the top! Try to beat them, I dare you.</p>
<p><a href="http://www.phpgolf.org" target="_blank">http://www.phpgolf.org</a></p>
<h3>PHP Simple HTML DOM Parser</h3>
<p>You may have edited the DOM with Javascript and jQuery, but how about editing the DOM in PHP? Although this probably isn't as common a task, if you find yourself needing to do so, there is a PHP class for that. With some good example code, it was easy to whip up a page scraper to dynamically grab content from a randomly selected page.</p>
<p><a href="http://simplehtmldom.sourceforge.net" target="_blank">http://simplehtmldom.sourceforge.net</a></p>
<h3>SyntaxHilighter</h3>
<p>Unbeknown to many, Wordpess already includes syntax highlighting out of the box! No need for another plugin, unless you have a less common language to show off. Here is an example...</p>
<p>[php]</p>
<p>&lt;?php</p>
<p>echo "Hello Syntax Highlighter";</p>
<p>?&gt;</p>
<p>[/php]</p>
<p>If you're interested in how to go about putting this sort of feature in your own CMS, more details can be found at the link below.</p>
<p><a href="http://alexgorbatchev.com/SyntaxHighlighter" target="_self">http://alexgorbatchev.com/SyntaxHighlighter</a></p>
<h3>Lesser Known Unix Commands</h3>
<p>Depending on your level of tech, and even some levels of creative, you might spend some time (or your whole day) in a Unix terminal. Someone on Quora asked for some lesser known commands, just to see what they have been missing out on. Here were peoples answers...</p>
<p><a href="http://www.quora.com/What-are-some-lesser-known-but-useful-Unix-commands" target="_blank">http://www.quora.com/What-are-some-lesser-known-but-useful-Unix-commands</a></p>
<h3>Generate Data</h3>
<p>Entering manual data for testing is OK, but when you're creating a big systems, your testing needs to be a little more thorough. While white box testing is fantastic for systems you are fully in control of, if you need some randomly generated data to test with systems where you don't have full access, black box testing with randomly generated data sets can help. I haven't seen another web app which generates data with as many settings as this.</p>
<p><a href="http://www.generatedata.com" target="_blank">http://www.generatedata.com</a></p>
<h3>Live.js</h3>
<p>There are a number of ".js" titled things coming out, especially with the rise of node.js. Live.js allows you to load in changes to a page without actually refreshing it. For example you can make changes to the css of a page, save, and watch it change dynamically right in front of your eyes.  I haven't implemented this myself yet, but I sure plan to. The example on the site is pretty neat, opening the CSS editor in a new tab/window, edit, save, and see the other page update itself accordingly. I dug around a bit on the site, and there is a tool called backfire which enables you to save any CSS changes you make in Firebug back to your CSS files, although with CSS aggregation, not much help for us. If you do try either of these, let me know how you got on.</p>
<p><a href="http://livejs.com" target="_blank">http://livejs.com</a></p>
<h3><a href="http://blog.clock.co.uk/wp-content/uploads/2011/05/gitcheatsheet.png"><img class="alignleft size-large wp-image-770" title="gitcheatsheet" src="http://blog.clock.co.uk/wp-content/uploads/2011/05/gitcheatsheet-1024x597.png" alt="" width="491" height="286" /></a>Git Cheat Sheet - Visual Version</h3>
<p>Git is starting to become the new source control application of choice, which in turn leads to a rise in cheat sheets. This one is slightly different though, as it gives a bit more context to the commands, and only shows those relevant to what you want to achieve. Clicking on "Workspace" as you can see in the image to the left, it displays all the commands relating to the workspace, and where they interact with. I haven't touched Git much myself, but I can see this will allow you to quickly work out what that command is if it's just on the tip of your fingers.</p>
<p><a href="http://ndpsoftware.com/git-cheatsheet.html" target="_blank">http://ndpsoftware.com/git-cheatsheet.html</a></p>
<h3>PHP Mess Detector</h3>
<p>No matter how long you've been programming, you will never produce perfect code first time round. PHPMD gives you a helping hand with your PHP code, giving it the once over and checking for things that could cause problems or lead to less maintainable code. It can pick up possible bugs, suboptimal code, overcomplicated expressions and unused parameters, methods and properties. If you take your PHP work seriously, this is something to add to your build script, or at least run now and then to make sure your code isn't getting out of hand. If you're working with legacy code, it can flag up things that you simply can't deal with (within budget), but at least it makes you aware of potential problems.</p>
<p><a href="http://phpmd.org" target="_blank">http://phpmd.org</a></p>
<h3>Apigee</h3>
<p>Working with a RESTful API? This may become your new best friend. Facebook have had an API console for a while now, and anyone who has worked with the Facbook API will tell you it has been damn handy. I heard about Apigee after some people tweeted about a twitter API console, which turns out was made by them. They also have a number of other API consoles including  Forsquare, Github, Groupon, Linkedin, Paypal, and Soundcloud. The most exciting thing however is the ability to create your own custom API consoles. I wish I had found this when I started working with the TopTable API!</p>
<p><a href="http://apigee.com" target="_blank">http://apigee.com</a></p>
<h2>Just For Fun</h2>
<h3>This is the Web Right Now (Winter 2010)</h3>
<p>Facebook, Google, Apple and a few other names you might know of too. The web has changed quite a bit over the last few years. This amusing infographic come comic gives an overview of some of the things that have change (and that haven't). The "Tumblr beasts" have actually been adopted by Tumblr as their version of the fail whale, which marks this posts importance.</p>
<p><a href="http://theoatmeal.com/comics/state_web_winter" target="_blank">http://theoatmeal.com/comics/state_web_winter</a></p>
<h3>Working with the Chaos Monkey</h3>
<p>The cloud has some buzz surrounding it, cloud this, cloud that. If you understand anything about cloud solutions, you understand there are instances or nodes, and you must build your system to allow any instance to fail without heavily effecting your system. Netflix, the streaming video rental website, moved to AWS a while back. One of the first systems they had built was "The Chaos Monkey" which would randomly pick and take an instance offline. They explain why this system is so important, and why anyone considering running a service on a could computing platform should have one.</p>
<p><a href="http://www.codinghorror.com/blog/2011/04/working-with-the-chaos-monkey.html" target="_blank">http://www.codinghorror.com/blog/2011/04/working-with-the-chaos-monkey.html</a></p>
<h3>Rawkets - An Experimental Multiplayer Space Shooter</h3>
<p><a href="http://blog.clock.co.uk/wp-content/uploads/2011/05/rawkets.png"><img class="alignright size-full wp-image-781" title="rawkets" src="http://blog.clock.co.uk/wp-content/uploads/2011/05/rawkets.png" alt="" width="532" height="308" /></a>While I spent a fair chunk of my placement year at Hijack Media, Clocks sister company in London. When an American intern joined the team, Rawkets soon became the non-smokers smoke break. In the first iteration of Rawkets, you would have to sign in via twitter, but now it's open to anyone. If you've ever played asteroids, the game mechanics are a lot like that, except rather than asteroids, its other people you are trying to take out. Rawkets has had a few upgrades in the last few weeks, so the UI has had a face life, you now see who killed you, keep a tally of your kills, and even chat in game now too. It's fun, fast pace, and while it seems quite simple, it can provide so much fun! The guy who made this, Rob Hawkes, is quite an authority on HTML5 canvas now. He speaks at events, has a book, and even works for Mozilla as a Technical Evangelist now. What are you waiting for? Go play some Rawkets.</p>
<p><a href="http://rawkets.com/">http://rawkets.com</a></p>
]]></description><link>http://clock.co.uk/tech-blogs/the-very-best-of-clocks-bookmarks</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/the-very-best-of-clocks-bookmarks</guid><dc:creator><![CDATA[Ben Hutton]]></dc:creator><pubDate>Fri, 13 May 2011 22:15:59 GMT</pubDate></item><item><title><![CDATA[What World of Warcraft taught me about Project Management]]></title><description><![CDATA[<h2>The Lesson</h2>
<p>Until about 4 years ago I was a major elitist when it came to work and skills. I just refused to work with people below a certain standard of coding or execution excellence and often found myself struggling with projects that, despite have elite teams of people throughout, never seemed to go exactly as planned. It used to frustrate me, occasionally enrage me and leave me perplexed.</p>
<p>About 4 years ago I started playing WoW. I got into it to get an escape from real life rigours of IT work and wanted to have a fun, collaborative place to play. I enjoyed the game immensely and eventually started my own guild with a bunch of people I met in PUGs. Adult players like myself, who did not power game, but wanted a good experience on the few hours we had. Molten Core raiding had just started happening in a big way and elite raiding guilds were emerging all over the world, for better and for worse. Most of these guilds rejected and frequently threw out players that were not elite, sometimes failing by only a small margin. Consequently, these people were disappointed and often sad while gaming. This was something I never understood in the gaming world - the lack of inclusion. So I started picking up these players into my guild, and essentially building a guild of people that were rejected from other guilds due to a lack of perceived skill.</p>
<p>The fun started to happen when I started organising raids in my guild. We set off with passion and fervour into Zul Gurub and I remember those days as feverish raids. We refused to use vent so I was typing commands furiously into the chat (hilarious typos emerged from this period) and people were running around like crazy, no coordination, no focus - in fact behaving in exactly the same way that got them thrown out of proper raiding guilds. So I thought...this is never going to work.</p>
<blockquote>
<p style="text-align: right;">
<p style="text-align: right;"><strong>You can't climb the ladder of success in anything and pull it up after you, that's not how life works.</strong></p>
</blockquote>
<p>After a few fruitless encounters I decided to do some out-of-raid-time tutoring. I grabbed the weak members that were trying to do things they could not, and spent time figuring out what they could do well. I paired weak members with strong ones to create offensive /defensive balances. I forgave mistakes (even serious ones) and gave people multiple chances, encouraging our pro players to not reject the weak ones but to guide them to great strengths instead.</p>
<p>Over the next three months we conquered Zul Gurub and brought it into farming status and over the next few expansions conquered all the raid content the game through at us, transforming that rag tag bunch of rejects from other guilds into a top 5 ten man strict raiding guilds on our server by the time Cataclysm hit despite being a casual guild. The break through came in Burning Crusade, when our first run into Karazhan I was boggled to find I did not need to give a single order in boss fights. I watched with amazement as each individual member of our  ten man team played with exceptional situational awareness, tanks moving to grab mobs that come out of the woodwork, priests being shielded by the dps and CC'ers...and all of this with no leadership effort on my part at all. It was epic.</p>
<p>This transformation of our guild happened over the space of three years and as this learning experience happened in the game it started leaking out into my real life as well. I stopped building teams of elitists and started building teams of complimentary skills. Academics mixed with street smarts, elite mixed with gut feeling driven, supporting roles mixed with leaders. Suddenly my projects started coming together, results appeared, timelines were met - clients were happy. So what did this translate to in reality?</p>
<h2>Team Makeup</h2>
<p><strong>Successful teams are not homogeneous in skill quality</strong>. In other words a team of people with the same level of skill at everything will think in the same way, and therefore not adapt to change. What does need to be homogeneous is attitude. It takes only one person with a bad attitude to ruin everything. Its better to have a person of mediocre skill with a great attitude than the reverse.</p>
<p><strong>Strong members must help weak members get better</strong>. If your skills are greater than your neighbours, it's your job to help them get better. You can't climb the ladder of success in anything and pull it up after you, that's not how life works.</p>
<p><strong>Adaptation to change is a key to success</strong>. The best laid plans fail, get over it and make another one.</p>
<p><strong>If you have a successful team, don't mess with it</strong>. If you have a team of people that play / work well together, don't change it. Adding or removing a member can throw the entire team into a new learning cycle of team and skill balance that can be time consuming and costly.</p>
<p><strong>Incentivise for success</strong>. Everyone is driven by different things. That is OK. DON'T try to make everyone motivated for the same reasons, DO try to get them all pointed in the same direction for their own different reasons.</p>
<p><strong>The right person for the right job</strong>. Everyone can't be the leader, no matter how cool it is. Strengths should play to team success, avoid ego's getting in the way. High level specialists do NOT make good leaders. High level generalists do. Specialists should be incentivised to do what they are special at.</p>
<h2>The Example</h2>
<p>Lets take a look at how to do this in an typical group example, say a technology team and analyse the role make-up:</p>
<h4>Technology Lead (in WoW this is your raid leader)</h4>
<p>This person is usually someone that has a lot of client contact and is also responsible for the overall technology vision. This should be a high level generalist with a broad technology skill set and very good grasp of translating technology to business value. If this person is the best coder in the team, then you have hired the wrong developers. This role provides vision, leadership and motivation for the unit.</p>
<h4>Team Lead (in WoW this is your class leader)</h4>
<p>This person is your best developer and has won the respect of the team though his excellence in code delivery. His job is to lead the execution of the plans and goals set down by the technology lead. Detail oriented, quality concious and rigorously devoted to churning out the best possible result.</p>
<h4>Senior Developer (in WoW this is your best performing class member)</h4>
<p>This is your experienced developer, it his job to assist the Team Lead in execution and train junior developers and make sure they are up to scratch.</p>
<h4>Junior Developer (in WoW this is your class team members)</h4>
<p>This role is supportive in nature to the team and is gaining experience by inclusion, exploration and observation.</p>
<h2>The Incentives</h2>
<h4>Technology Lead</h4>
<p>This person is incentivised by ownership/rewards and recognition outside of the team. The value of this employee should be acknowledged in the company at large outside the technology team and freedom and ownership is the proper incentive for this role.</p>
<h4>Team Lead</h4>
<p>This person is incentivised by ownership and rewards. Immediately reward successes and give the team lead greater and greater freedom as he earns that right.</p>
<h4>Senior Developer</h4>
<p>This person is incentivised by rewards and status. Tougher projects on completing existing ones well, public commendation within the team when coding excellence occurs.</p>
<h4>Junior Developer</h4>
<p>This person should be incentivised by recognition. Applaud his successes, be quiet about his failures and do one on one tutoring to educate past them.</p>
]]></description><link>http://clock.co.uk/tech-blogs/what-world-of-warcraft-taught-me-about-project-management</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/what-world-of-warcraft-taught-me-about-project-management</guid><dc:creator><![CDATA[Kosala Ubayasekara]]></dc:creator><pubDate>Fri, 06 May 2011 12:45:47 GMT</pubDate></item><item><title><![CDATA[HTML5 contentEditable CMS?]]></title><description><![CDATA[<p>This is a blog post of an idea, rather than the critique of such a system or nuisances thereof.<img class="alignright" style="margin: 10px 5px;" title="html5" src="http://www.w3.org/html/logo/img/html5-display.png" alt="" width="297" height="299" /></p>
<p>I have done some quick Google searches to see if there is anyone out there using the new html5 '<em>contentEditable</em>' feature to perform content management system tools for a Web site - and whilst there are forum posts indicating its usage I can't find anything concrete.
Therefore, I'd like to, in this post - in a "think-whilst-I-write" style of blogging, explore whether I think this new HTML5 feature could be used effectively..</p>
<p>Ok, so I am going to go-ahead and presume that if you have read this far you know what '<em>contentEditable</em>' means (not to be confused in this instance with '<em>designMode</em>').</p>
<p>'<em>contentEditable</em>' was originally designed and implemented by Microsoft in Windows Internet Explorer 5.5. There was some superficial documentation on how to use them (so developers could develop rich text editors), but little thought was given to interoperability.
Much of this was later reverse-engineered, and cross-browser support for basic operations is considered quite good.</p>
<p>So assuming that you can guide your CMS editors to use a 'contentEditable-safe' browser, then we are away and rolling.</p>
<p>Personally, I have found that the majority of our clients that use CMS systems have little to no experience of either html markup (or wiki formatting etc) - there are of course exceptions to the rule, but what I am thinking here is a very simple editor to allow text only amends (as I believe image/video input would result in non optimal code).</p>
<p>If we take a very simple site, a brochure site if you like, I believe it would be beneficial to allow specific parts of the page to be 'contentEditable', let's say in this instance - the introduction and body text.</p>
<p>The first two challenges that come to mind are:</p>
<li>1) How do we distinguish between an editor or a simple user, as we don't want normal users to be able to change and save the content</li>
<li>2) How do we save the amends</li>
<p>In answer to 1 - As we want this system to be light weight, we need to think of a way to distinguish users without necessarily implementing ACL (Access Control Lists e.g. Security Groups and the like) etc, so my first train of thought is to use a simple 'Basic access authentication' check. This itself dictates that we lose a lot of CMS functionality.
As we wouldn't want the users to see the login box, we'd need to place the site on another url (which would mimic the main site - but with login)</p>
<p>In answer to 2 - I believe the best method would be to place a save button on the footer (or header, or both) clicking save (using JavaScript) would take all the contentEditable regions and overwriting the saved content in the DBMS (whatever is being used).</p>
<p>Having now written a few paragraphs on this, I do not think the efforts involved mean that my approach would be preferable, as we are starting to lose functionality quickly. So perhaps a change of approach is suitable...</p>
<p>I still think that contentEditable has 1 big advantage over a text box in an isolated admin section.. <strong>the editor can see the amends real-time and how they effect the look and balance of the page</strong>.</p>
<p>So let's assume we are going to use the a pre-existing CMS system but now allow the method described when editors/administrators are looking at the front-end of the site. This means we have now not lost our lovely ACL and vast CMS functionality, but we can let the editor choose between editing text content in the CMS or editing in-line and on-page.</p>
<p>Some may argue that decent Content Management Systems have preview functionality - but the main drawback I see to this is that in introduces extra steps that are not needed. You could even allow the preview function to use contentEditable regions (reducing the number of steps for editors).</p>
<p>Sorry for the 'waffle', I did state this was going to be a "think whilst I write" style of blogging!</p>
<p><strong>In conclusion</strong></p>
<p>I started out with thoughts that contentEditable might provide an answer to a very light weight CMS for simple sites (text only amends). Through my thought process (and as you can see) I now believe that contentEditable could be used very effectively to aid CMS's rather than as a replacement/alternative method.</p>
<p>Your thoughts on such an implementation are welcomed.</p>
]]></description><link>http://clock.co.uk/tech-blogs/html5-contenteditable-cms</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/html5-contenteditable-cms</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Fri, 06 May 2011 10:23:52 GMT</pubDate></item><item><title><![CDATA[Bash Completion Problems with option lists generated by PHP ]]></title><description><![CDATA[<p>When creating bash completion scripts that get fed from PHP, I realised I was getting the following problem:</p>
<p>I would type the command then press tab to get the completion</p>
<pre>$maiden&lt;tab&gt;&lt;tab&gt;</pre>

But nothing would happen except the cursor jump forward. I would then not be able to backspace over the first part of the command.

After some digging I found the problem is because of PHP CLI has libedit compiled in for readline support. This causes any wordlist generated by php to break bash completion. I have only seen this problem on Ubuntu Lucid. It is suggested that you don't get the problem on other flavors of Linux, but I've not had a chance to test that yet.

Until someone fixes this problem properly I have prefixed the php script with a blank echo to catch any readline control. With this in place the bash completion works beautifully.

Here is the full completion script with the hack:
<pre>_maiden()
{
	local cur prev opts
	cur="${COMP_WORDS[COMP_CWORD]}"
	prev="${COMP_WORDS[COMP_CWORD-1]}"
	opts="-h -l -b -v -q"
	if [ -e "Maiden.php" ]
	then
		targets=`echo ""| maiden -b | sort -u`
		COMPREPLY=( $(compgen -W "${targets}" -- ${cur}) )
		return 0
	fi
	COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
	return 0
}
complete -F _maiden maiden</pre>

]]></description><link>http://clock.co.uk/tech-blogs/bash-completion-problems-with-option-lists-generated-by-php-</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/bash-completion-problems-with-option-lists-generated-by-php-</guid><dc:creator><![CDATA[Paul Serby]]></dc:creator><pubDate>Wed, 04 May 2011 23:25:34 GMT</pubDate></item><item><title><![CDATA[Exporting Postgres Tables as CSV]]></title><description><![CDATA[<p>If you need to get a quick CVS of a large query output to a client in a CSV and are using PgAdmin3 or some other GUI tool running on your local machine you might want to considering running this command on the database server directly.</p>
<pre> echo "COPY (SELECT * FROM \"User\") TO STDOUT CSV;" | psql -U postgres BigCompanyDatabase | gzip &gt; Users-`date +%F-%H%M`.csv.gz</pre>

This will then email you the file. NOT TO BE USED FOR ANYTHING OVER 2MB
<pre> mutt -s 'User Export' -a Users-`date +%F-%H%M`.csv.gz -- paul.serby@clock.co.uk &lt; /dev/null</pre>
<p>PgAdmin3, over SSH, on a 2Mbit line, took 30 mins to pull 11,000 rows. With the command line version it was in my inbox in less than a second.</p>
]]></description><link>http://clock.co.uk/tech-blogs/exporting-postgres-tables-as-csv</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/exporting-postgres-tables-as-csv</guid><dc:creator><![CDATA[Paul Serby]]></dc:creator><pubDate>Wed, 20 Apr 2011 14:53:58 GMT</pubDate></item><item><title><![CDATA[Why has Bing become my default search engine in Firefox 4?]]></title><description><![CDATA[<p>I decided to write this post because ever since I upgraded to the full version of Firefox 4, I have become really frustrated with a key piece of browser behavior I am accustomed to.</p>
<p>Not everyone browses the same way, but I love Chrome and the fact that the address bar is also my search bar. For all my non-work related browsing I tend to use Chrome as I like its speed. Firefox 4 is fantastic too, don't get me wrong, but as amazing as Firebug is, it slows down browsing to the detriment of my user experience. You have to take the rough with the smooth I guess - both browsers have their benefits for my personal and work purposes.</p>
<p>Anyway, back to the search / address bar bit. I like this in Chrome, and in Firefox I browse the same way. I try not to use the search box as it takes up extra UI space, hence in both Chrome and Firefox I type a search term in the address bar, and bingo - the URL I type loads, or I get my Google search results for the term I entered. Or not, as the case may be...</p>
<p>After upgrading to Firefox 4, all of a sudden my results started returning in Bing. Bing? Bing! Now I don't have too much of an issue with Bing. I am sure it's a very good search engine. But I want Google. Google is my search engine of choice, so where did Bing come from?! I didn't install any Microsoft-related extensions or plugins, and after scouring every preference in Firefox and coming up fruitless, I returned to my reliable Google-standard search bar, and voila! The Mozilla support forum came to my rescue.</p>
<p>I'm not too certain what happened, but if anyone else has the same problems out there - here's what you have to do to return to the good old days:</p>
<p>In your address bar, type: about:config, then scroll down to keyword.URL when the config loads (after promising to be careful with the settings).</p>
<p>Right-click keyword.URL and select modify.</p>
<p>Paste the following into the panel that appears: http://www.google.com/search?ie=UTF-8&oe=utf-8&q=</p>
<p>Close the tab and the World is right again!</p>
<p>Aaaaaaah, that feels better.</p>
]]></description><link>http://clock.co.uk/misc/why-has-bing-become-my-default-search-engine-in-firefox-4</link><guid isPermaLink="true">http://clock.co.uk/misc/why-has-bing-become-my-default-search-engine-in-firefox-4</guid><dc:creator><![CDATA[Andrew Devlin]]></dc:creator><pubDate>Wed, 13 Apr 2011 15:09:23 GMT</pubDate></item><item><title><![CDATA[Deploying node.js apps]]></title><description><![CDATA[<p>Here at Clock, long gone are the days of FTP uploads to put a site live. We use deployment tools to automate the process, which have the advantage of being faster, while reducing the chance of human error. I'm delving into <a href="http://nodejs.org/">node.js</a> development, for which I've set up my own deployment and hosting.</p>
<p>Here's my situation:</p>
<ul>
<li>I use my local machine for development</li>
<li>I have a remote server with SSH access for testing and production</li>
<li>I'm using git for source control</li>
<li><a href="http://nodejs.org/">node</a> and <a href="http://npmjs.org/">npm</a> are installed locally and remotely</li>
</ul>
<p>And here are my objectives:</p>
<ul>
<li>Encapsulate deployment process into single <code>git push</code> command</li>
<li>Host multiple apps on a single server</li>
<li>Have multiple instances of each app for testing and production</li>
</ul>
<p>Read on and I'll take you through the different aspects of my solution. It is still very much a work in progress, so if you see anything which could be improved, or have a different approach then let me know.</p>
<h2>Git</h2>
<p>When you initialise a git repository, it creates a directory called <code>hooks</code>. When certain actions are invoked with git, it looks in this directory for scripts to run. The one that is particularly useful to us here is called <code>post-receive</code>, which gets run when a branch is pushed to the repository – after it has received everything. This means we can set up a git repository on our server, clone it on to our local machine, do some development, push those changes to the remote and have it run whatever we place in our <code>post-receive</code> script.</p>
<p>The system will assume that your <code>post-receive</code> is bash. However, since we're working with node, it makes sense for everything to be in js right? To have your system run it with node, simply have <code>#!/usr/bin/env node</code> as the first line.</p>
<p>On your server, initialise an empty, bare repository like so:</p>
<p><script src="https://gist.github.com/907928.js?file=git-init.sh"></script></p>
<p>The <code>--bare</code> argument means that no working tree (all of the files that git is tracking) is stored in the filesystem, only their internal representation in git. This ensures that the repo has to be cloned to be worked with.  On your local machine clone the repo like so:</p>
<p><script src="https://gist.github.com/907949.js?file=local-setup.sh"></script></p>
<p>You can see I've renamed the remote <code>origin</code> to <code>deploy</code>. This is purely superficial, and simply serves to make our deployment command more verbose – we'll be typing <code>git push deploy live</code> as opposed to <code>git push origin live</code>.</p>
<p>To achieve multiple instances of a single app on the server, we can simply use git's branching model. Personally I have removed the default <code>master</code> branch and have <code>live</code> and <code>dev</code>. In Clock projects we tend to have <code>development</code>, <code>testing</code>, <code>staging</code> and <code>production</code> environments – the choice is yours.</p>
<p><strong>Here is what we want our </strong><code>post-receive</code><strong> script to do:</strong></p>
<ul>
<li>Create a temporary directory</li>
<li>Checkout the branch of the project that was just pushed to the repository into the temporary directory we just created</li>
<li>Run the project's build script</li>
<li>Remove the temporary directory</li>
</ul>
<p>I won't clutter up this post with my whole script, so <a href="https://github.com/bengourley/Node-Deployment/blob/master/post-recieve">here it is on github</a> (If you see references to Jake, that's my choice of build tool and it's explained later on). I have purposefully made this script do as few jobs as possible, and defer the bulk of the work to the build script – this is because the hook has to be (as far as I'm aware) placed into the git repo manually. The build script can live in the project so be project-specific and source controlled.</p>
<p>It is worth noting that if I had written this in bash, it would have been much shorter. For me, this was a trade-off I was willing to make in order to keep things all in one language (avoiding one I am a novice in).</p>
<h2>Jake</h2>
<p><a href="https://github.com/mde/node-jake">Jake</a> is a build tool written in node. It follows the node ideology and supports asynchronous tasks. In short, it is a framework for defining tasks and dependencies between tasks, and is written on top of node.</p>
<p>On your server you will need to install jake globally. <code>npm</code> normally installs packages in your current working directory, so you will need to use the global argument: <code>npm install jake -g</code>.</p>
<p>The bare minimum we want to achieve with the build script is as follows:</p>
<ul>
<li>Install dependencies</li>
<li>Create a versioned directory e.g. <code>SiteName@0.0.1</code></li>
<li>Move the files from our temporary directory to the versioned directory</li>
<li>Point a symlink to the new versioned directory</li>
<li>Stop old version and start new version</li>
</ul>
<p>The folder structure for my app directory looks like this:</p>
<p><script src="https://gist.github.com/913655.js?file=directory-structure"></script></p>
<p>There are are two main advantages to this:</p>
<ul>
<li>If anything goes wrong up to the symlink part of the build, then no damage will have been done to the live site and its associated files</li>
<li>If the deployment has some unexpected effect on the site, the previous version can be brought back, simply by replacing the symlink</li>
</ul>
<p>Once again, to avoid clutter <a href="https://github.com/bengourley/Node-Deployment/blob/master/Jakefile.js">here is my Jakefile.js in full</a>.</p>
<h2>Upstart</h2>
<p>If you start node from your build script, your node instance is a child process of the build process – that's not good. It's a good idea to wrap each application in a service. Based on node hosting tutorials out there, I went with <a href="http://upstart.ubuntu.com/">upstart</a> to achieve this.</p>
<p>I found my upstart service directory to be <code>/etc/event.d/</code>, it might be different for you. In this directory, I place my service wrappers for all of my node apps. e.g.:</p>
<p><script src="https://gist.github.com/913701.js?file=site.siteName-state"></script></p>
<p>Site can then be started and stopped with <code>start site.siteName-state</code> and <code>stop site.siteName-state</code>.</p>
<h2>Monit</h2>
<p>What happens if your node app unexpectedly dies? What if it is a strange anomaly that could be resolved (if only temporarily) by restarting the service? <a href="http://mmonit.com/monit/">Monit</a> is a utility for monitoring and managing processes. We can use it to send a simple http request to our app. If it does not respond, or responds with any other http code than <code>200 OK</code>, we can assume something went wrong and restart the service.</p>
<p>I use a monolithic monit config file called <code>monitc</code> located in <code>/usr/local/etc/</code> where all of my apps are defined. Here's an example of a site in my Monit config:</p>
<p><script src="https://gist.github.com/913720.js?file=monitrc"></script></p>
<p>The first line tells Monit to run as a daemon, and to check every 300 seconds with a 60 delay.</p>
<p>For each site, we tell Monit the location of the upstart wrappers, so it knows how to start and stop the services. A site can be targeted individually using the host name, e.g: <code>monit start BenGourley-dev</code> would start the service declared above.</p>
<p>You can start all the services that are defined with: <code>monit start all</code>. This is useful if the server is restarted and we want to bring all apps back up. I have placed this in my <code>/etc/rc.local</code> file to bring the apps up automatically.</p>
<h2>Summary</h2>
<p>So that's my process from start to finish. Just one more point – since multiple apps can't all listen on port 80, you'll need a proxy to sit on port 80 and route connections through to the appropriate node instance. For this, I use <a href="http://nginx.org/">nginx</a>.</p>
<p>I hope this has been in-depth enough, but not too much of a heavy read. This setup works really well for me as a single developer, and I hope it will help a few more get up and running. All of my examples in full can be found on <a href="https://github.com/bengourley/Node-Deployment">github</a>, where they will continue to evolve as I augment things.</p>
<h3>References & Further reading:</h3>
<ul>
<li><a href="http://howtonode.org/deploying-node-upstart-monit">http://howtonode.org/deploying-node-upstart-monit</a></li>
<li><a href="http://caolanmcmahon.com/posts/deploying_node_js_with_upstart">http://caolanmcmahon.com/posts/deploying_node_js_with_upstart</a></li>
<li><a href="http://node-js.ru/6-jake-task-check-npm-dependencies">http://node-js.ru/6-jake-task-check-npm-dependencies</a></li>
<li><a href="http://www.deanoj.co.uk/programming/git/using-git-and-a-post-receive-hook-script-for-auto-deployment/">http://www.deanoj.co.uk/programming/git/using-git-and-a-post-receive-hook-script-for-auto-deployment/</a></li>
</ul>

]]></description><link>http://clock.co.uk/tech-blogs/deploying-nodejs-apps</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/deploying-nodejs-apps</guid><dc:creator><![CDATA[Ben Gourley]]></dc:creator><pubDate>Mon, 11 Apr 2011 17:50:59 GMT</pubDate></item><item><title><![CDATA[PHPExcel Cheatsheet]]></title><description><![CDATA[<p>PHPExcel is a collection of classes that allows you to generate excel documents in PHP. It is incredibly powerful and you can perform almost all (if not all) task that you would normally use in excel.</p>
<p>It is really easy to install, either download the files or they now have a pear channel. For more details visit the <a href="http://phpexcel.codeplex.com/">PHPExcel site</a>.</p>
<p>This post is mainly for myself so that I can have a quick reference guide for common functions. For full documentation see <a href="http://phpexcel.codeplex.com/documentation">PHPExcel Documentation</a>.</p>
<p>PHPExcel supports fluent interfaces so function calls can be chained together. The following:
<script src="https://gist.github.com/903198.js?file=NormalExample.php"></script> Can be written like: <script src="https://gist.github.com/903199.js?file=FluentExample.php"></script></p>
<h3>Basics</h3>
<ul>
<li>Create a new object: <code>$phpExcel = new PHPExcel();</code></li>
<li>Getting the active worksheet: <code>$sheet = $phpExcel-&gt;getActiveSheet();</code></li>
<li>Add text to a cell: <code>$sheet-&gt;setCellValue("A1", "Hello World");</code></li>
<li>Add a new worksheet: <code>$sheet2 = $phpExcel-&gt;createSheet();</code></li>
<li>Add a formula to a cell: <code>$sheet2-&gt;setCellValue("A5", "=SUM(A1:A4)");</code></li>
<li>Rename a worksheet: <code>$sheet2-&gt;setTitle("Simple");</code></li>
<li>Merge cells: <code>$sheet2()-&gt;mergeCells("A1:E3");</code></li>
<li>Unmerge cells: <code>$sheet2()-&gt;unmergeCells("A1:E3");</code></li>
</ul>
<h3>Adding properties to your file</h3>
<ul>
<li>Set Author: <code>$phpExcel -&gt;getProperties()-&gt;setCreator("Tom Smith");</code></li>
<li>Set Last Modified By: <code>$phpExcel-&gt;getProperties()-&gt;setLastModifiedBy("Tom Smith");</code></li>
<li>Set Title: <code>$phpExcel-&gt;getProperties()-&gt;setTitle("Title");</code></li>
<li>Set Subject: <code>$phpExcel-&gt;getProperties()-&gt;setSubject("Subject");</code></li>
<li>Set Description: <code>$phpExcel-&gt;getProperties()-&gt;setDescription("A description of the file.");</code></li>
</ul>
<h3>Formatting A Cell</h3>
<ul>
<li>Setting Width: <code>$sheet2-&gt;getColumnDimension("A")-&gt;setWidth(40);</code></li>
<li>Setting Auto Width: <code>$sheet2-&gt;getColumnDimension("A")-&gt;setAutoSize(true);</code></li>
<li>Setting Text Alignment Right: <code>$sheet2-&gt;getStyle("A1")-&gt;getAlignment()-&gt;setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);</code></li>
<li>Making text of a range of cells bold: <code>$sheet2-&gt;getStyle("A1:F1")-&gt;applyFromArray(array("font" =&gt; array( "bold" =&gt; true)));</code></li>
<li>Adding an auto filter to a range of cells: <code>$sheet2-&gt;setAutoFilter("A1:C9");</code></li>
</ul>
<h3>Output to the browser as a download.</h3>
<p><script src="https://gist.github.com/903248.js?file=output.php"></script></p>
<h3>Example</h3>
<p>Here is an example of <a href="http://blog.clock.co.uk/phpexcel-example/">PHPExcel code</a>, it includes most of the functions described above.</p>

]]></description><link>http://clock.co.uk/tech-blogs/phpexcel-cheatsheet</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/phpexcel-cheatsheet</guid><dc:creator><![CDATA[Tom Smith]]></dc:creator><pubDate>Fri, 08 Apr 2011 19:04:33 GMT</pubDate></item><item><title><![CDATA[SCRUM Lite - Project Management for Small Teams]]></title><description><![CDATA[<p>Now...anyone that has done any work utilising SCRUM will happily tell you that implementing the full SCRUM method into a small development team is quite difficult...even unnecessary. Ask any SCRUM instructer and they will tell you if you DON'T implement the full SCRUM method ... then you aren't using SCRUM.</p>
<p>Keep in mind though that SCRUM was designed initially to be implemented in large groups of developers for large projects in large companies. It works great in smaller projects too with some modification and ensuring that you keep a few basic guidelines in mind.</p>
<p><strong>Truth 1</strong>: Rely on the Team. If the team is a very skilled one that has worked well together then they need less and less management. In a high accountability team you need less oversight.</p>
<p><strong>Truth 2</strong>: The Product Backlog is King. Make it well, update it often and keep it accurate. If this is followed you can skip huge amounts of unnecessary admin.</p>
<p><strong>Truth 3</strong>: Rely on Your Data. If its quacks like a duck, walks like a duck and looks like a duck - it's a damn duck. Don't rationalise the data, accept the findings and identify problems early and fix them.
<strong> </strong></p>
<h2><span style="font-weight: normal">The Barebones SCRUM Implementation</span></h2>
<p><strong></strong>If the above truths are well in-hand for you as the SCRUM master then this is the bare bones structure you need to implement SCRUM properly:</p>
<ul>
<li>Create the product backlog. If you want a template to start with <a href="http://www.mediafire.com/?scf9rs3i3v62a8o" target="_blank">use my one here</a>.</li>
<li>Do daily stand-ups every day. No exceptions, nobody gets to skip it.</li>
<li>Measure your results each sprint, don't skip it. Analyse the data together with the team and get team buy-in on the conclusions.</li>
<li>Do not run from problems. Engage the team in the solution. A large problem is not fixed by ignoring it and solving an easier one.</li>
<li>Do a project review session after the project to identify what you have learned.</li>
</ul>
<h2><span style="font-weight: normal">How do you know you need to use SCRUM?</span></h2>
<p><strong></strong>If your turn around time is less than a month, then you don't need SCRUM. Each sprint should be at least 2 weeks long and there should be at least 2 sprints for SCRUM to be needed. Why, you say? Because SCRUM is an iterative method of improving results based on data. If your project lasts less than 4 weeks any data you collect will be incidental and not yield correct results.</p>
<p>If you project team consists of less than 3 people you don't need it. Perplexed as to why? Because you need to analyze the data in a group and if you don't have enough people to weigh in and consult - you may very well draw the conclusions you want. Two people can convince themselves of anything, a dissenting majority requires at least three people to happen.</p>
<p>If you are going to be doing only one project in your working life - don't bother with SCRUM. It's designed to improve over iterations of many projects, not to slam dunk one.</p>
<h2><span style="font-weight: normal">Further reading</span></h2>
<p>Scrum Official Site: <a href="http://www.scrum.org/">http://www.scrum.org/</a></p>
<p>The Agile Manifesto: <a href="http://agilemanifesto.org/">http://agilemanifesto.org/</a></p>
<p>Other Agile Methods: <a href="http://en.wikipedia.org/wiki/Agile_software_development">http://en.wikipedia.org/wiki/Agile_software_development</a></p>
]]></description><link>http://clock.co.uk/tech-blogs/scrum-lite---project-management-for-small-teams</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/scrum-lite---project-management-for-small-teams</guid><dc:creator><![CDATA[Kosala Ubayasekara]]></dc:creator><pubDate>Fri, 08 Apr 2011 12:55:39 GMT</pubDate></item><item><title><![CDATA[A School Report: Optimisation...]]></title><description><![CDATA[<p><a href="http://blog.clock.co.uk/wp-content/uploads/2011/04/google-speed.png"><img class="size-full wp-image-523 alignright" title="google-speed" src="http://blog.clock.co.uk/wp-content/uploads/2011/04/google-speed.png" alt="Using Google Page Speed" width="200" height="200" /></a>A couple of useful tools that we use for checking page speed (and optimisation of) are 'YSlow' and 'Google Labs: Google Page Speed'.</p>
<p>To run through some of the nuances and discussions we have internally, I thought it might be a nice exercise to blog about the ones I discovered for our very own blog, which happens to be using the WordPress system (in this version of the site).</p>
<p>Impressively WP/we scored an overall Page Speed Score of 93 (out of 100), and no high or medium priority recommendations were raised.</p>
<p>The following items were raised as low priorities:</p>
<ul>
<li>
<div>Leverage browser caching</div>
</li>
<li>
<div>Defer parsing of JavaScript</div>
</li>
<li>
<div>Minify CSS</div>
</li>
<li>
<div>Minify JavaScript</div>
</li>
<li>
<div>Minify HTML</div>
</li>
<li>
<div>Remove query strings from static resources</div>
</li>
<li>
<div>Specify a <code>Vary: Accept-Encoding</code> header</div>
</li>
</ul>
<h2>Leverage browser caching</h2>
<p>So beginning with 'Leverage browser caching'. The feedback states that</p>
<blockquote><p>"Setting an expiry date or a maximum age in the HTTP headers for static  resources instructs the browser to load previously downloaded resources from local disk rather than over the network."</p></blockquote>
<p>GPS (which turns out is a terrible acronym for the Google Page Speed site!) listed a few different files that aren't being cached by the browser, one of which was: <a title="http://blog.clock.co.uk/wp-content/themes/clock-2010/fonts/fradmcn-webfont.svg" href="../wp-content/themes/clock-2010/fonts/fradmcn-webfont.svg" target="_blank">http://blog.clock.co.uk/.../fradmcn-webfont.svg</a></p>
<p>With the assistance of Mike Cronnelly - we checked the virtual host, specifically looking at the mod_expires settings and we had:</p>
<pre>ExpiresActive On
ExpiresByType text/plain "modification plus 5 year"
ExpiresByType image/png "modification plus 5 year"
ExpiresByType image/gif "modification plus 5 year"
ExpiresByType image/jpeg "modification plus 5 year"
ExpiresByType image/pjpeg "modification plus 5 year"
ExpiresByType text/css "modification plus 5 year"
ExpiresByType application/json "modification plus 5 year"
ExpiresByType application/x-javascript "modification plus 5 year"
ExpiresByType application/javascript "modification plus 5 year"
ExpiresByType image/x-icon "modification plus 5 year"
ExpiresByType application/x-shockwave-flash "modification plus 5 year"</pre>

We happen to use resource versioning to take advantage of being able to cache for such a long period. So in other words we usually append version numbers to  images etc so that only on deployment does the browser re-request the same (updated) file, i.e. <code>logo.gif?v=@VERSION-NUMBER@</code> becomes <code>logo.gif?v=1.0.3</code>

As you can see we didn't have a rule for svg files, so we now have a to-do item to revisit each site's caching criteria. A win for all sites - not just the blog.

<strong>Teachers grade: B
Teachers comment: Good effort, try that little bit harder</strong>
<h2>Defer parsing of JavaScript</h2>

We are going to have to take a slap on the wrists for this one, usually we would - as recommended, add JavaScript to the bottom of the page - however, due to WP set-up - the JS to include jQuery is in the header - a big no-no... there happens to be a couple of workarounds (that our very own Ben G knows of) but we have been lazy thus far. We consider ourselves told off.

<strong>Teachers grade: D
Teachers comment: See me after class
</strong>
<h2>Minify CSS &amp; JS</h2>

Usually our deployments handle the minification of CSS, as obviously for code maintenance point of view, it can't be minimised until the last thing... however, as discussed we are using the WordPress system, so this is something we have ignored for the blog site - we could of course run the CSS include through a script that minifies it.

We are usually pretty good at 'minifying' code where appropriate - so no real new learnings here, but obviously a reminder to keep on top of it.

<strong>Teachers grade: A
Teachers comment: Well done.</strong>
<h2>Minify HTML</h2>

Ah, this one actually stopped and made me think for a while and do some checks.

The learning would be that our deployments do not minify inline JavaScript nor CSS - when they perhaps should, however, from experience I know that we do not as a rule - write inline CSS, and also when JS does happen to be coded inline - it should just call a function included in an external JS file which *would* be minimised.

Also, we don't actually minify the actual HTML, one for our internal radar.

<strong>Teachers grade: B+
Teachers comment: You understand the fundamentals, now just make sure you follow through in your work</strong>
<h2>Remove query strings from static resources</h2>

Argh! as discussed, we utilise resource versioning - however, this is now raised as an issue by GPS - as:
<blockquote>Resources with a "?" in the URL are not cached by some proxy caching  servers.  Remove the query string and encode the parameters into the URL.</blockquote>

This raised some nice debate within clock, as we feel that by moving the version number parameter from the end of the file path (i.e. <code>logo.gif?v=@VERSION-NUMBER@</code>) to something like:

<code>logo-@VERSION-NUMBER@.gif</code> or perhaps <code>/image/@VERSION-NUMBER@/logo.gif</code>

We'd then simply be referencing a different file. But this does mean that our efforts to version resources and thus cache items, is actually bypassing a useful caching process implemented by large companies (proxy cache servers such as 'Squid').

A few more discussion about this I feel!!

<strong>Teachers grade: ?
Teachers comment: I might have to think about this too!</strong>
<h2>Specify a Vary: Accept-Encoding header</h2>

A new one on me:
<blockquote>The following publicly cacheable, compressible resources should have a <code>Vary: Accept-Encoding</code> header.</blockquote>

A quick Google search for the rationale shows:
<blockquote>Bugs in some public proxies may lead to compressed versions of your  resources being served to users that don't support compression.   Specifying the <code>Vary: Accept-Encoding</code> header instructs the proxy to store both a compressed and uncompressed version of the resource.</blockquote>

I am not convinced that coding for bugs in proxies is a good tip - but further reading shows:
<blockquote>The <code><a href="http://httpd.apache.org/docs/2.2/mod/mod_deflate.html">mod_deflate</a></code> module sends a <code>Vary:     Accept-Encoding</code> HTTP response header to alert proxies that a cached response should be sent only to clients that send the     appropriate <code>Accept-Encoding</code> request header.  This     prevents compressed content from being sent to a client that will     not understand it.</blockquote>

Usually mod_deflate is used for our sites:
<pre>&lt;Location /resource/&gt;
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/json ...
&lt;/Location&gt;</pre>
<p>so it may be that we just haven't set in our conf correctly for the blog.</p>
<p><strong>Teachers grade: B
Teachers comment: Please use your sound knowledge across all projects.</strong></p>
<p><strong><em>That's all for now folks, maybe some more findings later on...</em>
</strong></p>
<p><em>Big thanks to Mike Cronnelly, Ben Gourley, Jack Brewer and Tom Smith for their input.</em><strong>
</strong></p>
]]></description><link>http://clock.co.uk/tech-blogs/a-school-report-optimisation</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/a-school-report-optimisation</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Mon, 04 Apr 2011 17:38:10 GMT</pubDate></item><item><title><![CDATA[Forrst - The essential power-up to Software Development]]></title><description><![CDATA[<p><a href="http://blog.clock.co.uk/wp-content/uploads/2011/03/forrst.png"><img class="alignright size-medium wp-image-462" style="margin: 10px;" title="Forrst" src="http://blog.clock.co.uk/wp-content/uploads/2011/03/forrst-300x170.png" alt="Forrst logo and Park Ranger" width="300" height="170" /></a>Over the last year I've noticed people posting links on twitter to their latest design, a new layout they want feedback on, or even something graphically compelling. These links however, were Forrst links, and to anyone outside of Forrst, inaccessible (By default, but users can change). Not being a designer myself, it didn't bother me that much to find out what it was all about. When I started creating designs for one personal project, I was reminded of Forrst, and decided to give it a try.</p>
<p>Next to the logo on the Forrst homepage, we are greeted with the following description:</p>
<blockquote><p><strong>"<em>Forrst is a community of passionate developers and designers focused on helping themselves and others get better at their craft, providing thoughtful critiques, and sharing their knowledge to build better applications and websites.</em>"</strong></p></blockquote>
<p>Let’s decompose this a little. Forrst is for<strong> designers and developers exclusively</strong>. If you are looking for end user or general population feedback, you would be on the wrong site. Forrst welcomes <strong>passion in your craft</strong>, be it design or development. To get the most out of the community, you should like what you do! Forrst wants to help you (the prospective user) and other members be better. Final point, you should want to help each other!</p>
<h3>Three noteworthy qualities</h3>
<p>Here at Clock, we nominate staff for praise at our monthly company meetings, and try to focus on 3 qualities: <strong>being agile, being on the bleeding edge and being creative</strong>. Recently I've grown to believe Forrst can help with all 3 of these qualities with varying degrees. To explain how I came to this conclusion, I need to take you on a journey of several steps from the past few months.</p>
<p>About two weeks ago (17/02/2011), I attended the <a href="http://bit.ly/gOEmu4" target="_blank"><strong>London Web meetup</strong></a>, where <a href="http://bit.ly/ggvstd" target="_blank">Christian Heilmann</a>, a Mozilla evangelist, spoke on "Finding harmony in web development" [<a href="http://slidesha.re/hrGosB" target="_blank">slides</a>]. To summarise the 122 slides and 2+ hour’s presentation, Christian said the current state of web development mostly is, "<em><strong>A world of constant disagreement and overly quick and harsh responses</strong></em>". He continued to decompose the current debate regarding hashbangs (the #! in urls that makes javascript-generated content search engine crawlable), and concludes it with making the point that being all sensational isn't helping us progress. Christian is right when he says our job is to make the web of tomorrow better than the web of today. If we focus on the outcome of the work we do, rather than our ego, we CAN do this. Enter collaboration enablers, like <strong><a href="http://jsfiddle.net" target="_blank">jsfiddle</a>, <a href="https://github.com" target="_blank">github </a></strong>and <strong><a href="http://forrst.com" target="_blank">Forrst</a></strong>.</p>
<blockquote>"<em><strong>Everyone has something to contribute. Tell others, work together and build *real* products!</strong></em>” - Christian Heilmann - Mozilla Evangelist</blockquote>
<p><strong>Where does Forrst come in to all this?</strong></p>
<p>"<strong><em>Fantastic</em>,</strong>" you might say, "<strong><em>I'm all up for making the web better, but how as a web design agency will this benefit both us and our clients?</em></strong>" Part two of my explanation, begins at a talk from <a href="http://bit.ly/hbxReT" target="_blank"><strong>PHPUK</strong></a>, an annual PHP London conference. A fair number of us Clock folk attended PHPUK, something I would personally recommend to any web developer. <a href="http://bit.ly/fosULE" target="_blank">Sebastian Bergmann</a> spoke on<strong> Agility and Quality </strong>[<a href="http://slidesha.re/g47k2h" target="_blank">Slides</a>], and while talk was focused on how you can tweak the "Time, Money, Quality" triangle, the talks opening was something I had read about before. <strong>Software Development is much <a href="http://bit.ly/hxuD0f" target="_blank">like playing a Roleplaying game</a></strong> .</p>
<p>The simile was that each member of the team has different roles which aid the whole team. The project manager as the Tank, keeping the focus of clients. The Environment / Productivity engineer as the Healer, the invisible process facilitator, bug communicator and infrastructure maintainer. The coders and testers, the Damage Dealers, battling with the low level requirements and requests. Fantastic analogy for anyone who has played RPG's before.</p>
<p>Taking the comparison one step further, the Damage Dealers (Coders and Testers) in these games need to sometimes pause, use power-ups to make them stronger, go on a rage run or just something that gives them an edge. Forrst can be seen as one of those power-ups.</p>
<p><strong>The Forrst power-up increases the Damage Dealers' agility.</strong> Upload snippets of code here and there, or posting a quick question; both are reviewed by your followers who often suggest improvements or complements in the form of "Loves". Reviews of a small amount of modular code can be a different view when you don't look at the whole system. Complements encourage good quality code.</p>
<p><strong>The Forrst power-up increases the Damage Dealers' bleeding edge quality.</strong> Bookmarks are another form of post that you find on Forrst, often exciting new tech demos. Reviewing each others fresh code can help inspire new ideas and make us more willing to try out new things!</p>
<p><strong>The Forrst power-up increases the Damage Dealers' creativity.</strong> Depending on how many inspiration blogs you subscribe to, you will probably be aware of posts with titles such as... “20 amazingly inspiration email templates / profile sites / wordpress themes”. Forrst holds the front line for this sort of content, right from the source, the creators of awesomeness themselves. You will be inspired and awed.</p>
<h3>OK, you've sold it. How do I join?</h3>
<p>Becoming a member of Forrst isn't quite as easy since their latest update. You can either be invited or apply for membership, and your application would be reviewed and approved or denied by the community. you can now only gain invites to share if you are amongst the most active members (93rd percentile or higher).</p>
<p>I use Forrst maybe a few times a week, and I’m at the 85th percentile, so realistically this sounds like a good way to do things. If you are a business however, and already have one member of the team forrsting away, you can ask Forrst really nicely, they will allow your whole team in.</p>
<p>&nbsp;</p>
<p>If you've used Forrst, or any similar alternatives, we'd love to know what you think. Let us know in the comments section below.</p>
<p>Find me on <a href="http://forrst.me/Relequestual" target="_blank">forrst as Relequestual</a></p>
]]></description><link>http://clock.co.uk/tech-blogs/forrst---the-essential-power-up-to-software-development</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/forrst---the-essential-power-up-to-software-development</guid><dc:creator><![CDATA[Ben Hutton]]></dc:creator><pubDate>Mon, 21 Mar 2011 10:39:26 GMT</pubDate></item><item><title><![CDATA[Avoiding Superfluous HTML5]]></title><description><![CDATA[<p><a href="http://en.wikipedia.org/wiki/HTML5">HTML5</a> (or rather, the continuing specification of HTML) is <del datetime="2011-03-07T09:47:36+00:00">very, very good</del> really great stuff. New elements, better semantic meaning to mark-up, more accessible interactivity - it's all leading to some very exciting times ahead, and with those times I hope that we'll start to see more and more amazingly well-crafted products in our digital lives sooner rather than later.</p>
<p>I've been working on a few projects recently that have utilised many of the new features of 'HTML5' (I'm going to refer to it as that, as it's the easiest way to refer to it) and although I am enjoying the ride, I have noticed that the HTML I write these days has got bigger.</p>
<p>Years ago, when I started learning how to code, one of the golden rules was to restrict the amount of superfluous markup you wrote. As well as keeping things tidy, it meant there was less to render by the browser, and as long as you could still achieve the layout and design you wanted then the less code, the more efficient the site, and the better the product was.</p>
<p>Recently I have been getting a little bit frustrated because I have felt I have needed to increase the amount of code to achieve the same results as when I was writing old-school HTML. I'll give you an example - in the old days I would create a navigation menu like so:</p>
<p><script src="https://gist.github.com/901793.js?file=navigation.html"></script></p>
<p>It's plain, simple, and the unordered list contains the links that the user will need to browse my site. These days I wrap this unordered list in the brand-new nav element, which semantically makes more sense:</p>
<p><script src="https://gist.github.com/901798.js?file=html5-navigation.html"></script></p>
<p>So that's fine, I guess - it's not ideal as I've had to add a new element to what was previously there - but as it's just for one main functional element of the page, then that's ok, right?</p>
<p>Well no, not really - the problem is that I might have more than one group of links on my page that require other nav elements. This means for each one of these unordered lists of navigational links, I add the extra markup to achieve the same result.</p>
<p>The problem is that the extraneous code isn't just restricted to this example either…each new sectioning element can now have it's own h1 (which is excellent), as described on the fantastic Dive Into HTML5, but does that mean that each h1 also needs to be nested in its own <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-header-element">header</a> tag? This is where problems creep in, and things could easily start spiraling out of control. What was once a nice, clean document now gets riddled with repetitive extra code that actually, really isn't needed. By adding these things are we making the product better? Is it more semantic, or more machine-readable? And if so does that make the product better?</p>
<p>I would suggest that the header example above could be resolved using common sense really - no, every sectioning element doesn't need to have its own header - the h1 should suffice in many cases. Sometimes the header will be required, but not in every situation.</p>
<p>But back to the nav issue…</p>
<p><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-nav-element">WHATWG describes the nav element</a> as "a section of a page that links to other pages or to parts within the page: a section with navigation links".</p>
<p>You will almost always see more important groups of navigational links output as a list, within a ul tag. Looking at that link to WHATWG, you can see that the nav examples mostly contain unordered lists. If this is the case, perhaps we should see the development of a new HTML element or attribute - something along the lines of a navlist  tag, or a type="list" to add to the nav tag. This way, we could revert to fewer elements on the page by writing something like the following:</p>
<p><script src="https://gist.github.com/901803.js?file=navlist.html"></script></p>
<p>or</p>
<p><script src="https://gist.github.com/901805.js?file=nav-type-list.html"></script></p>
<p>Surely browsers could evolve to treat the content like a list of links in the same way as it would other lists, and we create leaner markup.</p>
<p>If measures like this start to be introduced into the specification then I feel that it will help the HTML5 standards continue to improve the quality of products we see day in, day out, on and offline. It'll be easier to create clean products with optimised code, which means everyone wins - the consumer gets to use the fastest-loading interfaces, and the construction of those interfaces can be more solid, and easier to manage too.</p>
<p>WHATWG / W3C - what do you think? I would love to hear what you have to say. HTML is always evolving, so if we can start introducing solutions to make our development lives better, that'd be great. Please!</p>
]]></description><link>http://clock.co.uk/tech-blogs/avoiding-superfluous-html5</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/avoiding-superfluous-html5</guid><dc:creator><![CDATA[Andrew Devlin]]></dc:creator><pubDate>Mon, 07 Mar 2011 12:11:24 GMT</pubDate></item><item><title><![CDATA[Just because you're listening to the client doesn't mean you're hearing the client. ]]></title><description><![CDATA[<p>Communication is key if you want to build strong relationships with your clients, and on top of this - an understanding of the work you are producing is key.</p>
<p>George Bernard Shaw once said that:</p>
<blockquote>
<p style="padding-left: 30px;"><em><strong>"England and America are two countries separated by a common language."</strong></em></p>
</blockquote>
<p style="text-align: left;">I think you could argue that in web design circles (and I'm sure other industries too):</p>
<blockquote>
<p style="padding-left: 30px;"><em><strong>"Developers and Clients are two separate entities that are also separated by a common language"</strong></em></p>
</blockquote>
<p>Imagine the scenario: You are building a new music website for a client, and they ask you to add a "shuffle playlist" feature to your product backlog.</p>
<p>Developers love to develop, but without using good communication in the process - via the PM or other (i.e. just letting the developers just crack on with the backlog items) the developers could easily upset the client by delivering their interpretation of shuffle (and not the client's).</p>
<p>Shuffle is a common term, used on almost every good music playlist device, yet it can vary hugely.</p>
<p style="padding-left: 60px;"><em>"Usually shuffle is completely random, but unfortunately it sometimes can repeat songs</em><em>."</em></p>
<p style="padding-left: 60px;">from: <a href="http://en.wikipedia.org/wiki/Shuffle_play">http://en.wikipedia.org/wiki/Shuffle_play</a></p>
<p>Just a few ways a developer could interpret  "shuffle":</p>
<ol>
<li>Randomise playlist (I don't want to get into the <a href="http://www.google.co.uk/search?q=is+anything+truely+random&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.mozilla:en-GB:official&amp;client=firefox-a">truly random argument</a>!) and play through the list until all songs are played once, then shuffle again (sometimes called shuffle repeat).</li>
<li>Play a song, then shuffle the list, then play a song, then shuffle the list...</li>
<li>Play a song, shuffle the list - refer to history and see if the next song has already been played, if so shuffle again, if not play it and so on..</li>
</ol>
<p>Each of them would have different outcomes, and depending on the client - they may get infuriated that you have "mis-read the brief" (it happens!).</p>
<p>Going back to my original point; having communications with the client, and not just assuming the common understanding is sufficient can be the difference between a happy client and an angry client.</p>
]]></description><link>http://clock.co.uk/misc/just-because-youre-listening-to-the-client-doesnt-mean-youre-hearing-the-client-</link><guid isPermaLink="true">http://clock.co.uk/misc/just-because-youre-listening-to-the-client-doesnt-mean-youre-hearing-the-client-</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Thu, 03 Mar 2011 17:13:29 GMT</pubDate></item><item><title><![CDATA[UI Draggable Switch jQuery Plugin]]></title><description><![CDATA[<p>I thought I'd share a small jQuery plugin I've built.</p>
<p><a href="/sandbox/drag/demo">See the demo</a> | <a href="/sandbox/drag/jquery.dragToEnvoke.js">View the source</a></p>
<p>The plugin works in all browsers, including IE &lt; 8 and Mobile Safari.</p>
<h3>How it works</h3>
<p>The plug-in requires a single element to get started. This element should have relative positioning, a width set and no padding. This defines the draggable area. The jQuery plugin should be called on this element like so:</p>
<p><script src="https://gist.github.com/901469.js?file=example-usage.js"></script></p>
<p>The plugin adds a child element which becomes the handle. This has a class of <code>handle</code> and no styles added by the javascript so it can be styled in your css; it just needs absolute positioning and a width set to be functional.</p>
<p>Mouse and touch event handlers are set up on the handle to detect clicks and drags. If the mouse button is held down / a touch happens for less than 150ms, the plugin treats this as a directive to change state – if it's on it will switch to off and vice versa.</p>
<p>If the mouse/touch action lasts more than 150ms, the plugin treats this input as a drag and will move the handle base on the mouse or touch position. When the drag is finished, the handles position is compared to a balance point – an optional bias – and moves to the nearest state – on or off, where a callback is fired.</p>
<h3>Options</h3>
<p>Here are all of the options that you can pass to the plugin:</p>
<p><script src="https://gist.github.com/901471.js?file=plugin-options.js"></script></p>
<h4><code>onFunc</code> and <code>offFunc</code></h4>
<p>These are callback functions to be executed when the switch is move to on/off states respectively. They are passed the drag elements for convenience (you don't have to put this in your callback signature if you don't want to use it)</p>
<h4><code>returnTime</code></h4>
<p>This is the amount of time in milliseconds that the handle animation should take to return to its nearest state.</p>
<h4><code>balancePoint</code></h4>
<p>A value from 0–1 to define the position at which the handle should switch to on/off. Closer to 1 means that the handle has to be dropped further to the right before it will stick to the on position. In the demo this is set to 0.9.</p>
<h4><code>runOnce</code></h4>
<p>If this is set to true, once the handle is set to the on position, all event listeners will be detached and it will no longer be interactive. If you want to add some sort of disabled class to the element to indicate this to the user, do it in the <code>onFunc</code> callback.</p>
<h4><code>handleText</code></h4>
<p>If you like, you add text to your handle element with this option.</p>
<h4><code>onTest</code></h4>
<p>A function to be executed when the handle is moved to the on position. This function should return a boolean value. If it returns true, the handle will remain in the on position and proceed to execute the <code>onFunc</code> callback. If the return value is false, the handle will return to the off state and the <code>offFunc</code> callback will be executed.</p>
<h3>Usage</h3>
<p>Feel free to use the plugin on any project – no attribution required, just leave a comment here if you do. You can find the plugin in my plugin repository on github – <a href="https://github.com/bengourley/Plugins">github.com/bengourley/Plugins</a>. If you have any feedback or make any improvements, feel free to use the issues and pull requests on there.</p>
<p>&nbsp;</p>
<p><a href="/sandbox/drag/demo">See the demo</a> | <a href="/sandbox/drag/jquery.dragToEnvoke.js">View the source</a></p>
<p>&nbsp;</p>

]]></description><link>http://clock.co.uk/creative-blogs/ui-draggable-switch-jquery-plugin</link><guid isPermaLink="true">http://clock.co.uk/creative-blogs/ui-draggable-switch-jquery-plugin</guid><dc:creator><![CDATA[Ben Gourley]]></dc:creator><pubDate>Fri, 25 Feb 2011 12:58:26 GMT</pubDate></item><item><title><![CDATA[Virtualbox 4.0.4 Shared Folder Update]]></title><description><![CDATA[<p>Continuing from <a href="/2011/01/07/virtualbox-4-0-shared-folders-still-slow/">previous blog post</a>, I have benchmarked the newest release of Virtualbox 4.0.4 with Shared Folder access. Same test as before, benchmarking static content servered up by apache from a <a href="http://www.virtualbox.org/manual/ch04.html#sharedfolders">Shared Folder</a> using the follow command:</p>
<pre>$ ab -c 10 -n 500 http://localhost/resource/image/sprite.png</pre>

Unfortunately as before I only got sub 200 request per second.
<h2>NFS is quicker than Samba</h2>

Since my last post I have switched from using Samba to share my  host system folders to using NFS. When I run the same benchmark I get 1,189 requests per second! That's nearly 3 times faster than Samba and 6 times faster than Shared Folders.

I'm currently using MacOsX as my main desktop environment  so setting up NFS was easy:
<h3>Step 1 - Define what to share over NFS</h3>

This is defined in <strong>/etc/exports</strong>. I wanted to export my <strong>/var/application</strong> folder which is actually <strong>/private/var/application</strong>. Here is the contents of my <strong>/etc/exports</strong>
<pre>/private/var/application -alldirs -mapall=501:501</pre>

To edit your /etc/exports open Terminal from Spotlight and edit with root permission:
<pre>$ sudo vim /etc/exports</pre>

Note that I've added <strong>-map-all=501:501 </strong>this is UID of my user on my Mac, this ensures that files I create on the Ubuntu guest can be accessed by the host system. You can find the UID of you Mac user in Terminal:
<pre>$ id</pre>
<h3>Step 2 - Reload the NFSD config</h3>
<pre>$ sudo nfsd update</pre>
<h3>Step 3 - Install NFS client on guest Ubuntu machine</h3>

If you haven't got nfs support you can install it via apt-get
<pre>$ sudo apt-get install nfs-common</pre>
<h3>Step 4 - Mount Host Folder via NFS</h3>

We mount the host folder in the same location on the guest system i.e. <strong>/var/application</strong> so we add the following line to <strong>/etc/fstab</strong>
<pre>192.168.56.1:/private/var/application   /var/application   nfs    _netdev,auto 0	0</pre>

The IP address is the address of the host from the <strong>host only adaptor.</strong>

If all went well you should now have your host /var/application folder mount on your guest system. If you run mount you'll see it:
<pre>$ mount
192.168.56.1:/private/var/application on /var/application type nfs (rw,addr=192.168.56.1)</pre>
<h3>Next Step</h3>

The next step is to secure your network share so that only your guest can mount it. I've not got round to this yet, if  you have please comment.

These may help you:
<pre>man nfsd
man exports</pre>
<p><a href="http://www.bresink.com/osx/NFSManager.html">NFS Manager</a> is a good paid for GUI app that creates your /etc/exports for you.</p>
<p>So it looks like until Virtualbox fix the bug that is causing Shared Folders poor performance we have no choice but to use NFS to access files on both the host and guest.</p>
]]></description><link>http://clock.co.uk/tech-blogs/virtualbox-404-shared-folder-update</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/virtualbox-404-shared-folder-update</guid><dc:creator><![CDATA[Paul Serby]]></dc:creator><pubDate>Sun, 20 Feb 2011 11:29:32 GMT</pubDate></item><item><title><![CDATA[VirtualBox 4.0 Shared Folders Still Slow]]></title><description><![CDATA[<p>I've recently installed the newest version of VirtualBox. I had every finger and toe crossed in the hope that my long standing bug with Shared Folders would be fixed.</p>
<p>We run an Ubuntu 10.04.1 VM and use a Apache/PHP stack and serve up sites using files from a folder on the host environment. This method works very well for us, but does mean that a folder on the host system has to somehow be mounted on the guest Linux system. The way the VM software allow this is via a Shared Folder mechanism. You configure a host folder with a identifier and then this is available to mount within the guest system.</p>
<p>Unfortunately Shared Folders on VirtualBox have always preformed badly with our setup and the VirtualBox 4.o release does nothing to improve that:</p>
<p>Using Apache Bench (ab) I get the following results using Shared Folder:</p>
<pre>$ ab -c 10 -n 500 http://localhost/resource/image/sprite.png
This is ApacheBench, Version 2.3 &lt;$Revision: 655654 $&gt;
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Finished 500 requests

Server Software:        Apache/2.2.14
Server Hostname:        localhost
Server Port:            80

Document Path:          /resource/image/sprite.png
Document Length:        22581 bytes

Concurrency Level:      10
Time taken for tests:   2.753 seconds
Complete requests:      500
Failed requests:        0
Write errors:           0
Total transferred:      11474000 bytes
HTML transferred:       11290500 bytes
Requests per second:    181.63 [#/sec] (mean)
Time per request:       55.058 [ms] (mean)
Time per request:       5.506 [ms] (mean, across all concurrent requests)
Transfer rate:          4070.29 [Kbytes/sec] received

Connection Times (ms)
 min  mean[+/-sd] median   max
Connect:        0    0   0.6      0       5
Processing:    31   55  14.7     50     118
Waiting:       31   54  14.7     50     118
Total:         31   55  14.9     50     120

Percentage of the requests served within a certain time (ms)
 50%     50
 66%     55
 75%     61
 80%     65
 90%     75
 95%     88
 98%    100
 99%    110
 100%    120 (longest request)</pre>

If you unmount the Shared Folder then mount the folder over samba you get the following:
<pre>ab -c 10 -n 500 http://localhost/resource/image/sprite.png
This is ApacheBench, Version 2.3 &lt;$Revision: 655654 $&gt;
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking
localhost
(be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests

Finished 500 requests
Server Software:        Apache/2.2.14

Server Hostname:        localhost
Server Port:            80
Document Path:          /resource/image/sprite.png
Document Length:        22581 bytes
Concurrency Level:      10

Time taken for tests:   1.184 seconds
Complete requests:      500
Failed requests:        0
Write errors:           0
Total transferred:      11473517 bytes
HTML transferred:       11290500 bytes
Requests per second:    422.31 [#/sec] (mean)
Time per request:       23.679 [ms] (mean)
Time per request:       2.368 [ms] (mean, across all concurrent requests)
Transfer rate:          9463.72 [Kbytes/sec] received

Connection Times (ms)
min  mean[+/-sd] median   max
Connect:        0    0   0.3      0       3
Processing:     9   23  19.6     16     121
Waiting:        9   23  19.3     16     121
Total:          9   23  19.6     16     121
Percentage of the requests served within a certain time (ms)

50%     16
66%     20
75%     26
80%     28
90%     39
95%     72
98%    111
99%    115
100%    121 (longest request)</pre>
<p>As you can see you get <strong>422</strong> requests per second over Samba and on <strong>181</strong> when using Shared Folders. I repeated the test on Windows hosts and got similar results.</p>
<p>On VMWare Fusion and the shared folders performed really well.</p>
<p>So it looks like for now we will have to stick to using the samba shares.</p>
]]></description><link>http://clock.co.uk/tech-blogs/virtualbox-40-shared-folders-still-slow</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/virtualbox-40-shared-folders-still-slow</guid><dc:creator><![CDATA[Paul Serby]]></dc:creator><pubDate>Fri, 07 Jan 2011 14:41:11 GMT</pubDate></item><item><title><![CDATA[Visualising live data with the HTML5 canvas]]></title><description><![CDATA[<p>I've been doing some research into representing live statistics visually in web pages. <em>Live</em> meant that bespoke images weren't an option, and I was reluctant (and not well versed enough in the technology) to use flash. This was a perfect opportunity to look in to canvas. Armed with a signed and printed <a href="http://blog.nihilogic.dk/2009/02/html5-canvas-cheat-sheet.html">HTML5 Canvas Cheat Sheet</a> (thanks Dom), Jack and I got busy.</p>
<p>If you're impatient, then skip over to the demo: <a href="http://blog.clock.co.uk/sandbox/canvas/" target="_blank">HTML5 Canvas Chart Demo</a>.</p>
<h3>The Idea</h3>
<p>We wanted to make something worth using the canvas for. It seemed pointless to draw a simple bar chart in canvas when that can be achieved with divs (or any of your favourite generic elements), so we opted to deal in circles, arcs and radians; firstly a form of pie chart, and secondly 'floating blobs'. However, we didn't want to neglect those not lucky enough to own a decent web browser. When browsers encounter tags they don't understand, their content is still rendered – the way it's dealt with may differ, but we can be sure that if we populate the canvas tags with fallback content, it will be displayed in any browser that doesn't support canvas. What's even better, is that although the content between the canvas tags is <strong>not</strong> rendered by the browsers that <strong>do</strong> support it, the contents still exist in the DOM. This is great – we only need one representation of our data; it can reside inside the canvas element and be fetched with Javascript for drawing.</p>
<h3>Building It</h3>
<p>Inside our canvas element, we decided to store our data in an HTML table, <em>shock horror</em>, but that's ok – it's semantic. This data is retrieved by the Javascript and stored in an array for drawing.</p>
<p>Firstly, we did a bit of normalising of our data. For the pie chart we needed to give each piece of data a proportional slice of the circle, and for the blobs it seemed sensible to give them values to add up to 100%. To draw the pie chart, we used the <code>arc()</code> method with a large stroke size. We also varied the stroke size based on the magnitude of the data which gives a nice dynamic effect. For the blobs, we used the <a href="http://en.wikipedia.org/wiki/Polar_coordinate_system"/>Polar Co-ordinate System</a> to divide the circle up in to equal angles based on how many data points there are, and plot the blobs with a radius based on the size of the data.</p>
<p>Here's a screenshot of the result:</p>
<p><a href="http://blog.clock.co.uk/2010/11/03/visualising-live-data-with-the-html5-canvas/screen-shot-2010-11-03-at-15-56-39/" rel="attachment wp-att-314"><img src="http://blog.clock.co.uk/wp-content/uploads/2010/11/Screen-shot-2010-11-03-at-15.56.39.png" alt="HTML5 Canvas Charts" title="Canvas Charts" width="426" height="212" class="alignnone size-full wp-image-314" /></a></p>
<p>So that's all pretty and stuff, but it lacks bells and whistles. We decided to introduce some animation and easing. The process goes something like this:</p>
<ul>
<li>We want the pie to start off with equally sized sections that animate to represent the data we've got.</li>
<li>We've got a draw-once type function <code>drawPie()</code>. Let's factor out the all of the drawing to another method called <code>drawShapeIncrementFromEqual()</code> which takes an argument called <code>progress</code>.</li>
<li>Our <code>drawPie()</code> method should now repeatedly call the <code>drawShapeIncrementFromEqual()</code> passing the <code>progress</code> argument between 0 and 1.</li>
<li>The <code>drawShapeIncrementFromEqual()</code> should draw the chart at its start position if <code>progress = 0</code>, and at it's finishing position if <code>progress = 1</code>, and a linear progression for all values between.</li>
<li>Now in our <code>drawPie()</code>, instead of passing our <code>progress</code> variable straight to the drawing method, we can run it through a custom easing method. Here we've chosen a nice bouncing ease.</li>
</ul>
<p><a href="http://blog.clock.co.uk/sandbox/canvas">Here's what we've ended up with.</a></p>
<h3>Creating the Fallback</h3>
<p>With a bit of CSS and some help from jQuery we can make the fallback data look nice, and even animate in some bar charts. The check for canvas support is simple: <code>getElementById("myCanvasId").getContext</code> will be undefined if canvas is not supported. Take a look at the fallback in your normal canvas capable browser; I've broken the canvas tag to make the fallback kick in.</p>
<p><a href="http://blog.clock.co.uk/sandbox/canvas/fallback.html">Canvas fallback</a>.</p>
<h3>Unfinished Business</h3>
<p>The thing that these charts are missing most is a key. What use is the data if we don't know what it represents? Obviously if we were to use this in a real-life situation then we would make one, but we confess we spent longer on tweaking the easing method than worrying about this!</p>
<p>If you haven't looked at the demo in IE (any version) yet, then <em>don't</em>! It is displaying the fallback content, but the fallback Javascript isn't executing. There are two things that could happen from here: either it's not possible for the javascript to interact with content inside an unrecognised tag. This is the worst case, and I doubt its likelihood, but it could just be styled with some simple CSS. Otherwise IE's not happy with some of the Javascript (somewhat more likely I think), and we could just fix that. I'll save this for a rainy day though, unless anyone would like to offer up any ideas!</p>
]]></description><link>http://clock.co.uk/creative-blogs/visualising-live-data-with-the-html5-canvas</link><guid isPermaLink="true">http://clock.co.uk/creative-blogs/visualising-live-data-with-the-html5-canvas</guid><dc:creator><![CDATA[Ben Gourley]]></dc:creator><pubDate>Wed, 03 Nov 2010 17:14:08 GMT</pubDate></item><item><title><![CDATA[Phing Filterset Custom Task]]></title><description><![CDATA[<p>I couldn't find anywhere online to quickly show me how to use filtersets in a custom phing target, so I worked it out myself and thought I'd bash it out here. Not much to it I know, but always nice for a reference!</p>
<p>Filtersets allow recursion through files with specific includes and excludes, and can be referenced in future if given a specific ID.</p>
<p><script src="https://gist.github.com/901810.js?file=phing-filterset-task.php"></script></p>
]]></description><link>http://clock.co.uk/tech-blogs/phing-filterset-custom-task</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/phing-filterset-custom-task</guid><dc:creator><![CDATA[Dom Udall]]></dc:creator><pubDate>Mon, 13 Sep 2010 17:06:07 GMT</pubDate></item><item><title><![CDATA[A Few Useful Online Tools]]></title><description><![CDATA[<p><strong><em>Online tools used to be fairly limited and not that useful for business, traditional offline software used to dominate - but I now find myself using more and more online solutions. A few to mention:</em></strong></p>
<p><strong><em>
</em></strong></p>
<p><a href="http://basecamphq.com/"><img class="alignleft" style="margin-left: 10px; margin-right: 10px;" title="Basecamp" src="http://johnnyholland.org/wp-content/uploads/basecamp-logo.png" alt="" width="218" height="147" /></a><strong>#1 Basecamp:</strong> It brings the projects (and teams) discussions/assets etc together  quite seamlessely and it means you can always refer to agreements and  designed/techinal routes for agile projects.</p>
<p>The milestones and to-do’s are a also a great tool for keeping things  in-check.</p>
<p>It's my first port-of-call, it's strangely addictive!</p>
<p><a href="http://www.evernote.com/"><strong><img class="alignleft" style="margin: 10px;" title="Evernote" src="http://www.evernote.com/about/media/img/logo.png" alt="" width="196" height="49" /></strong></a></p>
<p><strong>#2 Evernote:</strong> Use Evernote to save your ideas, things you see, and things you like.  For free.</p>
<p><a href="http://www.mindmeister.com/"><strong><img class="alignleft" style="margin: 10px;" title="Mindmeister" src="http://www.mindmeister.com/stylesheets/skins/default/images/logo_anon.png?1278618472" alt="" width="278" height="53" /></strong></a><strong> </strong></p>
<p><strong>#3 Mindmeister:</strong> A new one for me. Seems fantastic for getting ideas onto paper &amp; forming product backlogs etc</p>
<p><a href="http://www.google.com/reader/"><img class="alignleft" style="margin: 10px;" title="Google Reader" src="http://www.geakz.com/wp-content/uploads/2009/08/google_reader_logo.png" alt="" width="150" height="118" /></a><strong> </strong></p>
<p><strong>#4 Google Reader: </strong>Read your news in one place, sounds obvious - not everyone does it.</p>
<p>Also being able to filter really helps, such as tech news <a href="http://feeds2.feedburner.com/ibuildingstechportal">Tech Portal</a> <a href="http://www.popsci.com/rss.xml">Popsci</a> &amp; <a href="http://phpbenelux.eu/en/aggregator/rss">PHP Benelux</a></p>
]]></description><link>http://clock.co.uk/misc/a-few-useful-online-tools</link><guid isPermaLink="true">http://clock.co.uk/misc/a-few-useful-online-tools</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Mon, 19 Jul 2010 12:40:54 GMT</pubDate></item><item><title><![CDATA[Eclipse PDT Templates assisting CS]]></title><description><![CDATA[<p>Coding Standards are important for a number of reasons:</p>
<ul>
<li> Standards allow everyone to follow the same practices, which lowers  the learning curve when moving between projects.</li>
<li> Coding standards make the reading of source code easier, thus  lowering the time needed by a developer to understand it.</li>
<li> Standards make projects easier to maintain.</li>
<li> 80% of the software life-cycle is maintenance (<a href="http://java.sun.com/docs/codeconv/">Sun Microsystems</a>).</li>
<li> Software is often not maintained by the original author.</li>
</ul>
<p>For standards of any kind to work EVERYONE MUST do their best follow  them.</p>
<p>With that in mind, Eclipse PDT has a very useful tool for setting the layout of classes, functions, logical statements and the like - it's called templates.<a href="http://blog.clock.co.uk/wp-content/uploads/2010/07/pdt-templates.png"><img class="alignright size-medium wp-image-208" style="margin: 10px;" title="pdt-templates" src="http://blog.clock.co.uk/wp-content/uploads/2010/07/pdt-templates-300x251.png" alt="" width="300" height="251" /></a></p>
<p><em>Fire up Eclipse and take a look at Preferences &gt; PHP &gt; Editor &gt; Templates</em>.</p>
<p>The name column indicates what you need to type to insert a template.</p>
<p>For instance, to insert the elseif statement, type the name "elif" followed by Control + Space bar   (select the template), and hit enter/return, and <strong><em>hey presto</em></strong> - a Clock coding standards else if statement pre-formatted for your usage.</p>
<p>These templates allow for import and export, so ensuring your developers have imported the templates, you can rid of statements like "oh I didn't know we structured function comments like that" et cetera.</p>
<p><img src="file:///C:/Users/ArnIIe/AppData/Local/Temp/moz-screenshot-1.png" alt="" /></p>
]]></description><link>http://clock.co.uk/tech-blogs/eclipse-pdt-templates-assisting-cs</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/eclipse-pdt-templates-assisting-cs</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Wed, 14 Jul 2010 16:48:55 GMT</pubDate></item><item><title><![CDATA[The Future of Captcha?]]></title><description><![CDATA[<p>I saw an interesting post on <a title="forrst.com" href="http://forrst.com" target="_self">forrst.com</a> this morning which was a screenshot of a planned method for making Captcha easier for users and still stop robots / spammers from filling out your forms.</p>
<p>Captcha at the moment requires users to decipher a series of distorted characters and enter them in a text box to confirm they are actually human.</p>
<p><a href="http://blog.clock.co.uk/wp-content/uploads/2010/07/captch-slider1.jpeg"><img class="alignright  size-full wp-image-195" title="They Make Apps Captcha Slider" src="http://blog.clock.co.uk/wp-content/uploads/2010/07/captch-slider1.jpeg" alt="" width="248" height="126" /></a>The concept behind the new idea is to use a slider instead of entering characters. <a href="http://theymakeapps.com">They Make A</a><a href="http://theymakeapps.com">p</a><a href="http://theymakeapps.com">ps</a> use it for their <a href="http://theymakeapps.com/users/add">sign up form</a>.</p>
<p>Personally I think it's a great idea however implementations need to be throughly thought through to ensure it actual does the job of what it is supposed to do.</p>
<p>Possible solutions could be made using flash, Javascript or even HTML5.</p>
<p>I am not sure if it will take off, but I really like the idea. What do you think?</p>
]]></description><link>http://clock.co.uk/tech-blogs/the-future-of-captcha</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/the-future-of-captcha</guid><dc:creator><![CDATA[Tom Smith]]></dc:creator><pubDate>Tue, 13 Jul 2010 14:00:51 GMT</pubDate></item><item><title><![CDATA[Mooving the Atom & H.264 Video Codec]]></title><description><![CDATA[<p>Today I was held up by our Flash video player not <a href="http://en.wikipedia.org/wiki/Progressive_download">progressively downloading</a> a seemingly regular <a title="View the Wiki on this Flash video format" href="http://en.wikipedia.org/wiki/Flash_Video">F4V</a> video uploaded by a client. The symptoms of this meant that the person watching the video would get a blank screen up until 100% of the video had downloaded, often minutes later.</p>
<p>I used <a title="Free tool to determine codecs used on a video file" href="http://www.headbands.com/gspot/v26x/index.htm">G-Spot</a> to determine that the video and audio codecs used within the video were standard to Flash 9+ <a href="(http://en.wikipedia.org/wiki/H.264">H.264</a> and <a href="http://en.wikipedia.org/wiki/Advanced_Audio_Coding">AAC</a>. This was unusual as I had tested with this type of video before, and the videos progressively loaded as expected.</p>
<p>After some searching, it is the <a href="http://www.adobe.com/devnet/flashplayer/articles/hd_video_flash_player_02.html">Moov</a> atom that is responsible. It is needed to be at the beginning of the file for the player to index the video keyframes. Major video editing software packages (including Premier, After Effects and Final Cut Pro) by default place this critical information at the end of the file.</p>
<p>There are a few small tools out there to simply replace the atom to the front of the file including:</p>
<ul>
<li><a href="http://www.videohelp.com/tools/MP4Box">MP4Box</a> - An open source MP4 multiplexer that can move the atom through a simple CLI command:</li>
</ul>
<pre style="padding-left: 60px;">MP4Box -inter 0 test.mp4
</pre>
<ul>
<li><a href="http://renaun.com/blog/2010/06/qtindexswapper-2/">QTIndexSwapper</a> - An Adobe Air application that does the same thing. It seems to be a very popular tool that is still in development, however for the files I was using I found it did not work and errored:
<em>"ERROR: The MOOV atom is not located at the end of the file, the file is ready for progressive download or it is a invalid file"</em></li>
</ul>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 138px; width: 1px; height: 1px; overflow: hidden;">http://renaun.com/blog/2010/06/qtindexswapper-2/TQ</div>

]]></description><link>http://clock.co.uk/tech-blogs/mooving-the-atom-h264-video-codec</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/mooving-the-atom-h264-video-codec</guid><dc:creator><![CDATA[Elliot Coad]]></dc:creator><pubDate>Tue, 29 Jun 2010 20:13:37 GMT</pubDate></item><item><title><![CDATA[The Tea Game]]></title><description><![CDATA[<p>In order to make the tea making fair in the workplace, we have concocted a game to distribute the tea/coffee making responsibilities.</p>
<p>It goes like this:</p>
<h3>Objective</h3>
<p>Not to be the player with the lowest card (ace is high) or to be the  player holding a red Queen.</p>
<h3>The Dealer</h3>
<p>The dealer can be 1 or more players. They are the loser of any  previous games. and can be carried across any unparticipated games  (absent or 'not up for it!' (named the Loomis rule!))</p>
<h3>Setup</h3>
<p>The loser of any previous games.. "The tea making loser" (dealer)  shuffles and fans the playing cards out to be chosen.</p>
<h3>The Game</h3>
<p>Each player picks a card.</p>
<p>The person who draws the lowest card is the loser, and must make the  tea/coffee for every player.</p>
<p>They must ask all players their preferred drink out of Tea or Coffee,  then take all cups down to the kitchen.</p>
<p>Instructions on players preferences can be found on the kitchen  board.</p>
<p>Although they are the loser they have the added benefit of being  exempt from making the tea in the next game, as they become the dealer.</p>
<h3>Action Cards</h3>
<p>If a player pulls the 'Action Card':</p>
<h3>Queen of hearts</h3>
<p>They must collect monies from players, or use the biscuit fund, and  buy the biscuits (within 48 hours).</p>
<p>Multiple rule: if the queen of hearts is pulled again before the biscuits have been bought, then the puller must buy or bake cakes.</p>
<h3>Joker</h3>
<p>The player is exempt for the rest of the day, unless they draw a  Joker again, causing automatic loss.</p>
<h3>A Draw</h3>
<p>In what turns out to be, the unlikely event of a draw. the two (or  more) players must play a face-off. All cards are returned to the  dealer, who shuffles the pack and again fans the cards for the 2 (or  more) tied players.  They compete (lowest card again loses), this is  repeated until a loser is decided.</p>
<h3>Fairplay</h3>
<p>Fair play must ensue, and underhand play will result in a forfeit  decided by the majority group.</p>
<h3>Evolving the Game</h3>
<p>New rules can be implemented but must be agreed by all official  players (including any guest players - if affected)</p>
]]></description><link>http://clock.co.uk/misc/the-tea-game</link><guid isPermaLink="true">http://clock.co.uk/misc/the-tea-game</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Tue, 22 Jun 2010 11:05:45 GMT</pubDate></item><item><title><![CDATA[URL shortners, undoing DNS]]></title><description><![CDATA[<p>I am by no means an expert in DNS or the like, but as my colleague   (Mike) and I were discussing, the premise of DNS was to turn IP   Addresses of servers, which are humanly unreadable (just numbers) into   URLs that are readable and understandable by humans (i.e   www.amazon.com).</p>
<p>Now, as if someone has made a great discovery, URL shortners have   become popular (I am guessing Twitter made them popular?)..</p>
<p>Facebook have one, Twitter have one, as do Amazon and Google.</p>
<p>I don't want to just rant, but why so popular?
Why not just have a system where a User can input 'Link Text' to resolve   character restrictions?</p>
<p>Instead of them actually helping me as a User, they hinder me, I am   now open to phishing - or more realistically, wasting my time going to a   URL that I would have previously not bothered to navigate to!</p>
<p>i.e Check out this awesome link: <a href="http://bit.ly/aNVFpF" target="_blank">http://bit.ly/aNVFpF</a></p>
<p><strong>Stop turning a perfectly usable and good system (DNS) into its   previous incarnation! </strong></p>
<p><strong>Tinyurl and alike may as well have turned www.amazon.com into   72.21.210.250 !!!!!</strong></p>
]]></description><link>http://clock.co.uk/tech-blogs/url-shortners-undoing-dns</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/url-shortners-undoing-dns</guid><dc:creator><![CDATA[Robert Arnold]]></dc:creator><pubDate>Mon, 21 Jun 2010 13:49:50 GMT</pubDate></item><item><title><![CDATA[Branching Policy for SVN]]></title><description><![CDATA[<p>Recently I've been looking into the prospect of switching from our current <a href="http://en.wikipedia.org/wiki/Source_Code_Management">SCM</a> system of SVN to GIT. Linus gives a pretty convincing argument in this <a href="http://www.youtube.com/watch?v=4XpnKHJAok8">video</a> (Thanks to <a href="/people/michael-cronnelly">Michael Cronnelly</a> our Head of Technical Services for hooking me up with this) but for us the business case is not strong enough at the moment. I'll blog about why in detail in the future.</p>
<p>Analyzing the workflows for the two SCMs meant I had a chance to review and document a general policy for versioning, branching and merging. Currently we have a policy but it is passed around like folk-law and evolves during tea game debates. As with most things at Clock, policy is just a guide and the technical leads will still have the final decision on how a project is versioned and branched, but I thought a picture and policy is always nice.</p>
<p>So here is a first draft of an activity diagram to help the team know when to branch, and how to merge projects.</p>
<p style="text-align: center;"><a href="http://blog.clock.co.uk/wp-content/uploads/2010/06/Branching1.png"><img class="size-medium wp-image-117 aligncenter" title="Branching" src="http://blog.clock.co.uk/wp-content/uploads/2010/06/Branching1-300x231.png" alt="" width="300" height="231" /></a></p>

]]></description><link>http://clock.co.uk/tech-blogs/branching-policy-for-svn</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/branching-policy-for-svn</guid><dc:creator><![CDATA[Paul Serby]]></dc:creator><pubDate>Sun, 20 Jun 2010 00:22:25 GMT</pubDate></item><item><title><![CDATA[Opening Clock]]></title><description><![CDATA[<p>Clock have decided to embrace the open source world and release everything we can for all to use. We will open all our policies, development methodologies, software tools, and any assets we produce internally. As much as possible we are going to put it out there for others to use, comment, and criticize.</p>
<p>We are a digital design, build and hosting company with strong technology, visual, UX , and software design skills. Clock started in 1997 and has grown from a small design agency to one of the top 100 web agency in the country. Over the years we have used a lot of open source technology but always retained the IP (intellectual property) over the software and services we have built. At times the battle for IP has been the hardest part of  the contract negotiation with our clients. A few years ago I was talking to our CEO, Syd Nadim, about a deal that had stalled  because we couldn't come to an agreement on the IP of the Clock software framework (Atrox). I suggested to him that rather than repeatably going through this pain in the desperate hope that we would make more money controlling the IP, why didn't we just make it free for all to use. Clients have always paid for our skills and our ability to solve their problems. Giving them our frameworks and toolkits wasn't going to stop us selling the our expertise, at worst they would build new web sties on top of our framework without us. After some debate we agreed it would be better they did that and possibly ask us for support in the future rather than dumping our technology and going with another supplier. From then onwards we offered our software under the <a href="http://www.opensource.org/licenses/bsd-license.php">BSD License</a> which basically gives anyone the rights to do what they like with our code as long as they retain the license and credit us as the authors. This has been working well and the company continued to grow without a dent on revenue from the loss of IP. We now want to take the next step in the open world and actually make everything available and maybe even build a community around some of the tools or services we have produced over the years.</p>
<p>Over the next couple of months myself and others at Clock will be making public our polices, methods and software via this blog. All of this would have previously been for internal eyes only, but I'm hoping that some of it will be of interest to people or and maybe some will contribute feedback and suggestions on how we can make things better.</p>
]]></description><link>http://clock.co.uk/misc/opening-clock</link><guid isPermaLink="true">http://clock.co.uk/misc/opening-clock</guid><dc:creator><![CDATA[Paul Serby]]></dc:creator><pubDate>Sat, 19 Jun 2010 23:43:44 GMT</pubDate></item><item><title><![CDATA[The Joys of Patch Files]]></title><description><![CDATA[<p>I haven't been working with SVN that long, but the more I use it, the more I think I couldn't develop properly without it. Today I ran into an issue that I knew would crop up at some point, but for some reason never had. Let me set the scene:</p>
<p>I'm currently working on a large project which is in the final stages of development. There's an API being called by another company, and any changes they require means another deployment to the testing environment, and usually they need to be pretty snappy. So I'm developing away in my little development corner, refactoring a fair chunk of the code base, when a request comes in for an extra field to be returned in a call. Simple enough, however I've made about 6 other inter-related changes on that file and if I commit it, it's going to break everything.</p>
<p>On a system that's already previously been developed and has a trunk to be deployed, I'd go with the "make the change to the trunk, deploy, and merge" option, however this project isn't at that stage. Making a whole new branch would be more hassle than it's worth. Enter 'Create Patch'.</p>
<p>When creating a patch in Eclipse, it in essence dumps a diff of the files you want to patch into a text file, and that's it. End of. When applying that patch back to the project, it shows you the changes and allows you to merge them back in. This was perfect. All I had to do was create a patch for my single file, revert back to the head revision, make my simple change, commit it, and apply my single patch back onto the file.</p>
<p>If anyone else has other scenarios that creating a patch is useful in, I'd definitely like to know more!</p>
]]></description><link>http://clock.co.uk/tech-blogs/the-joys-of-patch-files</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/the-joys-of-patch-files</guid><dc:creator><![CDATA[Dom Udall]]></dc:creator><pubDate>Tue, 27 Apr 2010 22:22:55 GMT</pubDate></item><item><title><![CDATA[Missing my friends - Access Visibility in PHP]]></title><description><![CDATA[<p>Is it only me who wants to see the friend access visibility added to PHP so classes within the same package can call each others methods? Now we have Namespaces in 5.3 I see no reason why this form of access visibility has been left out.</p>

<p>Friend or Internal as it is called in C# is added to methods or properties so that only classess in the same packages can access them. I remember in C++ you could actually allow access from classes outside the package, but whenever I needed to do that I then found I could improve the design of my application to keep coupling down.</p>

<p>I often find that when developing an API I have to make many more of the methods public so other classes in the same package can interact, however I don't intend for the end user of the API to every call these methods. This weakens the API because the internal state of object can be changed by the user often simply by mistake but it can cause unnecessary pain for the user or a lot of additional validation within the class making the code bigger and perform worse.</p>

<p>I'm going to follow this up with some examples, but if anyone has any good examples where software design can be improved by the use of Friends please let me know.</p>
]]></description><link>http://clock.co.uk/tech-blogs/missing-my-friends---access-visibility-in-php</link><guid isPermaLink="true">http://clock.co.uk/tech-blogs/missing-my-friends---access-visibility-in-php</guid><dc:creator><![CDATA[Paul Serby]]></dc:creator><pubDate>Fri, 26 Mar 2010 23:46:28 GMT</pubDate></item></channel></rss>