<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>Eamonn Faherty</title>
 <link href="http://username.github.io/atom.xml" rel="self"/>
 <link href="http://username.github.io"/>
 <updated>2017-04-10T13:25:36+00:00</updated>
 <id>http://username.github.io</id>
 <author>
   <name>Eamonn Faherty</name>
   <email>blog@ineedarobot.co.uk</email>
 </author>

 
 <entry>
   <title>What Is A Stub</title>
   <link href="http://username.github.io/2016/07/01/what-is-a-stub"/>
   <updated>2016-07-01T00:00:00+00:00</updated>
   <id>http://username.github.io/2016/07/01/what-is-a-stub</id>
   <content type="html">&lt;p&gt;Title: What is a stub?
Date: 2016-07-01 23:39
Author: eamonnfaherty
Category: testing
Slug: what-is-a-stub
Status: draft&lt;/p&gt;

&lt;p&gt;I was recently at a python talk where there was a great presentation on testing.  It covered the concepts of mocks, magic mocks and patches but it did not cover stubs.  I found this omission interesting and then I looked through the python code at my place of work and realised that the python code I was looking at always tested using mocks and never used stubs.&lt;/p&gt;

&lt;p&gt;Before I jump into the definition it is good to recap some of the basics:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;The class you are testing is called the &lt;em&gt;subject under test&lt;/em&gt; or &lt;em&gt;sut&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;If your class works with in conjunction with other classes these are called &lt;em&gt;collaborators&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;When you are testing your class you should replace non simple collaborators with &lt;em&gt;test doubles&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mocks are a type of test double but they are not the only type.  You can replace your collaborator with another type of test double - a stub.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Classic And London Style Tdd</title>
   <link href="http://username.github.io/2016/07/01/classic-and-london-style-tdd"/>
   <updated>2016-07-01T00:00:00+00:00</updated>
   <id>http://username.github.io/2016/07/01/classic-and-london-style-tdd</id>
   <content type="html">&lt;p&gt;Title: Classic and London styles of TDD
Date: 2016-07-01 23:39
Author: eamonnfaherty
Category: testing
Slug: classic-and-london-styles-of-tdd
Status: draft&lt;/p&gt;

