Skipping

Spent a big chunk of the day in the garage. In the "Good Old Days" (tm) a garage was somewhere you kept the car. Nowadays it seems to be the place where you keep the family collection of empty cardboard boxes,bits of wood that at one time you thought you might have a use for and things that the kids once played with.

Anyhoo, I've filled the skip with stuff and covered myself with dust and nostalgia. Next stop, the loft.......

Of Garbage Man and Banjos

AlienBanjoAttackShot.PNG

This year the first year students can create a game as part of their programming coursework. The game is "Alien Banjo Attack" and above you can see a screenshot of my demo version. At the top are various different types of evil banjo and your mission is to defend the earth using nothing more than your accordion which will shoot notes of music to destroy the incoming swarm.  If the banjos reach the bottom of the screen you lose the game. If you crash into a banjo you lose a life. Space Invaders with a banjo feel. What's not to love?

I want there to be loads of objects (notes, banjos etc) on the screen at the same time, which means a lot of instances of the various classes that represent the game objects. There has been some discussion about the best way to handle this, as banjos are destroyed and new ones appear.

I reckon the best way to do this is to make a banjo stateful. The banjo will contain a flag to represent whether or not it is involved in the game. If a banjo is destroyed this flag set to indicate that it is dead and the banjo plays no further part in the gameplay. When we need a new banjo we just have to find one which is marked as dead and "resurrect" it by moving the banjo to a new position and then changing the flag to bring it back to life. 

You might think that creating new instances of banjos to replace discarded ones would be another way to achieve this behaviour but I don't like that at all. If we start creating and destroying objects this will make work for the Garbage Collector who will have to come in and tidy up memory every now and then which might slow things down a bit. 

Another way to reuse objects would be to keep a list of "dead" banjos. Each time a banjo is killed we move it out of the "active" list into the list of dead ones. That way, if we need a new banjo we just have to look in the list. This is a bit more complicated than just searching for a banjo that can be resurrected, but it does have the advantage that the game never wastes time working through "dead" display objects, as these are no longer in the active list.  Many operating systems use this technique in what is called a "thread pool" where previously used threads are kept ready for use by processes that might need them.

Phil and Stuart talk iPlayer Transcoding

Phil Cluff and Stuart Hicks getting ready for the off

Phil Cluff and Stuart Hicks getting ready for the off

We love it when ex-students come back to the department to tell us what they've been up to. Phil Cluff graduated a few years ago and Stuart Hicks a couple of years after that. Since graduation they've both been working for the BBC on the iPlayer team.

If your'e not from the UK you might not appreciate just how wonderful BBC iPlayer is. It lets you consume BBC TV output on any device, in any place. All the output of the BBC channels, plus the content from BBC local TV, is made available shortly after broadcast so you really don't have to worry about missing things. The programmes are available for a number of days after transmission and they are also made available for download. It's awesome. Phil and Stuart  told us that 3% of the consumption of BBC output is now via iPlayer and it is growing rapidly. There have been around 28 Million downloads of the iPlayer apps across the various platforms,  they get around 10 million requests a day and release around 700 hours of new content a week.  Amazing stuff. 

Of course, getting all that content onto the internet is a tricky job. The original content has got to be converted into the different video formats and sizes that are consumed by the users, and this must happen as soon after broadcast as possible. Nobody wants to have to wait until tomorrow to see today's news. There are huge peaks and troughs in demand and this makes it tricky to manage the computing resource that you need for the task.

A little while back the BBC decided to move their transcoding (as this is called) activities into the cloud. Phil and Stuart described the cloud as "A collection of services that someone else runs for you, which lets you not care about hardware". Which is just what the BBC needed. So they put together a project to build a cloud based "Video Factory" from scratch in 18 months. And they did it. 

Large computing projects are notable for failing or being expensively late. The Video Factory was neither of these things. Phil put this down to the way the design was based on a number of small components, each of which performs one step in the process of getting the video into your iPhone or whatever. The workflow of the video data through the system is managed as a series of messages that are passed from one component to each other. Components take messages out of their input queue, perform their part of the process on the message and pass it on to the next component.  If things get busy and queues start to fill up the system can "spin up" extra processing resource in the form of further servers in the cloud which can run components to work on the extra elements. 

And because each component has very well defined inputs and outputs this makes testing much easier. Phil and Stuart talked about Behaviour Driven Development, which is where you express what you want to achieve in terms of business outcomes. They used a language called Cucumber which lets you express your requirements in a really easy to understand way, and will also produce a whole framework of tests you can use to prove the solution. This is very, very interesting stuff.

It was great to see Phil and Stuart again. It looks like they are doing very well. It was also really nice to hear them echo a lot of the things that we tell our students during the course.  They had some very useful things to say about the craft of development. You can find the slide deck of their presentation here. I strongly advise you to take a look at the last few slides, there are some lovely references there that you can use to find out more.

