Got a Microsoft Band
/On the way down to London on Tuesday I had a weak moment, went onto eBay and bought one of these. It's arrived this afternoon.
I've paired it with my Lovely Lumia and so far it works a treat. Very excited.
Rob Miles on the web. Also available in Real Life (tm)
On the way down to London on Tuesday I had a weak moment, went onto eBay and bought one of these. It's arrived this afternoon.
I've paired it with my Lovely Lumia and so far it works a treat. Very excited.
Today we travelled back to Hull. Things were a bit time critical as it turned out. The train arrived in Hull around 50 minutes before I was due to give an open day talk. But thanks to the magic of taxis I got up to the university in time and it all went swimmingly. Sorry if I bored you with tales of who I'd been mixing with the night before.
The talk went great, thanks for being a lovely audience.
Well, that was fun. Some time back I had some correspondence with the Red Nose Day folks about my efforts with the charity over the years. Turns out I've been doing lectures in rhyme for nigh on thirty years. Which is scary. (actually my plan is to keep on doing them until I get one right...)
Anyhoo, the result of this was an invite from Samantha Cameron, wife of the Prime Minister, to a reception at Number 10 Downing street. Along with a stern injunction not to make a fuss until after the event was over, for security reasons.
The good news is that now I can tell folks about it. The great news is that the event was amazing. We turned up with a mix of fund raisers and Red Nose Day partners and spent a while in this posh reception room drinking free drinks and eating free food.
Samantha Cameron gave a lovely speech about the work of the Red Nose Day folks and then David Walliams, of Little Britain and Channel Swimming fame, turned up and read his Comic Relief book "The Queens Orang-utan" . Finally there was a speech from the Comic Relief head honcho, who's name I've sadly forgotten. Apparently they expect the charity to break the one billion pounds raised barrier on Friday, which would be completely amazing.
Another David, David Tennant, turned up to mingle. Sadly he moved on before I managed to have a chat or grab an autograph, but I did manage to get an autographed copy of David Walliam's book, which was wonderful. After that we had more mingling, drinks and nibbles. Turns out all the folk involved with Comic Relief are all splendid people. Who'd have thought?
Then, on the way out we all queued patiently to take our pictures on the hallowed threshold of the home of the Prime Minister. There was a strict embargo on the use of phones and cameras during the event, but it was nice to get one "I was there" image.
I do the lectures because they are an interesting challenge to write and great fun to deliver. Plus they bring in a bit of cash. It was really nice to be recognised for the work. The next lecture is on Friday 13th of March at 12:15 in the Robert Blackburn Building on the University of Hull campus.
You are welcome to come along. Free to get in, but expensive to get out....
If I hit my target, I'm wearing a tutu to deliver the lecture. You can sponsor me, and bring me one step closer to total embarrassment, here.
If you have discovered that what is missing from your life is a small, 3D printed piece of plastic with a unique arrangement of disks and squares on it, in a variety of colours, then I have just the thing for you. A Red Nose Day tag.
They are on sale in aid of Red Nose Day from our Departmental Office in Computer Science. They look great on a key-ring or as novelty ear-rings. Every one is unique and we will be using them in the lecture on Friday for some fun and games. They only cost a pound each. Bargain.
And don't forget that you can sponsor me, and maybe get me into that tutu, here.
If you are looking for the things we are going to auction tomorrow, you can find them here. Enjoy.
Chainsaws, Bottle, Kitchen, sphere, Leonard Nimoy, Hot dates, Bouncing, random, Crew, Chasing, Circuit Diagrams, Small Mammal, Turret, Friendly Fire, Hack, Zombie, Water, The End, Cornflower Blue, Road, Penguins, Dancing, custard, Rail Grinding, Shifty, A sweater that once had sleeves but now does not., Toilet Plunger, Sanctuary, Chess, Parody, Ferrero Rocher, Ninja, Soaring, Skeletor, Base, The King, Castle, Collision, Spooky Skeletons, BiPolarBear, Why-Wolves, Giant Spiders, Errors, Soldier, Chivas, Three Things, fighting, Yeast, Crippling debt, cloak, Rollercoaster, Captain, evolution, growing, Touch, Laser, Fruit, chicken, Something, Euphoria, Scout Salute, Penguin, Fire, Screenshake, , Cardgame, Railway, 2D, Doge, Oasis, Scratch, Badgers, Triangles, Tycoon, Communism, A man standing on a chair yelling wildly about marsupials., Joke, War, snakes, Beards, Platform, Disembodied Beards that Kill People, Alchemical Horrors and Fun, monkey, Bubble, Space, Sea, Baddie, Flying, The Fanta Gang, Colour, Pinball, Cat girls, A Bitcoin-Based Serial Killer, Queue, Spanking, The One Ring, ManBearPig, LegendFace, Uncommented Code, Balls, Ostrich, Beer, cooking, Escape, boomerang, Gore, Nerd, lasers n stuff, Mechanical Gears, shooter, 404 Error, dragon, Skeletons, spacehopper, Road, Solar Eclipse, Bandit, Obama, cactus, pixel, Fox, Shark, Cars, Ice, Arcade, Sword, Cool, N/A, Dragons, Horror, Jam, square, Grey, Wildcard, Burger King, Power-ups, 400 Tiny Bears, ASCII art graphics, Chairs, Fish, nothing, Dog the Bounty Hunter, Pirate, Robot, Cue, log stove, pies, Magic, Black hole, Defense, copious amounts of food, XNA, Death, Hull, Scrapper, Wombat, Bees, Badminton, Clouds
We are having the Three Thing Game thing auction next Monday. This is always a giggle. Teams bid "Bank of Thingland" money for things that they want to add to their games. This year all the things are student suggestions. What could possibly go wrong?
Anyhoo, one problem with the auction is that we need to get through over 120 lots in around half an hour, so the auction rate has to be frenetic. Last year I thought I'd solved the problem by fixing the auction length at 15 seconds and creating a countdown timer. Unfortunately, human nature being what it is, the result of this was that everyone sat waiting until the timer counted down and then tried to snipe with bids at the last minute.
So this time I'm trying something new. A random countdown timer that runs for between five and 15 seconds. Teams won't know when the auction is going to end, so they'd better get their bids in as soon as they can.
Of course this means I'll need a timer. I wrote one this evening and it took around half an hour. And for that I've got Windows Phone and Windows desktop versions.
These are the variables in the program. I use a DispatcherTimer to generate interrupts. I keep a flag to say whether or not the timer is ticking and I have a counter and a limit value which are used to manage the time outs.
This code sets up the timer. It ticks every second. The timer_Tick method is called each time the timer ticks. I also make a copy of the Foreground colour of the text so that I can put the timer digits back to the original colour when the timer is restarted.
This code sets the timer ticking. If the timer is already ticking the method returns straight away. Otherwise the timer is set up, the screen colour put back to normal, a random timeout between 5 and 15 seconds selected and the timer starts.
This is the third method. It runs each time the timer goes tick. If the timer is active we increment the counter and then display it. Next we check to see if we have hit our limit. If we have a sound effect is played and the counter text block is turned red. Then we stop the timer.
All this code is shared between the Windows Phone and Windows Desktop versions and it works a treat. Great stuff.
I've been doing a lot of 3D printing lately. For some reason I've got it into my head that it might be neat to sell little 3D tags as part of the Red Nose Day event. Which means I have to print them. Una, my lovely 3D printer has been misbehaving a bit of late, prints have not been adhering to the print bed very well and their undersides have been a bit rough.
Last night at C4DI I was talking to Robert and he reckoned the way to get perfect prints was to print with no adhesive on the bed and whack the printing bed temperature up to 70 degrees (which is actually rather hot for my tastes).
Anyhoo, I tried it today and it works a treat. The PLA sticks to the clean glass surface and then when everything cools down the prints just pop off the print bed with no problems. And each print has a lovely glassy smooth finish on the bottom.
I'm kind of annoyed that I didn't try this earlier. Why would I have a heated bed on the printer if I didn't actually make it properly warm? Anyhoo, I'm now turning out lovely tags. They'll be on sale next week.
If you have a Windows 8 or more PC, or a Windows Phone 7 or more phone, you can sample my wonderful Robs Red Nose Game.
Once you've played it for a while you can then go and sponsor me here.
Pro tips for the game:
The final slide....
Today David Grey and me gave a Rather Useful Seminar all about "what to do when you are stuck". I think everyone who was there got something out of it. You can find the slide deck here. If you want a quick summary, here goes:
We've been running the "Wrestling with Python" sessions again. Each Tuesday we get together with some local teachers and continue the process of getting up to speed with the Python language. We've reached the point where we are having a go at programming puzzles. And it is proving quite fun.
I've put the "Coding Conundrums" up on the Python site so anybody can have a go. You don't have to use Python, in fact I'm sending the same puzzles around our department to give folks some programming puzzles to get their teeth into. I reckon that programming is something that you have to work at continuously if you want to get (and stay) good at it. Bit like learning a musical instrument.
I'm also starting to properly like Python. Most of my Python programming takes place in the forbidding environment of the FreeCad graphic design program. I've got no debugger, scant error messages and Python programs can be terribly "brittle", in that a small mistake can cause them to shatter into a million pieces. But I must admit I'm really liking it.
Last time I did a Red Nose Day Lecture in Rhyme I offered to wear a tutu if I hit my target on the sponsorship page. Rather sadly we missed by only 16 pounds.
This year the offer still stands, and to show my faith in my sponsors I've actually bought the tutu.
So, if you want to see me make a complete fool of myself, as opposed to the incomplete version that is normally on show, you can sponsor me here.
Tags Ready for printing
Red Nose Day is a UK charitable appeal. I do Lectures in Rhyme for it and all kinds of silly fun stuff. If you want to sponsor me for the next one you can do so here:
http://my.rednoseday.com/sponsor/robmiles
Last time we had a Red Nose Day I had some RFID tags that I used as the basis of a raffle. The holder of the winning tag won a rather nice Gadgeteer kit.
This year I thought I'd try something different. I thought I'd 3D print some tags and sell those instead. Each tag is completely unique thanks to a Python program that I've written that creates a combination of square and round layers of different sizes on the top of each one. Above you can see how this works. Each tag has five layers on top, of which two are square, the rest round. The square layers are rotated a random amount too so that there is plenty of variation.
I'm going to print only one of each tag design, except for the winners, where I'll print a "golden" tag as well. We'll draw out the golden tag at the lecture on Friday 13th and find the winner.
Printed tags. I'm going to do lots of different colours.
I'm quite intrigued by the idea of using software to produce 3D printed objects which are unique. This lets me explore the field in a good cause.
The tags will go on sale later this week at a two pounds each. You can do what you like with them, they'll come with a keyring attachment, but you could use them as unique earrings if you were so inclined. And the more you buy, the more chance you have of winning our top secret big prize.
Note: Sharp eyed readers might have noticed that some of the red tags above have more than two square layers. These are test ones that I produced while tweaking the code.
Lunch at Thieving Harry's at the marina. Great stuff.
I've noticed for a while that our broadband at home has been a bit poor. Today I did a speedtest and found I was getting around a third of what I should have, data rate wise. So we did some more testing and were on the cusp of deciding that it was a problem with the line when I remembered that I might have a spare router up in the loft.
Turns out I did. We plugged it in and instantly the speed was restored to something that is very nearly good enough to watch 4K video. In fact we were able to view some of the rather good Harry Bosh series from Amazon in quite sparkly detail.
Oh, and how to fix a broken router? You just need two things. A new router. And a dustbin.
I published the First Year programming coursework today. If students fancy writing a game they can create a version of "Pick Up the Crew", an action packed game where the captain has to search the cruel sea for overboard crew members, all the while avoiding hungry sharks.
Above is my highly abstract test version written in XNA. I'm a great believer in "placeholder graphics", as you can see.
I'm expecting great things from the students this year. I've even bought "pickupthecrew.com" and I'll sign it over to the student who produces the best looking game at the end of the semester. As long as they publish the game of course.
Well, that could have gone better. I got an email from Amazon suggesting that I buy a copy of the C# Yellow Book. I get these from time to time, and this time I thought I'd tweet about it as above. It turned into a very popular tweet (for one of mine).
Anyhoo, with my ego nicely built up I thought I'd took a look at the Amazon page for the book. And I found a 1 star review which noted that they would have liked the book a lot more if all the code samples were properly formatted....
Oh dear. Turns out that if you view the book on your iPad or iPhone the code samples all get printed on one line. I thought I'd checked this, but apparently I hadn't. So I did some digging.
Kindle books are basically HTML documents, a bit like web pages. Like web pages, if you want to tell the renderer that you have already formatted the document you can use the <pre> </pre> enclosure to mark text that already has a layout. You can put code samples into text without their layout being damaged.
But there is another way to do this. You can add "white-space: pre-wrap; " to your styles for the pre-formatted text. This works fine on Kindle devices, Android devices. But not iOS devices. Guess which technique I'd gone for. My reasoning was sensible enough, I wanted to add other stylistic touches to the code samples (a grey background for example) and it made sense to do it all in once place. But it didn't work. Stupid me.
I had around 200 pages of text with lots of code samples, all of which were wrong. And a broken text up on Kindle that I really, really, needed to fix quickly. So I did some digging and came across the Html Agility Pack on CodePlex. This is completely wonderful.
It provides a way of reading in a large HTML text and then traversing the notes in the document and fiddling with them. Turns out all I needed to do was load each of the chapters and then do this:
void processNode(HtmlNode node)
{
foreach (HtmlAttribute attribute in node.Attributes)
{
if(attribute.Name == "class" && attribute.Value == "CodeExplained")
{
node.Name = "pre";
attribute.Value = "CodeExplainedPre";
debugString.AppendLine(node.InnerHtml);
}
}
if (node.ChildNodes != null)
{
foreach (HtmlNode childNode in node.ChildNodes)
{
processNode(childNode);
}
}
}
Â
This starts at the base node and then looks for anything with the class CodeExplained. It then changes the name of the node to pre (for pre-formatted) and changes the attribute to CodeExplainedPre.
It is not very elegant, but it does use recursion. If a node contains any child nodes it calls itself to sort those out too. I was going to figure out the structure of the document and only target the page for fixes, but I was in a hurry and this code meant I could reformat the document and make it to the coffee break in time.
Note: There are probably lots of much cleverer ways of doing this using the Document Object Model or regular expressions or something. But at least this worked and got I was able to get the fixed version up on Kindle within the hour.
We held a Careers and Internships event last year. It went really well so we thought we'd do it again. So we did. And it went really well again. We had loads of companies show up and present, and then they manned stands and took business cards (that we had rather thoughtfully provided) from our students.
One thing that surprised and pleased me was the number of companies in the area doing world beating stuff. And one company mentioned the awesome news that Hull was one of the top ten cities singled out in a recent Tech City UK report. You can find the report here. Skip to pages 45 and 46 for the good stuff.
It was great to see the students and employers engaging again. Many companies had brought Hull University graduates with them as part of their teams, and there was something of a reunion flavour to the event, which was really nice. And, of course, we'll run it again next year.
If you're a Hull student, I wrote a little executive summary about the event. Send me an email and I'll let you have a copy.
I'm quite proud of myself. I've managed to fix something. In the kitchen we have an internet radio which works quite well. We need one because there are no other radio signals that work properly there. But sometimes it stops working, It's taken me a while to figure out the cause of the problem, but finally I have the answer.
It's the microwave.
The confusing thing is that because the radio uses a lot of buffering it doesn't stop as soon as the microwave comes on and blocks out the signal. The radio plays for a minute or so and then drops out. Then, when you turn the microwave off it takes a few seconds for the radio to re-establish connections with the server and start working again.
I've checked on-line and apparently this is not an uncommon problem and the microwave radiation isn't hazardous as such, but it is irritating.
For me the fix was quite easy. I just switched the WiFi channel from 6 to 10 and the problem has gone away. Go me.
If you fancy owning an older camera my tip is to buy one and then wait. Works for me. I've had my Sigma DP2S for a while now. I bought it ultra cheap off eBay some years ago. I think you can get them even more ultra cheap now, which is unfortunate for me, but good news if you fancy an interesting camera to have a play with. This weekend I got it out to have a play with again.
The Sigma uses a rather strange Foveon sensor, which means that rather than combining adjacent Red, Green and Blue pixel information it has a multi-layered sensor which grabs all the colour intensities at one spot. This makes for sharper appearing pictures even though the actual resolution of the shot is modest. The camera also has a rather nice fixed lens.
The biggest problem with the camera is that, compared with modern devices, it needs a lot more light to get a good quality picture. The good news is that when you get a shot, it looks very good, on a par with much more expensive cameras.
Sometimes, rather than spending a huge amount on an expensive, state of the art, camera it is fun to spend much less on something that has been around a while. If you choose your supplier carefully (eBay feedback is important here) you can get some quite fun devices to have a play with.
Some time back they must have had a meeting in Bristol where someone said "Why don't we make one of our bridges emit smoke?". Or something. Anyhoo, the idea was approved, and today we trudged through the rain to see the results.
The picture is in Black and White because today the weather has been in black and white too.
Another snap of faces, thanks for coming folks. Hope you enjoyed the day. Sorry I had to zoom off right after my talk. Don't forget wherewouldyouthink for more details about what we do.
Rob Miles is technology author and educator who spent many years as a lecturer in Computer Science at the University of Hull. He is also a Microsoft Developer Technologies MVP. He is into technology, teaching and photography. He is the author of the World Famous C# Yellow Book and almost as handsome as he thinks he is.