Showing posts from May, 2013

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.

Arduino Robot

Arduino - RobotHeard about this new Arduino robot at the maker shed conference through Engadget.I really hope I can get my hands on this. It seems the perfect item for those who don't want to actually make their own robot. Its items like this that will inspire people to get into STEM subjects, engineering and computer subjects in particular.

Deleting interactions on websites

I have been thinking about how best to deal with users deleting information in systems. In our latest CMS we added a feature in which the user's had to type "delete" in a confirmation box to make sure they were certain that was the action they wanted to take.
Thinking upon it now, I'm not sure that's what we need. Certainly almost as many users seem to delete resources. I'm not sure they understand what will happen and they're either ignorant, don't care or they're just curious. I wonder whether we should give people that horrible delete warning at all.


Why not offer no confirm at all. Just do something. Then let them visibly see what's happened. If you are deleting something, remove it. That's the best feedback. Then let the user obviously undo it straight away. That will give them confidence in the system that they are the boss not the system. Sometimes it&#…

Gridpad by GRiD

Remind you of anything. This thing is really interesting! I'm reading about it in the book Designing Interactions by Bill Morridge. It's a fantastic book that I dip into from time to time. If you didnt know Jeff went on in the future to drive innovations like the Palm Pda, Palm Os and Handspring Pdas. He is also a student of e human brain and has written a book called On intelligence that is an excellent read in itself.

Engadget: Retailers reportedly briefed on how the Xbox One used-games market will work

Read this on Engadget Retailers reportedly briefed on how the Xbox One used-games market will work

As everyone else has already said, blocking used games is an utter howler. I don't care about used games on the PC as the games are normally reasonably priced but not so on the xbox. I know they won't lower the prices as their current online 360 store still tries to sell ancient games for comical prices.

I wonder how long it will be until someone manages to work around the playing offline and second hand games thing anyway. I am hope that the method of checking is something silly that can just be worked out in a request. If so, you will just be able to divert the xboxes network calls to someone else (locally or otherwise) that will return authentication signals back.

Something like:

Haskell Tutorials

I have been reading old pragpub magazines on my Nook. After reading through the "Thinking Functionally with Haskell" articles I thought I would give it a little whirl. I don't think I am going to invest too much time into it to be honest as I would prefer to invest my time in improving my FSharpishness; but a little peek never hurt anyone eh?

The articles start in August 2012 and carry on for a couple of months.

I have found a good tutorial from the main Haskell site too

I haven't really had a proper look yet but will do as soon as I get a little time :-)

Work based learning for engineering qualifications

Engineering Council - Education & Skills - Engineering Gateways

I think this is a good idea for helping people get up to scratch and giving them guidance in achieving IEng and CEng. The closest uni to me is Derby Uni. My only concern with the qualification is that it will cost you a pretty penny to do it through the University.

In some ways I hope people use the UK Spec themselves to guide what type of work they should be involved with and what professional development they do. Considering you will carry out most of the studying yourself, I am not sure the unis will offer value for money over doing it yourself and applying through the technical report route.

I suppose once I get a reply about my current IEng application, I will begin to make enquiries about working towards CEng. When the time comes I will try and get some prices about the course.

When did 3d printers get so good?

Just spotted the MakerBot Replicator™ 2 Desktop 3D Printer

The resolution is nuts! The last 3d printer I saw was one that one of the guys from Nottingham Hackspace had made a couple of years ago. Whilst I am not taking anything away from that, these new breeds are awesome.

Looking at the price now and seeing the complexity of what can be made with them makes me thing the future is coming much sooner then I thought. This Makerbot is only about £1500.

Ableton Push

Make music with Ableton Push | AbletonThis looks pretty cool. Its the sort of thing I just avoid at all costs!

Sony Discman Data

Data Discman - Wikipedia, the free encyclopediaAmazing! I would love to get my greasy hands on some of these. Saw it in the Engadget Distro magazine.

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 / avera…

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 < 2

Now if…

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 StudioOpen Studio.batAdd 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.

iPad and iPhone Notebooks

I found these notepads in the Range shop near me. I thought they were pretty cool. Especially if you worked in ios development. I thought you could potentially sit with a client drawing out screen prototypes.
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 throw …

My IEng application up to now with the BCS

My IEng Application I have been working towards the IEng title with the Engineering Council for some years. Last month I finally sent the application into the British Computer Society for assessment.  Why? Why have I made an IEng application? It all started when I was working for a construction company called Terrapin. There were quite a few people in the technical and research departments that had professional membership and others had titles such as EngTech, IEng and CEng. They seemed to get respect for these titles and they were deemed useful in tenders. Being a technician there (doing estimates and drawings and mainly programming), I thought it would be good if I could get involved so I begun to research the titles. 
I was pleased when I realised that the British Computer Society could issue the title and even more pleased that my course partially met the requirements for IEng too. After I finished my course I carried on doing professional development and even though I had left T…

Android Studio - The new Android IDE


I am really looking forward to this. I downloaded it this morning and although it installed without complaint, it won't load up. There are no errors displayed or logged in the Event Log....

I am not deterred though, I find Eclipse such a pain and a friend has recommended IntelliJ a good few times. He raved about it and so I am inclined to believe it's good (Android Studio is based on IntelliJ).

My biggest gripe about Android development is getting the UI nice. iOS development is miles ahead in this respect but I think objective c++ is gruesome.

Ah with this and my nice rooted nook, I can see crazy e-reader apps coming from me very soon!

The Nook has landed

I am not sure how, but my Nook has arrived now. I ordered one and it didn't work, so I ordered another and I got a message saying it wouldn't be delivered either but then I got a courier tracking email. 
I'm pleased it's here now anyway. The first thing I did was to root it and get some cool stuff on it. The process was very easy, I just followed this tutorial
I then used this tutorial to put the Google stuff on it.
The next plan is to get Doom on it and hopefully do some sort of network Doom game with everyone else in the office who has got one of these Nooks for £29.

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!