Final Summit Friday
/Today was the last day of the Summit. It has gone by real quick. Amongst the final presentations was one by Satya Nadella who heads up the new Microsoft search team.
These are the people bringing you Bing. Personally I quite like Bing. I like the user interface, the pictures and the way it groups results. I don’t like the way that it doesn’t always find what I want though, which means moving over to Google for the more technical searches. Hopefully Bing will catch up in due course.
It was interesting to hear how Microsoft are trying to improve the “search experience” and are working on why we search, in a bid to improve the usefulness of the activity. The way I see it, they are changing Bing from “search” to a “research” engine. When you search for a place it will try to pull down travel and hotel details, along with pictures and links to official sites. Quite neat. This all needs some frightfully clever algorithms to recognise content, along with a fair amount of editorial input as well I would think. However, it is nice to see Microsoft not just trying to equal the competition, but to go beyond this and move the field on.
In the afternoon we had a final wander around Bellevue and then headed to a nearby place for tea.
..can you guess where?
After tea I’d booked seats to see Avatar again, at the local Imax cinema in 3D. Awesome.
Hull Reunion
/I met up with Phil, Andrew, Andy and James today for lunch. They are graduates from Hull (and three of them are also old hands at the Imagine Cup). They all now work for Microsoft on various development teams around the company. It was nice to see them, even though they made fun of my haircut. Or lack of it…
MVP Summit Sessions Again
/I met another MVP in the lift today on the way to the sessions on the Microsoft campus. He asked me how I was getting on. “Fine” I said. “Yesterday they opened the top of my head and poured a whole bunch of stuff into it”. “Oh”, he replied. “With us they opened our heads and took a whole bunch out”. Perhaps that will happen to me.today Not sure what they will benefit from in my case though…
The weather is lovely again. Although we had some frost last night, the morning looks great.
Redmond Shuttle.
MVP Summit Product Sessions
/I set off on the bus at 7:00 am this morning. I’m trying to keep to “sort of UK time” by getting up at stupidly early hours. Because we are in Bellevue the bus journey is very short, which is nice.
As usual they had MVP banners on the Microsoft campus, which was nice.
Went to the company store as well, and bought some tasteful clothing.
We really are having fantastic weather this week.
MVP Summit and Fish Throwing
/This evening the MVP summit started with the opening keynote. Before the session started they were showing things about MVPs of note. And for some reason my name came up on the big screen.
As you all know I am very vain, and so I pulled out my camera and grabbed a picture. If you look very carefully at the middle screen you can see my name… 
The session ended with some fish throwing. As well it should. Then we went on for some free food, including hand thrown salmon, and discussion with fellow MVPs.
The agenda looks very interesting.
Bellevue Mist
/The long range weather forecast for this week was rain. Thank heavens it was long range. And wrong. Today started really misty, in a fantastically photogenic way.
It must be like being up in the clouds in those buildings at the top.
We found this place that did great pancakes, and nearly failed to eat all of them. They had a great set of posters advertising upcoming events in Bellevue.
Hmmm. I’ve missed the bicycle conference.
Then we grabbed a car and went for a drive.
View over the lake
Highway and sky
Mountain, truck and sky
We went out to the mall and I bought another robot. A friend for Jason.
The summit proper starts tomorrow. I’m hoping to find out a bit more about Windows Phone 7 which was announced today. It looks really good. It is definitely going on the “want one” list.
Hello from Bellevue
/Well, after a boring (but in a very good way) journey I’m now in Bellevue, where the conference is based this year. The whole setup is very nice, with a king sized bed in the room. I wonder if they measured it up against a real king?
Anyhoo, it is a very nice bed, although of course my body wants to use it at all the wrong times. I may have to do some “Jetlag coding” to get around this. The hotel is linked to a big shopping centre (how useful)
On the way to the mall I saw this really fancy glass sculpture thing.
Bellevue centre (or should that be center)
Packing for Seattle
/It is that time of year again, when I head off to Seattle for the MVP Summit. I’m really looking forward to this year’s event. It is always nice to meet up with folks I’ve not seen for a while, and talk about technology.
Of course this means that I have to choose which gadgets get to go with me. I’ve left the trouser press at home. Three is a good chance that the hotel room will have one anyway…..
Hull Students: Freeside Needs You
/If you are a CS student at Hull you might consider getting involved in Freeside. This is a student run organisation that operates out of our department. Their primary focus is on building systems that can host student services and they have been know to build the odd cluster.
They are also linked to Hull ComSoc and are involved in running game servers used in the department. Jon from FreeSide used some time in my lecture this week to give a short presentation about the group and recruit new members. He made the point that the skills you can get from Freeside will stand you in very good stead for future employment. Apparently big chunks of the server management team at Last.FM are ex Freeside stalwarts.
First Open Day of 2010
/
Another satisfied customer wins a PSP in our Open Day draw from Mike. With a copy of FiFa you can even play as Hull City….
We had a bunch of people up to see us today. Thank you very much for coming folks, we hope you found the visit worth your journey. This is the time of year when we start to get busy, we have a bunch of open days over the next few weeks.
Processing Lots of Files in C#
/Elliot came to see me today with a need to process a whole bunch of files on a disk. I quite enjoy playing with code and so we spent a few minutes building a framework which would work through a directory tree and allow him to work on each file in turn. Then I thought it was worth blogging, and here we are.
Finding all the files in a directory
The first thing you want to do is find all the files in a directory. Suppose we put the path to the directory into a string:
string startPath = @"c:\users\Rob\Documents";
Note that I’ve used the special version of string literal with the @ in front. This is so my string can contain escape characters (in this case the backslash character) without them being interpreted as part of control sequences. I want to actually use backslash (\) without taking unwanted newlines (\n)
I can find all the files in that directory by using the Directory.GetFiles method, which is in the System.IO namespace. It returns an array of strings with all the filenames in it.
string [] filenames = Directory.GetFiles(startPath);
for (int i = 0; i < filenames.Length; i++)
{
Console.WriteLine("File : " + filenames[i]);
}
This lump of C# will print out the names of all the files in the startPath directory. So now Elliot can work on each file in turn.
Finding all the Directories in a Directory
Unfortunately my lovely solution doesn’t actually do all that we want. It will pull out all the files in a directory, but we also want to work on the content of the directories in that directory too. It turns out that getting all the directories in a directory is actually very easy too. You use the Directory.GetDirectories method:
string [] directories =
Directory.GetDirectories(startPath);
for (int i = 0; i < directories.Length; i++)
{
Console.WriteLine("Directory : " + directories[i]);
}
This lump of C# will print out all the directories in the path that was supplied.
Processing a Whole Directory Tree
I can make a method which will process all the files in a directory tree. This could be version 1.0
static void ProcessFiles(string startPath)
{
Console.WriteLine("Processing: " + startPath);
string [] filenames = Directory.GetFiles(startPath);
for (int i = 0; i < filenames.Length; i++)
{
// This is where we process the files themselves
Console.WriteLine("Processing: " + filenames[i]);
}
}
I can use it by calling it with a path to work on:
ProcessFiles(@"c:\users\Rob\Documents");
This would work through all the files in my Documents directory. Now I need to improve the method to make it work through an entire directory tree. It turns out that this is really easy too. We can use recursion.
Recursive solutions appear when we define a solution in terms of itself. In this situation we say things like: “To process a directory we must process all the directories in it”. From a programming perspective recursion is where a method calls itself. We want to make ProcessFiles call itself for every directory in the start path.
static void ProcessFiles(string startPath)
{
Console.WriteLine("Processing: " + startPath);
string [] directories =
Directory.GetDirectories(startPath);
for (int i = 0; i < directories.Length; i++)
{
ProcessFiles(directories[i]);
}
string [] filenames = Directory.GetFiles(startPath);
for (int i = 0; i < filenames.Length; i++)
{
Console.WriteLine("Processing : " + filenames[i]);
}
}
The clever, recursive, bit is in red. This uses the code we have already seen, gets a list of all the directory paths and then calls ProcessFiles (i.e. itself) to work on those. If you compile this method (remember to add using System.IO; to the top so that you can get hold of all these useful methods) you will find that it will print out all the files in all the directories.
Console Window Tip: If you want to pause the listing as it whizzes past in the command window you can hold down CTRL and press S to stop the display, and CTRL+Q to resume it.
Best Laid Plans of Mice and Robots
/So, I had this plan to make a line following robot. I’d even figured out how to do the lines. The idea was to print track segments on A4 pages, and then laminate the pages and lay them on the floor. The robot would go from page to page and it would all work.
That was the plan.
So I drew out some track segments in Photoshop Elements, printed them out and then laminated them. Then, and only then, (and this is the stupid part) did I get round to testing my track design with the robot sensors. Turns out that the line sensors can see white paper really well. Really, really well. I get 99% reflection when I put the robot on the white parts of the paper. Only problem is, I also get 99% reflection when I put the robot on black parts. This is not a problem with the laminate, it seems that, as far as the sensor is concerned, black is most definitely not black. Robot fashion shows must be awfully dull.
Anyhoo, my line following plans were in danger of not being plans any more. Finally I had a brainwave. Carpet seems to give me only around 20% reflection, even through plastic. So I’ve now made some track parts that just have transparent sections where the dark bits should be. You can just see how this works in the corner section above. The green LED is lit because the sensor at the far side of the robot is on the white part.
And now I’ve hit another snag. The robot runs rather roughshod over the path sections. I was hoping they would be heavy enough to stay put when the robot goes over them, but it seems that Jason is rather heavy footed, and messes them up. I’ve now got to find some velcro, or something that will stop them getting moved around as the robot travels over them.
That’s for tomorrow though, I’m off to bed now.
As I lay in bed last night, worrying about my robot, I had a thought. Perhaps the sensors don't like inkjet pigments. I'm going to print out some more stuff tonight using a laser printer and see if that works better.
Such excitement...
Yep. That's it. A line printed by a laser printer works a treat. And I've even found some velcro to stick the map segments to the carpet. Great Stuff.
A “Bustlectomy” for Jason the Micro Framework Robot
/I did a bit of surgery on my Fez Micro Framework Robot yesterday. I took off his “bustle” at the back. I say his bustle, because my Micro-Framework robot is now called Jason, in honour of the JSON framework I’m working on to give him simple two way communication with a host machine.
The bustle was fine, but it hung out over the back a bit, and I wanted to make him (it?) a bit leaner and meaner. The new slim line Jason has all the sensors on his nose. He has a range finder right at the front and a pair of line followers underneath and coloured LEDs he can use to tell the world how he feels. At the moment he zooms around the living room nearly bouncing off things. I must admit it is great fun building him and writing programs to control what he does. You can write any number of desktop apps, but there is something very satisfying about seeing your code make the robot rush up to a wall, notice it, spin round and then vanish under the sofa. I’ll put up some more construction details later, when I’ve finished playing…
Kodu Rocks
/
I must admit I was a bit underwhelmed when I first saw Kodu. At first glimpse I couldn’t see how it would help to teach people how to program.
It turns out that this is because it is not really a teaching tool as such. The point that I seemed to miss was that the intention was to put people in touch with the experience of making a machine do a fairly complex task under their control. Rather than teaching programming, they were aiming to teach the joy of programming. Then, with a bit of luck, folks who find this fun will move into more formal ways of making this happen and turn to real coding.
I downloaded the free Kodu Technical Preview which runs on the PC (you can also get the program on Xbox Live for 400 credits) and had a play. It is great fun. In no time at all I had created a world and had my little creature running round after the ball and picking it up. I want to have another go with this.
I can see this being one of those things you show your kids and then after a while they will grab the gamepad and kick you off the machine so that they can have a go at finding all the things you can do with the environment. At first I was comparing the system with Little Big Planet, which also offers a way you can build your own worlds, but I think Kodu is better in this respect. It is presented from the start as an environment where you create behaviours, rather than as a platform game you can add things to.
From a teaching perspective it is great in that it gets you thinking about a program as a sequence of actions and decisions, and that is fine by me.
Mass Effect 2 Game Review
/I must admit that I’ve not actually played the game. But I have watched number one son play quite a bit of it on his laptop. Seeing him play you could have mistaken the action for a movie. The dialogue is so seamless, with the voice acting so pitch perfect for the various options he was choosing that it was only when I saw the screen that I figured out that he was actually making selections, and not just watching a cut scene.
The action looks good too, with a rich (if a bit scary) story beginning to play out. Anyone who doesn’t think that video games can stand alongside other art forms is seriously behind the times. This really is a new medium, and games like this show just what you can do with it.
Excellent.






