&lt;p&gt;Within the TDD world there are at least two different schools:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;the classic approach (defined by &lt;a href=&quot;https://www.amazon.co.uk/Test-Driven-Development-Addison-Wesley-Signature/dp/0321146530&quot;&gt;Kent Beck in Test Driven Development&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;the London approach (defined by &lt;a href=&quot;http://www.growing-object-oriented-software.com/&quot;&gt;Steve Freeman and Nat Pryce in Growing Object-Oriented Software Guided by Tests&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The classic approach focuses on building from the bottom up.  You start by defining smaller units in the regular red-green-refactor workflow whereas in the London style you define from the top down.  You define what the system does as a whole and you replace parts as you develop them again in a red-green-refactor workflow.&lt;/p&gt;

&lt;p&gt;The London approach is well suited to object oriented software as you start with a focus on the capabilities of a system.  It is useful when you have a lot of confidence your requirements will not change - for example when you are working with a specification by example approach.&lt;/p&gt;

&lt;p&gt;The classic approach is well suited to non object oriented software as you are focused on the effect&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>What Is An Api</title>
   <link href="http://username.github.io/2015/07/21/what-is-an-api"/>
   <updated>2015-07-21T00:00:00+00:00</updated>
   <id>http://username.github.io/2015/07/21/what-is-an-api</id>
   <content type="html">&lt;p&gt;Title: What is an API?
Date: 2015-07-21 12:38
Author: eamonnfaherty
Category: product
Tags: architecture, api
Slug: what-is-an-api&lt;/p&gt;

&lt;p&gt;Software systems are built to perform an action.  For example, there are software systems that calculate tax, allow you to place an order or send an email.&lt;/p&gt;

&lt;p&gt;It is very easy to think of software systems where the end user is a human.  There is another type of user that exists - other software systems.  For example, the software system that calculates tax may use another software system to discover the current rates of tax, the system that allows you to place an order may use another software system to get calculated delivery costs or the email system may use another software system to store address book / contact details - this is where APIs become very useful.&lt;/p&gt;

&lt;p&gt;When a human user interacts with a software system they may view and click items on a webpage or within an application.  They may even use their voice or perform a physical guesture to interact with the system.  This is described as the graphical user interface (or GUI).  Other software systems can also perform these actions using the same interface.  However, these interactions have been designed to cater for human users.  Software systems and human users are very different to each other.  Software systems can communicate much more concisely and efficiently than human users can.  Also, not all systems have need to cater for a human user.&lt;/p&gt;

&lt;p&gt;API stands for application program interface.  It is a way in which software systems send each other messages.&lt;/p&gt;

&lt;p&gt;In the tax calculator example a human user would click the mouse cursor inside a form field and enter the salary, they would then enter their tax code and then eventually click submit.  This is three interactions with the interface.  If another software system wanted to communicate with the tax calculator it would send all the information and the instruction to perform the action in one interaction.  This is much more concise and efficient.&lt;/p&gt;

&lt;p&gt;So far I have identified the following concepts:&lt;/p&gt;

&lt;p&gt;Interface - a way in which a user interacts with a system
Graphical User Interface - a way in which a human user interacts with a system
Application Program Interface - a way in which a software system interacts with another software system&lt;/p&gt;

&lt;p&gt;There are many different styles of API in existance.  Some are built on standards and consider more aspects that others.  I will describing some of these in future blog posts so stay tuned for updates!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>All Change Again</title>
   <link href="http://username.github.io/2015/07/21/all-change-again"/>
   <updated>2015-07-21T00:00:00+00:00</updated>
   <id>http://username.github.io/2015/07/21/all-change-again</id>
   <content type="html">&lt;p&gt;Title: All change again!?!?
Date: 2015-07-21 12:25
Author: eamonnfaherty
Category: misc
Slug: all-change-again&lt;/p&gt;

&lt;p&gt;I am returning back to blogging! I have updated my site to use the awesome &lt;a href=&quot;http://docs.getpelican.com/en/latest/&quot;&gt;Pelican&lt;/a&gt;.  My upcomming blog posts will be sharing my thoughts, opinions and experiences around the themes of development processes, architecture and tooling.  I have a huge backlog of posts to write so without any more delays here goes!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Wordpress On Docker The Docker Way</title>
   <link href="http://username.github.io/2014/12/11/wordpress-on-docker-the-docker-way"/>
   <updated>2014-12-11T00:00:00+00:00</updated>
   <id>http://username.github.io/2014/12/11/wordpress-on-docker-the-docker-way</id>
   <content type="html">&lt;p&gt;Title: Wordpress on docker (the docker way)
Date: 2014-12-11 00:44
Author: eamonnfaherty
Category: devops
Slug: wordpress-on-docker-the-docker-way&lt;/p&gt;

&lt;p&gt;I have just finished committing my initial version of Wordpress on
Docker.  It is available on
&lt;a href=&quot;https://github.com/eamonnfaherty/fig-docker-wordpress&quot; title=&quot;fig-docker-wordpress&quot;&gt;github&lt;/a&gt; and
available to download.  I have followed the Docker best practices and
have ensured that only one process runs per container.  This was made
possible using fig.&lt;/p&gt;

&lt;p&gt;To use it all you need to do is clone the repo, add an entry to your
hosts file pointing the name example to your docker service and run fig
up.  Once the process has finished running you can go to http://example
to see your instance running.&lt;/p&gt;

&lt;p&gt;I am welcoming pull requests should anyone feel like helping out.  My
todo list is roughly:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;backup/restore of database&lt;/li&gt;
  &lt;li&gt;backup/restore of data container&lt;/li&gt;
  &lt;li&gt;have the static content served by nginx and not the php server&lt;/li&gt;
  &lt;li&gt;switch from php server to php-fpm - thus allowing better concurrency&lt;/li&gt;
  &lt;li&gt;remove index.php from the urls&lt;/li&gt;
  &lt;li&gt;decide what to do next&lt;/li&gt;
&lt;/ul&gt;

</content>
 </entry>
 
 <entry>
   <title>Fig Docker Wordpress</title>
   <link href="http://username.github.io/2014/12/11/fig-docker-wordpress"/>
   <updated>2014-12-11T00:00:00+00:00</updated>
   <id>http://username.github.io/2014/12/11/fig-docker-wordpress</id>
   <content type="html">&lt;p&gt;Title: fig docker wordpress
Date: 2014-12-11 10:04
Author: eamonnfaherty
Category: devops
Slug: fig-docker-wordpress&lt;/p&gt;

&lt;p&gt;I have released a docker/fig combination allowing you to fire up a php,
nginx and mysql containers with the latest version of wordpress
preinstalled.&lt;/p&gt;

&lt;p&gt;I have followed the docker best practices so everything:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;runs in its own container&lt;/li&gt;
  &lt;li&gt;is configurable via the fig.yml file.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/eamonnfaherty/fig-docker-wordpress&quot;&gt;https://github.com/eamonnfaherty/fig-docker-wordpress&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Startup X Under Nda</title>
   <link href="http://username.github.io/2014/12/09/startup-x-under-nda"/>
   <updated>2014-12-09T00:00:00+00:00</updated>
   <id>http://username.github.io/2014/12/09/startup-x-under-nda</id>
   <content type="html">&lt;p&gt;Title: Startup X - Under NDA
Date: 2014-12-09 11:19
Author: eamonnfaherty
Category: projects
Slug: startup-x-under-nda&lt;/p&gt;

&lt;h1 id=&quot;description-of-the-work&quot;&gt;Description of the Work&lt;/h1&gt;

&lt;p&gt;Startup X wanted to build an online labour marketplace.  It was my role
to understand the requirements, build data models and create a custom
build django web app.  The project is not fully live and so I cannot
write about it.  If you would like to know more about what I was doing
please &lt;a href=&quot;http://www.eamonnfaherty.co.uk/index.php/contact/&quot; title=&quot;Contact&quot;&gt;get in
touch&lt;/a&gt;.&lt;/p&gt;

&lt;h1 id=&quot;key-responsibilities&quot;&gt;Key Responsibilities&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;Requirements analysis using UML&lt;/li&gt;
  &lt;li&gt;Data modelling using UML&lt;/li&gt;
  &lt;li&gt;Server provisioning using Fabric&lt;/li&gt;
  &lt;li&gt;Template integration&lt;/li&gt;
  &lt;li&gt;Backend programming using Django&lt;/li&gt;
  &lt;li&gt;Javascript programming&lt;/li&gt;
  &lt;li&gt;Stripe payment integration&lt;/li&gt;
  &lt;li&gt;LinkedIn API integration&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;technical-solution&quot;&gt;Technical Solution&lt;/h1&gt;

&lt;p&gt;I used nginx, gunicorn, django to serve the application.  I used
postgres to store the application data.  I used elasticsearch to power
the search functionality on the site and I used the excellent sentry for
exception monitoring.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.eamonnfaherty.co.uk/wp-content/uploads/2014/12/projectx.png&quot;&gt;&lt;img src=&quot;http://www.eamonnfaherty.co.uk/wp-content/uploads/2014/12/projectx.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h2 id=&quot;matching&quot;&gt;Matching&lt;/h2&gt;

&lt;p&gt;Matching clients who want to pay for work to people who are willing and
able to do the work is at the core of platform x.  This was built using
elasticsearch and custom python code.  I made use of field and model
boosts, as well as some custom logic written in python.&lt;/p&gt;

&lt;h2 id=&quot;currency&quot;&gt;Currency&lt;/h2&gt;

&lt;p&gt;The currency of platform X is hours.  Each hour has a purchase price,
current price and a history of owners.  This enables to the owner of
platform X to calculate liabilities and to ensure price changes will not
cause a loss of earnings.  This was the most rewarding part of the
project for me.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Project Dirt</title>
   <link href="http://username.github.io/2014/12/09/project-dirt"/>
   <updated>2014-12-09T00:00:00+00:00</updated>
   <id>http://username.github.io/2014/12/09/project-dirt</id>
   <content type="html">&lt;p&gt;Title: Project Dirt
Date: 2014-12-09 10:00
Author: eamonnfaherty
Category: projects
Slug: project-dirt&lt;/p&gt;

&lt;h1 id=&quot;description-of-the-work&quot;&gt;Description of the Work&lt;/h1&gt;

&lt;p&gt;Project Dirt had two existing social networking sites hosted on the Ning
platform.  It was my role to extract the data and migrate both of them
to a custom build django web app.  Static HTML templates were produced
by a digital agency and it was up to me to write the python and
javascript code to get the site up and running.  During the project I
had to build data models, prepare the server, write the backend python
code and write the front end javascript code.&lt;/p&gt;

&lt;h1 id=&quot;key-responsibilities&quot;&gt;Key Responsibilities&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;Requirements analysis using UML&lt;/li&gt;
  &lt;li&gt;Data modelling using UML&lt;/li&gt;
  &lt;li&gt;Data migration using PHP and Python&lt;/li&gt;
  &lt;li&gt;Server provisioning using Fabric&lt;/li&gt;
  &lt;li&gt;Template integration&lt;/li&gt;
  &lt;li&gt;Backend programming using Django&lt;/li&gt;
  &lt;li&gt;Javascript programming&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;technical-solution&quot;&gt;Technical Solution&lt;/h1&gt;

&lt;p&gt;I used nginx, gunicorn, django to serve the application.  I used redis
to store user session data and mysql to store the application data.  I
used celery as a task queue with redis as the broker.  I used
elasticsearch to power the search functionality on the site and I used
the excellent sentry for exception monitoring.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.eamonnfaherty.co.uk/wp-content/uploads/2014/12/projectdirt.png&quot;&gt;&lt;img src=&quot;http://www.eamonnfaherty.co.uk/wp-content/uploads/2014/12/projectdirt.png&quot; alt=&quot;projectdirt&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;h2 id=&quot;feeds&quot;&gt;Feeds&lt;/h2&gt;

&lt;p&gt;Within the Project Dirt platform as with most social networks you can be
friends with people and you can follow them.  Becoming a friend/follower
means you subscribe to see updates on what they are doing within the
platform on your feed.  You can also visit their feed to see who they
are following.  I had to decide whether to have complex, expensive
queries when you view a feed and have a simple update query when you
become a friend or follower or to do the inverse.  Given the frequency
of feed views is far higher than the number of friendships/follows
created I decided to have a complex, expensive async task to update
feeds using celery instead so that when a feed is viewed it is a simple,
cheap query.&lt;/p&gt;

&lt;h2 id=&quot;search&quot;&gt;Search&lt;/h2&gt;

&lt;p&gt;Search was a key feature for the Project Dirt platform.  To create a
great user experience it was imperative to be able to run searches
quickly.  I decided to use elasticsearch to gain this performance.  We
were able to deduce a lot of the searches on the site were people
looking for others by name or by skill.  To help these searches I
decided to use the boost functionality from elasticsearch to alter the
relevance of results and thus change the order in which they are
returned.  I also wrote custom search classes that returned snippets of
where the results were found.&lt;/p&gt;

&lt;h2 id=&quot;upstream-caching&quot;&gt;Upstream caching&lt;/h2&gt;

&lt;p&gt;Project Dirt have been featured in the media several times, appear at
community events regularly and have a weekly email newsletter.  These
real life events cause a spike in traffic.  The majority of the traffic
in these situations are from users that are not logged in.  To cope with
the load I decided to use varnish cache as an upstream cache.  I setup
last modified and etag headers on the pages and used nginx to strip
cookies so each non logged user sees the same page - as cached by
varnish.  This means users can view the pages within the server having
to run any python code or contact the database.  This strategy was
planned from the start and so the models within the site were primed to
help with the caching.  This was the most rewarding part of the project
for me.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Appsbooth</title>
   <link href="http://username.github.io/2014/12/09/appsbooth"/>
   <updated>2014-12-09T00:00:00+00:00</updated>
   <id>http://username.github.io/2014/12/09/appsbooth</id>
   <content type="html">&lt;p&gt;Title: Appsbooth
Date: 2014-12-09 11:47
Author: eamonnfaherty
Category: projects
Slug: appsbooth&lt;/p&gt;

&lt;h1 id=&quot;description-of-the-work&quot;&gt;Description of the Work&lt;/h1&gt;

&lt;p&gt;Appsbooth wants to reimagine the most popular sites on the Internet in
such a way that they work together and provide a single user experience.
These sites include Google Mail, Contacts, Calendar, AnyDo, eBay,
CityMapper, Uber, AirBnB, and Park At My House.&lt;/p&gt;

&lt;p&gt;It was my role to sift through the big picture to extract a product that
could be built, marketed and used to bring in revenue.&lt;/p&gt;

&lt;p&gt;After extensive requirements analysis achieved via interviews of the
stakeholder and user research I drove the delivery towards building a
“personal assistant in the cloud” as a first phase.&lt;/p&gt;

&lt;p&gt;The concept was to create an application consisting of a Calendar, ToDo
manager and Addressbook that worked together in harmony and allowed us
to collect data. The application was to provide the user with a
predictive user experience, driven by research I led into mental models
and behavior analysis. Once there was enough data collected on the users
we were going to mine the data to drive recommendations to sell goods
and services through direct sales and affiliate channels.&lt;/p&gt;

&lt;p&gt;Before starting the project I had to build prototypes/tests to prove the
components of the application could work together and that we could mine
the data.&lt;/p&gt;

&lt;p&gt;I led the UX process. I identified the target audience of
self-employed/independently contracting professionals aged 24 – 35 and
conducted interviews to understand the lifestyle and their visual
preferences. I explored the mental models and contexts building up some
example scenarios for the user’s day to understand what we could predict
and how could the application could be of assistance to them.&lt;/p&gt;

&lt;p&gt;Once complete, I initiated the kick off of the feature with the rest of
the team. I ran workshops where I presented initial versions of the
feature through discussions, wireframes and conceptual models –
explaining the user value and the business opportunity that it would
bring.&lt;/p&gt;

&lt;p&gt;I then worked with the visual designer providing prioritized lists of
elements that had to be on screen at a given time. I continued to work
with the visual designer throughout. Providing positive feedback and
questioning design decisions on layout, input method choices and
language – always drawing on the brand guidelines as a base.&lt;/p&gt;

&lt;p&gt;I led on branding, hiring and managing external designers to explore
ideas that we tested internally. I managed external designers supplying
mood boards, brand guidelines and lo fidelity sketches.&lt;/p&gt;

&lt;h1 id=&quot;key-responsibilities&quot;&gt;Key Responsibilities&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;Requirements analysis using UML&lt;/li&gt;
  &lt;li&gt;Data modeling using UML&lt;/li&gt;
  &lt;li&gt;SOA architecture using Python and Docker&lt;/li&gt;
  &lt;li&gt;Server provisioning using Fabric and Docker&lt;/li&gt;
  &lt;li&gt;Template integration&lt;/li&gt;
  &lt;li&gt;Backend programming using Django&lt;/li&gt;
  &lt;li&gt;Javascript programming with AngularJS&lt;/li&gt;
  &lt;li&gt;Recruitment&lt;/li&gt;
  &lt;li&gt;Mentoring&lt;/li&gt;
  &lt;li&gt;Backlog management&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;technical-solution&quot;&gt;Technical Solution&lt;/h1&gt;

&lt;h2 id=&quot;backend&quot;&gt;Backend&lt;/h2&gt;

&lt;p&gt;I built an initial proof of concept service oriented architecture. Each
service was built using nginx, gunicorn, django and ran in a docker
container. I used postgres databases for the services that needed a
persistent layer and I used elasticsearch to power search. The
provisioning and building of servers was fully automated using fabric
and docker.&lt;/p&gt;

&lt;h2 id=&quot;frontend&quot;&gt;Frontend&lt;/h2&gt;

&lt;p&gt;I worked closely with the javascript developer who was tasked with the
building of the frontend web and mobile applications using AngularJS. I
guided him through building reusable components using hologram and
creating automated builds and deploys for web and mobile applications.&lt;/p&gt;

&lt;h2 id=&quot;prototypes&quot;&gt;Prototypes&lt;/h2&gt;

&lt;p&gt;I built the following prototypes:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Twilio – API integration creating accounts, provisioning mobile
numbers, making calls and sending SMS.&lt;/li&gt;
  &lt;li&gt;Email scraping – API integration with gmail, outlook.com using
OAUTH/IMAP to sync emails and plain IMAP for others&lt;/li&gt;
  &lt;li&gt;Addressbook scraping – API integration with gmail, outlook.com using
OAUTH/IMAP to sync emails and plain IMAP for others&lt;/li&gt;
  &lt;li&gt;CARDDAV – API integration with gmail and outlook.com using
OAUTH/IMAP&lt;/li&gt;
  &lt;li&gt;NLP – reading emails to understand their purpose&lt;/li&gt;
&lt;/ul&gt;

</content>
 </entry>
 
 <entry>
   <title>User Stories</title>
   <link href="http://username.github.io/2014/11/16/user-stories"/>
   <updated>2014-11-16T00:00:00+00:00</updated>
   <id>http://username.github.io/2014/11/16/user-stories</id>
   <content type="html">&lt;p&gt;Title: User Stories
Date: 2014-11-16 08:17
Author: eamonnfaherty
Category: product
Tags: agile, requirements
Slug: user-stories&lt;/p&gt;

&lt;p&gt;It may be hard to believe that in 2014 I still often get asked:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;what is a user story?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I thought it might be beneficial to define it here so I can direct
people to my blog for an answer and possibly a discussion instead of
explaining several times (DRY principle).&lt;/p&gt;

&lt;p&gt;To me, a user story is the smallest piece of business value that can be
delivered as a piece of functionality.  For example, an online room
booking system for a hotel is not a user story as it comprises of many
pieces of functionality; searching for rooms, checking availability,
checking price, requesting the booking, seeing the booking status.  Each
of the pieces of functionality can be expressed as a user story
following the three Cs framework from Ron Jeffries.&lt;/p&gt;

&lt;p&gt;The three Cs framework encourages you to see user stories as:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Card - this is the summary of the user story.  The card should be a
reminder for a conversation and should follow the pattern:&lt;/p&gt;

    &lt;blockquote&gt;
      &lt;p&gt;As a USER I would like to DO SOMETHING so I CAN ACHIEVE SOMETHING&lt;/p&gt;
    &lt;/blockquote&gt;

    &lt;p&gt;and should follow the
&lt;a href=&quot;http://en.wikipedia.org/wiki/INVEST_%28mnemonic%29&quot; title=&quot;INVEST&quot;&gt;INVEST&lt;/a&gt;
principle:&lt;/p&gt;

    &lt;blockquote&gt;
      &lt;p&gt;Independent&lt;br /&gt;
 Negotiable&lt;br /&gt;
 Valuable&lt;br /&gt;
 Estimable&lt;br /&gt;
 Small&lt;br /&gt;
 Testable&lt;/p&gt;
    &lt;/blockquote&gt;
  &lt;/li&gt;
  &lt;li&gt;Conversation - this is the capturing of the discussions that occur
or any special information that is needed to deliver the story.  For
example, when considering the searching for room availability there
could be business rules that users can only perform 6 searches an
hour etc.  This is a way of specifying non functional requirements
where a customer has been defined.&lt;/li&gt;
  &lt;li&gt;Confirmation - this is the acceptance criteria describing what needs
to be true before the story can be considered delivered.  It should
describe every possible combination of scenario so the story can
delivered catering for the normal course and every possible
alternative course - that is when things go to plan and when things
do not.  For example, when considering searching for room
availability there should be acceptance criteria for when there are
rooms available and when there are no rooms available.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Following these best practices should stand you in a very good position
where it is clearly defined what is going to be delivered.  It is easy
to fall out of this practice but during planning you should ensure these
criteria are met to ensure everyone knows why they are doing this work,
what the work entails and when the work is complete.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Elasticsearch Sentry Happy Days</title>
   <link href="http://username.github.io/2013/05/21/elasticsearch-sentry-happy-days"/>
   <updated>2013-05-21T00:00:00+00:00</updated>
   <id>http://username.github.io/2013/05/21/elasticsearch-sentry-happy-days</id>
   <content type="html">&lt;p&gt;Title: elasticsearch + sentry = happy days
Date: 2013-05-21 15:06
Author: eamonnfaherty
Category: devops
Tags: elasticsearch, sentry
Slug: elasticsearch-sentry-happy-days&lt;/p&gt;

&lt;p&gt;I have been using the amazing &lt;a href=&quot;https://getsentry.com/&quot; title=&quot;sentry&quot;&gt;Sentry&lt;/a&gt;
for quite some time and I love it. For anybody running a live site it
really is a must!&lt;/p&gt;

&lt;p&gt;I have also recently switched from &lt;a href=&quot;http://xapian.org/&quot; title=&quot;xapian&quot;&gt;xapian&lt;/a&gt;
to &lt;a href=&quot;http://www.elasticsearch.org/&quot; title=&quot;elasticsearch&quot;&gt;elasticsearch&lt;/a&gt; as my
search engine of choice.&lt;/p&gt;

&lt;p&gt;BTW, I am on Ubuntu 12.04, installed elasticsearch via a deb file
downloaded from their site and installed sentry via pip.&lt;/p&gt;

&lt;p&gt;Once I was all setup I wanted to enabling logging of elasticsearch to my
centralised sentry instance. This was a real pain and would have taken
me a lot longer to complete (if at all) if it wasn’t for
&lt;a href=&quot;https://github.com/ColinHebert&quot; title=&quot;Colin Hebert&quot;&gt;ColinHebert&lt;/a&gt; -
&lt;a href=&quot;https://github.com/kencochrane/raven-java/issues/58&quot; title=&quot;details&quot;&gt;details&lt;/a&gt;.
Thanks again!&lt;/p&gt;

&lt;p&gt;Here is what I had to do to get it working:&lt;br /&gt;
Elasticsearch uses log4j for logging but has a yaml file to configure
it instead of a properties file. I had to append this to my
/etc/elasticsearch/logging.yml file:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;sentry: type: net.kencochrane.raven.log4j.SentryAppender dsn: &quot;http://XXXX:YYY@myserver.com/N&quot;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I also change the first line to read:&lt;br /&gt;
&lt;code class=&quot;highlighter-rouge&quot;&gt;rootLogger: DEBUG, console, file, sentry&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;All I did was append sentry to the list of rootLoggers.&lt;/p&gt;

&lt;p&gt;Once the config was sorted I had to download the dependencies:&lt;br /&gt;
raven-3.0-20130516.191912-9.jar&lt;br /&gt;
raven-log4j-3.0-20130516.191940-9.jar&lt;br /&gt;
commons-codec-1.8.jar&lt;br /&gt;
jackson-core-2.2.2-20130512.040915-3.jar&lt;br /&gt;
slf4j-api-1.7.5.jar&lt;/p&gt;

&lt;p&gt;and add them to /usr/share/elasticsearch/lib on the machine hosting
elasticsearch.&lt;/p&gt;

&lt;p&gt;Once that was all done restarting elasticsearch was all that remained
and I was logging to sentry!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Compiling Twitter Bootstrap On The Mac</title>
   <link href="http://username.github.io/2013/04/28/compiling-twitter-bootstrap-on-the-mac"/>
   <updated>2013-04-28T00:00:00+00:00</updated>
   <id>http://username.github.io/2013/04/28/compiling-twitter-bootstrap-on-the-mac</id>
   <content type="html">&lt;p&gt;Title: Compiling twitter bootstrap on the mac
Date: 2013-04-28 09:29
Author: eamonnfaherty
Category: development
Tags: bootstrap
Slug: compiling-twitter-bootstrap-on-the-mac&lt;/p&gt;

&lt;p&gt;Anybody who knows me in the real world has probably heard me rave about
twitter bootstrap. I am not going to get into why it is a good framework
or why frameworks are good in this post. If you would like hear stuff
like that please &lt;a href=&quot;http://www.eamonnfaherty.co.uk/contact/&quot; title=&quot;Contact&quot;&gt;contact
me&lt;/a&gt; and I will see
what I can do.&lt;/p&gt;

&lt;p&gt;This post is about how to compile your very own copy of
&lt;a href=&quot;http://twitter.github.io/bootstrap/&quot; title=&quot;bootstrap site&quot;&gt;bootstrap&lt;/a&gt;! Why
would you want to do that when the nice guys maintaining the package
allow you to choose &lt;a href=&quot;http://twitter.github.io/bootstrap/customize.html&quot; title=&quot;customize bootstrap&quot;&gt;your own colour
scheme&lt;/a&gt;?
I am very grateful for the customise options but I wanted to be able to
able to build the package myself for three reasons: 1) I am a geek and
it is a geeky thing to do, 2) I wanted to be able to customise my theme
and revisit it improving it as a I continue on my project (the customise
page does not have a save/resume feature) and 3) I wanted to create a
colour scheme that did not match the default - I didn’t just want to
choose the colours and watch them cascade through the package. I wanted
to change how the colours cascade through the package.&lt;/p&gt;

