Skip to main content


Showing posts from 2013

Local food for Christmas

In the latter part of this year both my brother and I have bought a new house and my second daughter has just arrived in time for Christmas. Because of this my family decided that we should tone down the level of giving this Christmas. To be fair, between the adults we don't actually spend much money, we operate a secret Santa lottery in which each of us, my brother, step sister, our parents and our corresponding partners put our names into a hat and brokered by my brother in law (who is a Jehovah Witness so abstains from the act of giving itself) picks the names for us and let's us know who we have to buy for. It's a reasonable system as it significantly reduces the cost of Christmas. It's main drawback is that you could have one of the poorer benefactors (namely me and my brother) meaning that you get both fewer and lower quality gifts! This year though, because our coffers have already been emptied we decided to still do the secret Santa; but limit the amount

Do I want to cook with a tiny screen next to me eye?

I really enjoyed this video on the BBC about the home and office of the future. . One of my favourite items was the giant screen on the kitchen wall and the display built into the work top of the kitchen. I think the large screen on the wall would definitely add to family live. It would be nice if you could hold up paper items and it takes a scan of them and leaves them on the board (no matter how much I try and get rid of them I still get paper bills and letters through the post that I have to do something about). The other use of the screens in the kitchen was for help with cooking. Google have a similar vision with their Google Glass product (it's one of the user stories here ). I find the screens more compelling than the wearable product for this scenario though. I see Google Glass as being useful for specific tasks, not as something I would wear all the time. One of my concerns is that having my vision fixed on somet

EEG - Recording brainwaves and pushing them to a live web feed.

Last Tuesday our EEG device arrived. I think I almost exploded with excitement. The device itself is very cheap so we don't expect particularly accurate results but it does work and it proves a concept for us more than anything else. This is the device  it's very basic but it does have a decent SDK with it that you can access in a number of ways so you can't complain. There was a different model that I was interested in that cost around £800.00 for the device but it transpired that they wanted a completely insane amount for the SDK (around 10k) so we left them well alone. Initially our plan was just to make sure we could get the readings out of the device which involved pinvoking a dll but the documentation was fairly good. We got that up and running after some fuss with the comm ports etc... Once that was done w

Trello - Free Online Kanban Board

This looks quite interesting as an online Kanban board. Spotted this morning whilst reading the morning brew blog. I am not convinced that you can emulate a Kanban board successfully but this seems a nice little solution for organising a group of tasks. In a similar manner to Pivotal you can Label tasks but I don't think it's quite as extensive as Pivotal. I think one of these tools would be really nice if you could tie them up with a git commit or so when someone picks it up to QA then can easily see the changes as part of the card. via >>  >>

Decoupled Responsibilities in Javascript

I have been updating the North 51 Coding standards for the benefit of the NHS and I had to stick a couple of things onto Gist so I thought I would share them here as well as the code isn't specific to anything internal to us. Some of our legacy javascript code is quite poor and we are addressing that at the moment. With this in mind, I want to promote nice decoupled Javascript functions that are namespaced and use Trullocks PubSub library In the examples below, I have broken out the functionality into seperate files so that the Javascript that manipulates the DOM is seperate from the the script that validates the user input and the script that handles communicating with the server. No function talks to another directly (apart from the internals) and all communication is done along the Bus. The beauty of this is: That one bit of functionality can be separated out nicely A fake event can be published on the bus for testing purposes More

Getting back up to speed with Arduino

We have been working on devleoping a new lab space at North 51 recently with a view to trying out some new technology and messing about with different interaction ideas.  One little bit of kit I am very enthusiastic about is the Arduino. Most people I have worked with haven't had the opportunity to play with one so we bought one in and a load of electronic bits and bobs to play with.  On Tuesday evenings we now have a Geek night after work. The plan is to play with technology and just see what comes from it. This Tuesday was fairly quiet as it was a little late notice so me and my friend Jon decided to use it as a chance to get back up to speed with the Arduino.  We started with the blinking an LED (the most basic but always satisfying) and then moved onto blinking the LED at a pace determined by an LDR.  With that success we moved onto setting the Arduino up as a little server and plugging it into a switch. We then plugged laptops into the sw

Skeleton Music - Music with the Kinect

I have started messing about with the Kinect again. Finally! Mr Randall, our head honcho at North 51 kindly supplied us with a company unit so we can begin messing about with it. I am hoping that once the holiday period dies down we can begin to really start thinking about genuine applications. At the moment it's just a case of reminding myself of the mechanics of how it works. I thought I would once again take one of the examples that comes with the SDK and just toy with it. I fancied a little peek at NAudio (I have been watching an Audio course on Pluralsight) so I got NAudio back out again. The project is to create a music generator based on the location of the hands according to the kinect sensor. It also changes amplitude depending on your distance from the device. I reallly like the way you can get a hold of the location points of the skeleton with the Kinect SDK. Once you have the skeleton getting the hands is as simple as               var leftHand = skel . J

Anonymous Functions vs Named Functions for Node.js

I am a fan of anonymous functions, it just makes like easier and I find the syntax of passing functions around more expressive. Only problem I have found though is that when you have a bug, anonymous functions can give you a bit of a headache when tracking down what went wrong. In the first example createServer is passed an anonymous function that gets called back. If something goes wrong you the error message is something like: C:\Node\imageshare\server.js:14         route(pathName);         ^ TypeError: undefined is not a function     at Server. (C:\Node\imageshare\server.js:14:9)     at Server.emit (events.js:70:17)     at HTTPParser.onIncoming (http.js:1610:12)     at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:91:29)     at Socket.ondata (http.js:1506:22)     at TCP.onread (net.js:374:27) Which although is easy enough to track down in this example, you can see that the name of the function is not listed because it doesn't

