Home Repair Hints: How to fix a broken router

Lunch at Thieving Harry's at the marina. Great stuff.

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.

Pick Up the Crew is Go

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. 

Formatting Code Listings in Kindle Books using the Html Agility Pack

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. 

Careers and Internships Networking Event

Gathering at the start. Nothing brings folks in like Free Food..

Gathering at the start. Nothing brings folks in like Free Food..

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. 

Peter gets things going

Peter gets things going

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. 

Plenty of action at the exhibition again

Plenty of action at the exhibition again

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.

Ooh. Free pens..

Ooh. Free pens..

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. 

Fixing your WiFi Radio

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. 

In Praise of Older Cameras

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. 

Capturing the Students Union

We've had a few lovely mornings on campus over the last week or so, and I've become kind of obsessed with getting a decent picture of the Student Union building in the sun first thing. After a few sweep panoramas that didn't turn out very well I've managed to stitch the above together out of six different photographs. It's not quite perfect, there is a bit of weirdness right at the very top of the roof, but will do for now. 

Students that Blog

I strongly encourage all our students to blog. Not because I think they'll gain a world following, but because it is a great way to practice writing. And it turns out you don't need a world following anyway. You just need that one potential employer to find their way to your site and suddenly you are streets ahead of everyone else.  I know students who have had job offers purely on the basis of their blogs. 

Anyhoo, here are a few Hull folks who have taken up the blogging challenge. These are just the first few that sprang to mind. Apologies to anyone I've missed out. Ping me an email and I'll update the list. If you want to go on the Blogroll (not sure about that name) at wherewouldyouthink, let me know about that too.

Go See Shaun the Sheep the Movie

As I've mentioned before, I don't go to the movies for dramatic insights into the human condition. I go for fun. And popcorn. 

Shaun the sheep is fun. It won't win any prizes for dialogue, because there isn't any. But there is a nice story, well told, with some very funny set pieces. The phrase "recommended for children of all ages" is a bit overused these days, but I reckon this one really is. 

Konstructor Camera Shots

Portrait of the artist...

Portrait of the artist...

Some time back I made myself a camera. I've just got some of the pictures back and it's worked. Yay!

When I dropped the film off to be processed I said to the girl in Jessops that it was quite possible that the pictures may all be black, or white, or on the same frame. But I took 25 or so pictures and got 22 back, which is great.

We don't have a word that describes that feeling you get when you go to get something from the place where it is usually stored and it isn't there.  If we did have I'd be able to use it now. I thought I'd been clever by having all my photographs transferred onto a CD when I had them processed. But of course when I got home I couldn't find my CD drive. Fortunately I'm an inventive soul and managed to use the PS3 to move the files somewhere I could read them.

Turns out that they have not been scanned to very high resolution and there are some nasty scratchy artefacts, but I'm very pleased with the results. They have a nice "other worldly" feel. I'm definitely going to put a few more rolls of film through the device. 

I like Saints Row 4 more than Destiny

I quite like Destiny. But I love Saints Row 4. Destiny is a bit serious for me, with a portentous narrative about "The Collapse" and ancient warlike races with mythical pasts of great mystery. Or somesuch. But Saints Row 4 is just crackers. Destiny is very worthy, but it hasn't made me laugh out loud once. But the presidential press conference right at the start of Saints Row 4 had me chuckling all the way to the alien invasion which takes place shortly after.

After the aliens arrive you get dumped into some deeply silly simulated worlds for no particular reason which is good for two reasons. Firstly you can lay waste to lots of people and buildings and stuff without worrying too much because none of it is real. And secondly you can break all laws of physics in increasingly outlandish ways.  

It reminds me a lot of a game called Crackdown that I played on the Xbox 360 many years ago. It's a bit like Grand Theft auto, but after you've been eating some really strong cheese.

I'm only 9% or so through the game at the moment, but I'm having a blast. The graphics aren't as good as Destiny, the game is supposed to be glitchy (but I've not seen this),  and I guess that for long term appeal it won't be as good. But I don't care about any of that. It's just more fun. 

FYI I'm playing the PS4 version of the game that I arranged to have as a Valentines Day present. Which has turned out rather well. I've not played any of the previous versions of the game. The word on the street is that if you've played any of the other editions you might not get as much out of this version, but if you haven't tangled with the franchise before, you're in for a treat.

Windows 10 Phone Edition First Impressions

The settings screen has had a serious makeover

The settings screen has had a serious makeover

Well, right on time, as promised, we get a technical preview edition of Windows 10 for the phone in February.  The only problem is that it doesn't work on my Lovely Lumia 1520. This is a technical thing involving the size of the boot images and phone internal storage. I reckon this is fair enough. The only problem is that I really want to have a go. Enter a bright orange Lumia 630 into my life.

You can pick up unlocked versions of these from Amazon for well under 100 pounds and they are actually a smashing little phone. They have nice things like a removable back and exchangeable battery, along with a socket for an SD card to boost the rather internal memory.  They can also run the Windows 10 Technical Preview.  Yay!

The install process was easy enough. I did it over the afternoon, just checking every now and then to see if the progress bars had moved any. You just install the Windows Insider application (you can find it here)  then follow the instructions. There's a "red pill - blue pill" moment where you have to choose between bleeding edge or an older but slightly better supported preview version (I went for bleeding edge - of course) but after that everything runs on rails. Microsoft really are getting good at rolling out over the air updates. 

