One Day and Counting

298266118
Now I just need to add the movie playback...

My wonderful new Message Display program has now managed to keep going for a whole day. It is my first ever Windows Presentation Foundation (WPF) program and it is running on Windows Vista RC2 on the machine in my office all hours of the day and night.

Since the real thing is required to run for weeks, and any failures of the system will be very visible (and therefore highly embarrasing) I've embarked on this soak test. The program is running in "dog time" (i.e. around seven times faster than it should) so that the results are better than realistic. Later this week I might dare to go live with it on the big plasma screen.

Sequence of Stupidity

  • October 10th Robert given receipt for hotel booking on Robert's credit card with instructions to "keep it safe so you can use it to claim back the money later".
  • Robert tosses the receipt onto desk on top of huge pile of papers.
  • Receipt stays safe for a couple of weeks or so, drifting around the office.
  • Robert notices the receipt just lying around and decides to address the problem by placing the receipt "somewhere safe".
  • Receipt vanishes.

There's probably a moral to all this, but I'm darned if I know what it is...

Make your own jigsaws

249244108_ef4b99b2b5.jpg
My first ever test..

Moosaic lives! I'm about to embark on a new project and so I'm going round finishing off some old ones. And the first result of this is that you can now download my Moosaic program. This lets you create image jigsaws out of your Flickr pictures and then get them printed onto little bits of card. Fun for all the family and just in time for Christmas..

Find out more here.

Going for a drive

After all the excitement of foreign travel and dodgy planes today we just settled for a litle drive to Durham and back to visit number one son.

On the way there we saw some amazing rainbows, including one which went all the way over the motorway. I'd love to have taken some pictures, but I was driving at the time, which is a bit sad.

When we got to Durham it rained. A lot. And then some more. Number one son showed his local knowledge by getting us lost down an alley on the way to the indoor market. With the torrents of rain, poor lighting and overflowing rubbish bins the place looked like the opening shot from a CSI episode. But fortunately there were no bodies to be found.

After a splendid time talking about nothing in particular and looking at large tellies (an AV upgrade is in the pipeline) we tootled back to warm Hull.

Danger at 300 feet

Well, I'm back home now. The conference was great fun. You can see a video of me here.

The trip back was slightly enlivened by the landing process, which seemed to involve a bit more going up than I remembered from previous flights. Then the captain came on and said that a warning light had come on concerning the undercarriage as we were making our final approach. However, not to worry because he had done the aeronautical equivalent of bashing the dashboard of the plane and things were fine now...

Although it was a bit disconcerting to find all the fire engines lined up alongside the runway when we finally touched down...

TechEd Update

Yesterday and today have been a bit of a blur. I've been to more sessions. Marvelled at the .NET Micro Framework, revelled in the Robotics stuff and been very impressed with the RSS feed talk this morning. I've found time to take a few more pictures too, which is always nice.

293325482
Rather a good sunrise

293326487
Even got the moon in this one

293326214
The Expo centre

293325756
The exhibition floor

293325574
MSP's from around the world.

293325902
If you have met me you will understand the humour in this picture.

There are some more on Flickr.

Tomorrow I give my session. Wish me luck.

C# 3.0 and Stronger Magic

Warning: This is a techie heavy post. If you are after witty prose and belly laughs then I suggest you look elsewhere (but then again - what are you doing here in the first place).

Just been to the presentation by Anders Hejlsberg about what C# will be doing in the future. I took a bunch of notes on the mobile phone which I've tidied up to post here (apologies for typos and spelling errors that got through):

Extensions

You you can add a method to an interface. Then any object that implements the interface can use the method. Extension methods are brought in with the interface by means of a using statement. You can add them to classes too. Serious potential for stupidity/confusion here but also a lot of power. What I call a Spiderman situation (With great power comes great responsibility).... You may end up leaving the impression that your extension is part of C# itself. I wonder if anyone has thought about colour coding the intellisense?

Talking of Intellisense (the bits in Visual Studio which suggest what items you might want to enter at a given point in the code) it seems that it is now part of the language design in that there is an inherent assumption by the language that it will be there for the programmer.

Var

The var keyword lets you simplify the deceleration process. The type of the thing that you are making is inferred from the type of the expression on the right. In this respect it smells a bit like the dim statement in Visual Basic, but there is a bit more to it than that. It underpins a general principle that you can manipulate items for which you have not specifically created a type, but from which the compiler can infer the required information to make sure that your code has integrity.

Lambda Expressions

