Skip to main content


Showing posts from 2014

Functional Filtering in Javascript

My good colleague Paddington bear   has just asked me for some help with a marvellous mobile project he has devised. He has some locally stored JSON arrays that he needs to filter based on various fields throughout the code and he was looking for a nice way to reduce the complexity without having to do nasty loops everywhere and in different ways. I came up with this example that we then turned into something for him (that you aren't allowed to see :-/) but I thought it might be of value to someone else. Basically, the code takes the onus of doing the filtering out of the filter function so you then pass the array and the function upon which it is filtered at the same time. Take a peek, I am sure there's some nicer ways of doing things but I just coded it as we were talking and now I am posting it. He has refined the production version and you guys can do the same if you like the idea!

Msmq with F# Quick start tutorial

I am working on a new distributed system at the moment and was using Msmq as my basic queue system (just because it's there, has no dependencies and I know how to use it already). Anyway, I was doing some of the mess about work using F# Scripts (don't you love it!!!). I have tidied some of them up into a quick start Msmq guide for anyone that is interested. I doubt it's exhaustive but it's a start! One annoying thing I noticed whilst doing this was that for some reason you have to #r reference the System.Messaging Dll. I have never understood why you had to do that when you can just directly reference other .NET framework Dlls like System.Xml (also used in the example). If anyone reads this and knows the answer, please let me know!

Accessing the UI Thread with Tasks in F#

I have a Windows Forms program written in F# that can deploy a code base to n number of sites at once (you select the sites you would like to deploy to and it goes off and completes a number of tasks (backing up current sites, various unpacking and moving of files etc... ). Once you start it, it begins it's merry journey and begins to update the UI with what has happened. At the moment this method of updating the UI is not pretty because the threads I am doing the work on can't update the UI so I perform some fiendery to make that happen (don't ask). I knew there was a better way using some newer .NET features but I just hadn't got round to having a fiddle yet. I have now found that if you use the built in Task class but break your code up in a nicer way and then chain the tasks together you can then pass the correct context into the task that you want to talk to the UI. Here's a little script to give you a feel for it. You can press the "start" butt

Oculus Rift

This morning I have been able to play with an Oculus Rift. I wasn't sure what to expect but the experience has blown me away. The control with the head movement is realistic and the feeling of immersion was crazy. I only had time to try the under the sea demo but that was enough for now until my own unit arrives.... I haven't included any video of the demo from my perspective as the various videos and youtube demos out there really don't do it justice. In preparation of mine arriving I started watching the introduction to Unity videos on Digital Tutors  and I think I will need to get back up to speed with some 3d drawing, it's been a long time since I used Autodesk Inventor or my all time favourite tool for 3d fooling about Sketchup.  This would have been an amazing tool when I was doing 3d images and walkthroughs of proposed building solutions some years ago. I haven't tho

New Blog Design

It's been quite some time since I have done any real blogging but I feel I ought to begin the push again. Writing (even badly) makes for excellent practice in expressing yourself. It's a skill I think all good software developers should have although I don't think that skill must be practised through blogging.  Anyway, with my return to blogging, I felt I ought to give my blog a bit of a shake up. The built in Blogger theme I had originally used looked awful and the newer design they offered didn't render Gist code examples correctly. In the end I chose a design from Themeforest . Themeforest is often the place I go to for HTML designs as I am extremely poor at front end design and integration, my skills lie elsewhere.  I hope you like it!

Toggle Peek Definition in Visual Studio 2013

I like the Peek Definition feature in VS 2013............... It saves opening up thousands of tabs just to take a quick peek at something. The only thing I don't like doing is having to right click on the mouse to access the feature via the context menu. Luckily you don't have to. [alt+f12] opens peak definition on whatever type you happen to be on and [esc] closes the peek window again :-) Here's a little more information on the feature if you don't know about it....