Tag Archives: laravel

Humber Elections

2015 is an election year in the UK, we have a chance to change our government through exercising our democratic right to vote.

To do this effectively we need to know who is standing to represent us and what views they hold on particular subjects.

This information is usually contained in a manifesto which, if the candidate is attached to a political party, is written in conjunction with the party members.

At the last general election, in 2010, the national voter turn out was around 65%, of which the two parties currently governing managed to get about 60% of that vote. So they actually represent around 36% of the population..

Anyone who has any understanding of democracy will realise this is not an ideal position from which to elect a governing party, this lack of representation is leading more and more people to disengage totally from the political landscape. We won’t mention the discourse people feel with the whole of the political set.. That’s another argument!

Engagement of the younger generation has always been poor, with the last election just 52% of 18-24 yr olds voting, these are the very people who will be most affected by the results of any election, it’s their very future which you’re voting on. Due to the very nature they don’t vote in the same numbers as the older generation means that the prospective MP’s don’t court the votes of the young.

Their views are mostly ignited and political promises of the MP’s are usually skewed towards the elderly as they are more likely to vote.

I want to help engage more voters into the political system to chose their future which is why I’ve converted the excellent election application created by Adrian Short.

Adrian is well known for building excellent community engagement through his multiple web applications, on this occasion he created an application to show the results of the various elections in his home town of Sutton.

I’ve converted his application from the Ruby language he wrote it in to the php based Laravel MVC framework. I’ve also placed it under the same leftcase licence that Adrian’s original software was released under.

The source code can be found on github.

The application can be seen at http://humberdata.org/elections

It will allow you to view the results of the elections, the parties, the candidate and their candidacies, it will link them all together and provide a means to find party manifestos.

You’ll also be able to find your nearest polling station by entering your postcode and links to how to register to vote.

Many thanks have to go to Adrian for creating the original code base for me to copy from, it’s so much easier not having to reinvent the wheel!


Small problem when trying to create a custom artisan command – Laravel

I came across a small issue that had me stumped for a while, I was creating a custom artisan command for Laravel and it returned this error when trying:

PHP artisan dump-autoload
{"error":{"type":"ErrorException","message":"Invalid argument supplied for foreach()","file":"\/var\/www\/elections\/vendor\/laravel\/framework\/src\/Illuminate\/Console\/Command.php","line":77}}

Try as I might I couldn’t figure it out, I removed my code bit by bit and it still came up with the error.

Then I realised that I didn’t need any options so I commented out the returning array: e.g.

	protected function getOptions()
		//return array(
		//	array('example', null, InputOption::VALUE_OPTIONAL, 'An example option.', null),

I changed it to:

	protected function getOptions()
		return array(

Then tried the dump-autoload again and no problems, so the solution is here in case anyone has the same issue.

Cisco uccx wallboard

As always with personal blogs – life gets in the way.
In this case life == getting fit, I’ve spent a lot of time cycling and at the gym.
Cycling is, for me, the perfect companion to working at a PC all day, I get to switch off.  My brain has time to disengage from the problem solving and normal thought processes and by the time I’ve finished I feel so much better, both physically and mentally, but I digress..

This post is about a recent project I was asked to get involved in, creating a wallboard for the UCCX equipment we use on one of our service desks. The staff were used to having a wallboard so when we moved across to the UCCX system the costs/benefits of purchasing the official wallboard didn’t stack up (I was led to believe) .

I was asked to look at the problem and with a bit of help from some vbscript code from Stoke Council I set about creating a new front end.

The vbscript code does the database connection via an ODBC connector, this connects every 3 secs to the database and reads from a summary table.  It then creates an XML message which is served via a web server.

Getting the ODBC connector to actually connect was a pain…

Informix is not as easy as MySQL – I’d even say Oracle is easier than Informix!

Some of the gotcha’s that we learnt were that the protocol has to be ‘onsoctcp’.

The client locale (on this occasion) has to be ‘en_US.UTF8’ and we also found that sometimes when the connection failed we could bring it back up by un-checking the ‘use server database locale’ on the environment tab, clicking apply (it fails to connect) and then ticking it back again – click apply and it connects… strange but true.

We also had to set the buffer size to 4096.

All in all it was a serious pain to get a stable connection through to the box but in all fairness, since we figured out the exact requirements of the connection it’s just worked – we rarely have to touch it.

That’s the database side – now onto the front-end, which is on a separate server.

A Laravel based site consumes the XML and updates a dashboard that the service desk staff can read.

It’s a bit convoluted as we need to pass data from one bit of the network to the another but it works and so far has been reliable.

The Laravel front-end was built quickly and used constant feedback from the service desk staff. Getting the right information in the right place was harder than I realised, I think we went through 20 iterations before it settled down.

The front-end is built on top of boot-strap CSS.

It was a fun and simple application to build, the end users are really pleased and we saved the tax payer a bit of cash as we didn’t have to buy the official front end.

Win win..


UCCX bootstrap Laravel based wallboard