Wresting with Pygame

We've been running our "Wrestling with Python" course for a while now. An intrepid bunch of local teachers have been coming in on Tuesday evenings to learn a bit about the Python language. Today we started up with our final sequence of the year. We are going to get folks writing games using the Pygame framework.

Then they are going to get their classes writing games and we are going to get a little "local school Three Thing Game action" going on. This is going to end with a hackathon in July with over 100 kids coming into the university and spending a day completing and presenting what they have done. Scary stuff, but we reckon we can make it work.

So today, as a way of getting started, we drew some cheese. As you do. Next week we will have bouncing cheese and possibly a cheese cannon. And why not.

You can find out what we have been doing and download the slide deck and lab sheets here.

Imagine Cup 2014 in Seattle

There's a little Imagine Cup shaped hole in my life this year. For the past few years around this time I'd be fretting about scoring and judges and stuff and getting ready to go and help out with the world finals. The Imagine Cup has given me some of the best experiences of my professional life. From the first ever World Finals in 2003, when "Team Random" and I made it to Barcelona and Third Place, to travelling the world as part of the judging and competition management team, the Imagine Cup has been part of my routine for quite a while. 

I've loved seeing the difference that the competition makes to the lives of the thousands (probably millions by now) of students that have taken part over the years. I always say to folks that they can split their lives into two chunks, the bit before you take part and the bit afterwards, and I've seen the "Imagine Cup Effect" go to work time and time again as folks do things that surprise themselves and everyone around them.

This year we've got some Hull involvement, which is splendid. James Croft is going over to Seattle to take part in the finals as a Microsoft Student Ambassador and Danny Brown is in the UK team helping to make Ripple a worldwide winner. 

Me, I'll be watching the World Finals with interest. It's great to see that Satya Nadella, the new Microsoft CEO, is taking part in the judging. It puts into a very strong context just how much Microsoft value future talent from all over the world.

If you are a student you really should take part. Today it's all about "getting yourself out there" and the Imagine Cup is one of the best "out there" places I know.

Making Screencasts the Hard Way

Having the house to myself this morning I thought I'd record a video of the 08120 Programming 2 Exam walkthrough. I try to remember to make these when I've finished marking the papers. I can cover lots of the questions that folks might have about the right answers and I like to do this when the marking issues are still fresh in my mind. 

Of course it wasn't as simple as I expected. I hadn't done a video for a while, so I had to find the headphones and the microphone, install Camtasia (my favourite program for recording stuff), find that the headphone and microphone weren't working and that sound playback was also broken. Fix all that, set the screen size to work properly, create a PDF that I can browse through and finally, after half an hour of faffing around, get to sitting down and recording something. 

And I thought that modern technology was here to make life easier....

Make Your Documents Work for You

I've spent a chunk of today performing Seed exit vivas. This is where students on our industrial placement module have to come along and explain why they should get 5 out of 5 for Project Management. Or whatnot. We discuss things for 45 minutes or so and finally agree on figures for each marking category. Sometimes the figure goes down, but in a surprising number of cases we end up delivering the happy news that we think that they have undervalued their work. Which is nice.

One thing I like to do is point at pages that have been supplied as part of the thick folder of documents and ask "What's that for?". This can be quite illuminating. For example:

"What's that for?"
"It's the Risk Analysis."
"OK, where did it come from?"
"Well, at the start of the project we wrote down all the risks we could think of, and that's the result."
"Did you ever look at it again?"
"No. Should we?"

.. at which point the conversation goes downhill a little bit. Risks should be identified and then tracked over the project. At regular intervals the document should have been produced and checked over to make sure that nothing has changed, and that none of the risks were becoming critical. 

If you are going to take the trouble to make a document that is part of your development then you are making an investment in your time. It is important that the investment pays off. Documents should "earn their keep".

The Risk Analysis document should be checked and updated at regular intervals to make sure that risks are managed. Minutes of meetings should record who was there, what was said, give people actions and check on actions from earlier meetings. Specifications should be signed off. Tests documents should be acted on and then the results of the tests recorded and used to drive future development. I could go on (and in fact I did - quite a bit). 

I got the feeling that some of the documents were shoved in "because we thought we had to write them". I also got the feeling that some folk thought that writing all this was a distraction from the proper job, which was creating the solution for the customer. However, this is very, very, important stuff. It can make the difference between success and failure in a project. And doing it right will definitely get you higher grades....

C4DI Arduino Hardware Meetup

