Looking for a new job? with an awesome high-tech/startup?

I have just been involved in launching a new site called http://nerdability.com

The site is a new place that allows us decent, hardworking tech folks to build real, representative resumes to help cut through the endless crap that is so often the tech recruiting process.

No one is really at fault with the problems in the current recruitment process. We know it's really tough to hire tech people, as its a specialist skill blended with a touch of creativity and art, so how in the world can a potential employer/recruiter realistically asses whether we can actually do what we claim?  Enter NerdAbility. NerdAbility is online resume builder that allows users to sign up, and then connect their resume with their blog, stackOverflow profile, GitHub account, etc - the end result being you have a living CV, everytime you get up-voted on StackOverflow, or commit to an open source project you are working on in GitHub, it gets reflected in your resume. So now, you can share a resume (all users have a publicly facing url that they can tweet/facebook/email to recruiters) that really shows what you have achieved, and employers can go ahead and see your code you have commited, or see how you solve problems by your answers on StackOverflow.

There are of course plans to continue building the product, including further code repository integration, but also an opportunity for companies to make profiles and start pitching to you why you should want to go work for them (plus of course, they will be able to list job openings).

It is open to everyone worldwide (y'all know how the internet works) - but being as we are based in London, we will be first targeting the UK and Europe to get wicked-cool startups and hi-tech companies on board.

All in all, we think its pretty ace.

So come on over and join the party




Just another quick one, seems like Google have launched their long awaited G-Drive. Have signed up and got my 5gb free storage and installed the pc software for teh G-Drive, but will post more once I have had a look around.

Check it out here:


Google Shortening URLs

As another quick follow on note from the below, one of the features that was built in to the application was the ability to share your resume or particular achievements with your friends on Twitter. To do this, I obviously wanted to share a link back to the URL of the resume, so to maximise the potential additional text I investigated URL shortening.

Their is a bit.ly API that uses OAuth, but for what I wanted to do, I decided that was overkill, as I didn't necessarily need to associate the shortened URLs to a users bit.ly account, all I really cared about was getting a shortened URL.

Fortunately, Google came to the rescue with their goo.gl URL shortening service that also exposes a public API without need for authentication.

So I simply wrote a service class that utilised the Spring RestTemplate class to shorten URLs:

public class UrlShortenService {

       private RestTemplate restTemplate;

       public UrlShortenService() {
              restTemplate = new RestTemplate(ClientHttpRequestFactorySelector.getRequestFactory());
              List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>();
              messageConverters.add(new StringHttpMessageConverter());
              messageConverters.add(new MappingJacksonHttpMessageConverter());
       public String shortenUrl(String url) {
              Map<String, String> request = new HashMap<String, String>();
              request.put("longUrl", url);
              LinkedHashMap<String, String> shortUrl = restTemplate.postForObject("https://www.googleapis.com/urlshortener/v1/url", request, LinkedHashMap.class);
              return shortUrl.get("id");

I didn't worry too much about validating that the string passed in was a URL for the time being as I always had control of that, but that should be something that would need to be considered.


Spring Social Integration

So, you may notice that I am something of a Spring fan, and generally like to try out different Spring projects where I get the chance. I have been aware of the Spring Social project for a little while (was looking at integrating LinkedIn with flutterby but decided against it), so recently, when a competition was announced in work to create a Java web app in the cloud for a chance to win a new Android tablet I thought this would be a good chance to put together something of a showcase of technology.

As always, the web app is a straight forward Spring MVC project built with the current latest Spring libraries (3.1 - also making use of declarative caching with ehcache, which was nice) and also includes the Spring Data MongoDB integration (again - primarily because it seems to be the most commonly supported NoSQL db in the cloud.. well CloudFoundry and OpenShift anyways). I also took the opportunity to integrate some Spring Social stuff, so I will go through that, as its pretty easy (will post again on some thoughts about Redhat's OpenShift platform and further SpringSocial stuff).

Maven Configuration

First of all, there is obviously some Maven configuration needed in the pom. It took me a little while to find the correct repositories to get all the different Spring Social libraries from (some implementations are less mature than others so not all have full proper releases yet)

	 Spring Maven Snapshot Repository

	 Spring Maven Milestone Repository

 Next we need to add the libraries we need:




As you can see, we take the core Spring Social library, and for my project I also used Twitter and GitHub integration (I also had LinkedIn early on, but removed that as the LinkedIn terms of use on the API are pretty limiting). I added the exclusions to ensure that the latest Spring libraries were being used, as these were declared elsewhere in the Pom.

Storing User Connection Details

Spring Social supports both OAuth1 and OAuth2, and provides the underlying mechanisms to perform the "OAuth Dance" which enables your application (once approived by a user) to capture the access token required to enable your application to access the third party API. Usually your application would capture the user details including access token and store them (encrypted of course!) so the user does not need to approve the application every time they use it. There are examples in the Spring Social showcase on GitHub of doing this with a standard JDBC connection implementation, but as I was capturing my user details in Hibernate I decided to implement a Hibernate version.

To implement your own storage mechanism you need two classes, a ConnectionRepository and a UsersConnectionRepository and must implement the same interfaces:

public class HibernateUsersConnectionRepository implements UsersConnectionRepository { 

public class HibernateConnectionRepository implements ConnectionRepository {

You can see my hibernate implementations here. Obviously I also needed a Hibernate entity to represent this connection details, but that was a straight forward entity as follows:

@Table(name = "CV_CONNECTION")
public class SocialConnection {

       private Long id;
       private String providerId;
       private String providerUserId;
       private String displayName;
       private String profileUrl;
       private String imageUrl;
       private String accessToken;
       private String secret;
       private String refreshToken;
       private Long expireTime;
       private Integer rank;

Configuring the Beans

The next step is to define the  Spring Social beans to use (such as Twitter, GitHub etc) so they can be used throughout the application.

For this I used a Configuration class rather than adding the config directly to my application context xml (this just involves creating a POJO and annotating it with the @Configuration annotation - this then allows you to create code equivalents of xml config that would normally exist in app context xml - we will see more in the details below).

public class SocialConfiguration {

The beans we need to define are the ConnectionRepository, UsersConnectionRepository, ConnectionFactoryLocator and then any Social interface that we are using, in our case Twitter and GitHub.


public ConnectionFactoryLocator connectionFactoryLocator() {
	  ConnectionFactoryRegistry registry = new ConnectionFactoryRegistry();
	  registry.addConnectionFactory(new GitHubConnectionFactory(gitHubKey, gitHubSecret));
	  registry.addConnectionFactory(new TwitterConnectionFactory(twitterKey, twitterSecret));
	  return registry;

The ConnectionFactoryLocator is simply used to initialise the UsersConnectionRepository, for every SpringSocial third party you want to use, you need to add a ConnectionFactory instance as per above - all Spring Social implementations will provide a ConnectionFactory implementation.

The @Bean annotation is like defining a <bean> in the application context xml.


@Scope(value = "singleton", proxyMode = ScopedProxyMode.INTERFACES)
public UsersConnectionRepository usersConnectionRepository() {
	  HibernateUsersConnectionRepository repository = new HibernateUsersConnectionRepository(connectionFactoryLocator(), Encryptors.noOpText());
	  return repository;

This is to configure the UsersConnectionRepository - as you can see, in this case we are telling Spring to instantiate a HibernateUsersConnectionRepository.


This one is straight forward as well - again, using the Hibernate implementation of the interface and

@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public ConnectionRepository connectionRepository() {
	  Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
	  if (authentication == null) {
			 throw new IllegalStateException("Unable to get a ConnectionRepository: no user signed in");
	  ApplicationUser user = (ApplicationUser) authentication.getPrincipal();
	  return usersConnectionRepository().createConnectionRepository(String.valueOf(user.getAccountId()));

You will note that this method also includes an @Scope annotation the value is set to "request" - this is because for every individual user that accesses the applciation, we want them to have access to their own connection (so the application connects to their twitter/github accounts etc, so this bean is scoped to each individual user request (but for user session life). 

ThirdParty Interfaces:

Finally we need a config method for every third party interface that we want to use - they all take a common form as follows:

@Scope(value = "request", proxyMode = ScopedProxyMode.INTERFACES)
public Twitter twitter() {
	if (connectionRepository().findPrimaryConnection(Twitter.class) != null) {
		return connectionRepository().findPrimaryConnection(Twitter.class).getApi();
	return null;

You will note once again these are scoped to  a user's request and simply gets the connection from the ConnectionRepository for the given interface.

Using the Interfaces

Every implementation exposes the third party API, so each will have a specific API available to it to allow you to perform common tasks (depending on the maturity of the implementation, it may only offer a limited subset of the overall API) .

Below is an example of using the Twitter interface in the Spring-Social-Twitter library to post an update:

private Twitter twitter;
public void postTweet(String content) {

As you can see, once the Twitter interface has been configured and injected, it becomes very simple to utilise the API.

On the whole, it is a relatively simple set of libraries to use and offers (an ever growing) set of integrations with third party sites so worth having a look at.

As always, the entire code base is on my GitHub account (if this link fails, then check the GitHub link on the right) and for the time being the application is being hosted on the CloudFoundry platform (although this is still in development, so it may come up and down, and data may be cleared out intermittently - it is not intended as a live production site and you should not put any data in there that you want to keep!) - The application is a dynamic online resume/CV application, that allows users to create a CV as well as pull in data from their GitHub accounts to show off actual examples of code and skills etc.


UK Government Design Principles

Holy crap.

This is great. I really love this - it's hard to believe that this is genuinely something that has been put together by the UK government.

Not perfect aesthetically, but still, just wow..



Spring and Neo4J integration - A Quick WebApp

Following my experimentation with MongoDB and the SpringData integration, I was keen to try out a few other NoSQL options - notably something outside of a document based data store. I had heard about a competition asking for submissions for Neo4J on the Heroku platform, which initially sparked my interest (although as of yet I have not tried it on Heroku) and seeing as Spring Data already had the Neo4J integration I thought I would have a go at it. Plus, I enjoy graphs as a data structure. I have fairly recently done some work on graphs having to implement Dijkstra's algorithm (also the A*) so this seemed like it was going to be fun.

Firstly, the documentation, in the form of an online e-book, for Neo4J Spring Data is awesome. Some guys have put together the e-book based on their experience setting up a Neo4J website and it really does cover everything from the first steps through to more complex stuff around traversal and transaction management. This also means, there is little point in me going through my every step in my app, as it wouldnt be very different from their advice, so most importantly, read this!!!

I will however, just highlight some interesting points i discovered along the way:

1. Simple Annotation based Entites
As you would expect, much like JPA or MongoDB, Neo4J supports simple annotation based configuration of your domain model to simply and quickly describe some pretty rich graph relationships. This is not that unexpected, as it is Spring after all, but worth noting that it is pretty comprehensive and easy to use.

2. Magic Repository Methods
A bit like in Grails, the Neo4J supports "magic" methods, that allow you to just define method names and the query implementation will be completed for you. For example, in your Movie repository (As per the book example, and also my example) if you defined a method such as:

Movie getMovieById(String id);

Then you do not need to provide an implementation, and Spring will automagically do the rest. (the convention being get[DOMAIN_ENTITY]By[ENTITY_PROPERTY]()

From the book: "In our wildest dreams we imagined the method names we would come up with, and what kinds of queries those could generate"

3. Arbor JS Graph Framework
A little while ago I discovered the Arbor JS framework for visualisation of graphs, and its really nice - I had to try and achieve something similar some time last year and got some of the way using core html5/JS but this library is a lot more comprehensive so wanted to have a go.
First, you should check out the demos over at http://arborjs.org/, they are really nice, and make for a really nice graph UI (see screenshot of my app).

4. The Data
I wanted to get some real data, and looked at a few big datasets available online such as the Stanford Large Data Set Network but being as Im only running locally, and I didnt really want to spend too much time getting the data into my graph model I decided to go for a far smaller, simpler dataset - this years Oscar nominations (actors/directors/movies/awards - hopefully you can make out the graph from the screenshot). The data I got from the Guardian (probably UK only) data set blog which also had some nice data sets in it, but this one seemed to be a small enough size for me not to loose too much time to the data.

As always, the code is up on my github, so feel free to check it out, fork/download/mistreat etc..


Retiring my Apps (website)

11:23 AM , 1 Comments

I have decided this weekend to retire my Android app development website (if you haven't already checked it out, you can still find it here for a while). The site was only really to provide more information and a contact method for anyone interested in the apps (and as part of an online portfolio really) but as my focus has been on other things (amongst them being Flutterby) I decided it was time to retire the site.

The apps will still be available of course, from the Android market, and I also updated my photo FX app "The Cutting Room" to be free now (as well as previously open sourcing the Android image processing libraries).


A Programmers Resolutions

The last week or two there was an article linked on HN about 12-month long resolutions for programmers - It was a nice read, so check it out

I would love to say Im gonna do them all, but there has got to be a very slim chance of that.. but there are a few i would like to complete, and some that I will complete just because it happens to match my other plans for the year:

(For more details, or examples of what the OP meant by each point jump through on the link)

  1. Go analog- So yeah, I'm gonna do this one. I love cooking anyway, and always looking to do more of that, and it just so happens I got an awesome BBQ over Christmas, so just waiting for some dry weather to get that out and start spit-roasting some meat. I would love to start a cookery blog, but given how long it takes between posts here, that might be tough.
  2. Stay healthy - would like to try, as always. But we will see.
  3. Embrace the uncomfortable.
  4. Learn a new programming language - Yes, Flutterby released I plan to sit down and learn. Probably a functional language.
  5. Automate.
  6. Learn more mathematics - would love to..
  7. Focus on security.
  8. Back up your data - Im sure I will do this, with so many cloud data offerings this is gonna happen (and already has in places).
  9. Learn more theory.
  10. Engage the arts and humanities- In another life there are loads of other things I would like to have been (wine taster, music producer, phtographer/film maker, movie critic) - and I try to embrace these other things when I get the chance, so maybe I will set up a movie blog for a month.. (watch this space!)
  11. Learn new software.
  12. Complete a personal project - Its on its way, Flutterby! this will hopefully be the January resolution hit at least.

 Check out the link. Has some interesting chat.


Formerly known as Butterfly

My side project, formerly known as "Butterfly", is approaching completion of its first beta approach, which is an exciting time. It has been in development in one way or another for some time, so its going to be great to see it finally getting an early release out there and (hopefully) seeing some feedback from real users.

It's in the final stages of getting together some slides to kind of show it off, sorting out a final URL and hopefully putting together a stand alone WAR file that will come bundled with Jetty/HSQL so users can just fire it up and test it out locally in an attempt to lower the barrier to adoption.

In the meantime, here is a bit of a blurb about what its actually all about..

Having worked in Enterprise software, on large scale projects spread across several geographic sites (often across several countries) we have seen and used several disparate, mediocre tooling to support collaboration and communication across the teams (even across teams on the same site), as an example of this, on my latest project engagement we have the following toolset:

  1. A web application to track defects/bugs
  2. A web application to manage work tickets (for example, requesting infrastructure team to patch/restart servers etc)
  3. A web application to manage internal work items/ToDo lists within the team
  4. An internal wiki
  5. Email (of course)
  6. Online chats

This was not unique to this project, but the obvious problem was that with all these disparate channels and mechanisms it made collaboration more difficult than it probably should be. For example, having multiple web apps to manage common tasks meant that most users were never "always on" any one tool, so to raise a ticket/defect/todo it involved opening app, logging in etc.  It also meant that knowledge was not easily centralised or searchable (searching for info across several web apps, email, and online chat archives is a pain in the ass) - The project attempts to tackle this inefficiency by building a single, user-centric web application that has these common communication and collaboration tasks at its heart whilst also borrowing metaphors and familiar mechanisms from popular social sites such as live feed "walls" for latest activity. Being user-centric it also means we can effectively capture the team/user relationships across the project.

Oh, and its called "Flutterby" now..

(there will be a more detailed write up shortly on the site once launched.. which is still pending the URL)