Reckitt Benckiser at c4di

David Keel of c4di explains what we are about

Spent an afternoon talking about robots and chatbots. In other words, a good afternoon. We had folks from Reckitt Benckiser over to talk about a new partnership with c4di. We were showing off stuff what we had made and I brought along a few Hull Pixelbots. 

Another satisfice Hull Pixelbot customer...

I really love it when I show someone a bit of tech and they go "Oh, so that means we could use this for......." That's a big chunk of what c4di is all about, and there was a lot of it about this afternoon.

Then we went straight into a Hardware meetup. It was great to see everyone come along, Ross brought his beautifully made Hull Pixelbots and we had a good natter about how to control them. 

Great stuff. 

Hull Pixelbot Rumble at c4di today (Thursday)

Finally, a blog post that isn't a thinly disguised plug for one of my books....

Anyhoo, today I'm plugging the Hardware Meetup at c4di tomorrow (Thursday). Ross is going to bring his robots, I'm going to bring some of mine, and we are going to do some robot things that might include rumbling.

You're welcome to come along and marvel. Sign up here. The meetups are in the ground floor of the awesome c4di building. We start at 6:00 pm and go on until 8:00 or until we run out of things to talk about (which usually means a bit later..)

If you've any interest in hardware (computer or otherwise) then it would be great to see you. 

Monday Games Snap

You might have heard of my Snaps framework. Then again you might not. I created it for my Begin to Code with C# book

The idea behind Snaps is that learning to create Windows 10 Universal Applications is hard because it takes a while to get to the point where you understand enough to have a bit of fun writing C#. 

So I created a bunch of helper functions that grew into an entire library for app and game development. 

As a celebration of being awarded another year as an MVP (thanks Microsoft) I thought I'd put the whole Snaps framework up on GitHub and then people can download and play with it, and maybe even take it further. 

Every week I'll take a Snaps function and explain how to use it, along with a bit of detail about how it works. Monday is now officially "Snaps Day". I'm going to start with the games creation framework and go on from there. 

This week I'm going to tell you how to get started and make your first sprite. You need Visual Studio 2015 or Visual Studio 2017 (it works with either). You'll also need to be running Windows 10 64 bit edition.

You can download the entire framework from GitHub. It's a single Visual Studio Solution that you just have to open. You might get warnings about the dangers of loading projects downloaded from the internet. Ignore those in this case. 

If you run the solution you'll get the Snaps main menu:

On the left you can select the book chapter. On the right you can pick an exercise from the book to run. Pick the one you can see above (Ch15_04_CompleteGame from Chapter 15). It's a complete game with moving sprites and all sorts. Click "Run and App" and the game will start. 

The graphics aren't the best to be honest. But you can control the game by the cursor keys, or mouse/touch on the cursor pad on the lower right hand edge. One sprite will chase you while the others look on. Everything is running under WPF and I'm very impressed with the performance. 

If you want to get ahead of the game you can grab the book and see exactly how the code works. For now though, use Visual Studio to stop the game (go back to VS and press the red Stop button), and take a look at the Solution Explorer on the top right. If you open up the Chapters folder you can find a folder for each chapter:

Open up a chapter and you can find all the sample code. The names of the samples are keyed to the ones you can find when you run the program. Take a look in Chapter 15:

Open up the one indicated (Ch12_02_BallSprite) It creates a single ball sprite and displays it.:

    public void StartProgram()
    {
        SnapsEngine.StartGameEngine(fullScreen: false, framesPerSecond: 60);

        ImageSprite ball = new ImageSprite(imageURL: "ms-appx:///Images/ball.png");

        SnapsEngine.AddSpriteToGame(ball);

        while (true)
        {
            SnapsEngine.DrawGamePage();
        }
    }

All the action takes place in the StartProgram method. It starts the game engine, creates a sprite and adds it to the game. Then, once we've made the sprites, we start a game loop which continuously draws the game page. It does this 60 times a second, because that is the frame rate requested at the start. The image for the ball is an asset which is in the Images folder in the project:

You can use your own images if you like. Drag them to the images folder and make sure that their build action is set to Content (as below). Then use the appropriate name to draw them.

If you run the framework and select this example (Ch12_02_BallSprite) you can see the ball on the screen. If you change the above code and use the handy "Run That Again" button you can see your changes. Don't worry about breaking the examples. You can always download a fresh set from GitHub if it all goes horribly wrong.