Lamda expressions let you pass code as a parameter to a method. Sometimes you need to tell a method what to do. In C# you usually need to create a delegate type which you then point at a method which does the job. With a lambda expression you can put the behavior right in place. There is no need to make a delegate.  

Object Initialisers

Object initialisers let you set initial values during declaration of an instance. Can also initialize collections.

Expression Trees 

These are scary. They let me manage code as data. The compiler will produce the tree based on a lambda expression it is given. It ends up as a bunch of atomic actions which you can pass around as data. You can also modify the tree or produce one of your own from scratch. You can also compile these into IL or use them to make things like SQL statements. This is how we get our C# program code mapped into database queries for the Linq stuff.

Automatic Properties

Not sure about these, they just seem to save you typing. They let you create properties directly without needing to produce the get and the set right at the start. Must have both get and set, but you can make set private if you want a read only property. You can also put real methods in later.

Linq Database Access

This is perhaps the jewel in the crown of the C# upgrades. Query expressions use context sensitive keywords to map the query into method calls. This happens during compilation. Linq uses lambda expressions to denote the selection criteria. 

A query result can deliver a result as an  anonymous type (created based on the context of the result required). Because this class implements things like IEnumerable (so you can work through it) you can use the var keyword to create variables to work on the data. C# will be able to infer the required type. This means that you don't need to create loads of classes just to deal with query results.

There were some good code examples which show how queries are mapped onto code. And the other good thing is that if you download the whole thing and play with it yourself.

You're Using a Q1 for that?

Last presentation of the day found me at a talk about the use of ink in Windows Presentation Foundation. This was a lovely presentation, not least because of what the speaker was using to run all the demonstrations.

He was running big chunks of the show on a lowly Samsung Q1. This is an ultra-mobile PC which you can just about fit in your pocket (if you have a big jacket). He swore that, over and above some slightly fancier hardware for the pen, his was a very standard machine, with only 512Mb of ram. Notwithstanding these limitations it proved quite happy to run all the demos, including the 3D one at the end, as well as Visual Studio, all sitting on top of Windows Vista.

This left me determined to put Vista on my Q1 when I get home. I don't have the fancy touch screen stuff, but I do have an extra 512Mb of ram, which should be interesting...

The talk itself was about how Windows Presentation Foundation supports ink. Unlike the original Tablet PC, which was forced to shoehorn ink in alongside all the other user interface gubbins, with WPF ink is an equal partner as far as the programmer is concerned. Couple this with the fact that all the WPF pages are rendered as vector items (no nasty size dependence and infinite scalability) and ink starts to look very viable in the future.

Qn: When is a protocol stack not a stack?

Ans: When it is a "framework".

Had a very good talk about Windows Communication Foundation.

This is the means by which software shall talk to software in the future. And jolly good it is too. For me the most impressive thing is the way that they have used the features of C# (interfaces, attributes etc) to make it easy to set up connections and select the components that you want to use in any given situation.

When I was a lad there was much talk of protocol stacks. I even wrote a song about the ISO/OSI seven layer stack for one of my world famous lectures in rhyme....

But these days things have moved on, and now the talk would seem to be of "frameworks". I think these are a bit like stacks, but laid on their sides and with the ability to have extra bits (like security and compression) plugged in alongside.

It does seem very easy to link two process on the same or different machines and it looks as if this technology will make a lot of hard wraught code redundant as it takes away a lot of the difficulty in linking programs together.

Windows Presentation Foundation Fun

Just been to a presentation on Windows Presentation Foundation. This is the thing that I've been using to write a message system for the department. I thought I'd go along and find out how the grown-ups do it.

The answer is "Very well indeed". I was kind of pleased to find that my basic understanding of the way things work (describe how it is going to look in one file - the XMAL and what it does in another file - the DLL) was pretty much right. However, what really blew me away was how far you can take this stuff in skilled hands, and with the right tools.

It also opened my eyes to the potential for 3D and so the message system might be going to get even prettier. And something else that I'm going to find out more about is the statement that WPF is going to be available for mobile devices. That, my friends, is seriously interesting......

TechEd 2007 Gets Going

Went to the keynote for TechEd 2007 today.  I've been to a few of these and so I thought I knew what to expect. What I didn't expect to see was the Imagine Cup coming down the tracks as the first headline item.

291410453
Bigging up the IC

Interesting in that three and a half years ago I went to the first imagine Cup world final and there were 14 teams who had a bunch of booths off to one side of the main exhibition. Today we have the IC as a keynote item and teams from pretty much every country in the world taking part and a big stand in the middle of the exhibition area. If you are at TechEd go and see Caroline on the stand. Tell her Rob sent you.... This is all such good stuff. Nice to see that Microsoft is still keen on getting students fired up in this business. They also introduced a lass from Pakistan who, at the tender age of 10 managed to get some C# qualifications. Very impressive. I thought back nervously to my 11 year old self, I think I was writing joined up by then.....