&lt;p&gt;Without further delay this is what I did:&lt;br /&gt;
&lt;code class=&quot;highlighter-rouge&quot;&gt;brew install node.js&lt;/code&gt;&lt;br /&gt;
You must have the excellent
&lt;a href=&quot;http://mxcl.github.io/homebrew/&quot; title=&quot;homebrew site&quot;&gt;HomeBrew&lt;/a&gt; installed to
run that command.&lt;/p&gt;

&lt;p&gt;Once I had node.js installed it was a simple case of&lt;br /&gt;
&lt;code class=&quot;highlighter-rouge&quot;&gt;cd twitter-bootstrap-src npm install make clean make bootstrap&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This uses the excellent npm package manager to install the dependencies
for bootstrap and then uses make to clean and build bootstrap. Once it
completed you will have a working bootstrap installation in
twitter-bootstrap-src/bootsrap.&lt;/p&gt;

&lt;p&gt;I hope this helps and if you have any questions post a comment and I
will try to help!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Ios App Signing</title>
   <link href="http://username.github.io/2013/01/26/ios-app-signing"/>
   <updated>2013-01-26T00:00:00+00:00</updated>
   <id>http://username.github.io/2013/01/26/ios-app-signing</id>
   <content type="html">&lt;p&gt;Title: iOS App Signing