Brownfield Refactoring

I did a talk at Geekup Nottingham last night on Brownfield Refactoring. It's a little controversial if you're a developer as essentially I asked questions like Do you need to refactor this at all? Can the decline of the product just be carefully managed so that newer projects can grow? These aren't questions we normally like to think about as developers as our passion is to make everything as good as it can be. However a project must be financially viable and you must not risk the functionality for the sake of code excellence. 

Named functions in Javascript

I am at Progessive.Net at the moment in the Helen Emerson talk. She mentioned a benefit of naming functions, you can then use them to recurse. Normally I would assign a function like var boo = function() { //something }; But if you name the function as well, you can then use it to recurse. I didn't realise you could do this so I am quite pleased. She also mentioned that it can also help when debugging and when you are catching exceptions. Anyway, here's an example! Update: Her examples and presentation is available on her github account  I really like the console library that she is using. Quite a cool little thing.

Messing about with Javascript Jasmine Tests

I first started messing about with Jasmine tests over a year ago at a Progressive.Net conference (A friend had mentioned them before that too I think), but I never got round to implementing them properly. I am having a bit of an evening of tinkering with our core software platform at work and thought it would be cool if  these were integrated into the admin site perhaps. Anyway, I need to get back up to speed so I have begun giving them a whirl. I can't remember the exact syntax before but this time looking at ig I am really impressed. The test runner prints the tests out in a real cucmberish way that allows you to essentially keep a nice living specification of the javascript on your site. Take a look at the site and some more examples here

Fibonacci algorithm performance testing in .NET languages.

I was doing a little tidy up of the some of the books under my desk and I started to flick through Foundations of F# by Robert Pickering. It's a great book and I started to flick through it. I spotted the Fibonacci sequence and it got me thinking. How could I waste some of my afternoon? I did the algorithm in F# and then begun to wonder if something in C# would be faster. That got me thinking about how to accurately measure performance. In the end I went down a bit of a rabbit hole but I found some interesting results.  The results above correspond to the names of the tests below. It's very difficult to create a true scientific test on your own computer but the tests were run an i5 Sandy Bridge with 8gb of ram. No other programs except Visual Studio and Windows 7 were running. I ran the test 5 times, each time it ran the tests 100,000 times and then it grouped on the test name and took the average and saved it to sheet 2 above. I then used a pivot table and aggregated /

Anonymous types and functions in Visual Basic.Net

A lot of people poo poo VB.NET and yet I think almost none of them know anything about it. It has essentially all the same functionality as C#. With the latest versions of VB.NET you can use anonymous functions really nicely. I think the syntax is very clear and it makes it more obvious to a beginner programmer what is happening ie, the lambda you are passing into the where is a function. I think that's a real commendable thing to do and the syntax is very true to the language. I think you would find an awful lot of C# developers using expressions such as results.Where(x => x.Success); but many of them (certainly a lot of the devs I have met in the past) would not really understand what is happening here. It's arguably not important but that's not fair. Using lambdas just in Linq wastes so much potential of the language. Anyway, there's an example below in VB.NET. This syntax is in some ways more similar to the way F# does lambdas! ie let test = fun x x <

Android Development - No default tying up of controls

After having a quick peek at Android Studio, I was hoping in the latest version of Android would automatically tie up or help you automate the leg work involved in getting a handle on controls on the view. You still have to find the view by Id and then cast it to the correct view. To me this just seems so stinky. I think something like the below is nicer as it just keeps your code more readable.... I quite like Ropbojuice too, this automatically squishes the things you need in and is worth looking into.

Android Studio won't load up - Solution :-)

I installed Android studio on several machines but could not get it to load up. It didn't even complain with an error. A very upsetting experience considering my extreme excitement about it. After a little moan about it on Twitter, my friend Adrian  pointed me in the right direction. Even though during the installation the installer confirms the location of the JDK, it still can't find it. So you just need to: Find where you installed Android Studio Open Studio.bat Add this line -> set JDK_HOME=C:\Program Files\Java\jdk1.7.0_03 (two lines below @ECHO OFF) Run Android Studio.  That should be it! Hope that helps someone out there.
Mulitple Assertions in one test This might be a bit of an anti-pattern to some but I have found it's sometimes useful to test more than one assertion in a test. Some would say, one assertion per test and yes this is normally the case. But sometimes you want to just check that all the values on a form have been bound to a model or all the values have been saved to an object correctly. In this case, one assertion per test is just a gigantic bit of ceremony. All you really want to express is that the model is bound so you can call the method TheModelIsBoundCorrectly() and not TheDateIsSet(), ThePostcodeIsSet(), TheNameIsSet(). Ugh that would be a pain. The problem with putting all the assertions in the same method is that when one fails, it raises an exception. It's a real pain to have to fix the test, run it and then the next field fails too and so on. The above would run all the tests first and only t

My Blog is Back!

I have finally sorted out my blog! It has resulted in me returning to my original blog on After leaving Posterous, I attempted to just host my blog on my Raspberry Pi but unfortunately barely a day went by when the Pi wasn't unplugged for some reason so I decided to move it again. There was a degree of foolery involved, I had to export my blog to a wordpress site then convert it to a blogger site then import it. Anyway! Hopefully blogging shall now commence!

Arduino ethernet shield

My ethernet shield arrived this morning from Hong Kong. Looking forward to making a little Arduino based Web server! The price for the shield was only ?5 on ebay including delivery :-) super cheap considering how much they cost a couple of years ago.

