.NET Micro Framework Demo Fun

What with the TechEd presentations less than a week away, today seemed a sensible time to start working on the code we are going to demo. We had a good idea of what we wanted to do, so today Dave Baker and I starting putting the final code together.

I've not played with the Micro Framework for a while. It has all been XNA for me for the last few months. But going back to it again I've re-discovered how neat it is. Dave had made a little application and needed to connect it to a pretend serial port so that we could demonstrate the emulation features. So in a couple of hours I've been able to build a custom emulator, put all the components that we need into it, map the emulator behaviour directly onto the real hardware and wrap it all around Dave's program. And it works. And you can flick an option and target the device and debug the code.

I'm really looking forward to the sessions now. If you are at TechEd come and see us. Sessions 201 and 301. If you are any good at poker you stand a chance of bagging an Embedded Fusion board at the first session. If you have hot breath you might win a board at the second.

We will also be running a little competition where we are going to give away the Micro Framework book that I co-wrote. First prize is a copy of the book. Second prize is two copies.....

http://www.microsoft.com/europe/teched-developers/signatures07/DEV-hearmespeak-v02.gif

Black Marble for the Micro Framework

This evening it was up to Black Marble for a talk about the .NET Micro Framework. This is the technology which lets you run your C# programs on tiny hardware platforms. I'm co-presenting a couple of sessions at TechEd 07 in Barcelona and those that turned up got a sneak preview of the material.

The talk went well, although the jokes could have been better received (although I see this as a failure of the audience, not of the jokes - of course...)

Next stop Spain.....

http://www.microsoft.com/europe/teched-developers/signatures07/DEV-hearmespeak-v02.gif

The path to enlightenment

Have you ever thought that there is more to life than you know? That there some fundamental truths out there, just beyond your grasp? And that knowing these truths will empower you in ways that could change your life forever?

Well, I've no idea about that kind of stuff myself, but if you come along to our session at TechEd 2007 on Thursday at 11:30  (LNC16 room N210B) Roger Wolff and I will show you how to take your C# and Visual Studio 2005 skills and use them to power tiny embedded devices.

You will also be privy to what could be the worlds first Zigbee powered poker game, and learn my current favourite joke in all the world.

If you are not lucky enough to be in Orlando, you can always catch up on the session in the webcast. Sign up here.

Free Massages

One of my favourite ever jokes was on an old Monty Python record. As I remember it went "And now for a massage from the Swedish prime minister". Followed the sound of heavy slapping. Wonderful stuff.

We haven't got the Swedish prime minister available, but we are giving out free massages at our stand in the TLC Blue area at TechEd 2007. We have a couple of .NET Micro Framework controlled massage chairs which are just the thing to ease away the strains of the day. And you can find out all about how you could be an embedded developer but just not know it yet....

Hot Spot

I wandered out to register at the conference. I mutter about my air-con in the room (I call it "Old Faithful" now) but I'm darned glad that it is there, because when you leave the hotel it is like stepping inside a hair dryer. This is not a cooling breeze, it is the output from a blast furnace.

529610878
Branded Lamp Post

529611004
My hotel

529699515
This probably symbolizes something

529611532
Why we are here

529611852
Guess what it is, and win a prize

529700347
My universe for the next few days....

Apparently it is going to be even hotter for the rest of the week. Oh goody.

Bright and Early

Slept surprisingly well considering. I seem to have an air conditioner in the room which was designed by the same person who does jet engines. And air raid sirens. It came on by itself in the middle of the night. The first time it did this I managed the amazing feat of leaping up in the air from the bed, whilst remaining completely horizontal. Since the unit seems to start up every ten minutes or so, I'm now mostly used to it, the sound only causing mild palpitations at the moment. By the time I leave here you'll be able to drop a piano on the ground behind me and I'll hardly bat an eyelid.

527549240
Noisy beast

The room is huuge. It is the entertainment part of a luxury suite, which means I get the sink, the fridge (bigger than the one at home and also with a distinctive sound) and the bed that pulls down from the wall.

527641097
Rich Living

I managed to sleep in until around 5:00 am, which for a first night away is pretty good. I was lured from my bed by a rather nice sunrise.

527641341
I bet all the sunrises are all like this here....

Later today I'm off to meet up with the rest of the team. For now, it's time for breakfast.

The Road to TechEd 2007

Author's Note:

From now on pictures are going to be presented in "SlightlyLargerVision" (tm). I've modified my Flickr plugin for Live Writer so that imported images now fill up the available screen width. Just one of the many ways I strive to make your lives better. Next I'm going to add a settings page so that you can adjust this. Not sure when, depends on how the jetlag goes.. 

Today's the day I head out to Orlando for TechEd.

527548212
My plane (although there were others on board)

527640635
The taxi from the airport. Note the rather worrying umbrella handle..

527548380
Trees and planes

527640731
The conference centre looking good

527548496
Pretty skyline

More tomorrow

TechEd here I come

I'm on the road again. TechEd 2007 in Orlando is beckoning. I'm doing some stuff about the .NET Micro Framework including promotion for the book, helping at a press launch of the Micro Framework, manning an exhibition booth and giving a lunchtime session and webcast.

If you are going to be at TechEd be sure to come and see me at the .NET Micro Framework stand or at the talk on Thursday lunchtime. If you are not at TechEd you can join in with the fun at the webcast above. Signing up is free and I'm going to tell a new joke - so it will be well worth a listen.

I'll also be taking the medium sized camera and blogging like crazy. Well, you have to do something when you are wide awake at four in the morning....

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....