Give Yourself Time to Fail

Restarted the teaching today. I did a show of hands in the first year lecture to find out how many people had started the coursework, which is due for completion in three weeks or so. I was pleased to find that pretty much everyone had started work on it. (or was claiming to have)

It is very important to start your computer science coursework as early as you can. This is because you need to have time to fail. By that I mean that there will be times when your program won't work and you won't be able to work out why. (this still happens to me by the way). In this situation you need time to be able to walk away from the computer and go back to it, which is a problem solving technique that works for me a lot of the time.

The other technique I use is explaining the problem to somebody else, or even just the wall. Half way through the explanation I hit upon the "broken assumption" that is the cause of the problem and can then go and fix it.

This is one of the things that makes computing different from lots of other disciplines. I don't think it is OK to work on the basis that you could dash off an essay overnight, but at least by the time morning comes you could have a bunch of words that may or may not be the right ones.

Try this technique with a programming assignment and at around 10:30 in the evening you'll find that your program doesn't work and you've no idea why. And you have no time to step away for a while and then come back and fix it. So start early.

Gadget Show Live Fun and Games

Today we had the other half of our "Busy Weekend", driving off down to the NEC for the Gadget Show Live event. We've been to these a few times and they are always worth the trip.

And so it was this time.

This stand prompted one of the first of several "Want One" moments. The gadget in question is the HP Sprout. This is a re-imagining of the PC which brings novel user interfaces and 3D scanning to the fore. In front of you sits a touch sensitive workspace onto which the computer projects a display. The workspace is also viewed by a number of cameras, including ones that can measure depth. The upshot of this is that you can scan objects in 3D and colour and manipulate them in all kinds of interesting ways. It's a bit pricey, at around 2 grand, but you do get a high-spec PC with an i7 processor and big hard drive for your cash.

There wee lots of 3D printers for sale, with some extremely tempting prices.

This brought out the second "want one" of the day. It's the Dyson robot vacuum cleaner. It looks really interesting. It uses SLAM (Simultaneous Location and Mapping) technology to build a map of its environment to make sure that it cleans everything. If its battery gets low it will go and pick up some charge and then return to cleaning where it left off. I had a Roomba robot vacuum a while back which was basically a "bumper car" toy that just bounced off the furniture for a while.  This looks a whole lot more advanced. It's due for release next year, so perhaps I should start saving now..

They even had a whole bunch of BBC micros. The urge to go down there and type

10 GOTO 10

- was pretty hard to resist.

And of course there were lots of, er, gadgets for sale too.


Hairy Bikers at the Good Food Show

I'm not a huge fan of TV shows about food preparation to be honest. I've been known to shout "But it's only cooking" at the telly during the final moments of MasterChef, when the music picks up tempo and the voiceover solemnly intones '..and now Anton only has two minutes to finish his Béarnaise sauce..".

To me cooking is that thing you do when you feel hungry, or if you are into advanced cooking an hour or so before you feel hungry, because that's the time it takes to bake a couple of potatoes and lob some sausages into the oven to have with them.

All this means that I didn't have the highest of expectations today when we set of to the Good Food Show. But it was great. First off they had lots of stalls dishing out samples of food (including a wealth of cheeses) and then we got to see the Hairy Bikers do a live presentation.

I was really hoping that they would bring out a Yamaha motorbike engine and discuss how to adjust the valve timings, followed by a few minutes on caring for greasy hair, but instead they did some cookery. However, it was great fun to watch then cook up some bits and bobs. They have a great banter and worked hard to make it very entertaining. Harrogate is a great location for this kind of thing. The theatre is lovely, see above, and the exhibition centre is near the middle of the town, which is a nice place to walk round.

We left burdened down with a whole bunch of samples (including a pint of milk each, which struck me as strange as I already know what milk is like) and some really nice cheese. Much more fun that I was expecting.

Unity Book Winner

I won a couple of Unity books from those lovely folks over at Microsoft Developer. Thanks so much. Here's a picture of me with them, looking smug.

I don't win prizes very often. The last thing I won was at a school raffle when I was six years old. And my dad was headmaster of the school at the time. The village was up in arms about it. Oh well.

Anyhoo, thanks for the books, I'm going to find them useful. I want to learn a bit more about Unity. They are from Simon, who was kind enough to come along to our last GameJam.

RGB LED Panel Magic

Some time back I got some of these SparkFun LED panels. I hooked one up to an Arduino and got impressive results, although just driving the pixels took pretty much all the power that the Arduino had. I had this plan to use a Parallax Propeller chip or maybe something from Xmos to create a fast moving animated display. But I never got around to it.

