Notes from Mix08

Virtual Earth announced during their session that they will release a Silverlight Control for embedding maps in your silverlight app. It will be interesting to see if the silverlight adds any benefit over the HTML/JS control.

Deep Zoom: This is an unmanaged part of SilverLight and not very customizable. The tilingscheme is hardcoded. You cannot create images larger than 4x4billion pixels. That's still enough for having a sub-millimeter precision image of the entire earth, so I think that should be sufficient!

The Steve Ballmer Keynote was very entertaining. It was more of a live interview than a keynote. Rumour has it that the questions he got really upset him, but he hides it very well. WATCH IT!

Other sessions worth watching:
Developing ASP.NET applications using the Model View Controller Pattern
Scott Hanselmans' presentation on WPF user controls was the best session that I attended, and also very entertaining. I talked to him today and he admitted to be nervous which was partly why he kept shooting off jokes. It turned out to be be the best presentation, so it worked out :-)

Developing Cutting Edge Web Applications With Internet Explorer 8
Lots of good tips on changes from IE7 to IE8. Espcially the part about the stuff they fixed that will break existing apps is a must read. Also a bit about new features, XDomainRequest objects, new accessibility features etc.

Creating Rich, Dynamic interfaces with Silverlight 2


Checking browser version in IE8

IE8 comes with an "Emulate IE7" button, which will revert the page back to run as IE7. This is great for developers who can quickly test their apps in both versions (I just wish we could have an IE6 button too!).

Furthermore you can place a tag in the page that will force IE8 to render the page as IE7 would have. However this poses a problem. Lets say you make some javascript that takes IE8 into account with version checking, but the page has this IE7-compatibility tag embedded. The JavaScript browser version check would still report v8. Instead for IE you should use 'document.documentMode' to get the version number. That means that if you set your browser to run as IE7, this would return version 7 (even though it really is 8), and if you set in quirks mode, you will be getting v5. It would be safer to adjust your javascript using this property.

I ran some few tests on the fresh IE8 beta1. It still looks pretty much like IE7. This blog runs with only one minor problem. I have a gallery page that relies on AjaxControlToolkit, and this really broke on IE8. Hopefully the AjaxControlToolkit team will quickly get all those issues fixed.

