Monthly Archives: May 2007

1 Comment

Martin Fowler notices a trend: interest in the .NET platform is declining. Ruby is all the rage. He has some recommendations for Microsoft on how to better collaborate with the community instead of going its own way. Martin noticed how Microsoft created its own unit testing variant that is incompatible with NUnit.

Change is visible in some parts of Microsoft, for example Microsoft is embracing dynamic languages, but boats the size of aircraft carries can only slowly change course. There are no clear signs from upper management at Microsoft that they are indeed changing course. The recent threats against the open source community over infringement on software patents seem to indicate that the old school closed-source thinking still has big strongholds within Microsoft.

Google is about to set a standard for offline storage for web applications with Google Gears. Even better, it's open source. Does Microsoft have the guts to embrace this technology instead of creating its own variant? I doubt it.

I am still pretty excited about the .NET platform. Especially about the LINQ wave of technologies coming with .NET Framework 3.5 and Silverlight. But I am also thinking about looking into Ruby on Rails more and more.

Not many Microsoft employees dare to publicly refer to WinFS as a black hole. Matt Warren does in this blog post. He gives us great insight into the origin of LINQ to SQL and how it managed to survive. He ends with:

So, for the sake of LINQ and the customer in general, we took up the OR/M torch officially, announcing our intention internally and starting the political nightmare that became my life for the next three years.

I briefly talked with Matt at PDC05. It was pretty clear already that he had had a big role in the development of LINQ to SQL even though the public presentation was done by Anders Hejlsberg. His blog is pretty quiet, but Matt is much more active on the MSDN Forums answering questions about LINQ to SQL.

1 Comment

I just experienced my first Windows Vista crash that didn't even display a Blue Screen Of Death (BSOD). My computer just suddenly rebooted, complaining about an improper system shutdown.

So what did I do?

I was trying to mount a VHD file (Virtual Hard Disk) with the vhdmount.exe tool from Virtual Server 2005 R2 SP1 RC. Apparently that made Windows Vista very unhappy.

So why did I want to mount a VHD file?

Windows Vista comes with the CompletePC Backup tool that allows you to backup an entire harddisk to a VHD file on an external hard drive. CompletePC Backup only allows you to restore the entire image in the case of hardware failure or system corruption. This makes it less then useful (as in completely useless) when you want to restore individual files. vhdmount.exe to the rescue! Or so you would think.

Is mounting a VHD file easy on Windows Vista?

No. This blog entry by the VirtualPC Guy would make you think that it is just a matter of installing the vhdmount.exe tool, importing some registry settings once, and just doubleclicking a VHD file. That doesn't actually work on Windows Vista with UAC turned on. The tool requires elevated priviliges and the Windows Explorer process doesn't have them. The tool doesn't initiate a UAC prompt to elevate. So you have to run a command line (cmd.exe) with administrative priviliges and run the vhdmount.exe tool from there.

Why did I want to restore some files?

I haven't actually lost data yet. I just wanted to make sure that I can restore my data in the unfortunate case that disaster chooses to strike in the future. The recent CodePlex disaster made me look into my own backup strategies again.

Now I know, that my backup strategy doesn't work ;(

Why didn't my backup strategy work?

My external USB-harddrive is formatted using the EXT2 filesystem (read here why) and I think the Ext2IFS driver doesn't play too well with vhdmount.exe. I'll have to investigate further, but the prospect of having to suffer through multiple crashes in the process is not very alluring.

1 Comment

Today, I wanted to continue working on my FlickrMetadataSynchr tool after a break of a month or so. This project uses SaaS in the form of a hosted Team Foundation Server by Microsoft for source control and work item tracking. This SaaS is called CodePlex

Team Foundation Server is known to be a very robust source control system that is based on SQL Server 2005. You can cluster the database tier, you can have hot standby for the application tier, etc.

Yet, Microsoft was able to corrupt the source control database and not have a proper backup schema in place. I.e., they thought they were making backups of the database, yet they weren't.

That will teach me not to trust a third party with my precious data. So based on my current experiences I don't trust Software as a Service (SaaS).

Even worse. Three weeks after the fact, Microsoft still cannot tell if the source control data will ever be restored. At some point you just have to admit you screwed up and say that nothing can be done about it anymore.

Luckily, I still have the latest version of my sources stored locally. But it is the nature of an integrated source control and work item tracking system that you can't keep a full local backup of the state of the system. If Microsoft (or another vendor) screws up you loose a lot of historic data.

Another SaaS that I have become to depend on quite heavily is Gmail. Considering the perpetual beta status of Google Mail, I have never fully trusted them to keep my data safe from disaster. I am very diligent in backing up my mail locally in Outlook PST files using the POP3 access that Gmail provides.

Do you trust SaaS?

1 Comment

I just came accross this gem by Paul Stovell:

Now, although I don’t really know anything about BizTalk, I do know that BizTalk is well-known as an enterprise-grade middleware product. I think that this is due to the fact that only Enterprises (with a capital E) can make custom software development such an expensive process that BizTalk is actually a cheap alternative :)