When water turns bad...

I have a love hate relationship with water. It's great for some things and I understand that it is one of the primary components of Strawberry Flavoured Milk, but I don't like the way that it lurks in my loft looking for a way out. Tonight I discovered that it had found one, courtesy of a leaking pipe connection to our cold water tank. 

I noticed this just after a shower (good water) when I found that some of the pipes in the back of the airing cupboard were damp (bad water). For half a second I managed to convince myself it was condensation, but then reality set in and I had to go up the ladder and take a look. And there it was. 

Fortunately I've got to the stage in my life where I have a collection of suitably large and scary spanners to hand which can be used to tighten things up a bit and so for now I think the leak has been sorted. And there is a Lego bucket (that is a bucket that used to contain Lego not a bucket made of Lego, that would be silly) underneath the offending joint just in case of future problems. 

The good news is that most of the water had traveled straight down the outside of the pipes towards the airing cupboard, and evaporated on the way. The bad news is that some of it stopped off in the cupboard above to ruin some bedding that we had put there. 

Oh well. At least it stopped me having a boring evening playing with computers.....

Making 3D Pictures with Cura

Just found out that the lovely Cura software that I use to slice 3D models for the my lovely Ultimaker printer will also import images and then create 3D landscapes from them. It will assign the height of points on the surface to the brightness (or darkness) of the image. You can use it to make rather nice renderings of text. I've actually printed out the above and will be giving to one lucky person who registers for our Careers and Internships event next week.  I'm also going to print out some 3D Business Cards. 

The event is on April 2nd and there will be free food, drink, business cards and mugs and other merchandise. Just for turning up and maybe getting an internship or a career. 

You can register here.

Wireless works better with Wires

There is apparently a difference between seems to work, and actually working. I spent a good chunk of today finding this out. The devices you can see here are used to send wireless signals from one place to another. You put a signal into the input pin on the transmitter (the one at the top) and it emerges from the receiver.  People say they seem to work. So I thought I'd have a go with them.

The first thing I did needed to do was prove that the devices work so I wired up a couple of Arduino controllers and used the lovely VirtualWire library to waggle the wireless signals up and down and transfer data. It worked first time. Yay for me. 

I really wanted to use these devices to transmit signals to control some lights, so the next thing to do was write some code that turned the lights on when it received the appropriate commands. So I wrote that and ran it and it worked. But only once. Not so much yay.

So I built a theory that light software and the VirtualWire library were fighting over Arduino hardware and losing data as a result. And I spent a while trying isolate the usage of the signal pins that they use. And getting nowhere. 

And then I had a brainwave. I took out the wireless devices and replaced them with a piece of wire between the two Arduinos. And the program worked perfectly. Flickering lights and everything. 

Most confusing. After a bit of thought I reckon I've figured out what is happening. The receiver likes being given a nice healthy 5 volt supply. And when the program starts running it gets exactly that. But when I send the command to turn some lights on this causes the voltage to drop (taking current out of a system often causes this) and so the receiver stops working. I'm now working finding a few volts from somewhere to beef up performance.

Working with hardware devices is like this. You don't just have to get the software to behave, you also have to consider the electrical environment too. But I'm still having fun.

Extra Large Applicants Event

We had our last Saturday Applicants Day today, which was our biggest ever I reckon. We had overspill seating beyond the overspill seating, and Lecture Theatre A was pretty much full as you can see above. I reckon these folks are well on the way to becoming great students, they have already picked up the knack of sitting towards the back of the auditorium....

Anyhoo, a good time was had by everyone and now I can get used to not having to wear a suit on a Saturday. Thanks to all those who came along, I hope you have a good journey back and that the day was an interesting one. 

Mad March Hackathon

This evening I dropped around to see how the Mad March Hackathon was going.  It seemed to me that things were picking up nicely. The event was hosted by the Platform Expo crew and organised by James, one of our students.  I've got an open day tomorrow which means that I will need a considerable amount of beauty sleep tonight, but I stayed around long enough to make encouraging noises and take a few pictures. 

W'eve got some big plans for hackathon events in the future, it's great to see that they are as popular as ever. 

Computer Science at the Science Fair

The university has organised a rather spiffy Science Fair. I suggested to Robert that it might be fun to set up our shiny new Ultimaker 3D printer on the Computer Science stand. So we did.

We were a bit worried about just picking up the machine, carrying it across campus, dropping it onto a table and then firing it up. But it didn't seem to mind a bit, and has been happily printing out vases and gears all day today.

We also had the Occulus Rift and some 3D displays along with some digital art that also proved very popular.

I went over to see Robert at lunch time and the place was awash with students and folks from all over the place taking a look at the science that we do here.  

March C4DI You Really Should Be