Date: 2013-01-26 10:33
Author: eamonnfaherty
Category: development
Tags: iOS
Slug: ios-app-signing&lt;/p&gt;

&lt;p&gt;I have restarted my iOS development and thought how better to celebrate
than writing a blog post.&lt;/p&gt;

&lt;p&gt;iOS is the software that runs on the iPhone, iPod touch, iPad and
AppleTV devices.  It enables apps to be installed, removed, run etc.  It
also has some utility features such as battery monitoring and display
etc.&lt;/p&gt;

&lt;p&gt;In order for a developer to have an app they have written run on iOS it
must be signed using a developer certificate issued by Apple.  This
signing means two things - all apps are developed by people have
approved and every time you build an app is built the author of the app
is verified using the certificate - so nobody can claim to be author of
your app or author an app in your name.&lt;/p&gt;

&lt;p&gt;The developer certificate is not the only thing used in the signing
process.  There is a provisioning profile file used.  During development
and testing apps are signed using a development provisioning profile.
 This profile lists the devices the app can be installed on.  To add
items to the list you must use Apples provisioning center.  When you are
ready to upload your app into the App Store you have to sign your app
using your distribution profile.&lt;/p&gt;

&lt;p&gt;Once you have a signed app you can install the app on your device using
iTunes.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Project Dirt V2 Business Analyst Technical Architect Social Networking Consultant Developer</title>
   <link href="http://username.github.io/2013/01/25/project-dirt-v2-business-analyst-technical-architect-social-networking-consultant-developer"/>
   <updated>2013-01-25T00:00:00+00:00</updated>
   <id>http://username.github.io/2013/01/25/project-dirt-v2-business-analyst-technical-architect-social-networking-consultant-developer</id>
   <content type="html">&lt;p&gt;Title: Project Dirt v2 - Business Analyst / Technical Architect / Social Networking Consultant / Social software engineering
