Student Led Teaching Awards

I was very pleased to find out a while back that I'd been nominated for an award for Innovative Teaching in the Student-Led awards run by the University Union at Hull.

Anyway, tonight was the night when the winners were announced at a  posh dinner at Staff House on the campus. I wore my new suit (no-really) and we had a really lovely time eating and drinking between announcements. I didn't get the award, but I'm really honoured to have made it to top four.

Thanks very much to the students who nominated me and to the Union and University administration for for organising such a splendid programme. 

Cut Price Robot Kit

These are all the bits that you get

These are all the bits that you get

I was up town visiting the Red5 gadget shop today (who'd have thought it) when I noticed they had robot kit at substantially less than half price. Of course I bought it. And I've already got plans for spending the money that I saved. Go me.

The robot is big version of the Hexbug tiny ones. It is remote controlled and is able to act intelligently. Sort of. A bit like me.

It's supposed to be suitable for 8 years and upwards, but I reckon you'd really need to be a few years than older than that or have a grown up assistant. There were a few stages where I could have used some help myself. Some of the parts are very similar to each other and their alignment is very important, something you only find out when you've built it and it doesn't work properly. Also the instructions can be hard to decipher, my advice would be use the ones you can find on the web site and zoom in on them a lot.

Reviews online are mixed, and I can see where the bad ones are coming from, but the robot is certainly impressive once it gets going. It has a definite preference for tiled floors, carpets cause it to get a bit stuck because its feet dig into the pile and make turning difficult. However, for the price I paid I reckon it is good value and building it was not a bad way to spend a rainy Saturday afternoon.

Windows 10 on Raspberry Pi

Windows 10 on Raspberry Pi works. In fact it works very well. You can deploy programs from Visual Studio 2015 into the Pi and they just run. You can even put breakpoints in the code while it is running, and remotely debug your code over an IP connection. Just like the "Good Old Days" (tm) when I was putting.NET Microframework code into embedded devices all those years ago. Except that Pi applications have proper .NET behind them and I can build a user interface using WPF.

The hardware connections are abstracted into classes, just like they should be:

const int LED_PIN = 5;
var gpio = GpioController.GetDefault();
GpioPin pin = gpio.OpenPin(LED_PIN);

This makes a pin that the program can use to interact with the outside world.

pin.Write(GpioPinValue.Low);

This sets the pin low.  A program can read and write the status of the pin and bind to events that fire when the pin changes state. This makes embedded development really easy.

Installation was smooth enough, although you'll need a PC running Windows 10 with Visual Studio 2015 RC to get started.

The walkthroughs are well written and accurate. You can get started here:

http://ms-iot.github.io/content/win10/SetupPC.htm

 One tip, if you have any problems getting Visual Studio to work after installation go to this page:

https://dev.windows.com/en-US/downloads/windows-10-developer-tools

Scroll to the bottom of the page and install "Standalone Windows SDK for Windows 10" and "Microsoft Emulator for Windows 10 Mobile". This fixed a few problems I had with stuff not installing properly.

I'm properly excited about this. I'm going to have a go at getting my Galileo to run Windows 10 as well. There are also bindings for frameworks that can talk over Bluetooth to Arduino devices.

Update: Turns out that Galileo doesn't run Windows 10 core, it uses the previous version of Windows. Apologies for any confusion.

The Thrilling Adventures of Lovelace and Babbage: Buy it

This is a completely brilliant book. The illustrations are fantastic and the research that backs up the content is exemplary. The book starts with the tragic and true story of Ada, Countess of Lovelace and her involvement with Charles Babbage, a 19th century inventor obsessed with the idea of using machines to perform mathematical calculations.

Ada has a background story that you really couldn't make up and the tale of how a poet's daughter became the first person on the planet to really think about what a computer could do is a compelling one.

Once the facts have been dealt with the action moves on into a parallel "Pocket Universe" where Lovelace and Babbage have built their huge steam-powered "Difference Engine" and are using it to solve mysteries and fight crime.

There are even jokes about cheese.

There are even jokes about cheese.

The narrative is littered with historical quotes and insights into maths and computing theory and gives a great introduction to what computers are about and where they came from. At the back you find get a series of appendices that supply plenty of historical context and by the end you really feel for the characters, in both their real and imagined forms.

Everyone should buy this book. It's just wonderful.

Vetinari Clock Complete

vetenari clock.PNG

Tonight I thought I'd build my Vetinari clock. It's a silly thing, but great fun.

Lord Vetinari is a character in the Discworld series of books by the now sadly deceased Sir Terry Pratchett. Vetinari, a powerful ruler of the largest city on the Discworld, has a clock in his waiting room which is designed to unnerve people by ticking irregularly. However, it still keeps accurate time. 

You can get a kit of parts to convert any quartz controlled clock into a Vetinari clock. It uses a PIC microcontroller to generate a sequence of 32 pulses of different lengths which give the appearance of randomness. But the clock still keeps time accurately.

I ordered mine a way back and, after my expensive trip to Ikea on Sunday, I finally got a clock mechanism I thought worthy of the conversion. Tonight I put it together and carefully connected the outputs from the circuit to the driver coil in the clock mechanism. It works a treat. If you are a fan of Discworld who likes soldering you might have some fun with this.

Hmm. Perhaps a video of the clock would make more sense....

The Mist in the Mirror at Hull Truck Theatre

Some time ago we went to see The Woman in Black. Great play. Go see it. The movie is apparently OK, but for proper scariness you should get to the theatre.

Anyhoo, the author, Susan Hill, has also written a book - The Mist in the Mirror - which has now been turned into a play. We went along to the Hull Truck last night to see it. Very good fun.

For me it wasn't as scary as the Woman in Black though. I think some of this is because the play is an adaption of a book. Books can have as many characters and locations as they like, because words are cheap. But a play needs actors and scenery and stuff. The company did a great job handling the number of different people and it was worth seeing just for the way that the staging worked, but when the same bloke turns up as the third different character in a row you start to notice this and it detracts a bit from the suspense.

The Woman in Black works well because it was written with these constraints in mind and for much of the play it is just two people, but for this production I just thought there were too many moving parts.

I didn't find the story worked that well either I'm afraid, with a whole bunch of exposition at the end that didn't really tie things up.

But having said that, I really enjoyed the night out. Hull Truck is a great venue and it was nice to acquire a bit of culture.

Springing a Leak

I hate water. I'd rather wire up a hundred mains plugs than do anything involving plumbing. Well, perhaps not a hundred. But certainly lots. Today I thought I'd to something simple involving pipework. And of course it all went wrong. After all, it does involve water. Hate the stuff. Have I mentioned this?

We have this fancy water filter thing under the sink and I figured it might be a good idea to replace the filter cartridge. Well, it has been a few years. So I carefully researched the item, bought a couple (in case I break one fitting it) and then successfully made the swap. In five minutes.

I was very impressed with me, as was number one wife. That was, until a puddle appeared under the sink. Turns out that the filter replacing shenanigans  had caused a completely different part of the plumbing to start leaking. I can only think that I must have dislodged something hair-triggered under there. I've tightened things and bent them into a position where I think the leakage has stopped, but I'm now researching replacement bits and bobs to fix the problem properly.

Some time ago I bought a flood alarm from Maplin. This is a little circuit that you can put under your sink and it will sound the alarm if it detects water that shouldn't be there. I got it because we had a rather unpleasant homecoming a while back involving a flooded kitchen. I never got around to fitting it though. I worked out that the only real difference it would make would be to change "coming home to a flooded kitchen" into "coming home to a flooded kitchen and an unpleasant buzzing noise".

I'm now researching Raspberry Pi powered solutions which would mean that in the event of a leak I could receive an email which says "You are going to come home to a flooded kitchen...", which might be an improvement I suppose.

You know you're making progress when you start a scrap folder

I'm doing some writing at the moment. V. exciting. I've spent some time playing with ideas and I've got something that I'm almost happy with. And one consequence of this is that I've opened a "scrap" folder for the project.  Turns out I never feel I'm making progress until I've started throwing things away. 

It might just be me, but my first attempt at something complicated is not usually much good. It's only when I've tried a few things and thrown them away that I feel I'm getting anywhere.

My scrap folder is a big part of this because one of my golden rules about working is that I never really throw anything away. Instead I create a scrap folder and throw it in there. Two reasons for this. The first is that these days I don't think anyone is ever really short of disk space, so deleting things is not necessary. The second reason is that it might be that my "better" idea is actually a worse one, and I need a way back to where I was.

I could use source code control for this I suppose, but since the work is really a collection of documents and bits and bobs it feels a bit like overkill. So I just make a folder called scrap and drop things in there when I don't think I need them any more.

Cortana Speech Library Helper for Windows Phone

I've been playing around with voice controlled adventures ever since I discussed them with someone at a Techdays session a while back. To make life easier I've now made a little helper class that takes away all the hard work from making simple speech enabled applications for Windows Phone. You can find out all about it on the Microsoft UK Developers pages here.

Hope and Glory Coffee at C4DI

Something different at C4DI tonight, with a visit from a bunch of folks from Hope&Glory coffee. I'm not much of a coffee aficionado myself, but number one wife is, and so we both headed out to find out about roasting and blending and whatnot.

Turns out that there is a lot more to this than I thought. Apparently coffee is second to oil as the most valuable commodity traded worldwide, it originated in Ethiopia and has been round the world since. It takes many years training to acquire the ability to properly discern different types of bean and there are only sixty or so people in the UK with the highest level of ability in this area. One of them is from Hope&Glory and we had a fascinating session where she showed off an iPhone controlled coffee roaster and talked about the business of sourcing the right beans, how they are prepared, what happens during roasting and lots of other stuff.

Then we took a look at different ways you can take your ground coffee and make it into a drink.

This was my favourite way to make a brew. In fact, it might turn out to be my favourite way to make any drink ever. It involves naked flames, steam and vacuum power to make a really nice cup of coffee. Heated water is forced up into the top container to mix with the coffee grounds. Then you take away the heat and as the steam in the bottom bulb cools it contracts and pulls the liquid back down through the cloth filter.

A great way to end a dinner party methinks, as long as you don't burn the house down. You can get all the kit from Amazon for around thirty quid. I've ordered mine. Much more exciting than a video game and actually cheaper. I was tempted by this amazing device but I think it is probably a bit expensive even though it looks enormous fun. If you aren't sure how to make any of this stuff work there are some rather nice howtos on brewing on the Hope&Glory site.

We left after an hour or so of learning about coffee, clutching a sample pack of beans. There are three different types of bean available from the Hope&Glory site. The prices are reasonable for coffee this nice and they do free postage, with the packets designed to fit through your letterbox and be waiting on the mat when you get home.

I still don't really think of myself as much of a coffee drinker, but after tonight that could change...

HIVE Rather Useful Seminar

Some of the audience, suitably attired

Some of the audience, suitably attired

Today Jon Purdy from HIVE (the Hull Immersive Virtual Environment) gave a great talk on how 3D displays work, followed by a demonstration of the HIVE systems. It was great to see so many first year students come along because we'd love them to come up with ideas for final year projects and the like using all our shiny toys.

 I took some pictures..

Using a virtual torch to send virtual light into simulated scene on the HIVE wall

Using a virtual torch to send virtual light into simulated scene on the HIVE wall

Using the HIVE cave to check out wind turbines

Using the HIVE cave to check out wind turbines

Time Travel in C#

Imagine if you could control time. Wouldn't that be useful? Especially if you were writing a program to manage artwork in an art gallery, and you wanted to test the part where after two weeks the artwork must be returned to the artist. You could start the program running, add an artwork, hop into the time machine and move two weeks forward and then check that the code works correctly. Of course this is impossible. But fortunately we don't have to do it this way. Instead we can build a bit of cleverness into the way that our program uses dates and times.

Normally a C# program will get a date from the system clock by using DateTime.Now:

artwork.DisplayDate = DateTime.Now;

This sets the display date of my Artwork to the current date and time. My program can then compare the artwork date with future dates to see if more than two weeks have gone by. The snag is that i have to wait two weeks to find out if the code works. So I make something like this:

static class DateSource
{
    public static TimeSpan Offest = new TimeSpan(0);

    public static DateTime Now 
    {
        get
        {
            return DateTime.Now + Offest;
        }
    }
}

This can be used in exactly the same way as the system DateTime class, in that it provides a property called Now which gives a date and time value. But, and this is the useful bit, the date it sends back has an offset applied to it, which I can change. If my program uses DateSource rather than DateTime I can move my program forward (or even backwards) in time simply by changing the offset value:

Console.WriteLine(DateSource.Now.ToString());
DateSource.Offest = new TimeSpan(days:14, hours:0, minutes:0, seconds:0);
Console.WriteLine(DateSource.Now.ToString());

The first statement will print out the current date and time. The second will wind the clock forward 14 days as far as my program is concerned. When we are testing I can add a "wind forwards" button that changes the offset so that I can test my code. I could even change the offset value in a test harness that does this automatically.

This is all part of my "build yourself a nice place to work" philosophy. If your program has to do special things depending on location, don't test it by walking around the countryside. Instead make a program that feeds test coordinates into the location part of the code.

Windows 10 Game Development Event: June 11th-12th

What better way to celebrate the end of the semester than a bit of game creation? Plus a chance to have a play with the latest operating system and development tools.

I'm very pleased to be able to announce a Three Thing Game that we are organising in conjunction with Microsoft. We'll have all kinds of interesting people coming along from Microsoft, local games companies and software houses.

The event is open to any developers who fancy coming along and having a go.

Folks from Hull University are of course welcome, but if you are in a company and want to get hands-on experience working with Windows 10, plus support from Microsoft expertise, then you should come along.

We are working on setting up a lab full of Windows 10 machines for you to work on, so all you have to bring along is yourself and a winning smile. Plus you get to join in our "Summer Bash", with lashing of pizza, video games and perhaps even a game of Werewolf.

It all happens over 11th-12th of June. We've got some presentations on Thursday morning, followed by an afternoon of coding, then the Summer Bash, some late night development and judging and presentations on Friday. With prizes.

If you've never done a game jam before, come along and find out what they are all about. If  you're a Three Thing Game veteran we'd love to see you back in Hull.

You can find out more here: https://www.gamejam10.com/?CR_CC=200617217 (but don't worry about bringing your own machine - we are sorting that out at the moment)

You can sign up here: https://london.gamejam10.com/register

If you've no idea what Three Thing Game is all about, take a look at www.threethinggame.com

This is going to be such fun.