David Gilson and Jon Moss, and a Media Centre

David Gilson and Jon Moss, and a Media Centre

I really like the "Your Really Should Be" events at C4DI. And so do lots of other people it seems. The place was packed.

There were four speakers, starting with David Gilson who took as his stating point "You really should be looking at XBMC" (or Xbox Media Centre) to use its full title. XBMC is a media client that runs on most anything, from Raspberry Pi upwards and lets you spread media around your house. You can even start watching a movie downstairs, move upstairs and continue from exactly where you left off. You can integrate it with other media tools such as BBC iPlayer and replace shelves full of DVDs with a single mass storage server tucked behind the TV.  David took us through configuration and usage scenarios and had even brought along a Ouya video game console which he also uses as a media centre device. 

Chris Gooding - Telling us all to train our replacements

Chris Gooding - Telling us all to train our replacements

Next up was Chris Gooding.  He is definitely a man after my own heart. I've always thought of programmers as "Creatively Lazy" people. We will work surprisingly hard to find solutions that we convince ourselves will save time and effort in the long run. Chris argued for taking this to the next level. Rather than programming computers to do things for us, why not program people? He reckoned you really should be training your replacement. If you spend your time showing other folks how to do your job they can pitch in and do your work for you. And if your boss does the same thing (and they should) then this will result in expertise trickling down the workforce and making it easier to keep all the skills inside the company. Nice idea.

Jason Taylor. The text on the screen says "Take Risks, Throw Darts, Make Rubbish, Surprise Yourself". Amen.

Jason Taylor. The text on the screen says "Take Risks, Throw Darts, Make Rubbish, Surprise Yourself". Amen.

Jason Taylor was next. He reckons that we should play more. Jason comes from an arts and product design background and gave a great talk about the benefits of just playing with stuff. I agree. Recently I've had a lot of fun playing with things just to see if I could make them do stuff. Hitting a specification and making the correct deliverable is all very well, but sometimes there is nothing nicer than just fiddling around with bits and bobs. I reckon this is particularly true of game development. Some of my best gameplay ideas have come from just starting with a few things on the screen, getting them moving and seeing what happens next. 

Mike Clarke on the automation trail.

Mike Clarke on the automation trail.

Finally Mike Clarke gave us another slant on the "creatively lazy" aspect of developers. But he took the perspective that rather than training people we should be making every use of the tools that are available to us.

Rather than perform actions we should create scripts that do them automatically. This has two happy outcomes. One is that you can do the task a second time very easily. The other is that you now have a documentation of that task. If you start out with this approach when you begin to do a job it will really pay off further down the tracks. I heartily agree with this way of working. It is very often the case that you find yourself repeating something that you thought you'd only have to do once. If you've built that into an automated action you can repeat it very easily. 

Then, right at the end of the session we had our first ever C4DI rap. Alan O'Donohoe gave a pitch perfect (if you can do that in rap) rendition of why you should be engaging with technology in general and Rasperry Pi in particular. 

All in all a great evening, and as usual I left with a whole bunch of ideas.

John Connelly Talks Hull City Plan

Today we had a Rather Useful Seminar from John Connelly of C4DI. He came along and told us about the exciting developments centered around the Hull City Plan. I wish more students had been around to hear all about it. As it is, there are lots of interesting things coming along soon, including a "Three Thing Thing" application development hackathon that we are going to run based on data that the City Plan is making available. 

I reckon everyone who is interested in getting and using data from the area should sign up and get involved. There are lots of problems that are well worthy of an attack based on big data and novel solutions. You can sign up to be kept informed of the plans here

Get a Multimeter. Preferably with a needle...

If you are at all serious about electronics you probably need to get a multimeter. This is a thing that lets you measure electrical items of various kinds, voltage, current and resistance. I got my first one a very long time ago. In fact, they were quite expensive and I actually ended up buying the bits and putting my own box around the thing. 

Nowadays you can get them very cheaply, and they tend to be digital. They show their readings as numbers. This is fine, but I much prefer one with a needle, like the one above. With a needle it is easy to see if something has just gone up or down. With digits you have to start comparing numbers. Most of the time when I'm testing a circuit I'm really checking to see if something is there or not and I don't really need an accurate value.

I thought you couldn't get cheap multimeters with needles on them, but it turns out I was wrong. You can get the above for less than five pounds from here. So I did. It works well enough and I'm already finding it useful to have around the office.

One important note though. As you can see above the dial has settings that indicate that the meter can read up to 1,000 volts. This is true enough, but you really, and I mean really should not be poking those kinds of probes into signals at that level, on account of a mistake making you suddenly, and electrically, not alive any more. For battery voltages and things like embedded controllers its fine, and it can also measure resistance.  But for high voltages I'd suggest you look at much higher specification tools that will have better insulated cables and probes.

Rather Useful Seminars. Please Come Along