Is he joking or is he dead serious?

1 Comment

Some people use hyperbole to refer to the disclosure of Silverlight and CoreCLR by Microsoft at MIX07. April 30, 2007 has been called the day that will be remembered as the day that Microsoft "rebooted the web".

This might be true in more than one way. I was just reading the Silverlight SDK and was struck by a feeling of deja-vu:

<TextBlock FontFamily="Arial" Width="400" Text="Sample text formatting runs">
  <LineBreak/> 
  <Run Foreground="Maroon" FontFamily="Courier New" FontSize="24">Courier New 24</Run>
  <LineBreak/>
  <Run Foreground="Teal" FontFamily="Times New Roman" FontSize="18" FontStyle="Italic">Times New Roman Italic 18</Run>
  <LineBreak/>
  <Run Foreground="SteelBlue" FontFamily="Verdana" FontSize="14" FontWeight="Bold">Verdana Bold 14</Run>
</TextBlock>

Doesn't it feel like FONT tags all over again to you too?

This is not revolutionizing the web, this is indeed rebooting the web. Just after text on the web has been semantically liberated from FONT and TABLE tags by judicious use of CSS, we are going back to the future...

PS: Although there is extremely tight coupling between text and layout in this piece of XAML, it is still a much better situation than text locked up in .swf files. At least it is indexable by search engines. Hopefully, Microsoft is just going after the Flash market and doesn't lure us into putting all text inside Silverlight controls leaving the (X)HTML page as just an otherwise empty shell around such controls.

PS2: Here is another commentary by someone who sees some downsides to this new "rich" web as well.

WPF comes with great support for animation using XAML without needing to code this in for example C#. With Silverlight (fka "WPF/E") you can also do animations from XAML.

If you want to perform custom animations in code that you can't do using XAML, you need timers. In the full blown WPF you have several options, e.g., System.Threading.Timer, System.Timers.Timer and System.Windows.Forms.Timer.

You normally provide a callback that gets called when the timer elapses from a background thread. Properties on WPF objects can only be set from the foreground thread, so you have to queue a call on the UI thread to perform the actual animation. You can do that by calling the Invoke or BeginInvoke method on the System.Windows.Threading.Dispatcher class. You can access the correct Dispatcher instance to use through the Dispatcher property on the UI element (*).

Another option in WPF is to use the Rendering event of a CompositionTarget instance. In that case you get called when WPF is ready to render a frame. The frame rate depends on CPU speed, GPU performance, graphics complexity and other factors, so it fluctuates. This means that the interval after which you get called also fluctuates. However this is great for some scenarios.

In the current Silverlight 1.1 alpha your options are more limited. The CoreCLR libraries do have a System.Threading.Timer, but there is no Dispatcher class to delegate work to the UI thread. So it is useless for doing custom animation. In the source of the Monotone sample by Lutz Roeder I found there is an HtmlTimer class in Silverlight 1.1. This class is undocumented and marked obsolete. Visual Studio shows a warning after compilation:

'System.Windows.Browser.HtmlTimer' is obsolete: 'This is not a high resolution timer and is not suitable for short-interval animations. A new timer type will be available in a future release.

Lutz shows how to use an HtmlTimer in his sample. HtmlTimer has a Tick event. Any event handler that you wire-up to that event gets called from the UI thread. So that solves the problem for the time being.

When I tried to Google for more info on HtmlTimer, all I found was this blog post by Mike Taulty which mentions this class in passing.

(*) In fact any .NET class that derives from DispatcherObject has a Dispatcher property.

1 Comment

If you haven't heard the news yet, you must be living under a rock πŸ˜‰ There is a new CLR in town. Silverlight (fka "WPF/E") 1.1 comes with its own CLR. And the best news is that it runs both on the Mac and the PC.

Go check it out at silverlight.net.

One of the greatest achievements is that the download is a mere 4 MB. If you have a reasonably fast Internet connection you can download and install it in under a minute. Try that with .NET 3.0! That will take at least an order of magnitude longer to install.

Before the announcment at MIX07, I wasn't sure if Microsoft would be able to pull this off. They have certainly gone beyond my expectations.

This is what the Silverlight directory looks like after the install:

 

It shows you this CLR is completely separate from the standard CLR 2.0 runtime and has no dependency on it. This CLR has 2.1.x.x as version number. It has no Global Assembly Cache (GAC). You can see that support for dynamic languages like Python and JScript is included. Support for Ruby is in the works.

Go listen to the Channel 9 interview with Scott Guthrie if you want to know how Microsoft succeeded in trimming down the CLR 2.0 and the Base Class Libraries to this size.

The Silverlight .NET assemblies have the same format as standard .NET assemblies, so you can view them using Reflector. The type system is the same, so Silverlight supports generics. It will also support C# 3.0, VB 9.0 and LINQ.

These are exciting times for the .NET world. The reach of .NET has been substantially increased. Not just because the few percent of Mac users can run .NET applications now, but because it is such an easy deployment for Firefox users on the PC. And soon for Opera users as well.