And when it has all finished you are left with the latest build of Windows 10 on your phone. And you can play "spot the difference". Lots of things look exactly the same, almost certainly because they are exactly the same just at the moment. The Settings menu has had a makeover, the keyboard is a bit different, there's a file explorer and you have to configure the phone to the US region of you want Cortana. 

From the point of view of Microsoft I think it makes very good sense to use the lower spec. phones to start with. If things run OK on the slower devices they are going to run really well on the larger ones. In fact the quality of the experience on the Lumia 630 brings out a problem that Microsoft have with flagship devices. Just what do you make the flagship do that sets it apart from the very acceptable behaviour of this low cost Lumia?

I was very pleased to find that Cheese Lander works fine on the phone, as has much everything else I've tried. I've had a few freezes in Internet Explorer but nothing that would stop me from using this phone as my daily driver. The interface is a bit choppy sometimes and there are occasional flashes of red screen as the video catches up, but it all works fine. I'm really looking forward to seeing how the system evolves in the future. 

First rule of Code Club: Do talk about Code Club

I picked up some flyers....

I picked up some flyers....

Yesterday evening I popped down to C4DI to hear Linda Broughton talk about Code Club. I'd not heard of it before, but now I have I think it is a splendid idea. The idea is to give pupils in primary schools some experience of coding, not necessarily with the aim of producing a nation of Mark Zukerbergs, but instead giving kids an appreciation of what software is all about.  

Making, modifying and fixing simple programs is a great way to introduce kids to problem solving and diagnostic techniques that have a huge range of applications, not least in writing code. Code Club has material for Scratch (a neat game creation system), making web based solutions and Python. Volunteers spend an hour a week with the kids going through the content in the context of an after school club. About code. Hence the name. 

 

Code Club do all the heavy lifting, sorting out the insurance and health and safety issues, along with checks that have to be performed so that you can go into schools. You can also work from their curriculum, so you just have to turn up and do the session.  You sign up on their web site (as a school or a volunteer) and then both parties can do a postcode search to find nearby partners to get involved with. 

I think I'm going to sign up for this, but better yet I think it is something that students (and staff in our department) should get involved with. We've run school events before and I've always found that working with kids like this is great fun. Any students who fancy getting involved (it looks great on your CV and gives you some great life skills) can get in touch with me if you like, and we'll see if we can sort out a Hull based effort.

Charlotte Talks Industrial Placements

As soon as I found out that Charlotte Godley, one of our students, had landed a placement at Airbus Industries I made a mental note to ask her to do a Rather Useful Seminar on her experience when returned to the department. Today she came along and gave that seminar.

It was excellent.

Charlotte started with reasons why you should take a placement for a year. (it just makes you all round more awesome) and reasons why not (it is hard work, and you might get out of step with chums in your cohort who will graduate just as you come back). Then she spoke about the best way to get a placement. I think her approach really boils down to three words.

Have a plan.

Having a plan means things like finding out about a company and tailoring your CV and accompanying letter to chime with what they do. It means thinking about the kind of questions you might get asked at interview and coming up with some really good questions of your own for the company. It means preparing for careers events and making hit lists of companies to target. But most important, it means giving some thought to what you really want to do in your future.

A placement is a great way to find out if you really want to work in a large company, or write Python programs, or travel the world in a van solving mysteries (my favourite). It is also a great way to learn the ways of work, where suddenly everyone around you is not the same generation as you and everything stops at 5:30 leaving you exhausted but looking for things to occupy yourself with.  

Charlotte gave a very good description of these issues and the fact that there were so many detailed questions at the end of the session was a testament to how well the material had been delivered. She has put her slides up on her blog, and I've asked if she wouldn't mind doing a screencast of the deck, as I'm sure it would be useful to all our students.

We are having a Careers and Internships Networking event in two weeks. Hull students can sign up here and get a set of free business cards that they can pass around. We'll be releasing the list of companies coming along so that you can prepare your "hit list".

Students from any year really should come along. First years can be thinking about internships over summer (we have some developers in the cohort who would be well up for this) and second and onward years can be thinking about taking years out or finding employers.

Free C# Course and a Shiny New Kindle C# Yellow Book

I've spent the last couple of weeks swearing at HTML files. Who would have thought that converting a Word document into nicely formatted markup could be so difficult. Anyhoo, I've finally managed to get the text into some sensible shape and it now has a proper Kindle table of contents.  If you have already bought my C# Yellow Book on Kindle,  then you might like to update your copy.  If you haven't you can get one here.  And why not?

Of course the original version is available at the usual place. And I've also added the entire content of our First Year programming course from last year. This includes over 100 slide decks, practical sessions and the assessed coursework. The content is free for anyone who wants to teach C# or learn it. Enjoy.

Red Nose Day + Three Thing Game + Pink Tutu : What could go wrong?

A note for your diaries folks. On Friday 13th of March I'll be doing one of my (in)famous Lectures in Rhyme in aid of Comic Relief. You can find out more (and sponsor me) here. You can also marvel at the strange distortion of my face in the picture. Or perhaps I always look like that. Ugh. 

Anyhoo, after the fun and frivolity of the lecture we'll be embarking on a Red Nose Day themed Three Thing Game. We'll have "rent a thing" events and allow you to exchange your real money for extra "Bank of Thingland" pounds to get more auction winning powers.

My fundraising target is £1,500. If we reach that before the event I will do the lecture wearing a pink tutu. Apparently you can get away with a lot of stuff in the name of charity.....