You might like to add more sprites, or fiddle with the properties of the existing sprite, in which case Intellisense is your friend:

See what adding :

ball.CenterX++;

.. to the while loop does. You should have:

while (true)
 {
        ball.CenterX++;
        SnapsEngine.DrawGamePage();
 }

If you make anything especially impressive take a video of it, send me the link and I'll start a hall of fame on this page. Because this is a Universal Application it can run on any Windows 10 device, including Xbox One and Raspberry Pi (although it is not as fast on the Pi)

Of course the best way to find out all these things (and learn to program as well) is to buy my book. 

But if you don't want to do that, then I'll have another Monday Snap for you next week.

Jeff Lynne's ELO are Awesome

I've liked ELO since, well, forever. And when I found out they were coming to Hull, I got tickets. They were playing at the KC Stadium. It's big. And it was full.

ELO did not disappoint. The support from The Shires and Tom Chaplin deserves special mention too for being excellent too. 

At the end they created enormous plumes of fire in time with the music. Awesome. 

A fantastic night that was only slightly let down by the one hour we spent in the car park trying to get out. The guide for the event said that "entry is gained by cash payment to the cash handlers". Sure enough, on arrival there were people in high-visibility jackets to take our money and direct us to our parking spaces. Unfortunately the guide also contained the ominous phrase "Vehicles exiting the car park are allowed to self regulate". What this meant was that come closing time all the chaps in high visibility jackets had disappeared (presumably to count their money) so there was nobody to direct the traffic, resulting in an enormous log-jam of cars going nowhere.  But it was still a great concert though. 

Apple Airpods

Number one son told me not to buy them because I couldn't afford them. 

So I bought them. Go me.

I've got a book on the go, I'm working quite hard (for someone supposed to be retired), and there's a prospect of another book after this. And besides this was close to Fathers Day. Enough said. 

I wasn't expecting to be able to buy them in Hull, but KRCS in Hull had just received some stock and they did look very nice.  

I don't regret the purchase. The Apple Airpods are quite pricey (after all, they are Apple) but their integration with the iPhone and the Apple watch is very impressive. You don't "pair" them in any kind of Bluetooth sense. You just open the dental floss like box they come in and your iPhone asks if you want to use them. And then they just work. With all your other Apple stuff as well. You can also press a button on the case to activate pairing with other Bluetooth devices, but I've not done that yet. 

The earpieces look like slightly longer ordinary earphones, minus the wires. And that is very important. You don't realise how annoying headphone wires are until you get a wireless pair. There's no sudden jolts when the cable catches, or walking away from the desk and watching your phone being dragged off the desk onto the floor. 

They fit perfectly in my ears and I've never really worried about them falling out. Even when wearing them to mow the lawn. Your experience might be different, I'd advise you to try a pair if you're thinking about getting some. 

The headphones work well with the Apple Watch, although I have a bit of a fight making them work with the watch if the phone is nearby. 

The sound quality is good enough. More expensive headphones sound better, as do some cheaper ones. The earpieces don't block out all external sounds, but that's probably a good thing bearing in mind you're going to wear them out and about, and you probably want to hear warning shouts about oncoming busses. Apple happen to own a headphone company and so they're not going to make their headphones sound better then ones they want to sell you for twice the price.

The sound has an emphasis to mid and high frequencies, the bass is there but you won't hear it unless you're somewhere quiet. 

The earphones are powered by tiny rechargeable batteries which are charged from a slightly larger battery that lives in the little case they come with. The case has a lighting connector that you can use to charge it. The earphones will go for around three hours and the case can charge then a few times before you have to get a wire out and plug things in.

The earphones detect when you take them out of your ears, so the music stops when you stop listening. If you only take one earpiece out of the box you can listen in mono. Double tapping the earphone (which probably looks quite silly) triggers Siri. Each earpiece has a microphone in it and uses some fancy audio beam forming shenanigans to pick up quality sound. I used the setup in a conference call and everybody seemed to understand me. 

Of course they are expensive. But they do what they say on the tin. I've used them a lot because they just make using headphones easier. 

Astonishing Customer Service

I've seldom been so happy to lose a bet. 

A week or so ago one of the taps in the kitchen broke. Or, perhaps to be more precise, I broke it. While replacing the internal fitting (the bit that you have to change every now and then otherwise the taps drip) I put the handle screw on cross threaded and managed to strip the threads so that the tap handle wouldn't fit properly.