Date: 2013-01-25 15:55
Author: eamonnfaherty
Category: projects
Slug: project-dirt-v2-business-analyst-technical-architect-social-networking-consultant-developer&lt;/p&gt;

&lt;p&gt;I was an agile, business value focused technical architect capturing
requirements, creating solutions and helping improve business processes
along the way.&lt;/p&gt;

&lt;p&gt;I was responsible for all of the data modelling and the migration of two
sites with over 5k users from an off the shelf (undocumented) Ning
platform onto a bespoke Django build.&lt;/p&gt;

&lt;p&gt;I established standards for documentation (using UML) and introduced a
language the business owners used to describe their product to others -
this was the business owners first development project. I introduced the
concept of a backlog and held daily standups to ensure the business
owners could track progress when desired.&lt;/p&gt;

&lt;p&gt;I introduced game mechanics and social engagement circles to help
increase user engagement and provided a solid platform for the business
owners to continue on with. I created the ‘cluster’ feature they are
using to earn revenue and I have provided suggestions of other features
(at scrum story level) with revenue making suggestions.&lt;/p&gt;

&lt;p&gt;I provisioned the whole stack - nginx, gunicorn, celery, mysql, redis,
varnish-cache. I defined and implemented the caching policy - all not
logged in users see the same rendered page so there are no db or django
calls after the first page load until the page is edited. I wrote every
line of python code the site used to go live using libraries like
django-allauth, django-model-utils, django-dajax, easy-thumbnails, pybbm
and django-celery.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Dti Game Design And Build Project</title>
   <link href="http://username.github.io/2012/11/25/dti-game-design-and-build-project"/>
   <updated>2012-11-25T00:00:00+00:00</updated>
   <id>http://username.github.io/2012/11/25/dti-game-design-and-build-project</id>
   <content type="html">&lt;p&gt;Title: DTI - Game design and build project