Reset SQL Server Management Studios intellisense after a schema change

For some reason it's taken me a while to cotton on to doing this. In fact I currently have intellisense in management studio switched off as it's main hobbies seem to be trolling me typing.? My main annoyance is the sea of red every time you add a table or column and the lack of red if you delete a column.? Anyway, I worked out over the weekend that you can reset the intellisense with ctrl+shit+r In case you weren't sure how to toggle the intellisense on and off, see the picture. It's under Tools -> Options -> Text Editor -> Transact-SQL -> Intellisense. :-)

How PhoneLocator Pro deals with Bad Comments on Google Play No matter how well you make your app, I guarantee you'll be trolled with reviews like... App iz shit. Don't use. Didn't work on my android watch phone. You can't reply to the reviews as a developer, only mark them as spam. The only good thing is that the good reviews normally drown the idiots out and it's easy to spot a fool by the review itself. Still if you wish to feed the Trolls, you can always respond to them on your website...

Microsoft ASP.Net System.Web.Optimization

I'm watching a Pluralsight video on this at the moment. I really like the nice way you can explicitly bundle assets together. The optimization libraries then join the files and minimise them. When you render them, they also attach a query string onto the end to help prevent stale results being cached. ? No pictures sadly as I am just quickly recording this before I go back to watching the rest. ? Sent from Windows Mail ?