We had our fourth in the series of Ardunino hardware meetups tonight. Peter was in charge, and he had folks attaching infra-red receivers to the Arduino boards and creating remote controlled lights. This involved making cunning use of TV remote controls specially purchased from Poundland (you'll never guess how much each one cost).

You can download the exercise from here if you fancy having a go.

Great fun for all, and a few new folks turned up, which was very nice. Hope to see you all at the next one. 

Mijnlieff - hard to say, fun to play

Turns out that this is not a winning position if you are playing with the light tiles....

Turns out that this is not a winning position if you are playing with the light tiles....

Last week in Whitby I bought a little two player game (there are some good game shops in Whitby - and a good sweet shop or two..). Anyway, this weekend we got around to playing it. 

The game is called MijnLeiff, a word my spelling checker doesn't know. Players take it in turns to put tiles down on a board with the aim of making rows of three or more of their own colour. What makes it more interesting is that the piece that you put down dictates where on the board your opponent can make their next move. And with a limited number of different pieces for each player it gets very, very, tactical towards the endgame. 

If you like games which are easy to pick up, quick to play and somewhat strategic, you will like this one.

Tricopter Flying

What happens when you strap three motors, a battery and some bits of electronics to some lumps of wood? You get something that flies, that's what. After overcoming our initial nerves from a while back we managed to get some quality flying time in on Sunday morning. The amazing thing is that it all worked.

Number one son now has a fully working tri-copter. It seems to be happy to hover on around a third power, which means that it should be up for camera lifting duties quite soon.  

Octodad - eight legs of fun

Octodad.PNG

Last night we spent some time playing Octodad- dadliest catch. This is a deeply silly game where you take the role of a man sized octopus taking the role of an ordinary suburban husband. Although your lack of co-ordination and deep seated fear of aquariums is starting to raise suspicions....

We played it on the PlayStation 4, and it at least gave us a reason to get out all that PlayStation Move hardware, which was a surprisingly good fit with the unwieldy tentacles of our hero. Towards the end things got surprisingly poignant, and I never did find out just what happens in the aquarium cafe, when we meet our nemesis, the mad chef who is one of the very few who know the fishy secret.

If you are looking for something fun to play, with a compelling story line, then it is worth seeking out. 

Using a Progress Ring in Windows Phone 8.1

I'm slowly getting the hang of unified applications. Most of the time I'm having to forget how the phone does things, and pick up some Windows 8 habits. The busy indicator is a case in point. Using it is very easy, but it is different from the phone and so I thought I'd blog it here in case I forget. You can get a rather nice animated ring display like the one above by simply adding it to the XAML in your page:

<ProgressRing Name="BusyProgressRing" IsActive="False"></ProgressRing>

Then, in your program, you can just turn it on and off when you start something that might take a while to complete.

BusyProgressRing.IsActive = true;

I've written a stupidly simple unified app that lets you start and stop the ring displaying at the touch of a button. You can find it here

This form of display is used when your program is doing something that will take a while to complete, and you don't know how long it will be. I use it when I'm setting up Bluetooth connections. 

Improving 3D Printer Quality by Adjusting the Temperature

For a while now I've been trying to improve the quality of prints from Una the Ultimaker. I've replaced quite a few bits and bobs here and there and she is now pretty reliable. But I've been having problems with "lumpy layers". Objects with flat sides end up having lots of ridges in them, as if the printer was laying down layers of different thicknesses.

You can see the effect above. The layers at the bottom of the print are nice and smooth, and then they suddenly become thicker and more uneven. This is not a huge problem but, me being me, I've been trying to figure out what causes it, particularly as earlier prints didn't seem to have the same problem. 

Turns out that it is all down to temperature. I used a plugin which is part of the Cura slicer which converts designs into printer instructions. The plugin lets you tweak printer settings at different heights during printing. The layers at the bottom of the print were printed at 210 degrees centigrade, then it switched to 215 and so on upwards in steps of 5 degrees. The effect of the changes is much more significant than I thought it would be. I've noticed that different makes and colours of printing material have quite different temperature profiles. I think I'll have to do a test print like this for each one and then set decide on an optimal temperature.

Oh, and I also managed to include a human hair in the picture so that you can get some idea of scale. It really is astonishing how precisely this technology can be made to work. 

Update: One thought occurred to me after writing this post. The temperatures I'm quoting are as reported by Una, and are probably unique to her (it) as different machines will have different arrangements of print head and temperature sensor. If the temperatures that I mention don't work for you the try different ones, the important point here is that it is worth calibrating your machine for each different material. 

Home to a Bluetooth Printer

We spent the night in Whitby at the Dolphin Hotel. We had a lovely large room which overlooks the bridge right in the centre of the town. I took the photo from the room first thing in the morning, just before we headed down for a really nice (and huge) breakfast. If you are looking for somewhere to stay, I strongly recommend the place.

Then we headed home and I found some time to finish off the hardware for the Bluetooth printer I've been working on.  Note how it is a Bluetooth device, and I've put it in a bright yellow enclosure. And why not....

When I designed the box it seemed like a good idea to put the switch in the bottom. Of course it is actually a bit silly, as whenever you put the box down you turn it on or off. Fortunately I have some bit stick-on feet that help with this, but I'm going to have to refine the design anyway as I don't seem to have left much room to allow the actual construction of the device.....

This is the guts of the printer, just a bunch of batteries and a trusty Bluetooth adapter. I'll post full details of construction and the software later this week. 

Robs Red Nose Game now in Windows Store

Robs Red Nose Game, long available for Windows Phone, has now made it into the Windows Store.  As you can see above, it is massively popular. Or something. 

It's a free download, and mostly harmless. It only works on tablets and it seems stupidly easy right up to the point where it becomes impossible. For some reason I'm embarrassed to relate it has 001 in front of the name. This is not a clever marketing wheeze to put it at the top of the Windows Store listings, but something silly I must have done a while back. I might keep doing it though, which means that the seventh game will probably involve secret agents. 

And get me sued. 

Anyhoo, feel free to have a go, and let me know what you think. 

Three Thing Game Summer 2014 Registration is Open

Three Thing Game is happening again. Of course. We are doing things a little differently from last November, but a little similarly to May last year (if you see what I mean). The competition will run from Thursday 12th of June to Friday 13th of June, during the final week of the semester. 

We'll have all the usual shenanigans, with a Thing Auction at 1:00 on Thursday 12th of June, a Summer Bash on Thursday night and a star studded presentation event on Friday evening. As long as we can find some stars. And some studs. 

You can get a registration form here.

You can find out about the glorious history of this most splendid of competitions here

Knife Throwing at the C4DI Developer Meetup

OK, so we didn't actually throw any knives. Because if we had I think that people would have died. Those knives were sharp, really, really, sharp. Jon was running his finger over the blades and saying how sharp they felt. I reckoned I'd make that judgement just by watching him....

Some people regard cooking is an art form (as opposed to something you do when you feel a bit peckish). The company CuttingEdgeKnives sell knives to such people. If you want the best tools for the job, these are the business. They are hand crafted in Japan and really look and feel the part. 

You might be wondering what they have to do with software development.  Well, tonight at C4DI James Young, Creative Director from Offroadcode was explaining how diversifying into luxury knives had paid dividends for the website development business. It's all very well making Content Management System (CMS) based sites for companies that sell stuff, it's quite another thing to be putting stuff in boxes and selling it via a CMS powered site of your own.

James made some very valid points as he described the trajectory from an initial investment in a box full of knives to successful niche business. Some points from his talk that I think make a lot of sense if you're selling things:

  • If you want to use Google and Facebook to promote your products this is really, really tricky to get right. Get in some appropriate expertise if you are going to do this. 
  • Competitions and paid advertising don't work as well as you might expect, but giving samples to influencers and reviewers does. 
  • Writing good editorial copy (and regularly updating it) will help sell your product.
  • If your customers need to think a while about a purchase give them time to do this by ensuring your shopping carts take a very long time to expire.
  • Address customer concerns about a purchase directly and at the point where they are making the transaction. 
  • Ask your customers "Did we nearly lose your business?" to find out what might be stopping others from parting with their cash.

The talk left me thinking that setting up a niche business like this is not a bad idea, and it gives you a lot of credibility. If someone is about to hire you to build them a site that helps sell stuff, it is useful to be able to show that you have built a site that works for you. 

All in all a great talk, followed by Pete Duncanson, Founder and MD of Offroadcode, who talked about the fun you can have when using Content Management Systems (CMS) to build web sites for clients.  A CMS system provides a friendly interface that lets a company edit their product range, prices, special offers etc and generates a web site that their customers can interact with.  All the product details are held in a database and the CMS is customised for the business needs of the particular client company. Offroadcode use Umbraco, which is a system I've heard good things about and seems to work very well. 

Pete gave a very good exploration of the psychology of dealing with clients who take your lovely web design and then subvert it to the point where you aren't proud of having made it any more. He explained how and why this happens and offered a lot of human and technical tips to make sure that the integrity of your design is preserved as long as possible. Some points he made include:

  • Plan for expansion. If the client swears that there will never be more than three of something, plan for an infinite number. If they promise that the number of items on a page will always be small, add paging anyway. This is not because clients tell fibs, or are silly, it is just that business needs change over the lifetime of the site, and the operators of the system might not be the people that gave you these design assurances.
  • Add pickers. Letting the operator enter an item directly is nice enough, but if they can pick one from a list, and then go back and fetch that item again, then they will thank you when they have to add the "Christmas Special Offer" again next year.
  • Constrain as much as possible, but in a constructive way. You don't want huge images on sites that the client creates, but just refusing to upload them will cause offence and lead to support calls. Much better to resize and then cache the image so that you can send out appropriately sized pictures when your system serves out the web pages. 
  • Use sensible names and be consistent about them. If you have a field called "Page Header" which is the header for one of your pages, use the same name throughout. 

This is all good, solid advice which is not a million miles away from what we tell our students on the Software Development modules. And it was all presented in a very entertaining way. Great stuff and a most enjoyable evening.

If you are not coming along to C4DI events, you are missing out. All the events are free and open to anyone, including Hull students who really, really should come along. 

The next C4DI event is the June hardware meetup. You can sign up here

The next C4DI develoepr meetup is also in June. Sign up here