Date: 2012-11-25 15:55
Author: eamonnfaherty
Category: projects
Slug: dti-game-design-and-build-project&lt;/p&gt;

&lt;p&gt;I worked with the campaign manager, consulting on their game design;
helping with player motivations, player rewards and scoring mechanics.&lt;/p&gt;

&lt;p&gt;I then went on to build the front end game and back end leader board.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>My Caching Tales Part 1</title>
   <link href="http://username.github.io/2012/03/25/my-caching-tales-part-1"/>
   <updated>2012-03-25T00:00:00+00:00</updated>
   <id>http://username.github.io/2012/03/25/my-caching-tales-part-1</id>
   <content type="html">&lt;p&gt;Title: My caching tales - part 1
Date: 2012-03-25 17:47
Author: eamonnfaherty
Category: development
Tags: caching, cdn, django, geo:lat=51.54171669999999, geo:lon=-0.08008210000002691, geotagged, London, nginx
Slug: my-caching-tales-part-1&lt;/p&gt;

&lt;p&gt;I am building a bespoke social network using Django. I am approaching
the first release and I thought it would be a good time to look at the
static asset performance. I installed
&lt;a href=&quot;http://developer.yahoo.com/yslow/&quot; title=&quot;yslow site&quot;&gt;yslow&lt;/a&gt; and tested my
site. I got an F! Arghhh! Luckily, YSlow gives you a lot of guidance on
how to improve your performance. I decided to write up what I did after
@gmsharky asked me to explain a little more about what I was doing. BTW,
after these steps I got to a grade C!&lt;br /&gt;
&lt;!-- more --&gt;&lt;/p&gt;

&lt;h2 id=&quot;cdn-usage&quot;&gt;CDN usage&lt;/h2&gt;

&lt;p&gt;I moved all my static assets and media to dedicated subdomains so that
the session and csrf cookies would not be transmitted whilst the assets
were being requested. This was an easy win thanks to Djangos STATIC and
MEDIA setup.&lt;/p&gt;

&lt;h2 id=&quot;gzip-compression&quot;&gt;GZIP compression&lt;/h2&gt;

&lt;p&gt;I turned on gzip compression within nginx:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt; http { ... gzip on; gzip_http_version 1.1; gzip_vary on; gzip_comp_level 6; gzip_proxied any; gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js; gzip_buffers 16 8k; gzip_disable &quot;MSIE [1-6].(?!.*SV1)&quot;; ... }&lt;/code&gt;&lt;/p&gt;

&lt;h2 id=&quot;expires-and-cookie-turn-off&quot;&gt;Expires and cookie turn off&lt;/h2&gt;

&lt;p&gt;I set far future expiration dates on my static content and disabled
cookies for the urls:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt; server { listen 80; ... location ~* .(?:ico|gif|css|js|jpe?g|png)$ { access_log off; expires max; add_header Pragma public; add_header Cache-Control &quot;public&quot;; break; } ... }&lt;/code&gt;&lt;/p&gt;

&lt;h2 id=&quot;js-and-css-minify&quot;&gt;JS and CSS minify&lt;/h2&gt;

&lt;p&gt;I used &lt;a href=&quot;https://github.com/jezdez&quot; title=&quot;jezdez github page&quot;&gt;jezdez&lt;/a&gt;’s great
&lt;a href=&quot;https://github.com/jezdez/django_compressor&quot; title=&quot;django-compressor&quot;&gt;django_compressor&lt;/a&gt;
library to minify my js and css. This basically read my JS and CSS
declarations and imported them into a single file for each. I had to
tweak this due to possible name conflicts but it worked well in the end.&lt;/p&gt;

&lt;h2 id=&quot;next-steps&quot;&gt;Next steps&lt;/h2&gt;

&lt;p&gt;The next thing for me to do is to use more sprite sheets instead of
seperate images but there are not too many images anyway so I am going
to stop for now.&lt;/p&gt;

&lt;h2 id=&quot;next-post&quot;&gt;Next post&lt;/h2&gt;