RatherUsefulSeminarLogo500.png

Last week our Rather Useful Seminar was a bit quiet.

Sad face.

I really want a good turnout for the one on Wednesday though. It should be very interesting, with John Connelly from C4DI coming along to talk about great plans for Hull as a digital city, followed by the "Rob and Dave" show, all about job finding technique. 

Find out more here: http://www.ratherusefulseminars.com/

Getting Started with Titanfall

I

I started playing with my copy of Titanfall today. Great fun, except for the way that the first skill you seem to have to pick up if you want to pilot a giant killing machine is running sideways on walls, something that I turned out to be spectacularly bad at. However, once I'd got past that obstacle and done my training missions (I found these fairly easy, which was pleasing) it was time for tea, and so I've not actually got into the game bit yet.

But the whole setup looks really, really great fun. Number one son got a copy over the weekend (and an Xbox One to play it on) and I'm looking forward to a few evenings walking a long way behind him watching him kill everything and pick up all the bonuses while I die for no good reason. Just like old days playing Halo together. 

Bristol Lumia Photo Challenge

I was in Bristol today. Very nice it was too. I'd taken my big posh camera and of course my Lovely Lumia 1520. Two of the pictures above were taken by the big posh camera and each is made out of three exposure HDR merges that have been quite heavily re-processed to get the best out of them. One of the pictures comes from my Lumia 1520, loaded from the raw image and given the tiniest amount of adjustment. 

Can you tell which is which? 

You'll Like Girls Like Robots

Girls Like Robots is a neat puzzle game for Windows Phone. It starts simply enough, making sure that girls get to sit next to robots rather than geeks, but as the number of protagonists increases and the arrangements change it can get a lot more head scratchingly difficult. 

The presentation and the background music are fine and dandy too. It is now down to 79 pence in the UK store. I paid quite a bit more for the game and considered it good value, at that price for such a well presented and well realised game it is a bit of a steal. 

An Ultimaker 2 in the Department

I've had my Ultimaker printer for nearly two years now. It was around now in 2012 that I ordered it, and the kit took around 6 weeks to arrive as they were very popular.

I've had a lot of fun with Una the Ultimaker. I've replaced her drive mechanism, print head, pulleys and print bed supports and added end caps and a bunch of other things. And I've printed one or two items as well. I like Una very much and most of the time she rewards me with good looking output.

Mr. Burns seems to approve

Mr. Burns seems to approve

This week our departmental 3D printer arrived. They asked me what to get and of course I said we should get an Ultimaker. But I suggested we get an Ultimaker 2 as this is pre-built and looks to have moved the field on a bit. It took around 6 weeks to arrive as they are very popular, so some things haven't changed I suppose.

I set the new printer up in my office and had it working within half an hour or so of opening the box. It is fundamentally the same as Una, but is much more of an appliance.  It has lost a lot of the "home spun charm" of the original, but replaced this with a slickness that would make it much more viable as a printer that you get because you want to print stuff, rather than tinker with the printer itself.

Some design changes took me by surprise. You now set things like print temperature on the printer rather than in the slicing program. This actually makes a lot of sense, in that you will need to customise your printing for different kinds of fibre and you don't want to re-slice the model every time. The integration with Cura, the program that converts your designs ready for printing, is impressive and once I'd fed the fibre into the machine (the only tricky part of the setup) I was turning out prints that were at least as good as ones from Una. The only real problem for me was that the heated bed was set to a temperature which was much higher than it should be for the PLA plastic I was printing. I turned the temperature down to 60 degrees and things got a lot better. 

I do miss the sense of control that I have with Una. The print display on the Ultimaker 2 just tells you how much time is left on the print, rather than the other useful metrics that I get. However I'd be much happier leaving the new one to print on its own, something that I'm not keen to do with my printer. 

One major improvement with the Ultimaker 2 is the fan arrangement around the print head, which blows cooling air from both sides onto the object being printed, so that there is a better chance of the next print layer being put down onto solid plastic.

I really liked this, so I had a look around to see if I could find something similar for Una. I found this design and so tonight I spent a happy couple of hours installing some new fan ducts along with a pair of very posh fans that are completely silent in operation. I reckon this has made quite a difference to the printed output, the definition on both sides of my owl test piece is now much better than before. Previously the right hand side of the owl face was a bit of a mess because it faces away from the fan. Now things are a lot more symmetrical. 

The next step is to change the fan arrangement on Una to make her a bit quieter. The Ultimaker 2 is very quiet in operation and I want to get rid of the rattling fan that was supplied as part of my kit, and seems to be rattling even more now.

If you want to get a printer that represents state of the art in FDM (Fused Deposition Modelling) printing then I reckon you'll do well with the Ultimaker 2. It produced some of the best prints I've ever seen right out of the box and is a very well presented package.