Previous month:
November 2010
Next month:
January 2011

December 2010

Bye, bye 2010

Just a few hours before the next year starts. My look back to 2010:

2010 has been a great year where I didn’t spent a single night in the hospital Smile. In 2009 it was just too many days and nights. I’ve just been in the hospital during the birth of my son Matthias. This was a great experience, and Matthias is really growing fast. He needs to catch up to Stephanie Winking smile

Business-related I’ve been mostly busy with WPF, Silverlight, Entity Framework, ASP.NET, and .NET 4. I helped developers on their way to the ASP.NET certification, helped several companies moving their applications to Windows 7, and also learned companies how to use Windows Azure, WCF, WF, and other .NET technologies.

Conferences have been fun in Darmstadt, Mainz, and Munich where I’ve done C# 4, LINQ, Code Contracts, WPF Data Binding…

The PDC conference (this time in Redmond) information on Windows Azure, IE 9 and HTML 5.

The Silverlight FireStarter had some information what’s coming with Silverlight 5.

The newest edition of the Professional C# book (Professional C# 4 and .NET 4) was released in March. This is  a 1536-page book with several additional chapters for download from the Web. Currently I’m working on one chapter of an MVP book that will be released in 2011.

During the holidays I’m using a Microsoft Kinect to play with the family. I never had a game console until I got the XBox 360 for free with my Windows Phone 7, so I’m not a hard core player. I bought a Kinect and some games, and the first experience is really great. Kinect is cool for the whole family!

With the Windows Phone 7 I’m developing some small applications. I really like the usability of WP7 devices in special how things I’m doing are connected. For example different calendars in one place, contacts from different sources (Facebook, Exchange, LinkedIn…) in one place…

Beside coaching companies on WPF, Silverlight, Entity Framework…,I’ve spent some time developing applications for Windows Azure, making use of the Windows Azure platform, using SQL Azure, the Azure AppFabric… I’ve done some ASP.NET MVC development to move a Website to MVC…

All really great stuff in 2010. In my next blog entry you can read what I’m expecting from 2011.

I wish you A Happy New Year 2011


CN innovation

A few LINQ Queries

Many of my course attendees, book readers, and attendees of my conference sessions know my Formula 1 samples Smile This time in a workshop I had questions on how to do some specific queries where the Formula 1 champions again come very handy.

Using the Racer class that has properties as shown here:

public string FirstName { get; set; } public string LastName { get; set; } public string Country { get; set; } public int Wins { get; set; } public int Starts { get; set; } public int[] Years { get; private set; } public string[] Cars { get; private set; }

these questions were asked: “how to get champions from three specific years”, and “how to sort the champions based on the first year they won the championship”. The interesting part is here that the Year property of a Racer is a collection on itself. A racer can be a champion in several years. Still, this can be done easily with LINQ.

The first example I’ve done more general instead of giving the option for three years, the method declaration allows for a flexible number of years:

public static void ChampionsOfSeveralYears(params int[] years)

And it can be invoked like this:

ChampionsOfSeveralYears(1970, 1975, 1984);

The query is not difficult to do. A compound from is good to access all the years of a racer, then the year can be used with the Contains method to check if the year of a racer is within the collection of years received with the parameter of the method:

var q = from r in Formula1.GetChampions() from y in r.Years where years.Contains(y) select r;

If you are curious, the result passing the years shown earlier is

Jochen Rindt Niki Lauda Niki Lauda

If the matching year should be shown with the racer, this can be done by creating a new type:

var q = from r in Formula1.GetChampions() from y in r.Years where years.Contains(y) select new { Racer = r, Year = y };

To get the first year of a racers championship the operator First comes handy. This sample has several orderby. Years.OrderBy(y => y) is first used to order the championship years of a single racer in case this is not already ordered. Then the first of these years is used, and then the result with all the racers and their first championship year is ordered.

var q = from r in Formula1.GetChampions() orderby r.Years.OrderBy(y => y).First() select r;

Many more queries are found in the book Professional C# 4 with .NET 4 and in my LINQ workshops.

Also more LINQ queries here:


CN innovation

Follow me on twitter

Silverlight 5

At the Silverlight FireStarter today Scott Guthrie gave the information what’s new in the next version of Silverlight. It’s awesome.  The new features look really exciting. Silverlight is alive and kicking.

20000 people were watching the Silverlight FireStarter online live. The voting site for Silverlight 5 collected 21000 votes. And 70% of the requested features are implemented with v5! Microsoft is listening to the community. I just hope they are listening with WHS Vail as well.

The first part of the keynote was a demonstration of applications using Silverlight 4. Silverlight 4 is now 7 months old. The SL4 demos got only a timespan of the keynote. The main part was on Silverlight 5 Smile

Silverlight 5 is more and more coming into the areas of WPF. SL5 gets great improvements that have been available only with WPF and even more. I’m not sure anymore that WPF should be named Silverlight+ Winking smile

With the 70% requested features, new things are coming in many different areas. SL5 is really a huge release!

One part is improvements with media. Hardware decoding support, Trick Play, power management enhancements, remote control are some features in that area. Server-side enhancements are with IIS Media Services 4.0. Windows Azure has support for IIS Media Services as well.

For the applications I’m doing event more important are the enhancements on data binding. There are great improvements in that area! It’s now possible to set breakpoints with XAML code, debug data binding, create custom markups, markups for MVVM, implicit data templates, ancestors for relative source binding… If you’ve done WPF and Silverlight development you can see that several features that have been only available with WPF are now here with Silverlight as well. Silverlight has even more!

WCF RIA Services gets improvements on supporting WS-Trust, low-latency networking, MVVM friendly data sources

The Pivot control that is now available separately with SL4 will be part of the SL5 SDK.

Improvements on Graphics: immediate mode graphics API, GPU accelerated 3D, fluid layout transitions that can be done really easily with small XAML code. A big advantage from WPF compared to Silverlight was 3D support. Now Silverlight has 3D as well.

Enhancements on OOB with multiple Window support, P/Invoke, Enterprise Group Policy support…

What about the tools developing Silverlight 5 applications? Of course, there are enhancements as well. New investments are in automated UI testing and improved profiling support to get information on memory, CPU, and thread contention.

Silverlight 5 will also be faster: faster startup, hardware acceleration with IE9 and a 64-bit runtime.

When can all this expected? A beta of SL5 is planned for spring 2011 (MIX?), the release by the end of the year 2011.



CN innovation