&lt;p&gt;In order to improve performance more I introduced
&lt;a href=&quot;https://www.varnish-cache.org/&quot; title=&quot;varnish site&quot;&gt;varnish-cache&lt;/a&gt; to my
stack. I had to do a lot of reading to come up with a working setup and
will post that in another blog post coming soon - I need to finish my
testing first!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Django Development Demystified Pt1</title>
   <link href="http://username.github.io/2012/02/10/django-development-demystified-pt1"/>
   <updated>2012-02-10T00:00:00+00:00</updated>
   <id>http://username.github.io/2012/02/10/django-development-demystified-pt1</id>
   <content type="html">&lt;p&gt;Title: Django development demystified - Part 1
Date: 2012-02-10 11:45
Author: eamonnfaherty
Category: development
Slug: django-development-demystified-pt1&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://djangoproject.com&quot; title=&quot;Django site&quot;&gt;Django&lt;/a&gt; is an amazing
development framework for those who want to separate concerns (write
good, clean code) and want to get the job done - quickly!&lt;/p&gt;

&lt;p&gt;It is written in &lt;a href=&quot;http://python.org/&quot; title=&quot;Python site&quot;&gt;Python&lt;/a&gt; and requires
you to write Python code to use it.  Python differs from PHP.  PHP comes
with most of the libraries you need out of the box and then has PEAR and
PHAR to supply the rest.  Python is a little more fragmented.  With
Python, you have to install the library and then install the python
bindings, which is the python code that allows you to communicate with
the libraries.  For example, if you want to use
&lt;a href=&quot;http://www.mysql.com/&quot; title=&quot;MySQL site&quot;&gt;mysql&lt;/a&gt; you must install mysql and
then the mysql python bindings.  This can be confusing and you can end
up in a world of dependency nightmare!&lt;/p&gt;

&lt;p&gt;With libraries like &lt;a href=&quot;http://pypi.python.org/pypi/pip&quot; title=&quot;Pip site&quot;&gt;pip&lt;/a&gt;,
&lt;a href=&quot;http://vagrantup.com/&quot; title=&quot;Vagrant site&quot;&gt;vagrant&lt;/a&gt; and
&lt;a href=&quot;http://pypi.python.org/pypi/virtualenv&quot; title=&quot;VirtualEnv site&quot;&gt;virtualenv&lt;/a&gt;
and PaaS like &lt;a href=&quot;https://www.dotcloud.com/&quot; title=&quot;dotCloud&quot;&gt;dotCloud&lt;/a&gt; and
&lt;a href=&quot;http://www.heroku.com/&quot; title=&quot;Heroku site&quot;&gt;Heroku&lt;/a&gt; I do not think it is such
a pain anymore.  These problems can now be solved once and shared across
projects.  For my own development (and sanity) I have put together a
bootstrap vagrant file which allows me to build a virtual server.  It
using vagrant, which in turn uses
&lt;a href=&quot;https://www.virtualbox.org/&quot; title=&quot;VirtualBox site&quot;&gt;VirtualBox&lt;/a&gt;, to build a
virtual server and then uses
&lt;a href=&quot;http://wiki.opscode.com/display/chef/Home&quot; title=&quot;Chef site&quot;&gt;Chef&lt;/a&gt; to install
the recipes (which are individual dependencies).  These recipeies
include nginx, postgres etc.  At the end of a couple of commands you end
up with a working virtual server because somebody else has saved a
working set for you.  Great eh!?!&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/ineedarobot/geodjango-env&quot; title=&quot;geodjango-env&quot;&gt;Here&lt;/a&gt; is
my git repo.  To use this all you need to do it install git and
VirtualBox and then run the following commands in a terminal window:&lt;/p&gt;

&lt;p&gt;[code lang=”bash” ]&lt;/p&gt;

&lt;p&gt;git clone https://github.com/ineedarobot/geodjango-env&lt;/p&gt;

&lt;p&gt;cd geodjango-env&lt;/p&gt;

&lt;p&gt;vagrant up&lt;/p&gt;

&lt;p&gt;[/code]&lt;/p&gt;

&lt;p&gt;Once it is up you can login using vagrant ssh and your server is ready!
Any questions please post a comment and I will try to help.  If you spot
any issues with my setup feel free to post an issue on the github repo.&lt;/p&gt;

&lt;p&gt;BTW, this is actually a working setup for geodjango, meaning it installs
Postgres, postgis and the gis libraries needed.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Python Mac Os X Mysql Problems</title>
   <link href="http://username.github.io/2011/06/21/python-mac-os-x-mysql-problems"/>
   <updated>2011-06-21T00:00:00+00:00</updated>
   <id>http://username.github.io/2011/06/21/python-mac-os-x-mysql-problems</id>
   <content type="html">&lt;p&gt;Title: Python Mac OS X MySQL problems
Date: 2011-06-21 06:14
Author: eamonnfaherty
Category: development
Tags: mac os x, mysql, python
Slug: python-mac-os-x-mysql-problems&lt;/p&gt;

&lt;p&gt;I recently had a three hour head banging off of wall session getting
Python to play nicely with MySQL.&lt;/p&gt;

&lt;p&gt;I was getting the following error:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;File
“/Library/Python/2.6/site-packages/Django-1.3-py2.6.egg/django/db/backends/mysql/base.py”,
line 14, in &lt;module&gt;  
 raise ImproperlyConfigured(&quot;Error loading MySQLdb module: %s&quot; % e)  
 django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
module:
dlopen(/Users/eamonnfaherty/.python-eggs/MySQL\_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/\_mysql.so,
2): no suitable image found. Did find:&lt;/module&gt;&lt;/p&gt;

  &lt;p&gt;/Users/eamonnfaherty/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/_mysql.so:
mach-o, but wrong architecture&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This was a complete mix up between 32bit and 64bit Python libraries
working together with MySQL.&lt;/p&gt;

&lt;p&gt;To fix it I put the following in my .profile file&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;export PATH=$PATH:/usr/local/mysql/bin&lt;/p&gt;

  &lt;p&gt;export CC=”gcc-4.0”&lt;br /&gt;
 export CXX=”g++-4.0”&lt;/p&gt;

  &lt;p&gt;export
PYTHONPATH=”/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/”&lt;br /&gt;
 export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/&lt;br /&gt;
 export ARCHFLAGS=’-arch i386’&lt;br /&gt;
 export VERSIONER_PYTHON_PREFER_32_BIT=yes&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After adding this I ran a clean, build and install on the mysql-python