5 Tips For Refactoring In Brownfield Land

1. Don't try and refactor on the branch / clone you are working on Whilst doing some of the everyday work, I couldn't help breaking into a refactor mission the problem is that refactor missions always take you down deeper than expected. You still need to get the other jobs done and other bugs may come up too. This has caught me out so many times when I just think I will do a little fix here or there. Be patient, you don't need to do the re-factor straight away. 2. Plan the refactor with clear objectives Ugh, another of my favourites. When starting my current refactoring mission, I was like an ape in the produce section of Asda. My code was highlighted in blue Resharper squiggles and I could see duplication everywhere. Now I have calmed down and grown a little wiser. I have begun making a list of objectives and sections that I plan to refactor. Make a list of what each section of code does, if you have an appropriate tool that you can tag it with then do that. You can the

Blackberry Q10, finally an upgrade path for typers

[youtube]     It's a pity they didn't release this a year or so ago. The hardware looks excellent. I know many die hard Blackberry fans that were hanging on as long as they could for a decent new BB to come out but most of them have no gone for Android or Apple phones. Still the news I have saw today all looks excellent. I did see this tweet from @mbrit about contracts. I haven't read this directly so I am not sure what the source is but he is normally pretty up to speed. Three year contract?! What the hell?!? Is that a thing? #BlackBerry10 — Matt Baxter-Reynolds (@mbrit) January 30, 2013 I hope that a 3 year contract isn't the case as that would be ridiculous.  On the subject of contracts, I am now seriously turned off from them. I am still on a two year contract until this summer. From then I am ditching it. I think my next step will be just to buy a 3g Nexus 7 and just keep my Galaxy SII. 

Keeping fit whilst sitting down all day

via Obviously this is the eternal problem of the office worker. As a developer I am sit down almost all of the time as I am straight back on the computer at night until around 12pm most nights. Whilst novel I think the treadmill idea is obviously no more than an amusement. The dream for me is to have a much more interactive environment to develop software in. It would be nice if you could stand and move virtual components around or build software using virtual components instead of just sitting down and typing. Obviously this would need some sort of higher generation language where more of the problems are abstracted out. It would be interesting if you could build classes like that, then bring up a virtual keyboard or use voice recognition to describe what you want to happen. I can imagine this working brilliantly whilst pair programming. Two people creating tests, assumptions and building software in a fashion that is almost like a debate crossed with a squash matc

Running your own GSM Network

I have been using my Nokia 7110 for a couple of days now. A strange feeling. I keep getting it out of my pocket and then realising there's nothing to check -> No facebook, Twitter, email... I tried to use the WAP browser on the phone but the call was dead. It made me wonder if I could set up my own WAP network. I am still thinking about that and if it would be possible. I am starting to think it would need some special hardware.  I then Googled setting up your own GSM network out of interest and found these slides from a conference in Germany a couple of years ago. They're worth a read for anyone interested!