Then I found out about the SmartMatrix Shield for the Teensy 3.1 device. This sorts out all the wiring and power supply issues (all you need is something that can spit out 5 volts at a couple of amps). The Teensy is a quite amazing machine. It pops a 72Mhz processor with 64K of RAM and 260K of ROM onto a platform the size of an Arduino Pro. The development tools integrate straight into the Arduino environment and the deployment to the device works wonderfully, far better than a "proper" Arduino.

TodayI set about building my display. Everything fits into an 8 inch picture frame that I got from HobbyCraft.

You can see it all above. The Teensy and the SmartMatrix Shield are at the bottom of the picture. I've also attached an SD card and an IR receiver that allows remote control of the display.  There's a really good set of step-by-step instructions on the AdaFruit site. I designed and printed some corner brackets to position the panel inside the frame, you can get them from Thingiverse here.

The Teensy runs the Aurora software which is completely wonderful. it produces some really lovely displays. I've had to hack it slightly to get it to work with a remote control I happened to have lying around. The display is excellent, and photographs just can't do it justice.

One other nice surprise was that I did all this on my old Surface Pro that is now running Windows 10. It took all these strange programs and usb devices in its stride and just worked. I'm looking forward to adding some more visualisations and searching down some animated gifs to play on the device.

Old Surface Pros, Windows 10 and Spartan

I've been running Windows 10 on an old Surface Pro 1 and it works a treat. I installed it from a USB key. I really wanted a clean install but the Windows 10 setup insisted on doing a (very successful) upgrade of the existing Windows 8.1 installation. However, by forcing a refresh I managed to get an empty machine to play with.

It's very snappy. Boot times put my Windows Phone to shame and it seems very complete and stable. I upgraded to the latest version so I could try the new "Spartan" browser. I was interested to see if it could render my blog home page and the editing environment that Squarespace provides. It works great. Takes a while to wind up but once it is going it all seems fine.

I've also done lots of things that I wasn't expecting to work very well, like connecting to network printers at the office and installing strange usb drivers. So far Windows 10 is looking like a win.

Game Jam Judging