Then it was on to the computer stuff. They showed a thing where you can view  business processes via Sharepoint 2007 and actually modify their actions directly using C#. Very clever.  Business process is a big, big, thing. And the ability to do this kind of thing is terribly interesting. I'm pondering about the potential of regarding academic progression as a process like this. Might be a fun student project. 

Then we went on to using Ajax to seriously spice up the user interface, which was very pretty. They had a bit whre you could select swatches for clothing and then view the outfits that would be made from the. this was kind of impressive, but what I really wanted was a tool which would do full cloth modelling (like some of our students are doing for games) and then put them onto representations of real people. I guess it will come with time. And I'm pretty sure the platform would support it.

Finally it was the seriously techie stuff. Using the new Linq extensions you can connect databases directly to your software objects with just about no glue. This is hugely significant. One of the nasty problems at the moment is how you can take your nice shiny objects and connect them to your big fat database. It looks like Linq will  pretty much nail this issue. And it has some lovely RSS tools too.

And now I'm off for lunch....

Barcelona by bus and foot

Done a lot of walking today. And a lot of top deck bus riding. After we had signed in at the conference centre we went on a tour of the city by open top bus. We took in the cathedral, which is the most impressive building site that I've ever seen, and Guadi park, which was very nice. Also a whole bunch of other, highly interesting, places which are all shut on a Monday. I've put a bunch of pictures up on Flickr. No doubt I'll take more.

290964500
Cathedral spires

Tomorrow the work starts for real.

Flying Out in Style

Flew out the Barcelona today. Jet 2 gave me the one seat on the plane with uber legroom. Very comfortable. Because I am a speaker at TechEd I was met by a very smart chap in a suit with a shiny Mercedes to take me to my hotel. Which was great. The hotel is posh too. It even has WIFI, although this did seem a bit dodgy, so I only managed to see around twenty seconds of Torchwood. Never mind.

In Search of Power

I'm going away tomorrow for TechED 2005. Cue frantic scurrying around and selection of bits and bobs to take with me. Today I bought some new re-chargeable batteries. I did this for two reasons:

  1. I can spend money on a gadgety type thing and still feel good about saving the planet (which is apparently quite trendy at the moment).
  2. Most re-chargeable batteries I get don't work properly.

I find that the name is very appropriate. You can re-charge them. However, this does not guarantee that they will actually do anything once the light on the charger goes green.

The only ones which really deliver the goods are the lithium-ion ones. All the other ones with scary sounding names, nickel-cadnium and nickel-metal hydride, absorb significant amounts of energy, get warm, and then go flat as soon as you try to get anything useful out of them.

 The only good news on the horizon is that the latest batteries have really impressive amp/hour numbers written on their sides and they seem to be getting cheaper. So I've got some.

But I'm taking some non-rechargeables just in case.

Customer Impressions

I love my job. Today has been uber busy. Updating the XNA presentation, giving a couple of lectures, attending a mid-semester review meeting with the second year (we had loads of students turn up - and some really good discussion about how we do what we do).

And acting as a customer in our Software Engineering project. At first I was not looking forward to this. We usually try to get people to do this who the students doing the work are not familiar with. I've been giving lectures to this group for a while, and in this respect I'm quite well known.

But for the project I have to be "just a customer". But actually it is quite fun. Some of the people who have come to see me have asked jaw droppingly sensible questions that I would not have thought of asking if I was doing the job, which is great. And I quite like being unhelpful and uncommunicative for a change. At least, I think it is a change......

I hate Microsoft

I had all the slides ready for my talk at TechEd 2006 in Barcelona. I'd even scheduled a presentation today so that I could preview the material to the students on our MSc course. Everything was ready. What could go wrong?

Well, what went wrong was that the Microsoft XNA team were too darned efficient for me, and released the second beta of the XNA Express yesterday. What's worse, they've fixed a bunch of issues that were irritating me and also made the Content Manager bit work so well that I just can't ignore it in the talk. I hate them all.

Because I have no intention of standing up next week and saying a whole bunch of stuff which is out of date or plain wrong it has meant that I've had to spend a big chunk of last night and this morning updating the slides and the sample code.

The good news is that the talk seemed to go OK (although I'm going to tighten it up just a bit) and that the sample game, "Hot Salad Death with Cheese" went down quite well.

287922640
Next stop Spain.