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

  <title><![CDATA[OiNutter.co.uk]]></title>
  <link href="http://oinutter.co.uk/atom.xml" rel="self"/>
  <link href="http://oinutter.co.uk/"/>
  <updated>2012-07-15T14:35:52+01:00</updated>
  <id>http://oinutter.co.uk/</id>
  <author>
    <name><![CDATA[Will McKenzie]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Think About The End User!]]></title>
    <link href="http://oinutter.co.uk/2012/07/14/think-about-the-end-user/"/>
    <updated>2012-07-14T17:24:00+01:00</updated>
    <id>http://oinutter.co.uk/2012/07/14/think-about-the-end-user</id>
    <content type="html"><![CDATA[<p>There seems to be a strange belief amongst some developers that just because admin systems aren&#8217;t shown to users, they don&#8217;t have to spend any time on them. The result is control panels that are ugly to look at and a nightmare to use, because they&#8217;ve just been done in the simplest way possible. Honestly, I think this is complete and utter nonsense! If you&#8217;re building something that people, whoever they are, have to interact with and you&#8217;re not considering the user experience, you&#8217;re doing it wrong!</p>

<p>Taking some time to think about how people will be using your admin system and planning accordingly will save everyone a lot of headaches down the line;</p>

<ul>
<li>You&#8217;ll be less likely to have users bugging you about needing the admin to do something else, or to do something easier, which means more time to work on new things, rather than re-doing existing work.</li>
<li>Because the flow of the admin system is clearer and more intuitive, there&#8217;s less chance of users making mistakes and doing the wrong thing with it, meaning you won&#8217;t have to spend time fixing their mistakes.</li>
<li>Information will be presented to the end user much clearer, so you won&#8217;t have to spend as much time explaining to them how it all works.</li>
</ul>


<p>For me there are other benefits to making the admin systems a lot nicer; in web development we spend a lot of our time having to make sure things are cross browser compatible, which can often mean not exploring the latest technologies or ideas, or making things as slick and funky as we&#8217;d like, because some browsers don&#8217;t support the features we&#8217;d need. With admin systems we can often have a bit more say in what browsers people should be using, so we can restrict them to modern, up to date browsers, giving us the opportunity to try out some cool stuff that&#8217;s going to make things much more interesting for both them and us.</p>

<p>Another thing often overlooked is the usefulness of colour. Colour coding information and buttons can give a much quicker visual clue than any label, allowing an end user to gain a broad overview of the information being displayed, just with a glance. This can also help with making the system more intuitive; green buttons for positive actions, red buttons for negative etc.</p>

<p>So next time you&#8217;re building a backend for a site you&#8217;re working on, or just any form of control panel. Stop and think about the end user. If possible ask them about how they would ideally want it to work, treat it like you would the design and developement of the front end and get user feedback throughout the process. Do all this (and act upon it) and you&#8217;ll end up with much happier end users, even if the end user is you.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Announcing Coderwall for iOS]]></title>
    <link href="http://oinutter.co.uk/2012/06/03/announcing-coderwall-for-ios/"/>
    <updated>2012-06-03T14:22:00+01:00</updated>
    <id>http://oinutter.co.uk/2012/06/03/announcing-coderwall-for-ios</id>
    <content type="html"><![CDATA[<p>After 2 months of wrestling with the App Store review process, I am proud to announce the release of my first iOS app, <a href="http://oinutter.github.com/Coderwall-iOS">Coderwall</a>. The app accesses <a href="http://coderwall.com">Coderwall.com</a>&#8217;s API and pulls down all your profile information and your list of achievements etc, and displays it in a native format, giving you access to your, and your friends&#8217;, information on the go.</p>

<p>At the moment the app is a very basic read only affair as Coderwall&#8217;s API is read only, but I know they have plans to expand on the API, particularly to enable access to some of the new features they are adding to the main site, and as they do I&#8217;ll be updating the app to take advantage of those.</p>

<p>The app is free to download for both iPhone and iPad, and also the source is available on <a href="https://github.com/OiNutter/Coderwall-iOS">GitHub</a> for anyone wanting to take a look and use it to help them get started in app development. The app was very much a learning exercise for me, which is why I&#8217;ve made it free to download and open sourced it, in the hope that the lessons I&#8217;ve learned will benefit someone else.</p>

<p>Also if you have any issues, or feature requests, you can use GitHub to tell me about them, or even submit a pull request for them.</p>

<p>There will be a Windows Phone version released, hopefully, in the next few months, will post more about that when it is released, and once I&#8217;ve got that out of the way I&#8217;m going to be looking at adding more functionality to both apps, so watch this space!</p>

<p>I&#8217;d like to say a big thanks to the guys at Coderwall, particularly Matt, who have been really helpful and supportive of me while I&#8217;ve been building this app, particularly in making extra information available to me via the API and in offering to add more functionality so we can make the app even better. Thanks very much guys, hope you like it!</p>

<p><a href="http://oinutter.github.com/Coderwall-iOS">Coderwall-iOS</a> |
<a href="http://itunes.apple.com/us/app/coderwall/id520035280?ls=1&amp;mt=8">On The App Store</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Guggenheim.js - Animated fun for your galleries]]></title>
    <link href="http://oinutter.co.uk/2012/05/19/guggenheim-dot-js-animated-fun-for-your-galleries/"/>
    <updated>2012-05-19T10:02:00+01:00</updated>
    <id>http://oinutter.co.uk/2012/05/19/guggenheim-dot-js-animated-fun-for-your-galleries</id>
    <content type="html"><![CDATA[<p>I&#8217;ve been holding off on posting for a few months as I&#8217;ve had a couple of pretty cool projects that I wanted to get released so I could write about them. Unfortunately they&#8217;re currently hitting a few snags so that&#8217;s going to have to wait. I do however have something else that I cooked up based on an idea for something at work that I would like to share. So without further ado, may I introduce guggenheim.js.</p>

<p>Guggenheim.js is a framework agnostic plugin for your website that will create an animatable gallery. It currently supports animated filtering and reordering of the galler items, as well as the pre-requisite pagination.  It makes use of absolute positioning and hiding the overflow to position each item in the right row and column so that they remain in the correct order but still inside the same container. This enables me to animate the items to their new position when filtering or re-ordering, giving a really cool looking effect.</p>

<p>The animation is using the same code I used on <a href="https://github.com/OiNutter/tipBox">tipBox</a>, but with improvements and fixes that I will eventually port back across. It will use CSS3 animations where available but fallback to Javascript when necessary. The javascript animation is using a modified embedded version of <a href="https://github.com/madrobby/emile">emile</a> with <a href="https://github.com/kangax/emile/commit/bec75a4e684fd701efe1e91069900814a4b55062">Kangax&#8217;s fixes</a> to make it play nicely with opacity in IE8. This gives it a nice, lightweight engine for handling the animation.</p>

<p>I am intending to add functionality to auto generate pagination links, including numbered pagination, but for now you can easily add your own prev and next buttons and call the exposed methods of the guggenheim object.</p>

<p>Check out the Source Code and Examples over on GitHub for more information:</p>

<p><a href="https://github.com/OiNutter/guggenheim.js">Source Code</a> | <a href="http://oinutter.github.com/guggenheim.js">Examples</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA['New Beginnings']]></title>
    <link href="http://oinutter.co.uk/2012/02/19/new-beginnings/"/>
    <updated>2012-02-19T00:16:00+00:00</updated>
    <id>http://oinutter.co.uk/2012/02/19/new-beginnings</id>
    <content type="html"><![CDATA[<p>So assuming anybody out there actually reads this blog more than once, you may have noticed a few things lately. Firstly that I&#8217;ve not posted in far too long,
and secondly that there have been some changes around here. Well, it&#8217;s not just the blog, hence the extended break from posts. As the title of this post suggests
2012 is a year of new beginnings for me. I&#8217;ve started a new job, more on that later, and decided to move my blog away from wordpress and give it a bit of an
overhaul.</p>

<p>Firstly, why the move? Well for one thing having done some work on setting up custom Wordpress sites for people recently I have massively fallen out of love with
it. Don&#8217;t get me wrong, for the layperson who wants a basic blog it&#8217;s great. But for me it just wasn&#8217;t working out. There was also the fact that it was costing me
for hosting and I wanted some cheap decent hosting. Enter <a href="http://octopress.org">Octopress</a>, I&#8217;d seen some information on this a couple of times but never really
properly looked at it, until now. For those that haven&#8217;t heard of it, Octopress is a blogging framework designed with hackers/coders in mind. It&#8217;s built on top of
<a href="http://github.com/mojombo/jekyll">Jekyll</a> the blog-aware static site generator that is used by GitHub pages. The way it works is that you create your posts in
Markdown or HTML files, then run a Rake task which then builds static pages with your content on them. What this means is no database requirements, and technically
no server side language required. This meant I had the choice of 2 (that I knew of) possible hosting options, <a href="http://pages.github.com">GitHub Pages</a> or
<a href="http://heroku.com">Heroku</a>. Both seemed like good options, both were free, had good levels of support and service, and would let me use custom domains. In the end
I decided to go with Heroku as I&#8217;d been wanting to try them out for a while and it gives me a good scalability, so while it&#8217;s free for now, I can add more to it if
I need to. So far this seems to be working out pretty well for me and I&#8217;ve since started hosting another project that I&#8217;m working on with them. As for Octopress,
I&#8217;m really happy with that and would thoroughly recommend it to anyone needing a simple blogging solution.</p>

<p>As for the new job, well I&#8217;m now working at a games company called Eutechnyx in Gateshead. I&#8217;m one of the main Web Developers working on their new Online Racing MMO
Auto Club Revolution. This has been a big change for me as it&#8217;s meant leaving behind PHP and MySQL and embracing Python and MongoDB. I&#8217;ve also had to get to grips with
SVN which has been a considerably less enjoyable process. As for Python and Mongo I&#8217;m really enjoying them. Python is still a strange language to adapt to with it&#8217;s
whitespace orientated style, thankfully the time I&#8217;ve spent using CoffeeScript lately has probably helped a great deal with that. I&#8217;ve also been using Mongo on a private
project I&#8217;m working on with Ruby and Sinatra and finding that really snappy easy to work with once you understand the way embedding documents works.</p>

<p>So what does the future hold for me? Well I think that for now I&#8217;m leaving PHP and MySQL behind. I&#8217;m still going to be continuing in my Javascript development and
looking to bring CoffeeScript into that as much as possible but my server side work is now going to be either Python or Ruby, both of which I&#8217;m having a lot of fun
with at the moment. As for my choice of data storage? I think it&#8217;s safe to say MongoDB is here to stay on that front, although I will miss working out clever SQL
queries.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Introducing Skeletor and Grayskull]]></title>
    <link href="http://oinutter.co.uk/2011/10/20/introducing-skeletor-and-grayskull/"/>
    <updated>2011-10-20T00:00:00+01:00</updated>
    <id>http://oinutter.co.uk/2011/10/20/introducing-skeletor-and-grayskull</id>
    <content type="html"><![CDATA[<p>So this month I&#8217;ve been playing with something new&#8230; again (I&#8217;m going through an experimental phase I guess). This month it was Ruby, or more specifically Ruby Gems. I&#8217;ve used Ruby a little in the Rakefiles I
use for building my javascript projects but not really done any major work with it, until now.</p>

<p>I&#8217;ve been trying to find a nice simple solution for setting up my project skeletons quickly and easily. I&#8217;d thought of some sort of Git repository but then I&#8217;d end up with some faffy process involving multiple
branches for different project types and having to clone a repository and then remove the git repository in the newly cloned folder and well, this didn&#8217;t sound quick or easy. Eventually I hit on the idea of a
command line ruby gem that could use templates defining a directory structure to set up what I needed. A quick search turned up nothing that seemed to do the job, the closest thing was
<a href="https://rubygems.org/gems/bones">Mr Bones</a> but that seemed to be entirely for Ruby projects and the template skeleton wasn&#8217;t easily customisable.  I was disappointed that it existed though as I wanted to name
my gem bones but hey, how many things am I going to write that I can actually justify calling Skeletor?</p>

<p>So I started looking into what was involved in creating ruby gems. Initially I started of using <a href="https://github.com/technicalpickles/jeweler">Jeweler</a> but this created a lot of stuff I didn&#8217;t really understand
so I decided to strip everything back and just look at the structure of some gems I already used. My main source of reference was Sprockets but I also used Capistrano when trying to understand the command line
aspect of the gem. These gave me a good source of reference for what was required in the various gem files.</p>

<p>For anyone who&#8217;s not created gemfiles before the basic folder structure is as follows:</p>

<ul>
<li>lib - contains 1 ruby file with the same name as the gem and a folder also named after the gem which contains all the code for the gem</li>
<li>bin - optional folder that contains the command line executable files for the gem</li>
<li>test - contains the unit test files</li>
<li>a Gemfile that contains the dependencies for the gem</li>
<li>a.gemspec file that contains the configuration details for building the gem</li>
<li>the usual README and LICENSE files in your choice of format</li>
</ul>


<p>I&#8217;m not going to go into the details of each of those files.  I&#8217;d say the best thing to do is to check out the source of some of the gems that you use and that will probably give you the best understanding of
what&#8217;s required. I&#8217;m using <a href="https://github.com/wycats/thor">Thor</a> for the command line interface and <a href="https://github.com/sstephenson/hike">Hike</a> to locate the files in the 2 possible load paths.</p>

<p>Skeletor supports defining a directory structure with files and folders. You can also specify include files which will be copied into the directory, either from a local file or a remote url, and define build
tasks to be run after the directory is set up.</p>

<p>The code for Skeletor is actually pretty simple. Ruby&#8217;s built in YAML.load function converts the template file into a Ruby Hash object which can then be looped through and there is a
<a href="http://flori.github.com/json/">JSON gem</a> that works in the same way. The most complicated part was the validation code as I needed to be able to specify custom data types that a node could match any one of. 
The only gem I could find for YAML validation was <a href="http://www.kuwata-lab.com/kwalify/">Kwalify</a> but that wasn&#8217;t flexible enough for what I needed so I had to write my own. I eventually managed to get a working
validation class that worked for what I wanted and decided to extract it into it&#8217;s own gem so it could be used for other projects, and thus Grayskull was born.</p>

<p>Grayskull will validate JSON and YAML files against a given schema including matching against custom types. All the details for how to create the schema are at the GitHub page, as are the instructions on how to
install and use it. The same goes for Skeletor. Grayskull is also using Thor for the command line as well as the aforementioned JSON gem for validation.</p>

<p>Check out the GitHub repositories for the source code and instructions.</p>

<p><a href="http://github.com/OiNutter/skeletor/">Skeletor</a> | <a href="http://github.com/OiNutter/grayskull">Grayskull</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[A Fistful of Documentation]]></title>
    <link href="http://oinutter.co.uk/2011/09/10/a-fistful-of-documentation/"/>
    <updated>2011-09-10T00:00:00+01:00</updated>
    <id>http://oinutter.co.uk/2011/09/10/a-fistful-of-documentation</id>
    <content type="html"><![CDATA[<p>Thanks to an issue raised on Uncharted by a fellow GitHub user pointing out that a lack of good examples was stopping people see if my work was any good and worth using I&#8217;ve started going through all my projects
and making sure they all have proper example pages and decent instructions in their README files.</p>

<p>So far the following have been updated:</p>

<p>Obscura - <a href="http://oinutter.github.com/Obscura/">Examples</a> | <a href="http://github.com/OiNutter/Obscura#readme">Documentation</a><br/>
Uncharted - <a href="http://oinutter.github.com/uncharted/">Examples</a> | <a href="http://github.com/OiNutter/uncharted#readme">Documentation</a><br/>
Ermintrude - <a href="http://oinutter.github.com/ermintrude/">Examples</a> | <a href="http://github.com/OiNutter/ermintrude#readme">Documentation</a><br/>
tipBox - <a href="http://oinutter.github.com/tipBox/">Examples</a> | <a href="http://github.com/OiNutter/tipBox#readme">Documentation</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Objective-C and iOS Development - Taking My First Steps]]></title>
    <link href="http://oinutter.co.uk/2011/08/26/objective-c-and-ios-development-taking-my-first-steps/"/>
    <updated>2011-08-26T00:00:00+01:00</updated>
    <id>http://oinutter.co.uk/2011/08/26/objective-c-and-ios-development-taking-my-first-steps</id>
    <content type="html"><![CDATA[<p>I recently managed to get myself a Macbook, which besides finally giving me a home computer that can cope with what I&#8217;m throwing at it, has finally enabled me to start looking at iOS development. I&#8217;ve briefly
played with Android development but what little Java skills I picked up at university and was able to remember after all this time weren&#8217;t quite up to the task. So you&#8217;d think that tackling developing in
Objective-C, a language I&#8217;ve never used, would be an even bigger challenge right? Well thankfully I managed to find some help, primarily from iTunes U. If anyone hasn&#8217;t checked this out yet I&#8217;d highly recommend
it, there are a load of free to download lectures from several of the big universities on there (primarily US from what I could see but there were some others). The course I&#8217;ve been following is Stanford&#8217;s
<a href="http://itunes.apple.com/us/podcast/cs193p-student-final-projects/id395605774?i=90218598" title="iTunes U Download for C193p">cs193p</a> course on iOS application development by Paul Hegarty. If you can get past Paul&#8217;s
slightly eccentric seeming nature, anyone wanting to get into iOS development would do well to check this out. I&#8217;m only a few lectures in at the moment but the course has already succeeded in helping me finally
get my head around MVC.</p>

<p>So what do I think of Objective-C? Well I&#8217;m still in my early stages of playing with the language so this is really just a first impression but I think I&#8217;m going to like developing in it, and I certainly think
I&#8217;m going to find it easier and more enjoyable than I ever did Java. It&#8217;s very different from most of the languages I&#8217;ve ever learned and certainly a huge change from the languages I use on a daily basis (PHP
and Javascript). One of the first things I&#8217;ve noticed is how verbose it is. There is very much a convention of the code reading like plain english, with things such as long variable names and methods. The way
methods are defined is one of the primary examples I would give of this verbosity, and of the difference of Objective-C to languages I&#8217;m used to. The following examples show a comparison of how methods are
defined in Actionscript 3 (I know, I know, but it&#8217;s the only langauge I know well enough to write comparison code in that defines the return and argument types) and Objective-C.</p>

<div><script src='https://gist.github.com/1171831.js?file=as3style.as'></script>
<noscript><pre><code>//Actionscript 3 - Method Definitions

//single argument methods
public function doubleNumber(double: number):double;

//multiple argument methods
public function multiplyNumberByAnotherNumber(double: number1,double: number2):double;</code></pre></noscript></div>




<div><script src='https://gist.github.com/1171831.js?file=objcstyle.m'></script>
<noscript><pre><code>//Objective-C Method Definitions

//single argument method
- (double) doubleNumber:(double)number;

//mulitple argument method
- (double) multiplyNumber:(double)number1 byAnotherNumber:(double)number2;

</code></pre></noscript></div>


<p>As you can see the single argument methods are pretty straight forward, return type at the start, followed by the method name, then the argument and it&#8217;s type listed after a semi colon (felt weird having no
brackets). From what I&#8217;ve seen there doesn&#8217;t seem to be any indication of public or private with the method definitions. What seems to happen is that you just don&#8217;t define methods you want to be private in your
header file, which defines the class&#8217; public api. The - at the start of the definition indicates that this is an instance method, a + indicates a static method. The primary difference in the way methods are
defined is when it comes to methods with multiple arguments, where you see this splitting of the method name. The only real purpose I can see of this is that if you write your method names and variables properly
it helps the code read like plain english.</p>

<p>As for developing in XCode, so far I&#8217;m liking it. The built-in Interface Builder Gui tools are really helpful, especially when it comes to linking the controller to your views.  It&#8217;s taking me a little while to
find everything in the property inspectors, possibly because what I&#8217;m looking for isn&#8217;t available for customisation but you never know. The in-line error and warning highlighting is really helpful as it makes it
much easier to see where you&#8217;ve missed that semi-colon or curly brace. I think I&#8217;m really going to like the property synthesization (more on that once I&#8217;ve gone more in-depth with it) that allows the compiler to
auto generate methods for you.</p>

<p>Developing for iOS is going to present me with some new challenges that I wouldn&#8217;t normally have to contend with such as Memory Management, which is going to take some getting used to, but that&#8217;s half the fun.
So hopefully before too long I&#8217;ll be posting about my new app that you can all go and buy and make me millions, (although based on how many readers I probably have  I might be lucky to make a pound!).  I promise
it won&#8217;t be a new fart app!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Obscura - Canvas, CoffeeScript and Micro Frameworks]]></title>
    <link href="http://oinutter.co.uk/2011/06/10/obscura-canvas-coffeescript-and-micro-frameworks/"/>
    <updated>2011-06-10T00:00:00+01:00</updated>
    <id>http://oinutter.co.uk/2011/06/10/obscura-canvas-coffeescript-and-micro-frameworks</id>
    <content type="html"><![CDATA[<p>It&#8217;s been a busy few months so I&#8217;m a bit behind on my posting so hopefully I can get back on schedule now. Once again I&#8217;ve been working on another javascript
library, this time a canvas based image manipulation library called Obscura.</p>

<p>t all started with the arrival on the scene of <a href="http://microjs.com">microjs.com</a> by <a href="http://mir.aculo.us">Thomas Fuchs</a> and <a href="http://dustindiaz.com/">Dustin Diaz</a>.
For those of you who haven&#8217;t heard of it, <a href="http://microjs.com">microjs.com</a> is an index of micro frameworks curated by Thomas and Dustin. The requirements for
inclusion on the site are as follows:</p>

<ul>
<li>Must be written in javascript</li>
<li>Must be less than 5k minified and gzipped</li>
<li>Must be focused on one thing, rather than being a library of all trades</li>
<li>Must have no dependencies</li>
</ul>


<p>I liked the idea of this and was keen to get a listing on there as a step towards my goal of becoming more known in the community. Unfortunately none of my
previous projects met the requirements, so if I wanted in I needed to come up with something else. I&#8217;d seen a tutorial in .Net magazine on image editing using
javascript and canvas and decided I could port my existing PHP ImageHandler class to javascript using canvas as a base.</p>

<p>I also decided to use this as an oppurtunity to try out <a href="http://jashkenas.github.com/coffee-script/">CoffeeScript</a> which I&#8217;ve been hearing a lot about. Once
again, for those out of the loop, CoffeeScript is a lot like <a href="http://sass-lang.com">Sass</a>, which I&#8217;ve mentioned previously, but for Javascript. It&#8217;s a language
that compiles to javascript, so you can write your code in CoffeeScript&#8217;s clearer, more verbose syntax, then compile it to normal working syntax.</p>

<p>I&#8217;m not normally a fan of stuff like this as I&#8217;ve never really seen the point, if you want to write javascript just learn javascript. However both Sass and
CoffeeScript have convinced me that there are benefits to these things. In the case of CoffeeScript the automatic handling of things like scope and variable
declaration make developing a lot easier and safer. The automatic wrapping in a function did cause me some confusion at first, which I&#8217;ll discuss later, but does
prevent any unnecessary pollution of the global scope and can be turned off with a compile option. I am however still adjusting to the braceless syntax which I&#8217;m
not too keen on. I appreciate that it makes the code cleaner and smaller but as a php developer predominantly I&#8217;ve grown used to curly braces or at the very least
some kind of ruby-esque closing statement.</p>

<p>I decided to stick with a small selection of basic image manipulation functions to start with. As I was using my existing PHP library as a starting point I had a
ready supplied list of functions to use, with the basic logic all worked out. All I needed to do was work out how to write the functions in CoffeeScript and
understand how to apply them with canvas. The latter proved to be the more challenging task for the most part. Particularly due to the inconsistencies in how the
W3C&#8217;s canvas spec is implemented in Gecko and Webkit. The main issue I came across was when working on the rotate function. I had been using the
globalCompositeMethod copy to overwrite the existing canvas data which worked fine in Firefox but in Safari and Chrome &#8220;copy&#8221; actually overlays the new data onto
the old, so the original, unrotated image was still visible. I ended up having to create an internal canvas object as a kind of staging area so all manipulations
were performed on that before the finished article was sent to the target canvas.</p>

<p>By far my favourite CoffeeScript feature when writing this was the way it handles scope and the ability to reference the parent object easily when writing the
code made life considerably easier, particularly as all the functions perform operations on internal objects. For any of you who haven&#8217;t played with CoffeeScript
yet or aren&#8217;t familiar with the scope handling, it works like this:</p>

<div><script src='https://gist.github.com/1084753.js?file=example.coffee'></script>
<noscript><pre><code>object -&gt;
    @prop = 'foo'
    @bar = (newProp) =&gt;
        @prop = newProp</code></pre></noscript></div>


<p>Which will compile to this</p>

<div><script src='https://gist.github.com/1084753.js?file=compiled.js'></script>
<noscript><pre><code>(function() {
  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
  object(function() {
    this.prop = 'foo';
    return this.bar = __bind(function(newProp) {
      return this.prop = newProp;
    }, this);
  });
}).call(this);</code></pre></noscript></div>


<p>Notice that CoffeeScript adds the __bind function which is then used to make sure the function executes in the object scope. Granted you can write this yourself
but the syntax of the CoffeeScript is a lot simpler and clearer as to what is going on.</p>

<p>After a few weeks of playing around I got Obscura into a state I was happy with for a first version release. It passed all the tests for inclusion on
<a href="http://microjs.com">microjs.com</a>, coming in at 1.5K compressed and gzipped, so I submitted it for inclusion and got it accepted. Obviously I was pretty pleased
about this as it was one of the main reasons for writing the library in the first place and it was great that my work was considered good enough to be accepted
onto the site but it didn&#8217;t stop there. Later in the same week I got an email from <a href="http://softpedia.com/">Softpedia</a> informing me that one of my projects had
been added to their Scripts section. At first I had no idea what they were talking about as I hadn&#8217;t submitted anything to Softpedia.Upon further investigation it
would appear that they&#8217;ve been scanning other websites and finding libraries and widgets to add to their new Scripts download section. The project they&#8217;d added
was Obscura so what I&#8217;m guessing has happened is they&#8217;ve been scanning through microjs.com and adding projects from there. It also appears they&#8217;ve been using
those projects as starting points to find other projects as throughout the day I got more emails telling me they&#8217;d added other projects that are on my blog and
github account. By the end of it 7 of my projects had been added; <a href="http://github.com/OiNutter/Obscura/">Obscura</a>, <a href="http://github.com/OiNutter/uncharted/">Uncharted</a>,
<a href="http://github.com/OiNutter/zebedee">Zebedee</a>, <a href="http://github.com/OiNutter/ermintrude">ermintrude</a>, <a href="http://github.com/OiNutter/Easel">Easel</a>,
<a href="http://github.com/OiNutter/tipBox">tipBox</a> and <a href="http://github.com/OiNutter/delorean">Delorean</a>. For me this was a huge breakthrough in terms of what I&#8217;ve been
trying to achieve this year as it&#8217;s providing more avenues for people to find out about my work and hopefully use it and help improve it. It&#8217;s also resulted in
people starting to watch my GitHub repositories so hopefully I can build on this and keep raising my profile as the year goes on.</p>

<p>For now feel free to check out Obscura on GitHub for the code and demos</p>

<p><a href="http://github.com/OiNutter/Obscura">Obscura</a> | <a href="http://oinutter.github.com/Obscura">Demos</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Tool tips, javascript animations and coding without a net]]></title>
    <link href="http://oinutter.co.uk/2011/03/28/tool-tips-javascript-animations-and-coding-without-a-net/"/>
    <updated>2011-03-28T00:00:00+01:00</updated>
    <id>http://oinutter.co.uk/2011/03/28/tool-tips-javascript-animations-and-coding-without-a-net</id>
    <content type="html"><![CDATA[<p>I&#8217;ve been working on overhauling the UI experience in the back end systems we use at work and decided that I wanted some tool tips to help tell users what things
do without them having to ask us. The only decent tool tip library I&#8217;ve ever found was <a href="http://www.nickstakenburg.com/projects/prototip/">Prototip</a> by Nick
Stakenburg but I knew I wouldn&#8217;t be able to get away with buying a license for it so I needed to create my own. After my experiences doing the emile.js version of
zebedee I decided to give myself a bit of a challenge and go completely frameworkless to create a standalone widget.</p>

<p>First up was finding out how to do encapsulation in javascript so that I was only giving access to the methods that needed to be accessible from outside the class.
The way this is done is to return an object with the public methods defined in it, rather than doing return this. For purposes of scope I defined the methods
before the return statement, then returned references to them. Like so:</p>

<div><script src='https://gist.github.com/1173224.js?file='></script>
<noscript><pre><code>var toolTip = function(){
    var _privateProp = 'foo',
         _privateMethod = function(){
             return 'bar';
         },
         publicMethod = function(){
             return _privateProp + _privateMethod();
         };
 
    return {
        publicMethod:publicMethod
    }
 
}</code></pre></noscript></div>


<p>Once I had that that figured out it was down to creating the various methods and setting up the event listeners. The main requirement was handling the
positioning of the tool tip in relation to it&#8217;s trigger element. As the position could either be fixed to a point on the trigger or follow the mouse, I ended up
creating an object with either the element properties or the mouse coordinates and using that as the starting reference to perform the calculations from, then
scanned the position option for one of the y position possibilities and set the top and did the same for the x position options. I later expanded this to have an
optional element passed through which would be positioned instead of the tooltip, for use with the animations.</p>

<p>I spent a lot of time going through <a href="http://prototypejs.org">prototype</a> and <a href="http://zeptojs.com">zepto</a> to find out how to do the various things I needed to do
without the frameworks and ended up stealing various little bits of code, like the user agent regular expressions from zepto so I could determine whether the
browser was running webkit, I also tweaked this to check for gecko 2 as well. This was so I could use css animations where available for the transitions. When it
came to dealing with the animation, <a href="http://github.com/madrobby/emile">emile.js</a> ended up being my main source of reference, to the point that when I needed to
expand my original animation function to be more flexible I ended up taking emile&#8217;s animation code and a few of it&#8217;s helpers and tweaking them for my own purposes.</p>

<p>The biggest challenge with doing the animation was the scale transition and positioning it, particularly the css animations. With the javascript animation it was
easy to make the box appear to grow and shrink from it&#8217;s trigger element, as I just needed to call the position method each time I adjusted the size. But with the
css couldn&#8217;t call anything on each iteration so I had to create a test element that was a clone of the tool tip, alter that, reposition it and get the end values,
to then pass through to the animation function. In the end it worked out but I&#8217;d like to play around with it to see if I can get something less long winded. I also
want to have a play to see if it&#8217;s possible to make the text grow and shrink with the box, by using ems. Another interesting thing I discovered while working on the
CSS transitions is that both Gecko 2 and Webkit have their own version of the transition end event, in Gecko 2 you can use transitionend but in webkit you need to
call webkitTransitionEnd. Also this event will get called for each property you are animation, so in the case of the scale transition,where I was animating width,
height,left and top, the event was being called four times. Remember to check for this when writing your handlers.</p>

<p>I ended up namespacing the tool tip function inside a tipBox object, so I could add the scan method and keep them together. This means that while the calls are a
bit longer, the functions are kept neat and secure, and shouldn&#8217;t conflict with anything.</p>

<p>The scan method enables you to have a load of elements on a page (preferably a tags for semantic reasons) with a given class name that you can turn into tipBox
triggers with one function call. All you need to do is pass the class name and the options you want to use to the method and it will scan the page and set up the
tipBox for each one, using the title attribute to supply the text.</p>

<p>I found getting the initial stages of the widget working were a lot easier than I expected, which I take to be a good sign that my understanding and knowledge are
improving (either that or it&#8217;s easier than I thought and I&#8217;m just being a numpty). The animations presented my biggest challenge and took as much time to work
round as everything else did to create but were without a doubt the most rewarding part of it to complete. The whole coding without a net approach forced me to
explore and learn more, and work out my own solutions to how to do things, which was great fun, and will hopefully result in an improvement in my javascript work
from now on.</p>

<p>Code and demos are available on GitHub:</p>

<p><a href="https://github.com/OiNutter/tipBox">tipBox</a> | <a href="http://oinutter.github.com/tipBox/">Demos</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Zebedee - v0.2 - A whole lot of frameworks]]></title>
    <link href="http://oinutter.co.uk/2011/03/04/zebedee-v0-2-a-whole-lot-of-frameworks/"/>
    <updated>2011-03-04T00:00:00+00:00</updated>
    <id>http://oinutter.co.uk/2011/03/04/zebedee-v0-2-a-whole-lot-of-frameworks</id>
    <content type="html"><![CDATA[<p>Ok, there&#8217;s only 3 more but still, it sounds more exciting. Yes, zebedee has made it to version 0.2, my first actual version increment on any of my projects, I
feel quite proud! So what&#8217;s new in version 0.2? Well the main additions are the versions for <a href="http://script.aculo.us">Scriptaculous</a>,
<a href="http://scripty2.com">Scripty2</a> and <a href="https://github.com/madrobby/emile">emile.js</a> Check out the readme for details on what files are needed and how to use them. 
In addition there are also a few bug tweaks, minor reworking of the zepto version to cope with a major restructuring of zepto and the addition of a default panel
option.</p>

<p>For the large part I&#8217;ve kept the code the same on the new versions, the main changes being updating the open and close methods to use each individual library. 
I&#8217;ve also removed functions that were duplications of methods available now available to me in Prototype for the Scriptaculous and Scripty 2 versions.  I did
however keep my own object merge function as it merges more recursively than Prototypes version.  Emile however was much more of a challenge as it is solely an
animation framework and therefore contains no helper methods whatsoever.  Cue a trip deep into zepto&#8217;s code and the
<a href="https://developer.mozilla.org/en-US/docs">Mozilla Javascript Docs</a> to find out how the frameworks do things. I ended up adding a few helper methods to deal with
manipulating the classnames, just to make life easier.</p>

<p>I&#8217;ve also added in the facility for the Scripty 2 version to use Scripty 2&#8217;s ability to use css transitions where available. This is only available on linear and
sinusoidal transitions at the moment but the library will fallback to javascript for the unavailable transitions. In the case of emile the transition calculation
functions have to be provided as an option so I&#8217;ve added a zebedeeTransition object with a selection of functions.  The default object just includes the linear
and sinusoidal transitions but by including the zeb-transitions.js file you can get access to all the transition types of Scripty 2.  The calculations are taken
from Scripty 2&#8217;s included calculations that are based on Robert Penner&#8217;s original AS2 <a href="http://www.robertpenner.com/easing/">easing equations</a>.</p>

<p>Coming up in version 0.3 will be a jQuery version, callbacks for when the panel opens and closes, at both the start and finish of the animation, and the option to
keep one panel open at all times.</p>

<p><a href="https://github.com/OiNutter/zebedee">Zebedee</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Python Wrangling - Getting To Know The Beast]]></title>
    <link href="http://oinutter.co.uk/2011/02/26/python-wrangling-getting-to-know-the-beast/"/>
    <updated>2011-02-26T00:00:00+00:00</updated>
    <id>http://oinutter.co.uk/2011/02/26/python-wrangling-getting-to-know-the-beast</id>
    <content type="html"><![CDATA[<p>Okay, so this month I finally got chance to delve into Python. I&#8217;m using version 3.1, as obviously there&#8217;s no point learning something thats going to be obsolete
fairly soon, although this did make finding examples and stuff harder as the majority of stuff I found was for Python 2.</p>

<p>While I know python is a popular, and very capable, web programming language, I&#8217;m not really interested in that side of it. As far as I&#8217;m concerned I&#8217;ve got PHP
which I use for regular development, and am pretty competent with, and Ruby on Rails, which I&#8217;m starting to try and get my head round, I neither need nor want yet
another contender vying for position as my chosen tool when it comes to developing for the web. What I am very interested in python for, is desktop apps. From
what I&#8217;ve heard python is a pretty good cross platform language with good tie-ins to the operating system and file structure. It also looks a hell of a lot
simpler than C++, which I have tried to master on a few occasions and only ever succeeded in achieving basic competency with.</p>

<p>Now if you&#8217;ve seen any of my other posts you&#8217;ll know that I tend to do a lot of work with Javascript, and also know Actionscript, so you may be wondering why I
don&#8217;t just use Air for building desktop apps. I&#8217;ve used Air before to build small desktop widgets using Actionscript, and will undoubtedly at some point end up
playing around with it a bit more, but for users to run Air apps they&#8217;re required to download the Air runtime, and the last time I looked the Linux version was a
bit behind. What I&#8217;m hoping to get with Python is something I can write once, maybe with some os specific tweaks, and compile to a valid executable/installer for
any system.</p>

<p>So onto my first impressions. For someone that is used to languages like PHP, Javascript and Actionscript, Python is something of a shock to the system. The lack
of curly braces to enclose functions and statements was something I was starting to come to terms with from Ruby, but the lack of any form of closing statement
made reading through the code a somewhat strange experience. My learning project is a file renaming utility so I found the os functions, particularly os.rename()
really useful. I started off just building the app as a command line script, then once I&#8217;d got that basic renaming functionality figured out, (not really that
difficult when it&#8217;s just a call to one built in function), I started looking into adding a gui.</p>

<p>I ended up going with PyQT4, mainly because it was the only free, cross browser GUI framework that worked with Python 3. The hardest part about getting it all
working was finding out how to actually create the window and use the ui. I&#8217;m using the following code:</p>

<p>Where main.ui is my layout xml file. One of the things I liked about PyQT was that it came with a GUI designer utility which lets me just layout the gui as I
wanted it and save it to xml. Makes building the layout much easier. At the moment I&#8217;ve not really done much more than set up a basic gui with ultra simple file
renaming (you select a file, type a new name and hit the big rename button) but I&#8217;m intending to add batch renaming with various renaming actions such as regular
expressions, substringing, extension changing and more.</p>

<p>The main challenge at the moment is understanding how to use PyQt as I&#8217;m afraid the documentation isn&#8217;t particularly novice friendly, being more of a reference
library. Some examples would be handy, especially as I struggled to find anything on google. I think when I&#8217;m a bit more comfortable with things I&#8217;ll post some
examples/tutorials. I&#8217;ll also write a bit more about my python experiences as I get to spend more time with it.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Zebedee - A Multi Framework Accordion Widget]]></title>
    <link href="http://oinutter.co.uk/2011/02/14/zebedee-a-multi-framework-accordion-widget/"/>
    <updated>2011-02-14T00:00:00+00:00</updated>
    <id>http://oinutter.co.uk/2011/02/14/zebedee-a-multi-framework-accordion-widget</id>
    <content type="html"><![CDATA[<p>Zebedee is an accordion widget for multiple frameworks. At the moment it is only at V0.1, which only supports <a href="http://zeptojs.com">zepto.js</a>, but I will be adding
support for various different animation frameworks as I have time. I wanted to play around with Zepto, <a href="http://mir.aculo.us">Thomas Fuchs</a>&#39; new mobile javascript
framework and decided it would be fun to do an accordion widget to see if I could use the CSS3 transitions to animate the opening and closing of the accordion
sections.</p>

<p>It was good fun having to go back to basics on it as I was used to having Prototype and Class.Create() to work with when creating new objects. Thankfully zepto
provided a few good utility functions to keep my code neat and simple. The jQuery like chaining also came in handy in that regard.</p>

<p>I&#8217;ve purposefully kept the functionality simple, as I don&#8217;t really think it needs to be all singing, all dancing! At the moment it supports vertical and
horizontal accordions and I will probably be adding the ability to set the the actual trigger event for the accordion to be bound to a child of the header object.
Also the duration, transition type and trigger event are all configurable, as well as the class names assigned to the various components.</p>

<p>I should hopefully be adding support for Scriptaculous in the next month or so, and Scripty 2 should follow soon after that, so watch this space. In the meantime
checkout the project page at the link below for more information and links to the GitHub source. I&#8217;ll also be popping up some demo pages when I get the chance.</p>

<p><a href="https://github.com/OiNutter/zebedee">Zebedee</a> | <a href="http://oinutter.github.com/zebedee">Demos</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Easel - An AS3 colour manipulation library]]></title>
    <link href="http://oinutter.co.uk/2011/02/13/easel-an-as3-colour-manipulation-library/"/>
    <updated>2011-02-13T00:00:00+00:00</updated>
    <id>http://oinutter.co.uk/2011/02/13/easel-an-as3-colour-manipulation-library</id>
    <content type="html"><![CDATA[<p>Well my post for this month was going to be a tutorial on customising Flash UI components, but unfortunately doing it properly is going to take more time than I
have available to me at the moment so I&#8217;m just going to keep working on that in the background and will post it when it&#8217;s ready.  In the meantime I&#8217;m going to
put up more information about some of my Open Source projects and hopefully get them better known, which in turns should, I hope, accomplish one of the aims of
this blog.  Getting people to help improve my stuff and, by proxy, improving my skills and knowledge.</p>

<p>So first up, purely by virtue of being my most recent, is Easel, a colour (I&#8217;m english, so yes it is spelt right!) manipulation library for Actionscript 3.  Easel
came about from a need to take a randomly generated colour and get colours that would work well with it for dynamically generated objects in a recent project at
work.  At first I just managed to find the <a href="http://lab.revoke.ca/2009/04/as3-color-functions/">Tint library by RevokeLabs</a> which provided me with a darken
function which did the trick for me.  However I then needed more, so I managed to find an algorithm to calculate the complementary colour on a forum somewhere,
which I&#8217;m afraid I can&#8217;t remember, but have subsequently replaced so I don&#8217;t feel too bad about not crediting it.  From there I had the idea of replicating the
colour manipulation functions of <a href="" title="http://sass-lang.com/">Sass</a>, which I&#8217;d read about in a recent .Net tutorial, but hadn&#8217;t had a chance to play around with
(I have now and will no doubt be writing more about this down the line, watch this space!).</p>

<p>I was struggling to find the algorithms to accomplish what I needed in AS3 so I ended up pulling the source for Sass from GitHub and wading through that to find
what I needed.  I then proceeded to rewrite the functions to AS3 which involved rewriting the original manipulation functions from the Tint library as they relied
on manipulating the RGB values whereas Sass was working with the HSL.  I did however keep the getHex and getRGB functions as there seemed to be no real difference
in them.  The upside to this approach was that I learnt a bit about colour manipulations, and got more experience with Ruby code, always a good thing!</p>

<p>Please check out the link below or on the right for the project page which contains links to the GitHub source and the Demo.</p>

<p><a href="https://github.com/OiNutter/Easel">Easel</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[New Year's Resolutions]]></title>
    <link href="http://oinutter.co.uk/2011/01/08/new-years-resolutions/"/>
    <updated>2011-01-08T00:00:00+00:00</updated>
    <id>http://oinutter.co.uk/2011/01/08/new-years-resolutions</id>
    <content type="html"><![CDATA[<p>Ok, so one of my goals for this year is to really start getting involved more in the coding community.  That is the whole intention of this blog, to try and share my learning experiences and provide a home for the various projects I&#8217;m working on in my own time in the hope that other people will find them useful.  There is also the hope that more knowledgeable and more skilled folk than myself might catch wind and offer advice and help to myself.</p>

<p>In actual fact this goal was something I set myself towards the end of last year, which is when I first started setting up this blog, but I never seemed to find time to actually kick it off.  I guess that&#8217;s what New Year&#8217;s resolutions are all about, making you take that step.  So here goes, the blog is now officially live, and you are now, hopefully, reading the inaugural post.</p>

<p>I&#8217;m going to try and post as often as possible on here, probably monthly at the moment until I find enough to write about more often.  I&#8217;ll also be gradually adding pages and links for my various open source playground projects, so I&#8217;ll undoubtedly be posting to launch them and keep you all updated on their progress.</p>

<p>Here&#8217;s to 2011</p>

<p>Will</p>
]]></content>
  </entry>
  
</feed>