There are 4 IE8 specific sessions at the Mix conference. Keep an eye on them at the Mix Website when they come online (about 24 hours after the session):

  • BCT08 - Welcome to Internet Explorer 8  Wed March 5 at 1:30 PM to 2:45 PM
  • CT07 - Cross-Browser Layout with Internet Explorer 8  Wed March 5 at 3:00 PM to 4:15 PM
  • T21 - Integrating Your Site With Internet Explorer 8  Thursday March 6 at 8:30 AM to 9:45 AM
  • T04 - Developing Cutting Edge Web Applications With Internet Explorer 8  Friday March 7 at 8:30 AM to 9:45 AM
  • Here's a picture from the first session, showing the Acid2 test:

    IE8beta1 and Silverlight 2.0 beta 1 available

    Reporting live from the Mix08 conference in Vegas :-)

    Internet Explorer 8 beta1 and Silverlight 2.0 beta1 will be available from today !

    IE8 comes with a much improved Developer tool with full debugger and style tracing, CSS2.1 and HTML5 support. You better get testing in IE8, because your existing website might be broken in IE8 (since it now finally follows the standards).

    Silverlight will also be available for Mobile, and is supported by Nokia who will add it to their S40 and S60 series. You can already see a mobile silverlight app here: This app was developed in less than 3 weeks and works cross-platform, cross-browser, cross-mobile, cross...


    Notes on javascript performance

    Earlier today (some would say way too early after a long night at Pure) I attended the session "How to make AJAX Applications scream on the client". This turned out to be more about general patterns in Javascript and not so much about AJAX.

    Anyway here are my notes from that session:

    Avoid Eval(). Instead use parameterized code.

    'Switch' is costly for large sets and grows linearly. Instead use a hashtable and wrap in try/catch.

    Getters/setters are inefficient. Use direct access to the variables in an instance.

    DOM Instantiating and traversing is slow because it has to go from the JS layer to the DOM layer through COM. Use it as little as possible. Example:

       Bad: for(var i=0;i<100;i++) { document.getElementById('myDiv').innerHTML = i; }
       Better: var div = document.getElementById('myDiv'); for(var i=0;i<100;i++) { div.innerHTML = i; }

    Use speculative download. Try and anticipate what the user needs to download next. For instance, on the login page start loading icons that the users will need after logging in. The browser might as well spend the time he is spending on entering his password on downloading stuff. When he then logs in the browser will retrieve the images from the cache instead of having to download them from the server, making the page load much quicker. Try going to the login page of an Outlook Webaccess website and see what happens behind the scenes through the Fiddler tool.

    Enable GZIP encoding on the webserver. Most browsers supports it and will result in smaller downloads. Again Fiddler is great for experimenting with this.

    You can see the full session online here.

    Getting (re)started with Silverlight and some notes

    On my way back from the Mix conference in Vegas I was trying to get one of my WPF/E applications to run on the new Silverlight 1.1alpha. It wasn't as easy as I thought it would be because a lot seems to have changed. I finally figured it out after reading Bryant Likes's blog. He already figured it out and shared the solution (Thanks Bryant!):

    If you want to go the "real" route of working with Silverlight 1.1alpha, here's what you need:

    I saw two really good sessions on Silverlight and .NET this morning. They are online now, and I really recommend that you watch them:

    One of the really neat things are that Silverlight also supports LINQ in the client browser. Part 2 shows a cool example on that and how easy it makes it to work with data. Furthermore you can easily communicate between Browser DOM, Javascript and .NET assembly code which makes for some interesting scenarios. Since .NET excution is 400-1000 times faster than JavaScript, you could have your heavy algorithms inside silverlight, and call them from Javascript. If you don't need the presentation-layer, you could just hide it and have it as a library you utilize from JS.

    So what is the main differences between v1.0 and v1.1? v1.1 contains:

    • Everything from v1.0
    • A subset of the .NET 3.5 framework and some extra browser and AJAX specific classes
    • XAML extensibility
    • Control class (for user controls)
    • Sample controls

    Currently Silverlight works with Safari, Firefox and IE on both Mac and Windows and soon to be Opera as well. I asked them whether they would also support other platforms like Linux. Basically they didn't have any 'issues' with making that, but were currently not considering it until there is a larger demand for it.

    Update: Mono has already announced that they will make sure we get Silverlight support on Linux. COOL!

    Ajax View: Remotely Monitoring Web 2.0 Applications

    Today Microsoft demoed their AjaxView application in one of the Mix07 sessions. It acts as a proxy and monitors requests, as well as execution time for each javascript function that gets executed. This is really neat for tracking what methods are putting the most load on the client browser. Now all we need is some built-in tracking of memory leaks ;-)

    A tech preview will be available within the next 1-2 months.

    Update: You can now see the full session where this was demoed online here.

    Mix07 Keynote

    The big topic of today’s keynote by Ray Ozzie & Scott Guthrie at the Mix07 was Silverlight. Today several new things were unveiled:

    • Silverlight 1.0 beta was released
    • Silverlight 1.1 alpha was released / unveiled
    • Silverlight Streaming was unveiled
    • Silverlights new community website was unveiled at
    • Blend Expression was released to day (we all got a free copy too)

    And to me the biggest news of them all:

    • Silverlight 1.1 alpha has support for .NET code inside the Silverlight application!

    Basically this means that you now can use C#, VB, IronPython, the all-new IronRuby (also unveiled today) and any other .NET language in an app that runs inside the browser crossbrowser AND crossplatform. Through .NET you can also work with and manipulate the HTML DOM, use REST services etc. No more JavaScripting! (and I was just about getting to a point where I really started to like JavaScript)

    Scott Guthrie demoed a cool Silverlight-based chess application that used both JavaScript and C# for the AI, and had the two languages “compete” against each other. According to Scott, .NET is 400-1000 times faster than JavaScript, so it could calculate a lot more moves in the same time. Of course .NET won the simulated game :-) There were a lot of other cool Silverlight demos by non-Microsoft companies, including a kick-ass video-editing app running in your browser.

    “Silverlight Streaming” ( is Microsofts new website for sharing video (A Youtube killer perhaps?). You can freely sign up for 4gb space, and supports up to DVD-quality videos of up to 10mins. You can completely integrate videos streaming from Microsofts servers onto your webpage through Silverlight. So the next time you upload a really cool video to your website with the risk of overloading your server, Silverlight Streaming might be your answer.

    So, Silverlight 1.0beta is out now, and will be finally released in the Summer 2007. 1.1alpha is out now too, but the final release is still to be determined. This includes a subset of the .NET framework, similar to what they did to the compact framework.

    They also showed that through Visual Studio Orcas you can now remotely debug Silverlight applications that run on a Mac, set breakpoints, change properties on the fly etc. REALLY cool stuff.

    Hi I’m a Mac. Hi I’m a PC and I can control you remotely! ;-)

    You can download Silverlight 1.0b, 1.1a and SDKs at

    So basically this means you now can use .NET for a larger array of purposes:

    • ASP.NET (Webserver)
    • XNA (XBOX)
    • CF.NET (Pocket PC/Phone)
    • Silverlight (Webclient – Crossplatform!)
    • WPF (Desktop)

    I can’t wait to get started with this!

    The other sessions I attended today was pretty good too (although missing most of the one I wanted the most because the hotel got my reservation screwed up), none of it was really new stuff we haven’t seen before. Hopefully there will be some more WOW tomorrow…

    Going to Mix '07

    The weather outside is awesome today. A shame I have to spend it getting ready for the Mix conference in Las Vegas. (but then again, I'm going to Vegas :-)

    There's a lot of focus on Microsoft AJAX and SilverLight (formerly known as WPF/E) this year. Both of which I find really interesting technologies for use in Web GIS.

    Some of the sessions that I plan to see are:

    • Building Rich Web Experiences using Silverlight and JavaScript for Developers
    • Using Visual Studio Codename "Orcas" to Design and Develop Rich AJAX Enabled Web Sites'
    • Using LINQ to Dramatically Improve Data Driven Development in Web Applications (By my Danish fellow Anders Hejlsberg)
    • Developing ASP.NET AJAX Controls with Silverlight
    • Go Deep with AJAX
    • How to Make AJAX Applications Scream on the Client
    • Navigating the Programmable Web
    • Accessing Data Services in the Cloud

    Are you going too?