This was the cue for a whole selection of MacGuyver-esque escapades as I tried a bunch of different tricks to try and attach the tap cover. Some were quite successful. One lasted all of a day.

Number one son watched these attempts up until the point they stopped being amusing (i.e. for around ten minutes) and then suggested that I contact the company and ask for a replacement for the broken part. "Don't be silly" I replied haughtily. "No one does that kind of thing any more. I bet you fifty pence that if I contact them I'll get no response". 

Anyhoo, a bet is a bet, so last week I filled in a web form describing the problem and received a reply from Anna telling me that the replacement parts were in the post. No charge. 

Astonishing service. Thanks so much Brita. You've restored my faith in customer service. I'll pay number one son next time I see him. And be very happy to.

Will Robots Take Over the World?

So, today I did my half an hour on "Will Robots Take Over the World?". I stated of by saying I was fairly sure that then won't, but that they are already here and all around is in the devices that we use from day to day. From that it was a short hop into the joys of software and I finished off with a plug for the Hull Pixelbot and a demonstration from Chrystal Masie, Commander Custard and Aunty Violet, who responded well to commands from the audience. 

Thanks for being a great audience folks. You can find the slides for the talk here

AI Rob Miles

Here's a nice quote: "The world is not only stranger than we imagine, it is stranger than we can imagine."

Now, here it is in action. On Thursday last week I blogged that I was giving a talk about robots taking over the world, but I had no recollection of arranging it. The blog post then gets some comments from folks who think that this Rob Miles should probably have been booked instead.

Then, today, AI Rob Miles (as I shall refer to him) got in touch offering to do the talk. From the videos that he has produced (you should watch them) I reckon he'd do a much better job than me. I've fiddled with AI and whatnot, but I wouldn't call myself much of an expert. AI Rob Miles is. 

Rob Miles is not an uncommon name I suppose, and there are lots of techy people out there. But even so I'm impressed by the coincidence. 

Will Robots Take Over the World

I've just discovered that I'm giving a talk about robots at the university on Monday 26th June. Or at least someone called Rob Miles has been booked to do 30 minutes on whether or not robots will take over the world as part of the Annual UCAS Exhibition which this year is in Hull. 

I probably said yes to it when I was drunk. Or something. 

Anyhoo, if you fancy coming along on Monday at 10:15 in LR13 in the Wilberforce Building on the University campus it would be lovely to see you. I will, of course, be showing off some robots of my own. And I'll be sober. Or something.

I don't teach at the university any more, but I retain a strong affection for the place where I spent my professional life. They even made me a Fellow of the University, which was very nice of them because I think it means I get to give talks like these. 

Troublesome Tanks Game Controller

Spent a chunk of today working on the design for the controller for the new "Troublesome Tanks" game that the "Spooky Elephant Collective" is building. 

Because I'm no good at 3D design I create all my objects in Python, running the code inside the FreeCad program. The programming environment in FreeCad is minimal, with no debugging support and error handling. If you get the program wrong it just stops.

I love this. 

It really keeps me on my toes. Especially with a language like Python. Anyhoo, the designs are looking good. Now, all we have to do is print them. 

Making a Windows Home from home

I've used Virtual PCs for quite a while. My first proper brush with the technology was when I was building and configuring Class Server systems. I found it kind of magical that I could have several "fake" PCs running inside my one real one. And I loved the way that if anything bad happened to the hardware I just had to spin up another PC on a replacement device.

I've started using them again. I'm writing a "Begin to code Python" book and I'm worrying about the installation documentation. It's important to be able to show the installation just as it would be for someone running Windows 10 Home Edition on their brand new laptop.

So I've built a brand new Windows 10 Home Edition installation on a virtual machine. Took around twenty minutes or so. And the beauty is that I've taken a snapshot of the empty machine, so I can easily "wind back time" to before the installation and practice it again.

I used a really nice guide which you can find here

Arms is Great Fun

I got Arms today for the Nintendo Switch. It's the first video game I've bought in a while. And the previous one was for the Switch as well. 

It's a fun game. The controls are easy to use, and you really feel that you're directing the punches, especially if you play holding the controllers in your fists (although more conventional arrangements work too). We had a go at two player mode using two Switches, and this worked very well, with much ensuing mayhem. 

There are quite a few tournament types and the various characters are all nicely realised. There's more depth to the single player affair than you might expect, although this kind of game really shines with multi-player. I'd love to get four players together for a proper brawl. 

The Switch is apparently doing pretty well. And with games like this it deserves to.