library and everything worked! Phew!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Signals</title>
   <link href="http://username.github.io/2011/06/13/signals"/>
   <updated>2011-06-13T00:00:00+00:00</updated>
   <id>http://username.github.io/2011/06/13/signals</id>
   <content type="html">&lt;p&gt;Title: Signals
Date: 2011-06-13 15:53
Author: eamonnfaherty
Category: development
Tags: actionscript3, signals
Slug: signals&lt;/p&gt;

&lt;p&gt;Anyone that knows me offline has probably heard me singing the praises
of signals.&lt;/p&gt;

&lt;p&gt;I really like the stricter typing of signals compared to events.  For
me, strict typing means that my code is checked by the compiler
(instantly, at compile time) as apposed to being checked by the AVM
(eventually, at runtime).  I have had countless times where I have seen
code fail due to the event types declared in the handler method being
wrong, even when the string values are stored as variables instead of
using literals. The checking that event handlers are added correctly is
not checkable by the compiler.  This means we need to either blindly
hope it all works out or rely on testing.&lt;/p&gt;

&lt;p&gt;Signals (out of the box) fixes this issue but there is still another
issue for me, the contract between an event (also a signal) and its
handler.  With events there are two contracts, the event type (the
Event.type String) and the event data.  Signals (out of the box) handles
the event type issue by moving the name of the type into an interface as
a signal, which is a great idea!  The data problem is harder to solve.&lt;/p&gt;

&lt;p&gt;There are two checks that should be performed on the data.&lt;/p&gt;

&lt;p&gt;The first is validation. At the moment this is limited to type
checking.  When you set up a signal, you specify that the signal should
be an int, String etc.  I think this is a great start but I think there
should be more (optional) validation checks available; range checks for
ints and regex checks for Strings.  When these validations fail then the
signal should have a built in mechanism to throw an InvalidSignalError. 
This would tighten up the robustness of projects using signals and would
definitely reduce the amount of code I write.&lt;/p&gt;

&lt;p&gt;The second check is verification. This is a lot harder to check but is a
much more valuable check to perform. I think this is up to developers to
check when developing. I am currently using signals to send messages
between objects. I like to keep the implementation of my objects hidden
from others so when writing a class I am always mindful of what values
are available to other objects. So, when writing a signal I often find
myself doing the following:&lt;/p&gt;

&lt;p&gt;[code lang=”as3” ]&lt;br /&gt;
public class ShowScreenSignal extends Signal&lt;br /&gt;
{&lt;br /&gt;
private static const MENU:int = 0;&lt;br /&gt;
private static const PLAY:int = 1;&lt;br /&gt;
…&lt;/p&gt;

&lt;p&gt;public function ShowScreenSignal()&lt;br /&gt;
{&lt;br /&gt;
super(int);&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;public function dispatchMenu():void&lt;br /&gt;
{&lt;br /&gt;
dispatch(MENU);&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;public function dispatchPlay():void&lt;br /&gt;
{&lt;br /&gt;
dispatch(PLAY);&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;…&lt;/p&gt;

&lt;p&gt;public function isMenu(message:int):Boolean&lt;br /&gt;
{&lt;br /&gt;
return message = MENU;&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;public function isPlay(message:int):Boolean&lt;br /&gt;
{&lt;br /&gt;
return message = PLAY;&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;…&lt;br /&gt;
}&lt;br /&gt;
[/code]&lt;/p&gt;

&lt;p&gt;This means in my controller/mediator I call signal.dispatchPlay() and in
my listener/command I check signal.isPlay(message) to check the message.
This means nothing knows about the message values other than the signal.
I can change the message to be a String without changing any of my
controllers/mediators/command. This is better encapsulation. This works
really well when using RobotLegs + Signals as you can subtype your
command classes and have a condition in your execute method if
(message.isPlay(message)).&lt;/p&gt;

&lt;p&gt;This is solving one problem. I want to have one signal with many
handlers based on the message. eg:&lt;/p&gt;

&lt;p&gt;[code lang=”as3” ]&lt;br /&gt;
public class ShowPlayCommand extends SignalCommand&lt;br /&gt;
{&lt;br /&gt;
[Inject]&lt;br /&gt;
public var message:int;&lt;/p&gt;

&lt;p&gt;[Inject]&lt;br /&gt;
public var signal:ShowScreenSignal;&lt;/p&gt;

&lt;p&gt;override public function execute():void {&lt;/p&gt;

&lt;p&gt;if (!signal.isPlay(message)) {&lt;br /&gt;
return;&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;//do something&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
[/code]&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Facebook Graph Api Oauth Change</title>
   <link href="http://username.github.io/2011/06/08/facebook-graph-api-oauth-change"/>
   <updated>2011-06-08T00:00:00+00:00</updated>
   <id>http://username.github.io/2011/06/08/facebook-graph-api-oauth-change</id>
   <content type="html">&lt;p&gt;Title: Facebook Graph API oauth change
Date: 2011-06-08 17:37
Author: eamonnfaherty
Category: development
Tags: facebook, php
Slug: facebook-graph-api-oauth-change&lt;/p&gt;

&lt;p&gt;Facebook have changed their Graph API policy so that when you view a
profile feed you need to have a valid oauth access token. See
&lt;a href=&quot;http://developers.facebook.com/blog/post/510/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here is the PHP I used to get the feed of mypage.&lt;/p&gt;

&lt;p&gt;[code lang=”php” ]&lt;br /&gt;
&amp;lt;?php&lt;/p&gt;

&lt;p&gt;//config&lt;br /&gt;
$appId = “999”;&lt;br /&gt;
$appSecret = “I_LOVE_ROBOTS”;&lt;br /&gt;
$feedURL = “https://graph.facebook.com/mypage/feed”;&lt;br /&gt;
$limit = 10;&lt;/p&gt;

&lt;p&gt;//script&lt;br /&gt;
$accessTokenUrl = “https://graph.facebook.com/oauth/access_token”;&lt;br /&gt;
$parameters =
“client_id=$appId&amp;amp;client_secret=$appSecret&amp;amp;grant_type=client_credentials”;&lt;br /&gt;
$accessToken = file_get_contents($accessTokenUrl .  “?” .
$parameters);&lt;/p&gt;

&lt;p&gt;$parameters = “$accessToken&amp;amp;limit=$limit”;&lt;br /&gt;
$result = file_get_contents($feedURL . “?” . $parameters);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
[/code]&lt;/p&gt;
</content>
 </entry>
 
 
</feed>