So, sixty two games later, I've finished judging. It was great fun, and I learned a lot. I sat down to take a peek at a few entries, and then five hours later I looked up again. The things I've taken away from the experience are:

  • There are some very clever, inventive and hard working folks out there who can make astonishing stuff in just forty eight hours. Well done to the lot of you.
  • If you want the judges to like your game, make it very, very, easy for them to get to it. I had to download and run some games (which I'm always nervous about) and others plain didn't work. If you can find an easy way to get it going in a web browser you should do that. Quite a few entries made very good use of the Unity web player. Some folks had found free hosting that had advertising. I've lost count of the number of adverts I had to watch to get to games. If your game needs an install, consider making a video instead. I can get a better feel for the gameplay by watching a video rather than failing to make something work because I have the wrong library installed.
  • When you start building your game one of the first things you should add is the instruction screens. Some games had very poor help, others had none at all. I spent five minutes with one game trying to figure out what I was supposed to do. Now I understand that discovery can be part of a game mechanic, but leaving a player with no idea of how to get started will encourage them to walk away rather than put in any effort to play. If you put the help screens in first it makes it easier to get feedback too, in that you won't have to explain what the game is about to anyone who wants to have a go.
  • Some of the games told a story as they went along. I thought these were great. There's nothing like a narrative to make a game format interesting.  Even a simple "old school" mechanic can be really enlivened by a background story.
  • Don't worry about graphics if you've got good gameplay. Some games had really simple graphics that worked really well. While a certain amount of polish is nice, you need a strong core mechanic to make a great game.  Other games had amazing graphics and physics but no gameplay that I could get my teeth into.
  • I loved to see how much folk seem to have enjoyed making these things. The journey is a great one. Please, please, please publish the games if you can.

Thanks to the Meatly team for inviting me to judge, it was great fun.

Meatly Game Jam Judging

Meatlyjam is a game jam that was running over weekend. I've been asked to help with the judging of the entries. Apparently there have been 62 games submitted, which is just amazing. Kudos to the organisers and those who took part.

You might think that going through 62 different games and scoring them is a bit of a pain, but actually I'm really enjoying clicking on each entry and finding out what it does.

If you fancy having a look at the entries you can find them all here. I've only had a look at the first few so far, but there are some really nice ones in there.

Cheap Game Fun

I went computer game shopping yesterday. And for 35 quid I managed to get a couple of second hand triple A games that I very nearly bought at full price a while back. Both games were in splendid condition and they are both great fun to play. Each is a first person shooter, but there the resemblance ends. Sunset Overdrive is all bright colours, wild graphics and crazy weapons. Wolfenstein is all about a dour colour scheme and a very linear story progression. I'm not sure which I enjoy more, but getting a game like Wolfenstein (in a collectors pack with some pictures and a little book) for fifteen quid has to count as some kind of a bargain.

I really must set aside more time to play games.

What Price Protection in Programs?

I got a lovely question from one of our students today. He is presently working on our "Pick Up the Crew" game coursework and is using objects to manage the items on the screen. The question concerned protection of the data members inside the game objects. If you are writing software for a bank you need to be careful to make sure to carefully manage access to data inside your objects, since you don't want naughty programmers fiddling with account balances. But in a game you don't care so much about this kind of protection. There is nothing particularly important about where on the screen a sprite is drawn.

The questioner was asking if it is OK for a sprite to expose its position information in public data so that other sprites could find out where it is on the screen and check for collisions with it. This is a good idea from a performance point of view (if we are really worried about such things) because it provides quick access to the position information. But is it a good idea from a programming point of view? Should we worry about protecting data inside things like game sprites?

To me this is the wrong question. I don't like using public properties like this because it can introduce dangerous dependencies. If I decide to change the way that I manage sprite position I'm going to break all the other objects that make use of this information directly to work out whether or not they have collided.

From a collision point of view I reckon it is best if each sprite exposed a method (perhaps called CheckCollision) which could be used to see if it has collided with something else. Then if you change how the sprite stores its position on the screen you can just update the behaviour of CheckCollision so that nobody outside your class is affected by the change. There may be a tiny performance hit with this approach, but the chances of introducing bugs are much reduced.

Sortlisted for Student Teaching Awards

The Students Union at Hull has been running teaching awards for a few years now. I've been lucky enough to be nominated a couple of times in the past, and in 2012 I even managed to win an award. Which was wonderful.

I've just found out that I've been nominated for an award again this year. Thanks so much. The presentation dinner is in early May, I'm rather looking forward to it.

You can find out all of the details of this splendid initiative here.

Amazing fun fact: Rob Miles has in fact been nominated twice. It turns out that Robert Miles from the School of Languages, Linguistics and Cultures has also been nominated for an award. We are going to so careful that we don't both head down to the front if our names get read out.....

CloudBit Libraries for Windows Apps

LittleBits are tiny electronic components that can be fitted together to create working circuits. They are great fun and you can find out all about them here:

http://littlebits.cc/

They make a device called CloudBit:

http://littlebits.cc/kits/cloudbit-starter-kit

This puts LittleBits signals into the cloud, where you can connect to them from browsers and services such as If This Then That (ITTT). I used my CloudBit in the Microsoft Band Hackathon earlier this week, where I was using values sensed by the cloudbit to trigger alerts in the Band. I also used the Band accelerometer to control the output of the cloudbit as well.

I thought I'd put the LittleBits library that I used to control the device up on GitHub. So I have. You can find it here:

https://github.com/CrazyRobMiles/CloudBitControl

You might want to control your LittleBits devices from your Windows PC or Phone, and that's what this library does. You can send a percentage power value to your CloudBit device and receive a percentage value back. What the signals mean is entirely up to you. They might control a servo, light a lamp, open a cat flap or any number of other actions. You can use the inputs from the CloudBit in any way you like too.

There's a sample universal application that uses the library. This is a good basis for getting started. You just need the device ID and access token for your CloudBit and you are good to go.

Go to the Folly Lake Cafe

Serendipity is one of my favourite words. And I only found out about it by accident. Just like I found out about the Folly Lake Café. Now that I'm back on Windows Phone I get Cortana telling me about places to eat nearby, and this place I've never heard of just popped up last week. So on Sunday we thought we'd check it out.

It's lovely.

My favourite special would definitely be  "Bacon, Egg, Burger chips - and salad" Yay!

My favourite special would definitely be  "Bacon, Egg, Burger chips - and salad" Yay!

We arrived a bit early to eat, although the food was tempting. The café is located in a dip in the ground that might have been a quarry a while back. Now it is just a haunt for anglers, walkers and cyclists. We didn't walk there, although we might next time.

If you are looking for somewhere in the countryside you should go and take a look.