<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Tim Sneath</title><link>http://blogs.msdn.com/b/tims/</link><description>Musings of a Client Platform Guy</description><dc:language>en-US</dc:language><generator>Telligent Community 5.6.583.21163 (Build: 5.6.583.21163)</generator><item><title>A Modern Browser</title><link>http://blogs.msdn.com/b/tims/archive/2011/02/15/a-modern-browser.aspx</link><pubDate>Tue, 15 Feb 2011 21:38:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10129801</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>100</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10129801</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2011/02/15/a-modern-browser.aspx#comments</comments><description>&lt;p&gt;This morning, Mozilla shared their feelings on IE9 &lt;a href="http://people.mozilla.com/~prouget/ie9/"&gt;with a post&lt;/a&gt; that claims to answer the question, “Is IE9 a modern browser?” While they grudgingly concede that IE9 is “a step in the right direction”, they seem to be operating under a very narrow definition of what “modern” means, that I don’t think matches the dreams that web developers and end-users actually have.&lt;/p&gt;  &lt;p&gt;Let me help them with a definition for what we believe users and developers should expect from a “modern browser”:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Modern browsers are &lt;a href="http://ie.microsoft.com/testdrive/Benchmarks/SunSpider/Default.html"&gt;fast&lt;/a&gt;. They take &lt;a href="http://ie.microsoft.com/testdrive/Benchmarks/SunSpider/Default.html"&gt;full advantage of the underlying platform&lt;/a&gt; to render graphics with the GPU, compile and execute JavaScript across multiple CPU cores and ensure that web applications run as close as possible to the same speed as native applications.&lt;/li&gt;    &lt;li&gt;Modern browsers enable &lt;a href="http://ie.microsoft.com/testdrive/Graphics/VideoCity/Default.html"&gt;rich, immersive experiences&lt;/a&gt; that could hitherto only be delivered through a plug-in or native application. They can blend video, vector and raster graphics, audio and text seamlessly without sacrificing performance.&lt;/li&gt;    &lt;li&gt;Modern browsers implement features when they are ready, providing predictable patterns that developers can rely on rather than &lt;a href="http://www.xtranormal.com/watch/7991991/"&gt;suddenly breaking or removing specifications&lt;/a&gt;. They don’t check off support based on a half-completed implementation written to pass a synthetic test, but validate against &lt;a href="http://test.w3.org/html/tests/reporting/report.htm"&gt;a test suite that confirms interoperability&lt;/a&gt;.&lt;/li&gt;    &lt;li&gt;Modern browsers &lt;em&gt;do &lt;/em&gt;adopt standards at an early stage of readiness so developers can experiment and validate the specification, but clearly delineate &lt;a href="http://html5labs.interoperabilitybridges.com/"&gt;unstable prototypes as such&lt;/a&gt;. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;It seems that others share this view. The &lt;a href="http://news.ycombinator.com/item?id=2221831"&gt;discussion on YCombinator&lt;/a&gt; starts with this comment:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Maybe I'm just weird, but I consider issues like performance, reliability, and having a stable foundation to build on to be far more important than supporting your own browser's take on some hypothetical future &amp;quot;standard&amp;quot;, which is just IE vs. Netscape all over again. On that basis, IE is currently the only one of the big three that is actually going in the right direction.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And Download Squad &lt;a href="http://downloadsquad.switched.com/2011/02/15/firefox-4-infographic-from-mozilla-taunts-ie9/"&gt;concludes its analysis&lt;/a&gt; of the Mozilla article with the following: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Don't get us wrong, [Firefox] &lt;em&gt;is &lt;/em&gt;an excellent browser -- but &lt;em&gt;more stuff &lt;/em&gt;doesn't necessarily equate to &lt;em&gt;better stuff&lt;/em&gt;.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;To our friends at Mozilla, we admire your passion for the open web, and we look forward to continued competition.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10129801" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/tims/archive/tags/windows/">windows</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/ie/">ie</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/html5/">html5</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/modern/">modern</category></item><item><title>An Open Letter from the President of the United States of Google</title><link>http://blogs.msdn.com/b/tims/archive/2011/01/11/an-open-letter-from-the-president-of-the-united-states-of-google.aspx</link><pubDate>Tue, 11 Jan 2011 22:46:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10114406</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>224</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10114406</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2011/01/11/an-open-letter-from-the-president-of-the-united-states-of-google.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://blog.chromium.org/2011/01/html-video-codec-support-in-chrome.html"&gt;&lt;img height="165" width="244" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/1108.esperandm_5F00_37DFA219.png" align="right" alt="esperandm" border="0" title="esperandm" style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" /&gt;&lt;/a&gt;The world&amp;rsquo;s ability to communicate with one another is a key factor in its rapid evolution and economic growth. The &lt;a href="http://www.webmproject.org/"&gt;Esperanto language &lt;/a&gt;was invented last century as a politically neutral language that would foster peace and international understanding. Since the launch, we&amp;rsquo;ve seen first-hand the benefits of a constructed language:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A pure form of communication that is unsullied by cultural context;&lt;/li&gt;
&lt;li&gt;Broad adoption by as many as 10,000 speakers&lt;/li&gt;
&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Esperantido"&gt;Independent&lt;/a&gt; (yet mostly compatible) dialects that not only bring additional choice for speakers also foster healthy competition and innovation&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We expect even more communication between people in the coming year and are therefore focusing our investments in languages that are created based on constructed language principles. To that end, &lt;a href="http://blog.chromium.org/2011/01/html-video-codec-support-in-chrome.html"&gt;we are changing the spoken and written language of this nation&lt;/a&gt; to make it consistent with the form of speech already supported by the &lt;a href="http://www.whatwg.org/"&gt;Language Creation Society&lt;/a&gt;. Specifically, we are supporting the &lt;a href="http://www.webmproject.org/"&gt;Esperanto&lt;/a&gt; and &lt;a href="http://theora.org/"&gt;Klingon&lt;/a&gt; languages, and will consider adding support for other high-quality constructed languages in the future. Though &lt;a href="http://en.wikipedia.org/wiki/H.264"&gt;English&lt;/a&gt; plays an important role in speech today, as our goal is to enable open innovation, its further use as a form of communication in this country will be prohibited and &lt;a href="http://www.youtube.com"&gt;our resources&lt;/a&gt; directed towards languages that are untainted by real-world usage.&lt;/p&gt;
&lt;p&gt;These changes will occur in the next couple months but we are announcing them now to give citizens using other languages an opportunity to translate the &lt;a href="http://techcrunch.com/2010/05/01/h-264-66-percent-web-video/"&gt;libraries of the world&lt;/a&gt; into Esperanto.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Dankon, nedankinde!&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10114406" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/tims/archive/tags/video/">video</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/webm/">webm</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/html5/">html5</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/parody/">parody</category></item><item><title>Top 10 Tips for the Effective Use of Social Media</title><link>http://blogs.msdn.com/b/tims/archive/2010/11/29/top-10-tips-for-the-effective-use-of-social-media.aspx</link><pubDate>Mon, 29 Nov 2010 19:19:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10097928</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10097928</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/11/29/top-10-tips-for-the-effective-use-of-social-media.aspx#comments</comments><description>&lt;p&gt;While my job here at Microsoft consumes much of my waking life, I spend a little of my spare time volunteering with a small charitable organization called &lt;a href="http://healafrica.org"&gt;HEAL Africa&lt;/a&gt;. They do work in the Democratic Republic of Congo healing victims of sexual violence from the ongoing civil war there. It’s a &lt;a href="http://www.insightonconflict.org/conflicts/dr-congo/peacebuilding-organisations/heal-africa/"&gt;compelling story&lt;/a&gt; of how an organization is changing lives in &lt;a href="http://kristof.blogs.nytimes.com/tag/heal-africa-hospital/"&gt;an appalling situation&lt;/a&gt;, but I digress from the purpose of this entry. &lt;/p&gt;  &lt;p&gt;One area they asked me to think about is how they can use social media effectively – a question that many charities and non-profit organizations wrestle with. And of course, it’s an area of great interest to evangelists like myself: an area that is a daily focus as we attempt to change perceptions of emerging technologies like IE9 and Silverlight. &lt;/p&gt;  &lt;p&gt;So I thought I’d share a few thoughts here, both as a forcing function for me to distil a few ideas and hopefully as something that might be of interest to others. &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;strong&gt;&lt;font color="#005a88"&gt;Know what you’re trying to achieve.&lt;/font&gt; &lt;/strong&gt;Too few organizations have a clear sense of the outcomes they hope to realize from engaging in social networks. What are your goals? Many organizations spend a lot of time encouraging supporters to ‘follow’ them on networks like Twitter and Facebook without much sense of why this is important or what they’ll do with these people once mobilized. This has a negative, rather than a positive effect – it diverts attention away from a core mission, and it leaves supporters with a premature feeling that they’ve ‘done their part’. Remember your core mission and be cautious about using followers as a proxy metric of success. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;&lt;font color="#005a88"&gt;Know your audience.&lt;/font&gt;&lt;/strong&gt; Assuming some measure of success, it’s important to have a clear sense of who you’re communicating with. In a non-profit setting, those who follow you on a social network are likely already your supporters. A familiar trap is organizations who fail to recognize the difference between &lt;em&gt;converting&lt;/em&gt; and &lt;em&gt;energizing. &lt;/em&gt;In this setting, converting is the act of trying to persuade new people to side with your cause or invest in some way; energizing is the act of deepening an existing relationship or motivating someone to act in some way. The way you engage online should vary depending on whether your audience primarily consists of dedicated volunteers or those who have no prior knowledge of your organization. Fortunately, online channels tend to self-segment – a Facebook page is likely to be dominated with those who need energizing. A blog will often reach a far more diverse audience who aren’t already invested. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;&lt;font color="#005a88"&gt;Use social and online media to humanize your organization. &lt;/font&gt;&lt;/strong&gt;It’s tempting to take press releases or other news items and blast them out on all available channels. But that’s not the best use of social media – it disconnects you from your audience rather than creating a closer connection. This is your opportunity to put a more human face to your organization: telling the inside story, being open and transparent about how you think through issues and challenges, and providing a perspective that others can relate to. Ensure that you don’t edit out the personality. Tell people about the things you’ve done right, and the things you can learn from. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;&lt;font color="#005a88"&gt;Be timely. &lt;/font&gt;&lt;/strong&gt;Social media is about a flow of discourse and a conversation, rather than about blasting your message out to an audience. Use channels like Twitter and blogs to provide an up-to-the-minute view of the work you’re doing, offering fresh, first-hand updates on the situation that respond to current trends or news. You can only set the news agenda when you’re part of this flow. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;&lt;font color="#005a88"&gt;Don’t moderate views that you dislike. &lt;/font&gt;&lt;/strong&gt;To some people this is obvious, to others it’s counter-intuitive. If you are changing perceptions, you’re necessarily going to be bumping into those who don’t share your views. On a blog, it’s tempting to moderate or delete comments that provide an opposing view: it feels like a guest has come into your home and is insulting your choice of décor. Yet for the most part, these are the comments to relish: they demonstrate that you are engaged in an authentic conversation that is generating a reaction. There’s a lot more to say on this topic that I’ll perhaps address in a future post. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;&lt;font color="#005a88"&gt;Build a public record. &lt;/font&gt;&lt;/strong&gt;Particularly with blogs, podcasts and similar channels, consistency is key. Unless you establish a regular cadence of content, you’ll never establish a regular cadence of visitors. That doesn’t mean you have to post at a certain time each day: you don’t have to be rigid about it, but don’t go dark for weeks on end either. Remember that everything you post has a lifetime that extends for years beyond the original week of posting. Looking at the traffic to my blog, maybe as much as two-thirds of it goes to content I wrote in the preceding months rather than what is on the current home page. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;&lt;font color="#005a88"&gt;Be a recommendation engine. &lt;/font&gt;&lt;/strong&gt;In social media, the currency traded isn’t the dollar: it’s influence, reputation and audience. Use your own influence and reputation to give other interesting organizations or individuals their own spotlight. Follow and link to those around you who are doing interesting things. Unlike real money, trading online currency is that it isn’t a zero-sum game �� in fact, the more you give, the more you earn. Even your competitors can be your allies in this regard. But whatever you do, be authentic – don’t fall into the trap of trading links for cynical gain. Make your recommendations count. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;&lt;font color="#005a88"&gt;Strike up a conversation. &lt;/font&gt;&lt;/strong&gt;The &lt;em&gt;single most valuable outcome &lt;/em&gt;of social media is to strike up a conversation with your supporters or customers, giving you a much more accurate ability to channel their needs and wants. Don’t just pontificate: ask questions. The goal isn’t to preach, it’s to collaborate. You need to listen more than you talk. Give air for others to contribute – don’t leap in immediately with a reply to any comment that’s made because that stifles a broader discussion. Show you’re listening by responding, but don’t necessarily feel the need to offer a blow-by-blow response to every point that’s made. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;&lt;font color="#005a88"&gt;Understand the volume level. &lt;/font&gt;&lt;/strong&gt;Once in a while you have an earth-shattering announcement that blows out the barn doors. But not everything “&lt;a href="http://en.wikipedia.org/wiki/Up_to_eleven"&gt;goes to 11&lt;/a&gt;”. It’s important to understand the volume level you want to apply to what you share, otherwise it’ll be hard for others to spot when you’re telling them something big. My team often talks about new things we’re doing in terms of the impact it’s going to make – to use another analogy, how much it “moves the needle”. You have to have dynamic range in your communications – if everything is shouted from the rooftops, people will stop listening. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;&lt;font color="#005a88"&gt;To build traffic, go where your audience is. &lt;/font&gt;&lt;/strong&gt;&lt;em&gt;Don’t &lt;/em&gt;spam or steal someone else’s platform to push your cause. But spend time growing your profile and influence through others’ sites. Get involved and comment – become known for insightful responses that add value to the debates folks are having in other forums. When posting comments on another blog, use your real email and web address, but don’t be nakedly self-promoting. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;What do you think? What would you add? What are your most effective strategies? Have you seen good counter-examples where the “accepted wisdom” is in fact the wrong way to engage?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10097928" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/tims/archive/tags/blogs/">blogs</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/twitter/">twitter</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/evangelism/">evangelism</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/social+media/">social media</category></item><item><title>PDC10: The Future of C# and Visual Basic</title><link>http://blogs.msdn.com/b/tims/archive/2010/11/09/pdc10-the-future-of-c-and-visual-basic.aspx</link><pubDate>Tue, 09 Nov 2010 21:13:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10088454</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10088454</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/11/09/pdc10-the-future-of-c-and-visual-basic.aspx#comments</comments><description>&lt;p&gt;At PDC 2000, we rolled out the .NET platform, including a new language called C#. A lot has happened since then! Each release has had a theme – in C# 2 we added &lt;a href="http://msdn.microsoft.com/en-us/library/512aeb7t.aspx"&gt;generics&lt;/a&gt;; in C# 3 it was &lt;a href="http://msdn.microsoft.com/en-us/netframework/aa904594.aspx"&gt;LINQ&lt;/a&gt;. Most recently in C#&amp;#160; 4 with VS2010 we introduced deeper &lt;a href="http://www.nikhilk.net/CSharp-Dynamic-Programming-JSON.aspx"&gt;dynamic&lt;/a&gt; language support and expressed a commitment to feature parity across VB and C#. &lt;/p&gt;  &lt;p&gt;Language designers need to observe and integrate major trends into their work. Over the last few years, we’ve seen several major trends: (i) declarative styles – where you say more about the ‘what’ and less about the ‘how’, e.g. &lt;a href="http://en.wikipedia.org/wiki/Domain-specific_language"&gt;DSLs&lt;/a&gt;, functional programming; (ii) the resurgence of dynamic languages like Ruby and JavaScript, and how that affects static typed languages; (iii) concurrency. &lt;/p&gt;  &lt;p align="left"&gt;In the last major editions of the language, there has been significant investment in declarative styles and dynamic programming. But there isn’t heavy language support for concurrency today, even though there is good support in the framework through the likes of the &lt;a href="http://msdn.microsoft.com/en-us/library/dd460717.aspx"&gt;Task Parallel Library&lt;/a&gt;. &lt;/p&gt;  &lt;p align="left"&gt;One reason for the rise in concurrency is the rise in connected applications: it’s almost impossible today to build an application that doesn’t talk to a service, or indeed to build a service that doesn’t talk to another service. This increases latency – for example, it is just not acceptable for a UI to freeze while it waits for a service to return. As a result, we all practice the art of asynchronous programming. It is starting to become the norm, and we’re even starting to see the rise of async-only APIs in languages like JavaScript and Silverlight. &lt;/p&gt;  &lt;p align="left"&gt;As a result, we’re looking at making concurrency the theme of the next release of our C# and Visual Basic languages. &lt;/p&gt;  &lt;h5 align="left"&gt;The Challenges of Asynchronous Programming&lt;/h5&gt;  &lt;p align="left"&gt;In a synchronous call, the act of invoking a method and waiting for the result are fused: you can’t separate the two. With asynchronous programming, that changes. You can call the method and it will return immediately; later, it will deliver the result, so the two operations are separable. &lt;/p&gt;  &lt;p align="left"&gt;There are a few problems with today’s model: (i) that the function can’t return the result, since the code is asynchronously executing, so it has to use a callback instead; (ii) it can be complex to update the UI without marshaling data back from a background thread; (iii) in a server setting, you don’t really want unconstrained thread creation because of the increased competition to the thread pool. &lt;/p&gt;  &lt;p align="left"&gt;Anders demonstrated a simple example that shows how complex the asynchronous model quickly becomes. The code fragment below downloads and display movies based on a query of the &lt;a href="http://developer.netflix.com/docs/oData_Catalog"&gt;NetFlix OData feed&lt;/a&gt;:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;Movie[] QueryMovies(&lt;span class="kwrd"&gt;int&lt;/span&gt; year, &lt;span class="kwrd"&gt;int&lt;/span&gt; first, &lt;span class="kwrd"&gt;int&lt;/span&gt; count) {&lt;/pre&gt;

  &lt;pre&gt;  var client = &lt;span class="kwrd"&gt;new&lt;/span&gt; WebClient();&lt;/pre&gt;

  &lt;pre class="alt"&gt;  var url = String.Format(query, year, first, count);&lt;/pre&gt;

  &lt;pre&gt;  var data = client.DownloadString(&lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(url));&lt;/pre&gt;

  &lt;pre class="alt"&gt;  var movies = &lt;/pre&gt;

  &lt;pre&gt;    from entry &lt;span class="kwrd"&gt;in&lt;/span&gt; XDocument.Parse(data).Descendants(xa + &lt;span class="str"&gt;&amp;quot;entry&amp;quot;&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre class="alt"&gt;    let properties = entry.Element(xm + &lt;span class="str"&gt;&amp;quot;properties&amp;quot;&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre&gt;    select &lt;span class="kwrd"&gt;new&lt;/span&gt; Movie {&lt;/pre&gt;

  &lt;pre class="alt"&gt;      Title = (&lt;span class="kwrd"&gt;string&lt;/span&gt;)entry.Element(xa + &lt;span class="str"&gt;&amp;quot;title&amp;quot;&lt;/span&gt;),&lt;/pre&gt;

  &lt;pre&gt;      Url = (&lt;span class="kwrd"&gt;string&lt;/span&gt;)properties.Element(xd + &lt;span class="str"&gt;&amp;quot;Url&amp;quot;&lt;/span&gt;),&lt;/pre&gt;

  &lt;pre class="alt"&gt;      BoxArtUrl = (&lt;span class="kwrd"&gt;string&lt;/span&gt;)properties.Element(xd + &lt;span class="str"&gt;&amp;quot;BoxArt&amp;quot;&lt;/span&gt;).Element(xd + &lt;span class="str"&gt;&amp;quot;LargeUrl&amp;quot;&lt;/span&gt;)&lt;/pre&gt;

  &lt;pre&gt;    };&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; movies.ToArray();&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;But this code is synchronous – the UI will hang while waiting for the call to return. Let’s follow through the steps needed to fix this:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;We can replace the DownloadString() method with DownloadStringAsync(); &lt;/li&gt;

  &lt;li&gt;Then we need to separate out the remaining code in the method to a handler for the DownloadStringCompleted event; &lt;/li&gt;

  &lt;li&gt;But how do we then return the result to the calling method? The QueryMovies method will already completed by this point. We can’t – instead, we need to make this method async as well, adding an &lt;a href="http://msdn.microsoft.com/en-us/library/system.action.aspx"&gt;Action&amp;lt;&amp;gt;&lt;/a&gt; delegate as a parameter. &lt;/li&gt;

  &lt;li&gt;Now we have to go back to the method that called QueryMovies and retrieve the result asynchronously . And this is where it really starts to get unpleasant, because QueryMovies is being called in a while loop, as follows: 
    &lt;div class="csharpcode"&gt;
      &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;void&lt;/span&gt; LoadMovies(&lt;span class="kwrd"&gt;int&lt;/span&gt; year) {&lt;/pre&gt;

      &lt;pre&gt;  resultsPanel.Children.Clear();&lt;/pre&gt;

      &lt;pre class="alt"&gt;  statusText.Text = &lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

      &lt;pre&gt;  var pageSize = 10;&lt;/pre&gt;

      &lt;pre class="alt"&gt;  var imageCount = 0;&lt;/pre&gt;

      &lt;pre&gt;  &lt;span class="kwrd"&gt;while&lt;/span&gt; (&lt;span class="kwrd"&gt;true&lt;/span&gt;) {&lt;/pre&gt;

      &lt;pre class="alt"&gt;    var movies = QueryMovies(year, imageCount, pageSize);&lt;/pre&gt;

      &lt;pre&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (movies.Length == 0) &lt;span class="kwrd"&gt;break&lt;/span&gt;;&lt;/pre&gt;

      &lt;pre class="alt"&gt;    DisplayMovies(movies);&lt;/pre&gt;

      &lt;pre&gt;    imageCount += movies.Length;&lt;/pre&gt;

      &lt;pre class="alt"&gt;  }&lt;/pre&gt;

      &lt;pre&gt;  statusText.Text = &lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(&lt;span class="str"&gt;&amp;quot;{0} Titles&amp;quot;&lt;/span&gt;, imageCount);&lt;/pre&gt;

      &lt;pre class="alt"&gt;}&lt;/pre&gt;
    &lt;/div&gt;
  &lt;/li&gt;

  &lt;li&gt;How do we pass a delegate to a while loop? It’s delegates all the way down. Instead we have to replace the while loop and reorder the code, as shown below:&amp;#160; &lt;div class="csharpcode"&gt;
      &lt;pre class="alt"&gt;  ...&lt;/pre&gt;

      &lt;pre&gt;  action = movies =&amp;gt; {&lt;/pre&gt;

      &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (movies.Length &amp;gt; 0) {&lt;/pre&gt;

      &lt;pre&gt;      DisplayMovies(movies);&lt;/pre&gt;

      &lt;pre class="alt"&gt;      imageCount += movies.Length;&lt;/pre&gt;

      &lt;pre&gt;      QueryMovies(year, imageCount, pageSize, action);&lt;/pre&gt;

      &lt;pre class="alt"&gt;  }&lt;/pre&gt;

      &lt;pre&gt;  &lt;span class="kwrd"&gt;else&lt;/span&gt; { &lt;/pre&gt;

      &lt;pre class="alt"&gt;    statusText.Text = &lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(&lt;span class="str"&gt;&amp;quot;{0} Titles&amp;quot;&lt;/span&gt;, imageCount);&lt;/pre&gt;

      &lt;pre&gt;  }&lt;/pre&gt;

      &lt;pre class="alt"&gt;&amp;#160; ...&lt;/pre&gt;
    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As shown in the code above, you can do it – but it’s unwieldy, and the flow of the code gets lost. And this is before we’ve dealt with error handling! Clearly we can do better.&lt;/p&gt;

&lt;h5&gt;New Async Features&lt;/h5&gt;

&lt;p&gt;The &lt;a href="http://msdn.com/vstudio/async"&gt;Visual Studio Async CTP&lt;/a&gt;, announced at PDC, introduces some new extensions to VB and C# to support a simpler, more declarative approach to asynchronous development.&lt;/p&gt;

&lt;p&gt;The Task Parallel Library introduced a Task&amp;lt;T&amp;gt; type, which is used to represent an ongoing operation: a value that is currently being computed and will be delivered at some time in the future. We can use this as the return type along with a new &lt;strong&gt;async&lt;/strong&gt; keyword to let the compiler know how it will be used, as follows:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;async&lt;/span&gt; Task&amp;lt;Movie[]&amp;gt; QueryMoviesAsync(&lt;span class="kwrd"&gt;int&lt;/span&gt; year, &lt;span class="kwrd"&gt;int&lt;/span&gt; first, &lt;span class="kwrd"&gt;int&lt;/span&gt; count) {  &lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;We now can add some asynchronous work to the class. The CTP introduces a number of Task&amp;lt;T&amp;gt;-centric extension methods that will eventually be added into the core framework, which enable us to compose and call other asynchronous methods seamlessly. For example, the call to DownloadString() in our original method can be replaced by a call to DownloadStringTaskAsync(), which returns Task&amp;lt;string&amp;gt; instead of just string. (This is something you can offer for your APIs too, of course.)&lt;/p&gt;

&lt;p&gt;And we can now use the &lt;strong&gt;await&lt;/strong&gt; operator, as follows:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;var&lt;/span&gt; data = &lt;span class="kwrd"&gt;await&lt;/span&gt; client.DownloadStringTaskAsync(&lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(url));&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The compiler rewrites your code (as it does for iterators), to use a continuation and then return, executing the rest of the code when the result becomes available. &lt;/p&gt;

&lt;p&gt;Now the LoadMovies() method is really simple. Starting with the original code above, we can again mark the header with the async keyword and then we can call the new async version of QueryMovies using the same await operator:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;var&lt;/span&gt; movies = &lt;span class="kwrd"&gt;await&lt;/span&gt; QueryMoviesAsync(year, imageCount, pageSize);&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;That’s all you have to do! As you can see, the new syntax preserves the logical syntax of the code. Exception handling requires no additional work: we don’t need to worry about callbacks, for instance.&lt;/p&gt;

&lt;p align="left"&gt;It’s relatively easy to cancel an asynchronously executing task: you use the &lt;a href="http://blogs.msdn.com/b/pfxteam/archive/2009/05/22/9635790.aspx?wa=wsignin1.0"&gt;.NET 4 cancellation types&lt;/a&gt;, specifically &lt;a href="http://msdn.microsoft.com/en-us/library/system.threading.cancellationtoken.aspx"&gt;CancellationToken&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/system.threading.cancellationtokensource.aspx"&gt;CancellationTokenSource&lt;/a&gt;, to indicate a request to cancel the task. The token can be passed into the DownloadStringTaskAsync() method. Everything here is just as before. &lt;/p&gt;

&lt;h5 align="left"&gt;Background and Foreground Threads&lt;/h5&gt;

&lt;p align="left"&gt;It’s important to note that the example shown above does &lt;em&gt;not&lt;/em&gt; use a background thread – the async calls are happening on the UI thread. They aren’t computationally expensive; they are just blocking on a network call. &lt;/p&gt;

&lt;p align="left"&gt;What if there is something that is computationally expensive that you &lt;em&gt;do&lt;/em&gt; want to run on a background thread? You can simply use a lambda within an await context, for example:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;async void&lt;/span&gt; ComputeStuffAsync() {&lt;/pre&gt;

  &lt;pre&gt;  &lt;span class="kwrd"&gt;double&lt;/span&gt; result = 0;&lt;/pre&gt;

  &lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;await&lt;/span&gt; TaskEx.Run(() =&amp;gt; {&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;for&lt;/span&gt; (&lt;span class="kwrd"&gt;int&lt;/span&gt; i=1; i &amp;lt; 500000000; i++) {&lt;/pre&gt;

  &lt;pre class="alt"&gt;      result += Math.Sqrt(i);&lt;/pre&gt;

  &lt;pre&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;  });&lt;/pre&gt;

  &lt;pre&gt;  MessageBox.Show(&lt;span class="str"&gt;&amp;quot;The result is &amp;quot;&lt;/span&gt; + result, &lt;span class="str"&gt;&amp;quot;Background Task&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre class="alt"&gt;    MessageBoxButton.OK, MessageBoxImage.Information);&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;h5&gt;&lt;font style="font-weight: normal"&gt;In summary, what the new asynchronous support offers is an abstraction layer that unifies computational, network and I/O asynchrony. For more information on the features, you can &lt;a href="http://go.microsoft.com/fwlink/?LinkId=204844"&gt;read a whitepaper&lt;/a&gt; on the MSDN site. There are also a number of good samples in the CTP, including the example demonstrated above.&lt;/font&gt;&lt;/h5&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10088454" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/tims/archive/tags/visual+studio/">visual studio</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/pdc10/">pdc10</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/async/">async</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/vb/">vb</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/c_2300_/">c#</category></item><item><title>PDC10: Introducing HTML5 Vector Graphics</title><link>http://blogs.msdn.com/b/tims/archive/2010/11/02/pdc10-introducing-html5-vector-graphics.aspx</link><pubDate>Wed, 03 Nov 2010 04:22:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10085229</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10085229</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/11/02/pdc10-introducing-html5-vector-graphics.aspx#comments</comments><description>&lt;p&gt;The &lt;a href="http://blogs.msdn.com/b/tims/archive/2010/10/03/html5-a-specification-or-a-platform.aspx"&gt;HTML5 family of specifications&lt;/a&gt; provide two different models for &lt;a href="http://en.wikipedia.org/wiki/Vector_graphics"&gt;vector graphics&lt;/a&gt;: &lt;a href="http://dev.w3.org/html5/canvas-api/canvas-2d-api.html"&gt;canvas&lt;/a&gt; and &lt;a href="http://www.w3.org/TR/SVG/"&gt;SVG&lt;/a&gt;. Why have both? What is the difference between them, and how do you use them? &lt;/p&gt;  &lt;p&gt;It’s important to start by understanding the difference between retained mode and an immediate mode graphics models:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;In a retained mode API, the structure of a graphical scene or object is stored in memory as a graph. The &lt;em&gt;runtime&lt;/em&gt; itself is responsible for drawing the scene or elements of the scene as appropriate. &lt;/li&gt;    &lt;li&gt;In an immediate mode API, it is the &lt;em&gt;application&lt;/em&gt; that is responsible for drawing the scene and you can’t manipulate an object in the scene once it has been drawn. Each has their benefits, depending on the style of application being created, as we’ll see. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;More information on &lt;a href="http://msdn.microsoft.com/en-us/library/ff684178(VS.85).aspx"&gt;retained and immediate mode models can be found on MSDN&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;SVG&lt;/strong&gt; is a retained-mode graphics model. To build a scene graph in SVG, you write declarative markup to create an in-memory tree structure that lives in the HTML DOM. You can manipulate the scene graph through code or through CSS. SVG markup can be generated from a variety of tools, including Adobe Illustrator and Microsoft Visio.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Canvas&lt;/strong&gt; is the immediate-mode graphics model. Because it doesn’t store the graph in memory, it takes less memory overhead to use, and can be faster for intensive use. Unlike SVG, it is programmatic in nature – there is only one parent &amp;lt;canvas&amp;gt; element, and code is used to populate it. While you draw primitive objects on a canvas, the only thing that is stored is the generated bitmap surface. In general, canvas is a lower-level API than SVG because of these constraints. &lt;/p&gt;  &lt;p&gt;A quick tabular comparison of the two technologies:&lt;/p&gt;   &lt;table class="ms-simple1-main" border="0" cellspacing="0" cellpadding="2" width="600"&gt;&lt;!-- fpstyle: 1,011111000 --&gt;&lt;table&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td class="ms-simple1-top" valign="top"&gt;Canvas&lt;/td&gt;        &lt;td class="ms-simple1-top" valign="top"&gt;SVG&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class="ms-simple1-even" valign="top"&gt;Pixel-based (almost like a “dynamic PNG”)&lt;/td&gt;        &lt;td class="ms-simple1-even" valign="top"&gt;Shape-based (no concept of a pixel)&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class="ms-simple1-even" valign="top"&gt;Single HTML element&lt;/td&gt;        &lt;td class="ms-simple1-even" valign="top"&gt;Multiple graphical elements which become part of the HTML DOM&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class="ms-simple1-even" valign="top"&gt;Modified through script only&lt;/td&gt;        &lt;td class="ms-simple1-even" valign="top"&gt;Modified through script and CSS&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class="ms-simple1-even" valign="top"&gt;Event model / user interaction is simplified (x,y)&lt;/td&gt;        &lt;td class="ms-simple1-even" valign="top"&gt;Event model / user interaction is abstracted (rect, path)&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class="ms-simple1-even" valign="top"&gt;Performance is better with smaller surface and/or larger number of objects&lt;/td&gt;        &lt;td class="ms-simple1-even" valign="top"&gt;Performance is better with a larger surface and/or smaller number of objects&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Given these characteristics, what is the best technology to use for a specific scenario? SVG is perfect for high-fidelity documents and graphics for viewing and printing, and for interactive charts and maps. On the other hand, canvas is perfect for mathematically-intensive operations and complex scenes. However, there are a lot of cross-over scenarios where there’s no clear winner at this point in time, and as browsers evolve and improve, it seems that the performance characteristics of both technologies are starting to converge. Both technologies are clearly valuable!&lt;/p&gt;  &lt;p align="right"&gt;&lt;em&gt;[Session &lt;/em&gt;&lt;a href="http://bit.ly/b84DLG"&gt;&lt;em&gt;CD53&lt;/em&gt;&lt;/a&gt;&lt;em&gt; | presented by Patrick Dengler]&lt;/em&gt;&lt;/p&gt;&lt;/!--&gt;&lt;/table&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10085229" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/tims/archive/tags/ie/">ie</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/pdc10/">pdc10</category></item><item><title>PDC10: Kung Fu Silverlight – Architectural Patterns and Practices with MVVM and RIA Services</title><link>http://blogs.msdn.com/b/tims/archive/2010/11/02/kung-fu-silverlight-architectural-patterns-and-practices-with-mvvm-and-ria-services.aspx</link><pubDate>Tue, 02 Nov 2010 19:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10084987</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>13</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10084987</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/11/02/kung-fu-silverlight-architectural-patterns-and-practices-with-mvvm-and-ria-services.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://karlshifflett.wordpress.com/mvvm/"&gt;MVVM&lt;/a&gt; (Model/View/ViewModel) is an architectural pattern that is well-suited for Silverlight and WPF development. It is &lt;a href="http://blogs.msdn.com/b/johngossman/archive/2005/10/08/478683.aspx"&gt;a variation of the MVC pattern&lt;/a&gt; that originated from the development of Expression Blend. &lt;/p&gt;  &lt;p&gt;At its heart, MVVM imposes three kinds of classes that separate out ideas of presentation (Views), logic (ViewModels) and data (Models). Some of the advantages of structuring a project this way: (i) it facilitates code separation, which helps testability and helps you focus your classes on a specific role; (ii) it supports well the data binding architecture of Silverlight and WPF; (iii) it enables designers and developers to collaborate on a project with minimal overhead. (iv) it is a consistent, maintainable, well-understood pattern; (v) it scales well from small to large applications. &lt;/p&gt;  &lt;h5&gt;Models, Views, and ViewModels&lt;/h5&gt;  &lt;p&gt;Let’s take a look at each of the components of MVVM in a little more detail:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The &lt;em&gt;Model&lt;/em&gt; is the domain object or entity: it’s a class of properties that has the responsibility of storing your data (for example, a Person object that stores a name and address). &lt;/li&gt;    &lt;li&gt;The &lt;em&gt;View&lt;/em&gt; represents a screen, a page or even a control on the page. It provides a user-friendly presentation of the data, including themes, styles, declarative bindings, events, display of validation errors. &lt;/li&gt;    &lt;li&gt;The &lt;em&gt;ViewModel&lt;/em&gt; glues the View to the Model. It can interact through data bindings to talk to the view – presenting data, retrieving or saving data, talking to services, or handling any actions that might happen on the UI. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/1207.mvvm_5F00_1299AEB4.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="mvvm" border="0" alt="mvvm" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/8463.mvvm_5F00_thumb_5F00_6CC38850.png" width="600" height="322" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As shown in the diagram above, the ViewModel is the DataContext for the View, and that is how it gets data and commands. In general you should try and move as much code as possible out of the View and into the ViewModel – this makes it easier to unit test the code through the use of &lt;a href="http://en.wikipedia.org/wiki/Mock_object"&gt;mock objects&lt;/a&gt;. The Model is fairly straightforward: the main step you need to take is to implement the &lt;em&gt;INotifyPropertyChanged &lt;/em&gt;interface to provide a notification that the data has changed. Lastly, there are various techniques for binding the View to the ViewModel: in this session you’ll see them being bound with a &lt;a href="http://johnpapa.net/silverlight/simple-viewmodel-locator-for-mvvm-the-patients-have-left-the-asylum/"&gt;ViewModelLocator&lt;/a&gt;. &lt;/p&gt;  &lt;h5&gt;Commands and Behaviors&lt;/h5&gt;  &lt;p&gt;What happens after you want to display data? For example, what if you want to perform some action based on a UI interaction? This is where commands and behaviors come in. &lt;/p&gt;  &lt;p&gt;A &lt;em&gt;command &lt;/em&gt;is something you can fire based on a user action that starts an event in the ViewModel. It uses a binding syntax to do that. Any control that derives from ButtonBase will let you bind a command directly to it. In the ViewModel you can create your own instance of ICommand (a good recipe for this is RelayCommand from the &lt;a href="http://galasoft.ch/mvvm/getstarted/"&gt;MVVM Light toolkit&lt;/a&gt;) to handle the event.&lt;/p&gt;  &lt;p&gt;For other actions where a command isn’t possible (for example, a ListBox item selection), you can use a &lt;em&gt;behavior. &lt;/em&gt;Some good pre-built options include EventToCommand (again from MVVM Light) or &lt;a href="http://msdn.microsoft.com/en-us/library/ff724018(Expression.40).aspx"&gt;InvokeCommandAction&lt;/a&gt; (from Blend 4’s Interactivity DLL). &lt;/p&gt;  &lt;h5&gt;Services and Separation&lt;/h5&gt;  &lt;p&gt;As we’ve seen the primary role of the ViewModel is to perform tasks: GetBook, SaveToStorage, NavigateTo etc. However, as this becomes more complex, the ViewModel starts to include code to call web services, access third-party libraries, etc. It starts to make sense to create a separate &lt;em&gt;service&lt;/em&gt; class that separates out this helper code and makes it available across multiple ViewModels.&lt;/p&gt;  &lt;p&gt;So services provide related tasks to the caller, and are passed through the constructor using &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163739.aspx"&gt;dependency injection&lt;/a&gt; (passing the class into the constructor as an interface). This abstraction makes the service very testable and easy to write, and keeps a clear delineation between the task and its physical execution on the disk or network.&amp;#160; &lt;/p&gt;  &lt;h5&gt;Design-time Data&lt;/h5&gt;  &lt;p&gt;This is a topic that is sometimes neglected. A lot of the code in your application won’t run at design-time, because the designer can’t be waiting for a web service to return before it shows anything on screen. Design-time data ensures that you can see a fully-populated view of the UI when you’re developing or designing the application. Without some data, it’s almost impossible to style an application, or for that matter, to ensure that the bindings are right. &lt;/p&gt;  &lt;p&gt;One way to provide design-time data is to use sample data (Expression Blend makes this relatively easy); another approach is to use design-time services. A proposed approach to this is to use a ServiceProvider, which is one line of code that automatically switches between design-time and run-time service code as appropriate. &lt;/p&gt;  &lt;h5&gt;Child Windows and Messages&lt;/h5&gt;  &lt;p&gt;The big question to answer with a child window: should you create a separate ViewModel, or use the parent’s ViewModel? Like most architectural questions, the answer is “it depends”. In some cases, the child window is deeply related to the parent child and is essentially an extension of the parent; in other cases, it’s really an unrelated screen. Depending on how you’re using the child window, either approach may be the appropriate. &lt;/p&gt;  &lt;p&gt;One note: a child window doesn’t inherit the DataContext from its parent, so you either need to pass the ViewModel through the constructor or have the child window find the ViewModel it needs. &lt;/p&gt;  &lt;p&gt;How should the child window be displayed? You can do this in many ways – often a delegated service is an appropriate choice. As a suitable pattern, we can use messaging to handle this. &lt;/p&gt;  &lt;p&gt;Messages are events that provide a loosely-coupled model between the ViewModel and the child window. The process is usually triggered by a user action, which initiates a command to the ViewModel. If there is some business logic that needs to be run to determine whether to display the child window or not, that should be in the ViewModel. Then a message is used to send the request to display the window – either to a service or directly to the view. Some popular choices for the message pattern include the &lt;a href="http://msdn.microsoft.com/en-us/library/dd458915.aspx"&gt;EventAggregator&lt;/a&gt; from &lt;a href="http://msdn.microsoft.com/en-us/library/ff648465.aspx"&gt;PRISM&lt;/a&gt; and the Messenger class from MVVM Light. &lt;/p&gt;  &lt;h5&gt;WCF RIA Services and MVVM&lt;/h5&gt;  &lt;p&gt;RIA Services is very helpful in these kinds of applications: it takes care of managing change tracking for entities, provides methods for saving and reading data, generates entities and models, handles data validation.&lt;/p&gt;  &lt;p&gt;With RIA Services, you create your Domain Services as you normally do; you can use the Entities as your models (they already implement INotifyPropertyChanged), and you get a DomainContext object that acts as a gateway to your services and provides change tracking.&lt;/p&gt;  &lt;p&gt;For more on Silverlight, check out &lt;a href="http://silverlight.tv"&gt;Silverlight TV&lt;/a&gt; and the upcoming &lt;a href="http://jpapa.me/slfs10"&gt;Silverlight Firestarter&lt;/a&gt; event on December 2nd. &lt;a href="http://galasoft.ch/mvvm/getstarted/"&gt;Laurent Bugnion’s MVVM Light Toolkit&lt;/a&gt; is available here.&lt;/p&gt;  &lt;p align="right"&gt;&lt;em&gt;[Session &lt;a href="http://bit.ly/9WuRSI"&gt;CD50&lt;/a&gt; | presented by &lt;a href="http://johnpapa.net"&gt;John Papa&lt;/a&gt;]&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10084987" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/tims/archive/tags/silverlight/">silverlight</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/pdc10/">pdc10</category></item><item><title>PDC10: Unlocking the JavaScript Opportunity with IE9</title><link>http://blogs.msdn.com/b/tims/archive/2010/11/01/pdc10-unlocking-the-javascript-opportunity-with-ie9.aspx</link><pubDate>Mon, 01 Nov 2010 20:46:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10084285</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10084285</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/11/01/pdc10-unlocking-the-javascript-opportunity-with-ie9.aspx#comments</comments><description>&lt;p&gt;Websites are exploding in the quantity of interactivity they contain: over the last few years, they have become fully-fledged applications with &lt;a href="http://office.microsoft.com/en-us/web-apps"&gt;functionality and complexity at a level&lt;/a&gt; that was previously limited to desktop applications. &lt;/p&gt;  &lt;h5&gt;Scripting Engine Design Challenges&lt;/h5&gt;  &lt;p&gt;Prior to IE9, the JavaScript engine was built from an original design optimized for many different uses beyond IE (for example, Windows Scripting Host). As a result, it was designed as a component that could be dropped into different applications, with COM used to marshal data between the engine and its host application. COM-based marshaling added an overhead of 10-20% to the overall page load time, due to all the required boxing and unboxing. &lt;/p&gt;  &lt;p&gt;Today’s engine needs to be optimized for a different set of scenarios: the browser is now by far the most prevalent usage scenario for our JavaScript engine, and these days there’s no question about which scripting language is dominant, so the browser has a far reduced need for extensibility. &lt;/p&gt;  &lt;p&gt;On top of the architectural changes, we enable compilation to native machine instructions to provide a performance boost at execution time, particularly with large codebases. (See also the &lt;a href="http://blogs.msdn.com/b/tims/archive/2010/11/01/pdc10-inside-internet-explorer-performance.aspx"&gt;session on IE9 performance by Jason Weber&lt;/a&gt; for further details on this.)&lt;/p&gt;  &lt;h5&gt;Chakra&lt;/h5&gt;  &lt;p&gt;Chakra offers a hybrid approach, with &lt;em&gt;both&lt;/em&gt; interpreter and designer built into the design. By having the interpreter running on the UI thread, we can stay responsive; but we still get the benefits of compilation through a background thread. It’s not a simple task, however – challenges we had to solve included keeping a tight memory footprint and optimizing compilation for real-world patterns.&lt;/p&gt;  &lt;p&gt;The diagram below shows an architectural view of Chakra:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/3757.chakra_2D00_arch_5F00_2C98AABC.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="chakra-arch" border="0" alt="chakra-arch" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/3755.chakra_2D00_arch_5F00_thumb_5F00_0D45DE1C.png" width="600" height="280" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;We don’t compile all code, instead, we keep a compilation queue; we speculatively compile some quantity of code, but use heuristics to prioritize the queue based on most frequently called functions, the size of the function etc. &lt;/p&gt;  &lt;p&gt;We’ve spent time validating the design of Chakra against real-world websites. For page load times, we’re seeing an average of 14-15% improvement performance improvement – not just for the engine but across the entire stack. &lt;/p&gt;  &lt;p&gt;IE9 introduces a new type system for JavaScript. Dynamic languages in particular need an efficient type system – types are created at runtime and multiple objects often have the same set of property. By providing a type evolution model that shares types, we can be much more efficient in these scenarios. &lt;/p&gt;  &lt;p&gt;One important property-based technique introduced in IE9 is inline caching. Since property access is the most widely used operation and the same key of a key-value pair is often accessed multiple times on a call site, we simply cache the value for each call site.&lt;/p&gt;  &lt;p&gt;The old JavaScript engine used to only work with 8-byte representations of numbers, even if they required less precision. Chakra introduces tagged integer support – with 31-bit numbers (a flag is used for the 32nd bit as an indicator); we go to a full 8-byte representation automatically if the number grows to require more then 31 bits of precision. &lt;/p&gt;  &lt;p&gt;In a similar vein to tagged integer support, Chakra avoids conversion to UTF-16 where possible, retaining strings in UTF-8. This results in a gain of about 300-400K in working set and 3-4% load size wins for complex apps. &lt;/p&gt;  &lt;p&gt;One piece of research which was particularly helpful in planning was done by Microsoft Research. The &lt;a href="http://research.microsoft.com/JSMeter"&gt;JSMeter&lt;/a&gt; project was conducted to measure real-world usage of JavaScript on top sites. One specific insight related to the percentage of code that sites load that is actually executed. For most large sites (including Amazon, Bing, CNN, eBay, Facebook etc.) only 40% of the code fetched is executed. Learning from this, Chakra uses a deferred parser, which reduces working set and increasing load times. (Note that you can also use the HTML &amp;lt;script defer&amp;gt; attribute to &lt;a href="http://peter.sh/experiments/asynchronous-and-deferred-javascript-execution-explained/"&gt;manually hint to the scripting engine&lt;/a&gt; that it needn’t &lt;em&gt;execute &lt;/em&gt;a certain block of code during page loading.)&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;New ECMAScript 5 Features&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The relatively recent release of &lt;a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm"&gt;ECMAScript 5&lt;/a&gt; introduces a number of new keywords and language features. For backward-compatibility reasons, these features are only enabled in IE9 when IE9 Standards Mode is enabled (by default for external sites unless an older compatibility mode has been selected).&lt;/p&gt;  &lt;p&gt;There is a very detailed blog post on the ES5 features added to Internet Explorer 9 on the &lt;a href="http://blogs.msdn.com/b/ie/archive/2010/06/25/enhanced-scripting-in-ie9-ecmascript-5-support-and-more.aspx"&gt;IE engineering blog&lt;/a&gt; (also see &lt;a href="http://blogs.msdn.com/b/ie/archive/2010/10/27/ecmascript-5-part-1-reusable-code.aspx"&gt;this update&lt;/a&gt;). &lt;/p&gt;  &lt;p&gt;You can see a fun test of &lt;a href="http://ie.microsoft.com/testdrive/HTML5/DOMCapabilities/Default.html"&gt;browser support for various DOM capabilities&lt;/a&gt; on the IE Test Drive site.&lt;/p&gt;  &lt;p align="right"&gt;&lt;em&gt;[Session &lt;a href="http://bit.ly/cWnL9V"&gt;CD08&lt;/a&gt; | presented by &lt;/em&gt;&lt;a href="http://blogs.msdn.com/b/gauravseth/"&gt;&lt;em&gt;Gaurav Seth&lt;/em&gt;&lt;/a&gt;&lt;em&gt;]&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10084285" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/tims/archive/tags/ie/">ie</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/pdc10/">pdc10</category></item><item><title>PDC10: Inside Internet Explorer Performance</title><link>http://blogs.msdn.com/b/tims/archive/2010/11/01/pdc10-inside-internet-explorer-performance.aspx</link><pubDate>Mon, 01 Nov 2010 19:14:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10084238</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10084238</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/11/01/pdc10-inside-internet-explorer-performance.aspx#comments</comments><description>&lt;p&gt;Browser performance is a multi-dimensional topic: there are eleven different subsystems that taken together can affect the overall performance of a browser: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/8865.image_5F00_7A8BB7A0.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/8053.image_5F00_thumb_5F00_7283EF71.png" width="658" height="200" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Different browsers may organize their internal implementation differently, but all these elements are important in their impact of the overall performance of a site.&lt;/p&gt;  &lt;p&gt;An interesting lesson we can draw from the data we’ve measured in our research: site performance is not strongly correlated with the number of elements, CSS rules and amount of JavaScript code. Many people assume that JavaScript is the most significant indicator for browser performance, but the sample shows that it accounts for less than one-quarter of the overall client page load time.&amp;#160; &lt;/p&gt;  &lt;p&gt;So the key lesson is that browser performance requires all the subsystems involved in page display to be optimized, rather than just the script subsystem. In IE9, we have rewritten a number of the eleven subsystems for maximum performance, and we’re going to cover a couple of these in greater detail.&lt;/p&gt;  &lt;h5&gt;JavaScript&lt;/h5&gt;  &lt;p&gt;Starting with JavaScript, IE9 introduces the new &lt;em&gt;Chakra&lt;/em&gt; engine. &lt;/p&gt;  &lt;p&gt;JavaScript engines can be placed on a continuum from a pure interpreter to a pure compiler. But picking one or the other end of the spectrum introduces compromises. IE9 is the first browser to do both: to build a full interpreter &lt;em&gt;and &lt;/em&gt;a full compiler that are truly integrated. Because the compilation happens in parallel with the rendering, with every compiled function becoming available as soon as it is ready, the compiled code is available quickly to the page, while the interpreter can be used in the meantime. &lt;/p&gt;  &lt;p&gt;This architecture makes sense because of the growth of multi-core client machines running Windows. Our data shows that the mean average number of cores on a Windows Vista or Windows 7 machine (i.e. machines that support the system requirements for IE9) is 2.46. In IE8, the ecosystem was not yet ready for this change, and so the interpreter there only takes advantage of a single core. &lt;/p&gt;  &lt;p&gt;Another aspect of the change is the way the JavaScript engine integration has changed from IE8. In the past, COM was used as the bridge between the various language engines and the browser. This offered a lot of extensibility, but at an overhead for the primary language of the web. In IE9, we’ve built JavaScript directly into the browser as a first-class citizen, enabling the compiler and the browser engines to communicate directly via shared memory. We still support other language engines via the traditional COM mechanism.&lt;/p&gt;  &lt;p&gt;One last interesting piece of data – we crawled the API usage of the top 7,200 websites worldwide, and discovered that the Pareto principle applies pretty accurately. Over 80% of the APIs in JavaScript are unused on 90% of the top sites. And surprisingly, indexOf() is the most commonly called function (not getElementById() as most people assume). This kind of data helped us optimize Chakra for real-world usage rather than synthetic benchmarks. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/7888.image_5F00_1232C93A.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/2021.image_5F00_thumb_5F00_5606FD91.png" width="600" height="272" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h5&gt;Hardware-accelerated Graphics&lt;/h5&gt;  &lt;p&gt;&lt;font style="background-color: #ffff00"&gt;&lt;font style="background-color: #ffff00"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="style"&gt;&lt;font style="style"&gt;Every&lt;/font&gt; &lt;/font&gt;&lt;font style="background-color: #ffff00"&gt;&lt;/font&gt;Windows computer has a GPU these days, and on Windows Vista or above, over 80% of machines have a graphics score of greater than 3.0. The GPU has become a highly-specialized computational engine optimized for graphics. Ten years ago, the CPU and GPU were roughly comparable in terms of the number of &lt;a href="http://en.wikipedia.org/wiki/FLOPS"&gt;floating point operations per second&lt;/a&gt; each processor could deliver; today, the fastest GPUs in the world have a 10x advantage over the fastest CPUs in the world, delivering over a teraflop of computing power.&lt;/p&gt;  &lt;p&gt;IE9 fully unlocks the GPU, using DirectX technologies like &lt;a href="http://msdn.microsoft.com/en-us/library/dd370990(VS.85).aspx"&gt;Direct2D&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/dd368038(VS.85).aspx"&gt;DirectWrite&lt;/a&gt; to accelerate everything in the browser: images, text, video, SVG, canvas, and CSS3. This has a &lt;em&gt;dramatic &lt;/em&gt;impact on the performance of Internet Explorer 9 for visually-intensive websites, both compared to IE8 and indeed competitive browsers, as the following CPU usage graph shows while profiling one animation step in the &lt;a href="http://ie.microsoft.com/testdrive/Performance/FlyingImages/Default.html"&gt;Flying Images demo&lt;/a&gt;:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/6724.image_5F00_71AB8987.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/5241.image_5F00_thumb_5F00_1C83ED9A.png" width="600" height="450" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font style="background-color: #ffff00"&gt;&lt;/font&gt;Other browsers are starting to add hardware acceleration – but no other browser available today adds hardware acceleration for more than a couple of technologies – for example, text, video, SVG remain CPU-bound on most other browsers.&lt;/p&gt;  &lt;p align="right"&gt;&lt;em&gt;[Session CD09 | presented by Jason Weber]&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10084238" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/tims/archive/tags/ie/">ie</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/pdc10/">pdc10</category></item><item><title>PDC10: Mysteries of Windows Memory Management Revealed: Part Two</title><link>http://blogs.msdn.com/b/tims/archive/2010/10/29/pdc10-mysteries-of-windows-memory-management-revealed-part-two.aspx</link><pubDate>Sat, 30 Oct 2010 03:31:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10083374</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10083374</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/10/29/pdc10-mysteries-of-windows-memory-management-revealed-part-two.aspx#comments</comments><description>&lt;p&gt;In the last session, focusing on virtual memory, it was noted that there was almost no connection between virtual and physical memory. The only connection is that the system commit limit is the sum of physical memory and the size of the paging file(s). This session focuses on the physical memory aspects of the memory management architecture in Windows. &lt;/p&gt;  &lt;h5&gt;Physical Memory and Working Set&lt;/h5&gt;  &lt;p&gt;The &lt;em&gt;working set &lt;/em&gt;is the physical memory that Windows gives to your process, given to you when you demand it by touching the virtual address space. A process starts with an empty working set – as it references pages that aren’t in the working set, it incurs a page fault. Many such page faults are resolved simply from memory (for example, if you load an image that is already in the file cache). &lt;/p&gt;  &lt;p&gt;Each process has a working set default minimum and maximum. Windows doesn’t pay any attention to the maximum working set; Windows uses the minimum to commit that amount of memory, as well as to lock memory.&lt;/p&gt;  &lt;p&gt;At some point, the memory manager decides the process is large enough; it then gives up pages to make room for new pages. If your process is ballooning, the memory manager will tend to favor it because it is obviously memory-hungry; but at some stage, it will start to pull pages out of the working set that are least recently used before it will allocate new memory to that process. &lt;/p&gt;  &lt;p&gt;Unlike other OS, it is a local page replacement policy, meaning that it will pull the pages from the requesting process. &lt;/p&gt;  &lt;p&gt;The working set consists of shareable and private pages; there are performance counters that measure this. Shareable working set is effectively counted as “private” if it is not shared. Note that the working set does not include trimmed memory that is still cached. &lt;/p&gt;  &lt;p&gt;Windows Task Manager only offers the private working set figure; Process Explorer gives you a more detailed view. Remember – it’s only when you touch the memory that is committed that it becomes part of the private working set. Comparing &lt;a href="http://download.sysinternals.com/Files/Testlimit.zip"&gt;testlimit&lt;/a&gt; with –m, –r and –d switches demonstrates the differences here. &lt;/p&gt;  &lt;h5&gt;Physical Memory Page Lists&lt;/h5&gt;  &lt;p&gt;The system keeps unassigned physical pages on one of several page lists in the Page Frame Number (PFN) database, each maintained as FIFO list:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;free (available for allocation but has dirty data in it);&lt;/li&gt;    &lt;li&gt;modified (previously belonging to a process but needing to be written to a backing store before it can be reused; &lt;/li&gt;    &lt;li&gt;standby (still associated with a process but not included in the working set);&lt;/li&gt;    &lt;li&gt;zero (zeroed out memory safe for allocation), &lt;/li&gt;    &lt;li&gt;ROM (read-only memory)&lt;/li&gt;    &lt;li&gt;bad (pages that failed internal consistency checks). &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Note that &lt;a href="http://www.winsiderss.com/tools/meminfo/meminfo.htm"&gt;meminfo&lt;/a&gt; gives you a way to investigate these page lists: &lt;a href="http://www.alex-ionescu.com/?p=51"&gt;Alex Ionescu provides further helpful commentary&lt;/a&gt; on the tool on his blog.)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/8203.pagelists_5F00_0EACAEBA.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="pagelists" border="0" alt="pagelists" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/4370.pagelists_5F00_thumb_5F00_06B50C58.png" width="600" height="295" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;When Windows starts, all memory is in the free page list.&amp;#160; As a process demands memory, it is faulted in from the zero page list (however, the free page list can be used if the memory is to be used for a mapped file, since the data will be overwritten before the process sees it). If a page is pulled from a process, it may be moved to the modified or the standby page, depending on whether it contains private data that needs to be flushed or not. When a process exists, its pages are moved to the free page list. &lt;/p&gt;  &lt;p&gt;There are two threads that are specifically responsible for moving threads from one list to another. Firstly, the zero page thread runs at the lowest priority and is responsible for zeroing out free pages before moving them to the zeroed page list. Secondly the modified page writer is responsible for moving pages from the modified page list to the standby page list, first writing out any data. &lt;/p&gt;  &lt;p&gt;What happens if the zero and free pages are exhausted? The memory manager starts using the standby page list; if that is exhausted, then the modified page list can be used (once the modified page writer has flushed the content and moved it to the standby page list). If all these pages are exhausted, the last resource is to remove memory from the working set. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/1323.image_5F00_4612BFE8.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/0576.image_5F00_thumb_5F00_5EA25D38.png" width="215" height="240" /&gt;&lt;/a&gt;With this information, we can more helpfully interpret the data provided by Task Manager. &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The Available field (right) shows all the pages in the zero, free and standby lists. &lt;/li&gt;    &lt;li&gt;The Cached field shows all the pages in the standby and modified page lists as well as the system&amp;#160; (kernel) working set. &lt;/li&gt;    &lt;li&gt;The Free field shows just those pages in the free and zero page lists. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://technet.microsoft.com/en-us/sysinternals/ff700229.aspx"&gt;Rammap&lt;/a&gt; is another useful tool, showing the most detailed breakdown of what’s going on in RAM at the time it takes the snapshot. It breaks down all the memory in the system by type and page list. For processes, it shows the private working set for each process as well as memory for that process on the standby or modify page list as well as kernel memory in the page table. &lt;/p&gt;  &lt;p&gt;As you can see, having a low “free memory” value in Windows is normal – and a good thing. In fact, a technology like SuperFetch has the &lt;em&gt;goal &lt;/em&gt;of reducing free memory (moving pages from the free to the standby list as it caches files into memory).&lt;/p&gt;  &lt;p&gt;SuperFetch is used to proactively repopulate RAM with what it believes is the most useful data: it takes into account the frequency of page usage, and the usage of the page in the context of other pages in memory. Interestingly, the choices it makes are also influenced by a time-based heuristic – it understands that users launch different applications at the weekend than during the weekday, and at the evening than the daytime. SuperFetch is disabled in Windows 7 if the operating system is booted from an SSD drive, because the primary benefit is to reduce random read seeks on a platter-based hard drive. &lt;/p&gt;  &lt;p&gt;It’s worth noting that there are actually eight standby page lists in practice on Windows Vista and above; this is used to ensure that the least important standby pages are scavenged first. (Rammap can show you how much memory has been repurposed from each of the standby priority lists.)&lt;/p&gt;  &lt;p&gt;A common question: do you have enough RAM in your system? There’s actually no sure-fire way to tell if you have enough memory. If available memory is low for a considerable length of time, then you probably could use more. You can check Process Monitor to see if there are an excessive number of reads from the paging file (there’s no performance counter for paging file reads). &lt;/p&gt;  &lt;p&gt;Mark closed with some examples of how certain memory usage can be hard to or inspect or detect: a shared memory leak, large quantities of reserved but uncommitted memory, locked memory, driver locked pages and AWE pages. &lt;/p&gt;  &lt;p align="right"&gt;&lt;em&gt;[Session CD02 | presented by &lt;/em&gt;&lt;a href="http://blogs.technet.com/b/markrussinovich/"&gt;&lt;em&gt;Mark Russinovich&lt;/em&gt;&lt;/a&gt;&lt;em&gt;]&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10083374" width="1" height="1"&gt;</description></item><item><title>PDC10: Mysteries of Windows Memory Management Revealed: Part One</title><link>http://blogs.msdn.com/b/tims/archive/2010/10/28/pdc10-mysteries-of-windows-memory-management-revealed-part-one.aspx</link><pubDate>Fri, 29 Oct 2010 00:16:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10082549</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10082549</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/10/28/pdc10-mysteries-of-windows-memory-management-revealed-part-one.aspx#comments</comments><description>&lt;h5 align="left"&gt;Fundamentals of Memory Management&lt;/h5&gt;  &lt;p&gt;Windows has both physical and virtual memory. Memory is managed in pages, with processes demanding it as necessary. Memory pages are 4KB in size (both for physical and virtual memory); but you can also allocate memory in large (2-4MB, depending on architecture) pages for efficiency. In general, there are very few things in common between physical and virtual memory, as we’ll see. &lt;/p&gt;  &lt;p&gt;On 32-bit (x86) architectures, the total addressable memory is 4GB (2&lt;sup&gt;32 &lt;/sup&gt;bytes), divided equally into user space and system space. Pages in system space can only be accessed from kernel mode; user-mode processes (application code) can only access data that is appropriately marked in user mode. There is one single 2GB system space that is mapped into the address space for all processes; each process also has its own 2GB user space. (You can adjust the split to 3GB user / 1GB system on PAE-enabled systems, but the 4GB overall address space limit remains.) &lt;/p&gt;  &lt;p&gt;With a 64-bit architecture, the total address space is theoretically 2&lt;sup&gt;64&lt;/sup&gt; = 16&lt;a href="http://en.wikipedia.org/wiki/Exabyte"&gt;EB&lt;/a&gt;, but for a variety of software and hardware architectural reasons, 64-bit Windows only supports 2&lt;sup&gt;44&lt;/sup&gt; = 16TB today, split equally between user and system space. Mark: “I think I’m pretty safe in saying that we’ll never need more than 16TB, but people smarter than me have been proven wrong with statements like that, so I’m not sure if I should make that claim or not!”&lt;/p&gt;  &lt;h5&gt;Virtual Memory&lt;/h5&gt;  &lt;p&gt;Within a process, virtual memory is broken into three categories: (i) private virtual memory – that which is not shared – e.g. the process heap; (ii) shareable – memory mapped files or space that you’ve explicitly chosen to share; (iii) free – memory with an as yet undefined use. Private and shareable memory can also be flagged in two ways: reserved (a thread has plans to use this range but it isn’t available yet), and committed (available to use). Why should you reserve memory? It allows an application to lazily commit contiguous memory. For example, a stack: the system only needs to commit a small amount in advance, and can grow as appropriate by committing previously-reserved memory.&lt;/p&gt;  &lt;p&gt;Task Manager only lets you see the private bytes (“commit size”); indeed, most virtual memory problems are due to a process leaking private committed memory, since it backs the various heaps in the system. But this doesn’t offer a full view of the address space – it doesn’t account for shareable memory that isn’t shared (e.g. a DLL only loaded by this process). Fragmentation can also be an issue, causing the address space to be exhausted prematurely. &lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx"&gt;Process Explorer&lt;/a&gt; lets you split out the overall virtual memory used by a process from the private bytes; another useful tool is &lt;a href="http://technet.microsoft.com/en-us/sysinternals/dd535533.aspx"&gt;VMMap&lt;/a&gt; (with a new v3.0 released for PDC10), which provides a really deep level of inspection into the virtual memory used by a given process. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/5428.image_5F00_5F9AE305.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/5516.image_5F00_thumb_5F00_2467073A.png" width="600" height="435" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In the example above, the committed memory is about 54MB, but only a tiny amount is private. The middle section shows how the memory is allocated –&amp;#160; images (DLLs and executables), mapped files, shared sections, heaps (unmanaged and managed), the stack region, private data (memory that is private and doesn’t fall into one of the other categories, e.g. if you call VirtualAlloc()), and page tables. If you click on one of these rows, you’ll filter the details section at the bottom of the window.&lt;/p&gt;  &lt;p&gt;Fragmentation can be an issue, as mentioned earlier. Mark demonstrated creating a large number of threads with &lt;a href="http://download.sysinternals.com/Files/Testlimit.zip"&gt;testlimit&lt;/a&gt; –t. The number of threads he was able to create on a 32-bit machine was limited to ~2900 even though in theory he should have been able to create more, because the address space was so fragmented that there were no more contiguous spaces of 1MB or more (1MB being the default size).&lt;/p&gt;  &lt;h5&gt;&lt;strong&gt;Mapped Files&lt;/strong&gt;&lt;/h5&gt;  &lt;p&gt;Mark then demonstrated how mapped files are used heavily by Explorer. Files are mapped regularly so that it can get access to the resources and metadata from within them. You can trace file mappings with Process Monitor – so if you don’t understand why a file is mapped, you can see how the DLL got loaded by capturing a snapshot filtered to “Load Image” operations and examining the stack at the point the image was loaded. &lt;/p&gt;  &lt;p&gt;You can also use VMMap to compare the difference between two snapshots of a process. In the given example of loading a file into Notepad, the committed memory grew from the 54MB above to over 100MB – with most of it coming from image loading.&lt;/p&gt;  &lt;p&gt;New in VMMap 3.0 is tracing, which enables you to launch a process with profiling and track virtual and heap activity over a period of time. &lt;/p&gt;  &lt;h5&gt;System Commit Limit and Paging Files&lt;/h5&gt;  &lt;p&gt;Certain kinds of process committed memory are charged against the system commit limit. System committed memory is that which is backed either by the paging file or physical memory. Not all memory in the address space is system committed memory – for example, the notepad.exe image or its DLLs are backed by disk, so if the system tossed out of memory and Notepad wanted to access it again, it could simply retrieve it from notepad.exe on disk. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/2867.vmem_5F00_5D11B147.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 0px 0px 7px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="vmem" border="0" alt="vmem" align="right" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/5504.vmem_5F00_thumb_5F00_03DFC788.png" width="320" height="418" /&gt;&lt;/a&gt;When Windows needs to reallocate private memory, it has to store it in the paging file (otherwise it would be missing when it needed to retrieve it). When that limit is reached, you’ve run out of virtual memory. You can increase the system commit limit by adding RAM or increasing the paging file size: if paging files are configured to expand, that means that the system commit limit may not actually be the maximum limit. &lt;/p&gt;  &lt;p&gt;So how is the paging file size determined? By default, it is automatically managed by Windows based on the RAM available: on systems with &amp;gt;1GB RAM, the minimum is equal to the size of the RAM and the maximum is 3x RAM or 4GB (whichever is larger). You can manually adjust this, however. &lt;/p&gt;  &lt;p&gt;What’s ironic about this algorithm is that in the dialog, the recommended value is often a completely different number (on my 8GB machine, it’s 1.4x RAM), which as Mark notes fails to inspire confidence in the algorithm. &lt;/p&gt;  &lt;p&gt;You can view system commit charge and limit from Task Manager or Process Explorer; you can test exhausting the system commit limit by running testlimit –m. (Be careful – this will stress your machine to its limit!)&lt;/p&gt;  &lt;p&gt;So how should you size your paging file? Many people will give you advice based in multiples of the RAM, but that isn’t good advice.&amp;#160; You should look at the system commit peak for the most extreme workload and if you want to apply a multiplication factor (1.5x, 2x), apply it to that value instead. Note that it’s important to ensure that the paging file is big enough to hold a kernel crash dump. Although you can turn off the paging file altogether, it is useful – the system can page out unused, modified private pages, providing more RAM for real workloads. &lt;/p&gt;  &lt;p align="right"&gt;&lt;em&gt;[Session CD01 | presented by &lt;a href="http://blogs.technet.com/b/markrussinovich/"&gt;Mark Russinovich&lt;/a&gt;]&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10082549" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/tims/archive/tags/windows/">windows</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/pdc10/">pdc10</category></item><item><title>PDC10: Session Time!</title><link>http://blogs.msdn.com/b/tims/archive/2010/10/28/pdc10-session-time.aspx</link><pubDate>Thu, 28 Oct 2010 21:27:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10082454</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10082454</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/10/28/pdc10-session-time.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://player.microsoftpdc.com/session"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="ff657791_pdc10_2(en-us)" border="0" alt="ff657791_pdc10_2(en-us)" align="right" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/2502.ff657791_5F00_pdc10_5F00_2en_2D00_us_5F00_190D69B5.png" width="240" height="122" /&gt;&lt;/a&gt;Now that the keynote is over, my formal duties for the event are mostly complete. Lots going on still, and I hope to meet a number of you in person – but I thought I’d take a little downtime and watch a few sessions. Rather than just greedily hoarding all the knowledge I learned for myself (incidentally, did you know that Apple &lt;a href="http://developer.apple.com/wwdc/faq/"&gt;require you to sign a non-disclosure agreement&lt;/a&gt; to attend their breakout sessions?), I’d prefer to share my notes with you. So over the next few posts you’ll hopefully get some useful distillations of several client-related sessions from the event. &lt;/p&gt;  &lt;p&gt;It goes without saying – if you don’t like my choices, you can watch it all live yourself online at &lt;a href="http://player.microsoftpdc.com/session"&gt;http://player.microsoftpdc.com/session&lt;/a&gt;. Let’s see how this goes!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10082454" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/tims/archive/tags/pdc10/">pdc10</category></item><item><title>Demo Failure: The Answer to the Puzzle</title><link>http://blogs.msdn.com/b/tims/archive/2010/10/28/demo-failure-the-answer-to-the-puzzle.aspx</link><pubDate>Thu, 28 Oct 2010 15:11:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10082173</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10082173</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/10/28/demo-failure-the-answer-to-the-puzzle.aspx#comments</comments><description>&lt;p&gt;Yesterday &lt;a href="http://blogs.msdn.com/b/tims/archive/2010/10/27/demo-failure-a-puzzle-with-an-amusing-ending.aspx"&gt;I shared the story of the Steve Ballmer keynote demo that was breaking&lt;/a&gt; and the urgent call I got to help figure it out.&lt;/p&gt;  &lt;p&gt;I left you hanging as to the solution; a few of you posted interesting ideas of what might have gone wrong. But Richard Cooper was the first to figure it out – congratulations!&lt;/p&gt;  &lt;p&gt;The answer can be found in the &lt;a href="http://i.lsimg.net/media/js/defaultnew-msh.js"&gt;defaultnew-msh.js&lt;/a&gt; file. Here’s the relevant function:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;(&lt;span class="kwrd"&gt;function&lt;/span&gt;(){&lt;/pre&gt;

  &lt;pre&gt;  &lt;span class="kwrd"&gt;if&lt;/span&gt;(&lt;span class="kwrd"&gt;typeof&lt;/span&gt; window.external.msIsSiteMode!=&lt;span class="str"&gt;&amp;quot;undefined&amp;quot;&lt;/span&gt;){&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;function&lt;/span&gt; d(){&lt;/pre&gt;

  &lt;pre&gt;      &lt;span class="kwrd"&gt;var&lt;/span&gt; o=&lt;span class="kwrd"&gt;new&lt;/span&gt; Date;&lt;/pre&gt;

  &lt;pre class="alt"&gt;      &lt;span class="kwrd"&gt;if&lt;/span&gt;(o.getHours()==8||o.getHours()==9||o.getHours()==10||&lt;/pre&gt;

  &lt;pre&gt;                 o.getHours()==11||o.getHours()==12||o.getHours()==13){&lt;/pre&gt;

  &lt;pre class="alt"&gt;        window.external.msSiteModeClearJumpList();&lt;/pre&gt;

  &lt;pre&gt;        window.external.msSiteModeCreateJumpList(&lt;span class="str"&gt;&amp;quot;MyPlate Reminder&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;        window.external.msSiteModeAddJumpListItem(&lt;span class="str"&gt;&amp;quot;Track Your Breakfast&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;                             &lt;span class="str"&gt;&amp;quot;/myplate/&amp;quot;&lt;/span&gt;,&lt;span class="str"&gt;&amp;quot;/media/images/ico/bell.ico&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;        window.external.msSiteModeSetIconOverlay(&lt;span class="str"&gt;&amp;quot;/media/images/ico/bell.ico&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;                &lt;span class="str"&gt;&amp;quot;Reminders&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;        window.external.msSiteModeShowJumplist()&lt;/pre&gt;

  &lt;pre&gt;      }&lt;/pre&gt;

  &lt;pre class="alt"&gt;      &lt;span class="kwrd"&gt;if&lt;/span&gt;(o.getHours()== 14||o.getHours()==15||o.getHours()==16||&lt;/pre&gt;

  &lt;pre&gt;            o.getHours()==17||o.getHours()==18||o.getHours()==19){&lt;/pre&gt;

  &lt;pre class="alt"&gt;        window.external.msSiteModeClearJumpList();&lt;/pre&gt;

  &lt;pre&gt;        window.external.msSiteModeCreateJumpList(&lt;span class="str"&gt;&amp;quot;MyPlate Reminder&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;        window.external.msSiteModeAddJumpListItem(&lt;span class="str"&gt;&amp;quot;Track Your Lunch&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;                             &lt;span class="str"&gt;&amp;quot;/myplate/&amp;quot;&lt;/span&gt;,&lt;span class="str"&gt;&amp;quot;/media/images/ico/bell.ico&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;        window.external.msSiteModeSetIconOverlay(&lt;span class="str"&gt;&amp;quot;/media/images/ico/bell.ico&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;                &lt;span class="str"&gt;&amp;quot;Reminders&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;        window.external.msSiteModeShowJumplist()&lt;/pre&gt;

  &lt;pre&gt;      }&lt;/pre&gt;

  &lt;pre class="alt"&gt;      &lt;span class="kwrd"&gt;if&lt;/span&gt;(o.getHours()==20||o.getHours()==21||o.getHours()==22||&lt;/pre&gt;

  &lt;pre&gt;             o.getHours()==23){&lt;/pre&gt;

  &lt;pre class="alt"&gt;        window.external.msSiteModeClearJumpList();&lt;/pre&gt;

  &lt;pre&gt;        window.external.msSiteModeCreateJumpList(&lt;span class="str"&gt;&amp;quot;MyPlate Reminder&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;        window.external.msSiteModeAddJumpListItem(&lt;span class="str"&gt;&amp;quot;Track Your Dinner&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;                             &lt;span class="str"&gt;&amp;quot;/myplate/&amp;quot;&lt;/span&gt;,&lt;span class="str"&gt;&amp;quot;/media/images/ico/bell.ico&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;        window.external.msSiteModeSetIconOverlay(&lt;span class="str"&gt;&amp;quot;/media/images/ico/bell.ico&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;                &lt;span class="str"&gt;&amp;quot;Reminders&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;        window.external.msSiteModeShowJumplist()&lt;/pre&gt;

  &lt;pre&gt;      }&lt;/pre&gt;

  &lt;pre class="alt"&gt;      window.setTimeout(&lt;span class="kwrd"&gt;function&lt;/span&gt;(){&lt;/pre&gt;

  &lt;pre&gt;        d()&lt;/pre&gt;

  &lt;pre class="alt"&gt;      }&lt;/pre&gt;

  &lt;pre&gt;      ,3E5)&lt;/pre&gt;

  &lt;pre class="alt"&gt;    }&lt;/pre&gt;

  &lt;pre&gt;    d()&lt;/pre&gt;

  &lt;pre class="alt"&gt;  }&lt;/pre&gt;

  &lt;pre&gt;})();&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Now you can hopefully see that the notifications are set up based on the time: the site authors had designed around certain time windows when users would be tracking breakfast / lunch / dinner. But (by design) there’s no notification between midnight and 8am. &lt;/p&gt;

&lt;p&gt;I was tempted to tell the demo team that the demo would magically start working in about half an hour or so, but I decided that was a bit unfair to their blood pressure. They set the clock forward an hour, and the demo ran flawlessly.&lt;/p&gt;

&lt;p&gt;It's a good example of how demos can be unpredictable - despite your best efforts to rehearse and prepare, there are so many variables in the system for a keynote demo that you can expect something unexpected.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/0383.Photo_5F00_EC7F7B0E_2D00_1434_2D00_BF5B_2D00_715F_2D00_F6997AB95650_5F00_793634BE.jpg"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="Photo_EC7F7B0E-1434-BF5B-715F-F6997AB95650" border="0" alt="Photo_EC7F7B0E-1434-BF5B-715F-F6997AB95650" align="right" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/2043.Photo_5F00_EC7F7B0E_2D00_1434_2D00_BF5B_2D00_715F_2D00_F6997AB95650_5F00_thumb_5F00_3893E84F.jpg" width="300" height="225" /&gt;&lt;/a&gt;I’m sat in the PDC keynote room this morning for the final run-through – we finished rehearsing last night at 1am and we started this morning at 5am. Behind the scenes, there’s a whole conference room full of equipment: video streaming equipment to broadcast the event around the world, a bank of about forty demo machines (primary and backup for each demo), video and lighting control, a slide editing suite and site production services. &lt;/p&gt;

&lt;p&gt;There are a whole host of challenges that are only exposed in this scenario: as an example, we need to remote a USB cable from a Windows Phone to a PC backstage (and provide a second one as an emergency backup); we need to provide consistent and reliable networking for myriad devices even when the wifi and cellular networks are saturated; we need to be able to switch between all forty machines from a single demo podium. Last night, we saw a Windows 7 error message that I’d never seen before – we’d exceeded the USB specification by chaining five hubs together in a certain configuration. Given all this, you can probably imagine why demos can fail: ironically, there comes a point where redundancy introduces so much complexity that it actually increases the risk of failure. &lt;/p&gt;

&lt;p&gt;Crossing fingers for a demo failure-free morning! Be sure to tune in, won’t you? We’re &lt;a href="http://player.microsoftpdc.com/"&gt;broadcasting live over the internet&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10082173" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/tims/archive/tags/ie/">ie</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/pdc10/">pdc10</category></item><item><title>Demo Failure: A Puzzle with an Amusing Ending</title><link>http://blogs.msdn.com/b/tims/archive/2010/10/27/demo-failure-a-puzzle-with-an-amusing-ending.aspx</link><pubDate>Wed, 27 Oct 2010 19:58:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10081710</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>7</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10081710</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/10/27/demo-failure-a-puzzle-with-an-amusing-ending.aspx#comments</comments><description>&lt;p&gt;Tomorrow is the start of the &lt;a href="http://microsoftpdc.com"&gt;PDC&lt;/a&gt;, and while I have a quiet moment before the final keynote rehearsals start, I thought I’d share this little story with you. &lt;/p&gt;  &lt;p&gt;I got an urgent email very early yesterday morning as I was just waking up from a colleague who was about to go on stage to do a demo &lt;a href="http://www.vcsummit2010.com/"&gt;in a Steve Ballmer keynote&lt;/a&gt;. The demo showed how IE9 enables web apps to feel more like Windows desktop apps, using features like &lt;a href="http://blogs.msdn.com/b/tims/archive/2010/10/04/real-world-implementations-of-pinned-sites-with-ie9.aspx"&gt;pinned site mode&lt;/a&gt;, jump lists, notification icons and so on. The issue was that the notification icons just weren’t popping up on cue. They’d worked perfectly well the night before during rehearsals, but all of a sudden they weren’t appearing. &lt;/p&gt;  &lt;p&gt;Everyone was racking their brains to try and figure out what was going wrong. Had someone tinkered with the demo machine? Had the website changed? I’ve been there before, and you can probably imagine how stressful it is to hit a demo issue so close to a CEO keynote.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.livestrong.com"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/8875.image_5F00_5B7AB742.png" width="240" height="195" /&gt;&lt;/a&gt;From the relaxed atmosphere of my bedroom, I decided to go have a quick look at the code to see why it was failing. I was amused to discover the source of the issue. Rather than jump straight to the answer, I’ll give you the chance to figure it out for yourself – see how long it takes you, and go ahead and post in the comments section when you’ve figured it out. &lt;/p&gt;  &lt;p&gt;The site in question is &lt;a href="http://www.livestrong.com/"&gt;LiveStrong&lt;/a&gt; – co-founded by the Lance Armstrong Foundation. (Hit F12 when you’ve opened the link below to open the IE Developer Tools.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10081710" width="1" height="1"&gt;</description></item><item><title>Presenting IE6 with the Lifetime Achievement Award</title><link>http://blogs.msdn.com/b/tims/archive/2010/10/22/presenting-ie6-with-the-lifetime-achievement-award.aspx</link><pubDate>Fri, 22 Oct 2010 17:34:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10079644</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10079644</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/10/22/presenting-ie6-with-the-lifetime-achievement-award.aspx#comments</comments><description>&lt;p&gt;I want to take you on a journey. A journey to a land that is at once both familiar and strange. &lt;/p&gt;  &lt;p&gt;Step into my &lt;a href="http://www.archive.org/"&gt;time machine&lt;/a&gt; and let me take you back to the last decade. Sit down and buckle up!&lt;/p&gt;  &lt;p&gt;We’re eight months into the new millennium. George W. Bush has recently started his first term of office, Enron has recently been named “America’s Most Innovative Company” by Fortune magazine, the first Lord of the Rings movie is still in production and the most famous wardrobe malfunction since Lady Godiva is still three years away. This is the era of Internet Explorer 6.&lt;/p&gt;  &lt;p&gt;I thought it might be amusing to take a look at the web that IE6 was built for, with thanks to the &lt;a href="http://web.archive.org/"&gt;Wayback Archive&lt;/a&gt;, Bing and a few other resources.&lt;/p&gt;  &lt;p&gt;Here is the news from CNN the week that IE launched:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://web.archive.org/web/20010823105703/http://www.cnn.com/"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="cnn" border="0" alt="cnn" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/4885.cnn_5F00_177DE59A.png" width="602" height="451" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Yahoo is promoting &lt;em&gt;Free &lt;/em&gt;56K Internet Access:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://web.archive.org/web/20000827150328/http://www.yahoo.com"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/6433.image_5F00_27C93786.png" width="602" height="483" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Wikipedia has reached the giddying heights of 6,000 articles:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://web.archive.org/web/20010808121638/http://www.wikipedia.org/"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="wikipedia" border="0" alt="wikipedia" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/2235.wikipedia_5F00_044C9321.png" width="602" height="431" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Apple have just launched some cool new iMac models and a G4-based workstation:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://web.archive.org/web/20010812042658/http://www.apple.com/index.html"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/2235.image_5F00_74C98151.png" width="602" height="527" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;What about web browsers? Firefox is just some dude’s blog:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://web.archive.org/web/20010925125226/http://firefox.com"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/7610.image_5F00_77DB1D9F.png" width="602" height="483" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;OK – so what’s the alternative to Internet Explorer then? Glad you ask – let me introduce you to Netscape 6:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/0172.image_5F00_53861350.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/0160.image_5F00_thumb_5F00_79E7F69B.png" width="604" height="454" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The system requirements for IE6 were pretty demanding: you needed Windows 98 or greater&lt;sub&gt;&lt;/sub&gt;. If you were running a six year old operating system, you had to &lt;a href="http://www.windowsbbs.com/windows-95-98-me-nt/22207-ie6-win95.html"&gt;upgrade first&lt;/a&gt;. (Sounds familiar?)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/4477.pcmag_5F00_1132FB0D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="pcmag" border="0" alt="pcmag" align="right" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/4061.pcmag_5F00_thumb_5F00_17E60490.png" width="102" height="47" /&gt;&lt;/a&gt;But it was worth it – after all, Internet Explorer 6 &lt;a href="http://www.pcmag.com/article2/0,2817,541298,00.asp"&gt;won PC Magazine’s “editor’s choice” award&lt;/a&gt;, with the reviewer praising it for “offer[ing]few quirks and many superb features”. &lt;/p&gt;  &lt;p&gt;Back to the present. Times have moved on a long way since IE6 was the belle of the ball. It’s dying quickly – in the US and many developed countries, &lt;a href="http://www.netmarketshare.com/report.aspx?qprid=12&amp;amp;qpcustom=3332&amp;amp;qptimeframe=M&amp;amp;qpsp=139&amp;amp;sample=35"&gt;it has 5% or less market share&lt;/a&gt;. Some have &lt;a href="http://ie6funeral.com/"&gt;already held a funeral&lt;/a&gt; for it – we sent flowers, naturally. &lt;/p&gt;  &lt;p&gt;We are &lt;a href="http://www.computerworld.com/s/article/9136508/Microsoft_Killing_IE6_not_an_option_?source=CTWNLE_nlt_security_2009-08-11"&gt;as keen to see the world move on from IE6&lt;/a&gt; as everyone else: but while it’s not necessarily a popular message to convey, we don’t think it’s up to us – it’s our customers’ choice when they choose to move, even if it makes our lives harder. Over the nine years of IE6’s existence, going back to the days before web standards were as well established as they are now, developers (particularly in enterprise environments) took a dependency on IE6 that takes time to migrate away from. Backwards compatibility and long support lifecycles are a reality for enterprise development, as we all know. &lt;/p&gt;  &lt;p&gt;In closing, IE6 is a poor choice of browser for the internet of 2010. But it’s fun to look back at the world it was engineered for, and perhaps it explains a little why &lt;a href="http://stackoverflow.com/questions/3714600/does-ie6-support-any-html5-elements"&gt;IE6 doesn’t support HTML5&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;More on the history of Internet Explorer &lt;a href="http://www.microsoft.com/windows/WinHistoryIE.mspx"&gt;can be found here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10079644" width="1" height="1"&gt;</description></item><item><title>Silverlight Hallowe’en Card</title><link>http://blogs.msdn.com/b/tims/archive/2010/10/19/silverlight-hallowe-en-card.aspx</link><pubDate>Wed, 20 Oct 2010 00:25:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10078149</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10078149</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/10/19/silverlight-hallowe-en-card.aspx#comments</comments><description>&lt;p&gt;Love &lt;a href="http://halloween.cloudapp.net/"&gt;this Hallowe’en card creator&lt;/a&gt; from &lt;a href="http://www.archetype-inc.com"&gt;Archetype&lt;/a&gt;:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://halloween.cloudapp.net/pumpkin/3b4ec9d8-4823-4974-90c5-2ea372ea4481"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/8304.image_5F00_0BC58B3B.png" width="604" height="388" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Built using Silverlight, it enables you to carve your own pumpkin, add suitably demonic or gremlin-like sound effects using Silverlight’s built-in microphone integration support, and then share the final result with a friend. This is really cool – and a good example of the kind of experience that remains the preserve of plug-ins for now at least, even with the strong HTML5 support now emerging in modern browsers.&lt;/p&gt;  &lt;p&gt;After a very messy weekend with some friends carving the real deal, my kids are going to have a lot of fun with this – &lt;a href="http://halloween.cloudapp.net/"&gt;try it out&lt;/a&gt;!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10078149" width="1" height="1"&gt;</description></item><item><title>Pushing the Boundaries of HTML5 Gaming: Jitterbugs</title><link>http://blogs.msdn.com/b/tims/archive/2010/10/11/pushing-the-boundaries-of-html5-gaming-jitterbugs.aspx</link><pubDate>Mon, 11 Oct 2010 15:50:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10074190</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10074190</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/10/11/pushing-the-boundaries-of-html5-gaming-jitterbugs.aspx#comments</comments><description>&lt;p&gt;For many developers, the acid test of whether HTML5 is ready for primetime is gaming. Few other scenarios push a technology as far: with demands for low-latency input, intensive rendering of animated graphical content, layered audio, full-screen display, and a consistent framerate despite inconsistent workloads. &lt;/p&gt;  &lt;p&gt;Given the support for &lt;a href="http://blogs.msdn.com/b/ie/archive/2010/09/10/the-architecture-of-full-hardware-acceleration-of-all-web-page-content.aspx"&gt;full hardware acceleration in IE9&lt;/a&gt;, we were eager to see how far we could push the platform. Until now, there has not been an impressive selection of HTML5 games, or rather, the games that are there around are limited in their level of interactivity. For instance, the most highly rated games on &lt;a href="http://www.chromeexperiments.com/"&gt;Chrome Experiments&lt;/a&gt; at the time of writing are implementations of &lt;a href="http://www.chromeexperiments.com/detail/world-of-solitaire/"&gt;Solitaire&lt;/a&gt; and &lt;a href="http://www.chromeexperiments.com/detail/internetris/"&gt;Tetris&lt;/a&gt;, games that were well within the capabilities of Windows 3.1. &lt;/p&gt;  &lt;p&gt;We felt the web deserved better, and so we commissioned one of the world’s leading rich internet application designers, &lt;a href="http://www.cynergysystems.com/"&gt;Cynergy&lt;/a&gt;, to see what they could put together in a few short weeks with Internet Explorer 9 beta. The game they put together, &lt;a href="http://html5.cynergysystems.com/"&gt;Jitterbugs&lt;/a&gt;, is in my opinion the most intensive HTML5 game available so far, and it certainly shows off why we need hardware acceleration in our browsers if they are to serve us well as a foundation for client application development. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://html5.cynergysystems.com/"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/4705.image_5F00_01C4658A.png" width="600" height="458" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Jitterbugs is (by &lt;a href="http://blogs.msdn.com/b/tims/archive/2010/10/03/html5-a-specification-or-a-platform.aspx"&gt;any definition&lt;/a&gt;), an extensive example of HTML5 usage, with in particular both &lt;a href="http://dev.w3.org/html5/canvas-api/canvas-2d-api.html"&gt;Canvas 2D&lt;/a&gt; and &lt;a href="http://dev.w3.org/html5/spec/Overview.html#audio"&gt;audio&lt;/a&gt; features used to great effect within the game. Indeed, the primary element of the DOM tree is a large (1100x800) canvas on which the game surface is rendered. There’s very little HTML itself in the program – it’s primarily used for preloading audio assets and creating the frame for the game, with JavaScript used to handle the canvas rendering and interactions, as you’d expect.&lt;/p&gt;  &lt;p&gt;In the game, the objective is to use your mouse (or a touchscreen if you have one at your disposal) to circle two or more identically-colored bugs, which are “jittering” around the screen at a fairly slow pace. The faster you net the bugs, the more points you score. If you complete an entire screen, you get a nice win animation before the next level, where there are more bugs than previously. Over a few levels, the intensity builds up – you need to start scoring combos by netting the same colored bug repeatedly, which slows down the jittering and makes it easier to capture more of them. At the end, you can &lt;a href="http://twitter.com/#!/rickbarraza/status/24609024254"&gt;tweet your final grand score&lt;/a&gt; as a challenge to others!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/8103.image_5F00_55A76898.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/1588.image_5F00_thumb_5F00_3AFACC7F.png" width="600" height="462" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;&lt;strong&gt;Inside the Code&lt;/strong&gt;&lt;/h3&gt;  &lt;p&gt;Turning to the JavaScript for a moment, Jitterbugs is very well-structured and surprisingly short – the entire game is less than 2,500 lines of code, spread across four files (audio.js, controller.js, gameLogic.js and band.js), which I’ll briefly describe.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;audio.js &lt;/strong&gt;contains functions that are used to transition between individual layers of sound as well as reset the audio. When you first begin a level, the sound is silent, and then as you start to net bugs the various &lt;a href="http://html5.cynergysystems.com/audio/s0layer1.mp3"&gt;instruments begin to play&lt;/a&gt;, gradually the &lt;a href="http://html5.cynergysystems.com/audio/s0layer2.mp3"&gt;bassist and other instruments&lt;/a&gt; join in, and by the time you get to the end, &lt;a href="http://html5.cynergysystems.com/audio/s0layer3.mp3"&gt;the entire band is swinging&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;The audio files themselves are loaded in HTML, for instance:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&amp;lt;audio id=&lt;span class="str"&gt;&amp;quot;s0layer1&amp;quot;&lt;/span&gt; preload=&lt;span class="str"&gt;&amp;quot;preload&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;  &amp;lt;source src=&lt;span class="str"&gt;&amp;quot;audio/s0layer1.mp3&amp;quot;&lt;/span&gt; type=&lt;span class="str"&gt;&amp;quot;audio/mp3&amp;quot; &lt;/span&gt;/&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;/audio&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;audio id=&lt;span class="str"&gt;&amp;quot;s0layer2&amp;quot;&lt;/span&gt; preload=&lt;span class="str"&gt;&amp;quot;preload&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;  &amp;lt;source src=&lt;span class="str"&gt;&amp;quot;audio/s0layer2.mp3&amp;quot;&lt;/span&gt; type=&lt;span class="str"&gt;&amp;quot;audio/mp3&amp;quot; &lt;/span&gt;/&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;/audio&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;audio id=&lt;span class="str"&gt;&amp;quot;s0layer3&amp;quot;&lt;/span&gt; preload=&lt;span class="str"&gt;&amp;quot;preload&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;  &amp;lt;source src=&lt;span class="str"&gt;&amp;quot;audio/s0layer3.mp3&amp;quot;&lt;/span&gt; type=&lt;span class="str"&gt;&amp;quot;audio/mp3&amp;quot; &lt;/span&gt;/&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;/audio&amp;gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Note the use of the preload attribute, which hints to the browser that the files can be loaded asynchronously as resource availability permits. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;controller.js &lt;/strong&gt;is responsible for the flow of the game: it handles drawing things like the preloader screen, animating the “stage” (e.g. the windmill and tower signs in the odd-numbered levels) and setting up event listeners for the mouse events. It also contains the game loop itself, which looks like this:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; gameLoop() {&lt;/pre&gt;

  &lt;pre&gt;  canvasRoot.width = STAGE_WIDTH;&lt;/pre&gt;

  &lt;pre class="alt"&gt;  updateBkg();&lt;/pre&gt;

  &lt;pre&gt;  updateStage();&lt;/pre&gt;

  &lt;pre class="alt"&gt;  updateGameboard();&lt;/pre&gt;

  &lt;pre&gt;  updateResults();    &lt;/pre&gt;

  &lt;pre class="alt"&gt;  updateBugs();&lt;/pre&gt;

  &lt;pre&gt;  updateGameUX();&lt;/pre&gt;

  &lt;pre class="alt"&gt;  updateBand();&lt;/pre&gt;

  &lt;pre&gt;  updateFrame();&lt;/pre&gt;

  &lt;pre class="alt"&gt;  updateAudio();&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;The game loop is triggered with a call to setInterval, a JavaScript method which calls the function every 20ms:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;masterLoop = setInterval(gameLoop,20);&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;This ensures the UI itself is drawn at a constant 50fps rate (assuming the browser has finished drawing the previous frame and handling any associated events by the time the interval has completed. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;gameLogic.js &lt;/strong&gt;contains most of the core game itself, in terms of displaying the various sprites and managing interactions between them (e.g. lassoing the bugs). The interesting piece to note here is how the images are drawn on the screen with a given rotation. Here’s a simplified portion of the code: for drawing the bugs on-screen:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;for&lt;/span&gt; (&lt;span class="kwrd"&gt;var&lt;/span&gt; i = 0; i &amp;lt; introBugs.length; i++) {&lt;/pre&gt;

  &lt;pre&gt;  temp = introBugs[i];&lt;/pre&gt;

  &lt;pre class="alt"&gt;  temp.x += temp.vx;&lt;/pre&gt;

  &lt;pre&gt;  temp.y += temp.vy;&lt;/pre&gt;

  &lt;pre class="alt"&gt;  temp.vy += Math.random();&lt;/pre&gt;

  &lt;pre&gt;  temp.vx += Math.random();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;  ctxRoot.save();&lt;/pre&gt;

  &lt;pre class="alt"&gt;  ctxRoot.translate(temp.x, temp.y);&lt;/pre&gt;

  &lt;pre&gt;  ctxRoot.rotate(Math.atan2(temp.vy, temp.vx));&lt;/pre&gt;

  &lt;pre class="alt"&gt;  ctxRoot.drawImage(bugImages[temp.imgIndex], -.5*temp.width, &lt;/pre&gt;

  &lt;pre&gt;    -.5*temp.height, temp.width, temp.height);&lt;/pre&gt;

  &lt;pre class="alt"&gt;  ctxRoot.restore();&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The important thing to note is that it’s the canvas being rotated, rather than the graphical elements themselves. The process is analogous to drawing a stick figure at an angle on a piece of paper, where you’d likely rotate the paper and then draw the figure upright at that angle before returning the piece of paper to its original position. In the same way, here we save the position of the context with (ctxRoot.save), translate and rotate the context (ctxRoot.translate / ctxRoot.rotate), draw the image (ctxRoot.drawImage), and then restore the context to its saved position (ctxRoot.restore). &lt;/p&gt;

&lt;p&gt;This is a little counter-intuitive: as &lt;a href="http://www.twitter.com/rickbarraza"&gt;Rick&lt;/a&gt;, the developer notes, there are no good tutorials currently out there that explain this, how to do it, or even why it works. Rotating the drawing context isn’t an obvious solution, particularly to developers who come from a Flash or Silverlight world.&lt;/p&gt;

&lt;p&gt;Lastly, &lt;strong&gt;band.js &lt;/strong&gt;contains the functions that draw and animate the band that appear at the bottom of the screen. It wasn’t until I looked through the code for the first time that I realized that the band had two different outfits, which alternate with each level along with the background imagery and music. Each band member is composed out of a number of limbs – &lt;a href="http://html5.cynergysystems.com/graphics/bassist_armLeft.png"&gt;left&lt;/a&gt; and &lt;a href="http://html5.cynergysystems.com/graphics/bassist_armRight.png"&gt;right&lt;/a&gt; arms, a &lt;a href="http://html5.cynergysystems.com/graphics/bassist_body.png"&gt;body&lt;/a&gt;, and the &lt;a href="http://html5.cynergysystems.com/graphics/bassist_bass.png"&gt;instrument itself&lt;/a&gt;, which are drawn on the canvas in the same manner as the bugs, listed above. &lt;/p&gt;

&lt;h3&gt;&lt;strong&gt;Fun Trivia&lt;/strong&gt;&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;This project didn’t always seem to be going in the right direction. Having submitted a great concept for an ambient touch-based musical experiment, Rick sent me a mail a couple of weeks in to say that he’d got a new idea for the project of building a game that involved lassoing bugs while some birds sang a song in French. There were a few sleepless nights on both sides because this sounded too surreal to be appealing to a broad audience. Fortunately, this is one of those cases where if you have a good designer you should just trust them rather than trying to manage by committee – I’m tremendously pleased by the final result, even if I had no idea how it would turn out four weeks prior to the beta launch. &lt;/li&gt;

  &lt;li&gt;Cynergy worked with two award winning musicians to create the fantastic music for the game. They had a &lt;a href="http://www.tbd.com/blogs/tbd-arts/2010/09/-dj-eurok-and-kokayi-visit-world-of-butterflies-birds-french-in-new-video-game-2412.html"&gt;great write up about it at TBD &lt;/a&gt;(the local news site for Washington DC, where Cynergy are based). To our collective amusement, the &amp;quot;girl&amp;quot; singing the songs is actually one of the two male artists (&lt;a href="http://qn5.com/kokayi/"&gt;Kokayi&lt;/a&gt;) whose voice was modified in the studio by the other artist (&lt;a href="http://www.djeurok.com/"&gt;DJ Eurok&lt;/a&gt;). &lt;/li&gt;

  &lt;li&gt;The game was originally designed with SVG, because we hadn’t at that time released a version of IE9 that supported the Canvas 2D APIs. Over a period of time, the code got gradually rewritten until it was entirely using Canvas. (I’ll feature another project in a little while that is SVG-centric, to redress the balance.) &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Outcomes&lt;/h3&gt;

&lt;p&gt;We’re really happy with the project – I think it’s a really fun game that pushes HTML5 far further than I imagined it could go. When I first showed it to some of the Program Managers responsible for Canvas and other parts of the rendering engine, they were genuinely astonished that HTML5 and what they’d built could handle this kind of intensive experience. And without full hardware acceleration, this game just doesn’t work well at all – try it in another browser to see that in practice. It’s not because Jitterbugs does anything to optimize for IE itself – it’s just because this kind of experience needs to harness the full underlying power of the PC. &lt;/p&gt;

&lt;p&gt;The other point of interest is that this was the first HTML5 project for Rick Barraza, the designer / developer responsible for this game. As he &lt;a href="http://windowsteamblog.com/ie/b/ie/archive/2010/09/09/developer-and-designer-q-amp-a-rick-barraza-cynergy.aspx"&gt;commented in an interview with the marketing team&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“I had already dismissed HTML5 as still not being good enough. If it wasn’t for a commission by my company to spend a couple weeks and deep dive into the Platform Preview, I probably wouldn’t have tried it. I think a lot of interactive media people like myself may be in that same boat right now. I had seen other people’s work with Canvas in other browsers, and I figured IE9 would be more of the same thing. But I’ll openly admit that I was premature in that. Once the Platform Previews came out that supported Canvas and also, more importantly, showed off the true power of full hardware acceleration, everything changed for me. I was finally able to dive deeply into HTML5 and start creating things that were on par with what I do in the other interactive media languages I work with. It was really impressive and now I’m very glad that I’ve had this chance to upgrade my skill set so quickly. My toolbox just got bigger.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is great news if you care about having a powerful, mainstream HTML5 platform. May your toolbox also get bigger!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10074190" width="1" height="1"&gt;</description></item><item><title>Never Mind the Bullets: The “Making Of” Video…</title><link>http://blogs.msdn.com/b/tims/archive/2010/10/07/never-mind-the-bullets-the-making-of-video.aspx</link><pubDate>Thu, 07 Oct 2010 17:51:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10072864</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10072864</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/10/07/never-mind-the-bullets-the-making-of-video.aspx#comments</comments><description>&lt;p&gt;This is really nicely done – a behind-the-scenes video for the &lt;a href="http://blogs.msdn.com/b/tims/archive/2010/10/01/never-mind-the-bullets.aspx"&gt;Never Mind the Bullets&lt;/a&gt; project I featured a couple of days ago…&lt;/p&gt;  &lt;p&gt;&lt;iframe height="338" src="http://player.vimeo.com/video/15578518" frameborder="0" width="600"&gt;&lt;/iframe&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://vimeo.com/15578518"&gt;Making Of: Never Mind the Bullets&lt;/a&gt; from &lt;a href="http://www.steaw-webdesign.com/"&gt;Steaw Web Design&lt;/a&gt; on &lt;a href="http://vimeo.com"&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10072864" width="1" height="1"&gt;</description></item><item><title>The Best Job in the Company…</title><link>http://blogs.msdn.com/b/tims/archive/2010/10/06/the-best-job-in-the-company.aspx</link><pubDate>Thu, 07 Oct 2010 00:33:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10072512</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>7</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10072512</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/10/06/the-best-job-in-the-company.aspx#comments</comments><description>&lt;p&gt;I’m serious. &lt;/p&gt;  &lt;p&gt;I genuinely think this is the single most exciting open position in Microsoft today. &lt;/p&gt;  &lt;p&gt;After the release of Internet Explorer 9 beta, nobody should be questioning our commitment to delivering a hardware-accelerated HTML5 platform that can form the foundation for the next generation of web applications.&lt;/p&gt;  &lt;p&gt;Microsoft is sometimes accused of being slow to move; but when we do set a course and direction, we can be faster and more focused than perhaps any other company of our size. &lt;/p&gt;  &lt;p&gt;We’re about to hire our next &lt;strong&gt;IE9 / HTML5 Technical Evangelist&lt;/strong&gt;, who can be the public face of Microsoft in the web community. This is a senior position, based out of our corporate headquarters in Redmond, WA. &lt;/p&gt;  &lt;p&gt;This is not an ordinary job, and it requires an extraordinary individual. Someone who is a developer at heart, but who has a whole host of other skills beyond technical depth: dynamism, an entrepreneurial nature, creative talent, strategic awareness. Someone who is a natural ambassador and communicator. Someone who has presence. Someone who is dedicated to changing the world and ready to give their all to something that endures and touches tens of millions of people.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://cid-928723d7ca03fa44.office.live.com/view.aspx/Public/IE%209%20Technical%20Evangelist.docx"&gt;Are you the one&lt;/a&gt;? &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10072512" width="1" height="1"&gt;</description></item><item><title>Real-World Implementations of Pinned Sites with IE9</title><link>http://blogs.msdn.com/b/tims/archive/2010/10/04/real-world-implementations-of-pinned-sites-with-ie9.aspx</link><pubDate>Mon, 04 Oct 2010 23:49:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10071452</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10071452</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/10/04/real-world-implementations-of-pinned-sites-with-ie9.aspx#comments</comments><description>&lt;p&gt;Beyond the work we’ve done to support HTML5 and other standards in Internet Explorer 9, the engineering and design teams also spent a lot of time thinking about how to enable sites to blend in more naturally with the rest of the applications on your system. Today the boundary between a site and an application is too pronounced: for example, why should you have to build a fully-fledged application just to get an icon on the start menu? It would be great if developers had fewer limitations and more choices, and users had a more consistent experience.&lt;/p&gt;  &lt;p align="left"&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/2311.image_5F00_56F0A4C7.png" target="_blank"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/3301.image_5F00_thumb_5F00_31570199.png" width="304" height="190" /&gt;&lt;/a&gt;In IE9 &lt;a href="http://blogs.msdn.com/b/ie/archive/2010/09/17/user-experiences-customizing-pinned-sites.aspx"&gt;we introduced a feature called Pinned Sites&lt;/a&gt; that makes it easy for a user to add a site to their taskbar or start menu, just by dragging the tab (or the icon to the side of the address bar) to the intended location. The site will reopen in its own window, with the browse frame and navigational controls integrating the site’s icon and primary color.&lt;/p&gt;  &lt;p align="left"&gt;While the basic Pinned Sites feature works without any changes required on the site, you can optionally add to the taskbar integration by adding jumplists, custom thumbnail preview buttons, icon overlays and extended site metadata. Just two weeks after the launch of IE9 beta, many of the most popular sites on the Internet have implemented support for this feature. Some good examples of adoption with sites you might use on a daily basis are &lt;a href="http://www.cnn.com"&gt;CNN&lt;/a&gt;, &lt;a href="http://www.facebook.com/"&gt;Facebook&lt;/a&gt; and &lt;a href="http://www.twitter.com"&gt;Twitter&lt;/a&gt;, and I thought I’d take a moment to pick this apart a little to show you what one of these (Facebook) has done.&lt;/p&gt;  &lt;p align="left"&gt;For the purposes of this discussion, I’m looking at Facebook. If you check out the &amp;lt;head&amp;gt; section of the markup for the home page of Facebook, you’ll see something like the following (edited for readability and line-length):&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&amp;lt;meta name=&lt;span class="str"&gt;&amp;quot;application-name&amp;quot;&lt;/span&gt; content=&lt;span class="str"&gt;&amp;quot;Facebook&amp;quot;&lt;/span&gt;/&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;meta name=&lt;span class="str"&gt;&amp;quot;msapplication-tooltip&amp;quot;&lt;/span&gt; content=&lt;span class="str"&gt;&amp;quot;Start the Facebook App&amp;quot;&lt;/span&gt;/&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;lt;meta name=&lt;span class="str"&gt;&amp;quot;msapplication-starturl&amp;quot;&lt;/span&gt; content=&lt;span class="str"&gt;&amp;quot;/&amp;quot;&lt;/span&gt;/&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;meta name=&lt;span class="str"&gt;&amp;quot;msapplication-window&amp;quot;&lt;/span&gt; content=&lt;span class="str"&gt;&amp;quot;width=800;height=600&amp;quot;&lt;/span&gt;/&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;meta name=&lt;span class="str"&gt;&amp;quot;msapplication-task&amp;quot;&lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt; content=&lt;span class="str"&gt;&amp;quot;name=News;action-uri=/home.php?sk=nf;icon-uri=/images/news.ico&amp;quot;&lt;/span&gt;/&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;meta name=&lt;span class="str"&gt;&amp;quot;msapplication-task&amp;quot;&lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt; content=&lt;span class="str"&gt;&amp;quot;name=Messages;action-uri=/home.php?sk=inbox;icon-uri=/images/messages.ico&amp;quot;&lt;/span&gt;/&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;meta name=&lt;span class="str"&gt;&amp;quot;msapplication-task&amp;quot;&lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt; content=&lt;span class="str"&gt;&amp;quot;name=Events;action-uri=/home.php?sk=events;icon-uri=/images/events.ico&amp;quot;&lt;/span&gt;/&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;meta name=&lt;span class="str"&gt;&amp;quot;msapplication-task&amp;quot;&lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt; content=&lt;span class="str"&gt;&amp;quot;name=Friends;action-uri=/home.php?sk=ru;icon-uri=/images/friends.ico&amp;quot;&lt;/span&gt;/&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&amp;lt;link rel=&lt;span class="str"&gt;&amp;quot;shortcut icon&amp;quot;&lt;/span&gt; href=&lt;span class="str"&gt;&amp;quot;http://static.ak.fbcdn.net/facebook.ico&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;/div&gt;




&lt;p&gt;Taking a quick glance through the various fields included here, application-name simply provides a shortened title of the site that is suitable for use in a menu. This comes straight out of the HTML5 specification (&lt;a href="http://dev.w3.org/html5/spec/Overview.html#meta-application-name"&gt;Section 4.2.5.1, “Standard metadata names”&lt;/a&gt;), and also provides the &amp;lt;meta&amp;gt;-based pattern for the additional metadata that a site can supply.&lt;/p&gt;

&lt;p&gt;Beyond the application-name field, Internet Explorer 9 also acts on a number of other defined fields; since these are not part of the specification today, we added a vendor prefix to the application-foo convention &lt;a href="http://www.alistapart.com/articles/prefix-or-posthack/"&gt;in the same way that is commonly adopted for CSS today&lt;/a&gt;. The tooltip and window fields are relatively self-explanatory; the starturl field simply represents the initial page that should be opened (by default the current page, but often you’ll want to override this to the root). &lt;/p&gt;

&lt;p&gt;The msapplication-task field provides support for up to five tasks, which in IE9 are exposed as jumplist entries. You can set the name, the link that it points to and the location of a custom icon if you want to show something other than the favicon (which is selected in the final line of markup). In theory, this field could be used for other purposes (e.g. on a mobile device it could be used to pre-populate a context menu): there’s nothing intrinsically tied to a jumplist here. &lt;/p&gt;

&lt;p&gt;There are other optional fields you can set, incidentally – &lt;a href="http://msdn.microsoft.com/en-us/library/ff976309(VS.85).aspx"&gt;full documentation is available at MSDN&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/5037.image_5F00_45701E22.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 0px 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/4073.image_5F00_thumb_5F00_1CF13C0E.png" width="193" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So that takes care of the statically-declared content on the site. One other nice addition is the way that Facebook takes advantage of the overlay icon to surface notifications (e.g. new friend request or new wall post). As you can see in the screenshot to the right, there is a red asterisk bubble overlaid on the Facebook icon, indicating new activity has taken place that I might want to review. &lt;/p&gt;

&lt;p&gt;You can set this icon using the &lt;a href="http://msdn.microsoft.com/en-us/library/ff976316(v=VS.85).aspx"&gt;msSiteModeSetIconOverlay()&lt;/a&gt;function, which takes one parameter containing the URI for the icon itself and optionally a second parameter with a tooltip. &lt;/p&gt;

&lt;p&gt;Buried in the JavaScript code on the site, there is a snippet of code which looks very roughly like this:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt;(window.external &amp;amp;&amp;amp; external.msIsSiteMode())&lt;/pre&gt;

  &lt;pre&gt;(&lt;span class="kwrd"&gt;function&lt;/span&gt;() {&lt;/pre&gt;

  &lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;var&lt;/span&gt; wext=window.external;&lt;/pre&gt;

  &lt;pre&gt;  &lt;span class="kwrd"&gt;var&lt;/span&gt; icon=&lt;span class="str"&gt;'/images/icons/notif.ico'&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;var&lt;/span&gt; news={messages:0, notifications:0, requests:0};&lt;/pre&gt;

  &lt;pre&gt;  &lt;/pre&gt;

  &lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;var&lt;/span&gt; updateIcon = &lt;span class="kwrd"&gt;function&lt;/span&gt;(f,e){&lt;/pre&gt;

  &lt;pre&gt;    news[e.type]=e.count;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt;(news.requests + news.messages + news.notifications &amp;gt; 0)&lt;/pre&gt;

  &lt;pre&gt;      wext.msSiteModeSetIconOverlay(icon);&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;else&lt;/span&gt;   &lt;/pre&gt;

  &lt;pre&gt;      wext.msSiteModeClearIconOverlay();&lt;/pre&gt;

  &lt;pre class="alt"&gt;  };&lt;/pre&gt;

  &lt;pre&gt;  &lt;/pre&gt;

  &lt;pre class="alt"&gt;  wext.msSiteModeClearIconOverlay();&lt;/pre&gt;

  &lt;pre&gt;  &lt;/pre&gt;

  &lt;pre class="alt"&gt;  Notifications.subscribe([&lt;span class="str"&gt;'messages-updated'&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="str"&gt;'requests-updated'&lt;/span&gt;,&lt;span class="str"&gt;'notifications-updated'&lt;/span&gt;], updateIcon);&lt;/pre&gt;

  &lt;pre class="alt"&gt;})();&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Here you see how the icon overlay is set where there are more than 0 items to show, but this code is only parsed if msIsSiteMode() returns true – that is, when the site is running in pinned mode. The window object is a safe place to hang browser shell logic, and is used already for similar purposes that relate to the frame rather than the content (e.g. setting favorites or manipulating tabs). &lt;/p&gt;

&lt;p&gt;So we’ve taken an in-depth look at Facebook, but there’s already a plentiful list of other sites that also implement deep support for Pinned Sites. Some other well-known examples beyond the three I’ve already mentioned include: &lt;a href="http://vids.myspace.com/"&gt;MySpace&lt;/a&gt;, &lt;a href="http://www.amazon.com/"&gt;Amazon&lt;/a&gt;, &lt;a href="http://www.zillow.com"&gt;Zillow&lt;/a&gt;, &lt;a href="www.cracked.com"&gt;Cracked&lt;/a&gt;, &lt;a href="http://www.break.com"&gt;break.com&lt;/a&gt;, &lt;a href="www.msn.com"&gt;MSN&lt;/a&gt;, &lt;a href="http://wordpress.com/"&gt;WordPress&lt;/a&gt;, &lt;a href="http://www.linkedin.com"&gt;LinkedIn&lt;/a&gt;, &lt;a href="http://www.usatoday.com/"&gt;USA Today&lt;/a&gt;, &lt;a href="http://www.imdb.com/"&gt;IMDB&lt;/a&gt;, &lt;a href="http://magazine.wsj.com/"&gt;WSJ&lt;/a&gt;, &lt;a href="http://www.flixster.com/"&gt;Flixster&lt;/a&gt;, &lt;a href="http://photobucket.com/"&gt;Photobucket&lt;/a&gt;, &lt;a href="http://www.neowin.net/"&gt;Neowin&lt;/a&gt;, and &lt;a href="http://dsc.discovery.com/"&gt;discovery.com&lt;/a&gt;. We’re also seeing other frameworks adopt support, for example Umbraco (one of the most popular .NET-based CMS solutions) has &lt;a href="http://our.umbraco.org/projects/backoffice-extensions/ie9-extensions"&gt;an extension to add Pinned Sites support&lt;/a&gt; to the admin console. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10071452" width="1" height="1"&gt;</description></item><item><title>HTML5: A Specification or a Platform?</title><link>http://blogs.msdn.com/b/tims/archive/2010/10/03/html5-a-specification-or-a-platform.aspx</link><pubDate>Mon, 04 Oct 2010 05:56:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10071017</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>15</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10071017</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/10/03/html5-a-specification-or-a-platform.aspx#comments</comments><description>&lt;p&gt;An interesting discussion broke out in the comments to the blog post on &lt;a href="http://blogs.msdn.com/b/tims/archive/2010/10/01/never-mind-the-bullets.aspx"&gt;Never Mind the Bullets&lt;/a&gt; during the weekend over my allegedly loose usage of the term HTML5 to describe the site. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/5736.682383_5F00_55089219_5F00_0BA40D2E.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="682383_55089219" border="0" alt="682383_55089219" align="right" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/0647.682383_5F00_55089219_5F00_thumb_5F00_742958FC.png" width="300" height="225" /&gt;&lt;/a&gt;Here’s the problem: while strictly HTML5 refers to a draft &lt;a href="http://dev.w3.org/html5/spec/Overview.html"&gt;specification published by the W3C&lt;/a&gt;, HTML5 is increasingly being used (particularly in the media) as a generic term to describe the web platform that is built on an emerging generation of web standards. In this context, the term is used as a catch-all for a whole suite of specifications. As a fairly typical example, &lt;a href="http://www.infoworld.com/d/developer-world/html-5-could-it-kill-flash-and-silverlight-291"&gt;this InfoWorld article&lt;/a&gt; quotes a vast array of luminaries in an attempt to suggest that HTML5 is an emerging competitor to plug-ins like Flash or Silverlight. &lt;/p&gt;  &lt;p&gt;Yet the HTML5 specification itself is taken up with very different concerns than many people assume – a large portion of the specification concerns itself with tightening the parsing and manipulation of HTML documents; a considerable proportion of the new additions to the specification have to do with form elements and improved semantic markup. While video and audio are included in the core specification, the specification doesn’t define many other technologies that are often considered part of the emerging web. These are instead described in external specifications (of varying levels of completion): for example, &lt;a href="http://www.w3.org/TR/SVG/"&gt;SVG 1.1&lt;/a&gt;, &lt;a href="http://dev.w3.org/html5/canvas-api/canvas-2d-api.html"&gt;Canvas 2D API&lt;/a&gt;, &lt;a href="http://people.mozilla.com/~jkew/woff/woff-spec-latest.html"&gt;WOFF File Format&lt;/a&gt;, &lt;a href="http://www.w3.org/TR/wai-aria/"&gt;WAI-ARIA&lt;/a&gt;, and so on. CSS is itself &lt;a href="http://www.w3.org/Style/CSS/current-work"&gt;a whole family of specifications&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Complicating matters still further, some draft features that are not part of the W3C specification are included in a parallel HTML5 proposal from the WHATWG, a separate community led by a subset of browser vendors (&lt;a href="http://www.itwriting.com/blog/2353-the-two-specifications-of-html-5-0-what-wg-vs-w3c.html"&gt;Tim Anderson has a good primer &lt;/a&gt;for those who are interested). &lt;/p&gt;  &lt;p&gt;So we have an overload of terminology: while at times it’s reasonable and appropriate to distinguish between each of these technologies, it creates problems. A purist will argue that the use of the term HTML5 to represent everything from H.264 video to SVG is wildly inaccurate, and it’s a fair point. On the other hand, we need some term to refer to this family of technologies for ease of reference, and expecting common parlance to explicitly reference a list of distinct specifications is even more unlikely than &lt;a href="http://en.wikipedia.org/wiki/GNU/Linux_naming_controversy"&gt;trying to get everyone to refer to GNU/Linux&lt;/a&gt; rather than the usually shortened form. As I mentioned earlier, it’s unlikely that Wiley are going to publish “HTML5, CSS3, SVG 1.1, Canvas 2D API, ARIA, WOFF, and Indexed DB for Dummies”!&lt;/p&gt;  &lt;p&gt;What is the answer? While I don’t like the conflation of two different meanings, I also don’t realistically see any solution on the horizon. It’s important to be able to describe the modern web client platform succinctly, but it’s also important that we’re precise with our terminology. Maybe the core HTML5 specification should be described as “HTML5 Core”: at least that would provide for the use of the term in both a specific and a general sense.&lt;/p&gt;  &lt;p&gt;Lastly, although I called it out in the comments, I’ll do it again here. If you’re looking for a good primer on the HTML5 specification, I recommend Bruce Lawson and Remy Sharp’s &lt;a href="http://introducinghtml5.com/"&gt;Introducing HTML5 book&lt;/a&gt; as a very readable discussion of the new features. While it contains coverage of a few features from the WHATWG proposal that are unlikely to ever be part of the W3C HTML5 specification, it’s both pragmatic and (in my view) fair-minded.&lt;/p&gt;      &lt;p&gt;Thoughts? How do you usually differentiate between these two uses of the term HTML5?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10071017" width="1" height="1"&gt;</description></item><item><title>Inside an HTML5 Interactive Experience: Never Mind the Bullets</title><link>http://blogs.msdn.com/b/tims/archive/2010/10/01/never-mind-the-bullets.aspx</link><pubDate>Fri, 01 Oct 2010 20:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10070109</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>17</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10070109</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/10/01/never-mind-the-bullets.aspx#comments</comments><description>&lt;p&gt;I wrote in my previous post about &lt;a href="http://blogs.msdn.com/b/tims/archive/2010/09/30/html5-grows-up-the-genesis-of-beauty-of-the-web.aspx"&gt;the approach we took to the IE9 beta launch&lt;/a&gt;: partnering with design agencies and interesting customers to build what we believe are some of the most comprehensive HTML5 reference sites on the web today. Over the course of a couple of blog posts, I wanted to delve into a few of my favorite examples and talk about what I think makes them special, as well as highlight how the designers and developers took advantage of some of the new capabilities of HTML5.&lt;/p&gt;  &lt;p&gt;The first experience I want to highlight is &lt;a href="http://www.nevermindthebullets.com/"&gt;Never Mind the Bullets&lt;/a&gt;, an interactive comic book set in the Wild West. It comes from &lt;a href="http://www.steaw-webdesign.com/"&gt;Steaw Web Design&lt;/a&gt;, a small Paris-based web studio who I met for the first time back in May. Steaw had done some early prototypes with using parallax-style effects with layered images and were keen to see whether they could create a complete experience using that technique. They pulled it off very nicely indeed with the final project, which also takes advantage of the &lt;a href="http://blogs.msdn.com/b/ie/archive/2010/04/23/meet-woff-the-standard-web-font-format.aspx"&gt;WOFF font format &lt;/a&gt;for the comic-style typography and SVG for graphical effects.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/1033.image_5F00_3A8229E0.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/7801.image_5F00_thumb_5F00_4D9330BF.png" width="600" height="448" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You read the comic left to right by simply panning the mouse cursor across to the right side. Each panel of the story is composed out of a series of several transparent or alpha-blended PNG images that are overlaid onto a JPEG background. For example, in the panel above there are separate images for the &lt;a href="http://steawie9.blob.core.windows.net/1-1/soif-2.png"&gt;cowboy&lt;/a&gt;, the &lt;a href="http://steawie9.blob.core.windows.net/1-1/soif-3.png"&gt;steam from the train&lt;/a&gt;, the &lt;a href="http://steawie9.blob.core.windows.net/1-1/soif-4.png"&gt;traincar&lt;/a&gt;, and the &lt;a href="http://steawie9.blob.core.windows.net/1-1/soif-5.jpg"&gt;passengers&lt;/a&gt;. The speech bubbles are created out of an &lt;a href="http://www.nevermindthebullets.com/img/common/BulleSvg.aspx?type=Speak&amp;amp;arrow=BottomLeft"&gt;SVG shape&lt;/a&gt; with real text rendered using a WOFF display font that is loaded through the @font-face CSS attribute (with fallback solutions for browsers that don’t yet support WOFF). &lt;/p&gt;  &lt;p&gt;All these elements are simply positioned using inline styles within a &amp;lt;div&amp;gt; element that represents the panel itself, as shown in this example (edited for brevity and formatting):&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&amp;lt;div &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;Panel&amp;quot;&lt;/span&gt; style=&lt;span class="str"&gt;&amp;quot;width: 723px; height: 700px;&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;  &amp;lt;div &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;Layers In&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &amp;lt;img &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;Layer&amp;quot;&lt;/span&gt; style=&lt;span class="str"&gt;&amp;quot;left:-95px;  top:-75px&amp;quot;&lt;/span&gt; src=&lt;span class="str"&gt;&amp;quot;soif-5.jpg&amp;quot;&lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;         cp:y=&lt;span class="str"&gt;&amp;quot;50&amp;quot;&lt;/span&gt; cp:x=&lt;span class="str"&gt;&amp;quot;50&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;img &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;Layer&amp;quot;&lt;/span&gt; style=&lt;span class="str"&gt;&amp;quot;left:-127px; top:-75px&amp;quot;&lt;/span&gt; src=&lt;span class="str"&gt;&amp;quot;soif-4.png&amp;quot;&lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;         cp:y=&lt;span class="str"&gt;&amp;quot;70&amp;quot;&lt;/span&gt; cp:x=&lt;span class="str"&gt;&amp;quot;100&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;img &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;Layer&amp;quot;&lt;/span&gt; style=&lt;span class="str"&gt;&amp;quot;left:-190px; top:-75px&amp;quot;&lt;/span&gt; src=&lt;span class="str"&gt;&amp;quot;soif-3.png&amp;quot;&lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;         cp:y=&lt;span class="str"&gt;&amp;quot;100&amp;quot;&lt;/span&gt; cp:x=&lt;span class="str"&gt;&amp;quot;200&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;img &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;Layer&amp;quot;&lt;/span&gt; style=&lt;span class="str"&gt;&amp;quot;left:-444px; top:-75px&amp;quot;&lt;/span&gt; src=&lt;span class="str"&gt;&amp;quot;soif-2.png&amp;quot;&lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;         cp:y=&lt;span class="str"&gt;&amp;quot;100&amp;quot;&lt;/span&gt; cp:x=&lt;span class="str"&gt;&amp;quot;600&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;#160;&amp;#160; &amp;lt;/div&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&amp;#160; &amp;lt;div &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;Layers Out&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;p &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;Balloon&amp;quot;&lt;/span&gt; cp:text=&lt;span class="str"&gt;&amp;quot;Little&amp;quot;&lt;/span&gt; cp:balloon=&lt;span class="str"&gt;&amp;quot;Tell&amp;quot;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;       style=&lt;span class="str"&gt;&amp;quot;left: 74px; top: 35px; width: 280px; position: absolute&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; He's come to the west; the land of opportunity.&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/p&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;div &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;Layer&amp;quot;&lt;/span&gt; cp:y=&lt;span class="str"&gt;&amp;quot;100&amp;quot;&lt;/span&gt; cp:x=&lt;span class="str"&gt;&amp;quot;550&amp;quot;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;         style=&lt;span class="str"&gt;&amp;quot;left: -575px; top: -100px; width: 900px; height: 900px&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;p &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;Balloon&amp;quot;&lt;/span&gt; cp:text=&lt;span class="str"&gt;&amp;quot;Medium&amp;quot;&lt;/span&gt; cp:balloon=&lt;span class="str"&gt;&amp;quot;Speak&amp;quot;&lt;/span&gt; cp:arrow=&lt;span class="str"&gt;&amp;quot;BottomLeft&amp;quot;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;         style=&lt;span class="str"&gt;&amp;quot;left: 530px; top: 200px; width: 280px; position: absolute&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; I need a drink.&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/p&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/div&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&amp;#160; &amp;lt;/div&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;#160; &amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;The magic of the comic comes from its interactivity, and here Steaw used a clever technique. Each panel element (the cowboy, the traincar etc.) is extended with several custom attributes (prefixed with “cp:”) that contain metadata on how it should be rendered and the depth of field for the parallax effect.&lt;/p&gt;

&lt;p&gt;For rendering purposes, the browser itself ignores these custom attributes since they don’t have any defined semantics. But in the $.fn.parallax() function (found in parallax.js), these attributes are read out and used to generate a displacement value that is applied using a callback on the mousemove event, as can be seen below (again, slightly edited):&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;self.each(&lt;span class="kwrd"&gt;function&lt;/span&gt;() {&lt;/pre&gt;

  &lt;pre&gt;  &lt;span class="kwrd"&gt;var&lt;/span&gt; $&lt;span class="kwrd"&gt;this&lt;/span&gt; = $(&lt;span class="kwrd"&gt;this&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;  &lt;/pre&gt;

  &lt;pre&gt;  $&lt;span class="kwrd"&gt;this&lt;/span&gt;.mousemove(&lt;span class="kwrd"&gt;function&lt;/span&gt;(&lt;span class="kwrd"&gt;event&lt;/span&gt;) {&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;var&lt;/span&gt; pos = $&lt;span class="kwrd"&gt;this&lt;/span&gt;.offset();&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;var&lt;/span&gt; mouseX = &lt;span class="kwrd"&gt;event&lt;/span&gt;.clientX - pos.left;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;var&lt;/span&gt; mouseY = &lt;span class="kwrd"&gt;event&lt;/span&gt;.clientY - pos.top;&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;var&lt;/span&gt; containerDemiWidth = $&lt;span class="kwrd"&gt;this&lt;/span&gt;.width() / 2;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;var&lt;/span&gt; containerDemiHeight = $&lt;span class="kwrd"&gt;this&lt;/span&gt;.height() / 2;&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;var&lt;/span&gt; centerX = containerDemiWidth;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;var&lt;/span&gt; centerY = containerDemiHeight;&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;var&lt;/span&gt; displacementX = Math.min(1, Math.max(-1, (mouseX - centerX) / &lt;/pre&gt;

  &lt;pre class="alt"&gt;      (containerDemiWidth - settings.xMargin)));&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;var&lt;/span&gt; displacementY = Math.min(1, Math.max(-1, (mouseY - centerY) / &lt;/pre&gt;

  &lt;pre class="alt"&gt;      (containerDemiHeight - settings.yMargin)));&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    $&lt;span class="kwrd"&gt;this&lt;/span&gt;.children(&lt;span class="str"&gt;&amp;quot;.Layers&amp;quot;&lt;/span&gt;).children(&lt;span class="str"&gt;&amp;quot;.Layer&amp;quot;&lt;/span&gt;).each(&lt;span class="kwrd"&gt;function&lt;/span&gt;() {&lt;/pre&gt;

  &lt;pre&gt;      &lt;span class="kwrd"&gt;var&lt;/span&gt; $layer = $(&lt;span class="kwrd"&gt;this&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;      &lt;span class="kwrd"&gt;var&lt;/span&gt; rect = $layer.data(&lt;span class="str"&gt;&amp;quot;rect&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;      &lt;span class="kwrd"&gt;var&lt;/span&gt; xFactor = $layer.attr(settings.xFactor);&lt;/pre&gt;

  &lt;pre class="alt"&gt;      &lt;span class="kwrd"&gt;var&lt;/span&gt; yFactor = $layer.attr(settings.yFactor);&lt;/pre&gt;

  &lt;pre&gt;      &lt;span class="kwrd"&gt;var&lt;/span&gt; x = Math.round(centerX - displacementX * (-xFactor) / &lt;/pre&gt;

  &lt;pre class="alt"&gt;                         100.0 * (rect.centerX - centerX));&lt;/pre&gt;

  &lt;pre&gt;      &lt;span class="kwrd"&gt;var&lt;/span&gt; y = Math.round(centerY - displacementY * (-yFactor) / &lt;/pre&gt;

  &lt;pre class="alt"&gt;                         100.0 * (rect.centerY - centerY));&lt;/pre&gt;

  &lt;pre&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;      $layer.animationMoveTo(x, y);&lt;/pre&gt;

  &lt;pre&gt;    });&lt;/pre&gt;

  &lt;pre class="alt"&gt;  });&lt;/pre&gt;

  &lt;pre&gt;});&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The resultant effect is very polished and fluid. Open it in Internet Explorer 9, hit F12 to bring up the developer tools and browse around the code – they make heavy use of jQuery but the whole site is a surprisingly small amount of code. &lt;/p&gt;

&lt;p&gt;The &lt;em&gt;piece de resistance&lt;/em&gt; is that you can customize your own comic strip with the link at the top. Because they’ve used SVG and text for the speech bubbles, it was relatively easy for them to implement this feature, and you can &lt;a href="http://www.nevermindthebullets.com/Nemesis.aspx?c=f7f5896e5f8f46e1a47b2b3b1ae56caf"&gt;share your own comic strip with others&lt;/a&gt; via email, Facebook or Twitter.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/3480.image_5F00_5A9B2C8E.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/6457.image_5F00_thumb_5F00_648F821F.png" width="600" height="428" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Never Mind the Bullets is receiving a good reaction from the community so far:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://www.thefwa.com/shortlist/never-mind-the-bullets"&gt;It was shortlisted for the FWA Site of the Day award&lt;/a&gt;;&lt;/li&gt;

  &lt;li&gt;&lt;a href="http://us1.campaign-archive.com/?u=16b832d9ad4b28edf261f34df&amp;amp;id=e2d51baf68&amp;amp;e=9fe72a966f"&gt;Smashing Magazine featured it&lt;/a&gt; in their newsletter;&lt;/li&gt;

  &lt;li&gt;&lt;a href="http://thenextweb.com/microsoft/2010/09/26/ie9-tells-you-never-mind-the-bullets-in-comic-to-showcase-html5/"&gt;The Next Web called it “pretty damn cool”&lt;/a&gt;;&lt;/li&gt;

  &lt;li&gt;Even John Gruber (not known for his love of Apple competitors) &lt;a href="http://daringfireball.net/linked/2010/09/21/never-mind-the-bullets"&gt;linked to it on Daring Fireball&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check it out (even if you’re not using Internet Explorer 9) – I’m interested in your thoughts!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10070109" width="1" height="1"&gt;</description></item><item><title>HTML5 Grows Up: The Genesis of Beauty of the Web</title><link>http://blogs.msdn.com/b/tims/archive/2010/09/30/html5-grows-up-the-genesis-of-beauty-of-the-web.aspx</link><pubDate>Thu, 30 Sep 2010 19:27:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10069986</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10069986</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/09/30/html5-grows-up-the-genesis-of-beauty-of-the-web.aspx#comments</comments><description>&lt;p&gt;About four months before the beta launch of Internet Explorer 9, we sat down to start planning how we would share the work we’d done with developers and our customers at large. We really wanted to show how sites could take advantage of the hardware-accelerated HTML5 engine in the browser. But looking around the web, it was almost impossible to find anyone who had taken heavy advantage of HTML5 with a real-world site, in particular with graphical content. Sure, there were some technical demos: we built the &lt;a href="http://ietestdrive.com"&gt;IE Test Drive&lt;/a&gt; site, for example, and Google had their &lt;a href="http://www.chromeexperiments.com/"&gt;Chrome Experiments&lt;/a&gt;. But considering that HTML5 is supposedly the hottest thing in town, it was pretty surprising how actual usage amongst real developers and designers was limited to physics and UI prototypes like &lt;a href="http://www.chromeexperiments.com/detail/deep-sea-stress/"&gt;this one&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;We therefore decided to partner with a few different organizations to create some more fully-fledged showcases of the kind of sites you could build without plug-ins when all users are running a modern, hardware-accelerated browser like Internet Explorer 9. We figured it would be good to have both real-world sites with recognizable brand names, as well as some more artistic works where we invited a design agency to just let their talents run wild without constraint. &lt;a href="http://blogs.msdn.com/b/giorgio/"&gt;Giorgio Sardo&lt;/a&gt; and I spent an exhausting few weeks flying around the world meeting with agencies and doing early briefings to a few key customers, and finally we had a pipeline of interesting projects.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://beautyoftheweb.com"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; float: ; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/5037.image_5F00_1FA87306.png" width="598" height="400" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It was a wild couple of months from that point to the launch. The partners we worked with experienced both the joys and the challenges of using what is still a fledging platform for building complex, graphically-rich, media-centric sites. For most of the design agencies involved, this was a dream brief: many of them are used to dealing with the &lt;a href="http://en.wikipedia.org/wiki/Request_for_proposal"&gt;RFP&lt;/a&gt; process, compromising their artistic vision to meet with the needs of a never-ending committee at the client, and building for the lowest-common denominator. We took completely the opposite approach with many of these projects – giving the designers &lt;em&gt;carte blanche&lt;/em&gt; to implement the crazy idea that they’ve always wanted to create, using the hottest technology in the market and a product that few others had access to. The only constraint was time:&amp;#160; with had less than eight weeks to build something from concept to production. &lt;/p&gt;  &lt;p&gt;For the press, we put on a small launch event at a venue in the heart of the design community in San Francisco; the focus of much of the event was the partner pavilion area where we put the focus on the sites themselves: after all, the browser really is just the theater, not the play itself. But of course, the real launch was online – the moment we announced the release of the beta and launched the &lt;a href="http://www.beautyoftheweb.com/"&gt;Beauty of the Web&lt;/a&gt; site to feature some of this work. &lt;/p&gt;  &lt;p&gt;From the start, we were anxious to ensure that we didn’t block other browsers from accessing the HTML5 experiences. As is documented exhaustively &lt;a href="http://blogs.msdn.com/b/ie/archive/2010/04/14/same-markup-writing-cross-browser-code.aspx"&gt;on the IE blog&lt;/a&gt; (and &lt;a href="http://blogs.adobe.com/jd/2010/09/same-markup-makes-sense.html"&gt;commended by companies like Adobe&lt;/a&gt;), our philosophy is to enable developers to write the same markup for all browsers, using the W3C specification as our guide to create and test for interoperability. Of course, since not every browser supports technologies such as WOFF typography yet, and hardware-acceleration is only partially implemented or off-by-default on most other browsers, there is certainly still work to be done for these kinds of intensive HTML5 experiences to run consistently across the web. &lt;/p&gt;  &lt;p&gt;In the next couple of blog posts, I’ll pick a few of my favorite sites and talk about how they took advantage of HTML5 and what makes them beacon experiences for the future of web development. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10069986" width="1" height="1"&gt;</description></item><item><title>Rebooting the Client Platform Blog</title><link>http://blogs.msdn.com/b/tims/archive/2010/09/29/rebooting-the-client-platform-blog.aspx</link><pubDate>Wed, 29 Sep 2010 22:31:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10069553</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=10069553</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2010/09/29/rebooting-the-client-platform-blog.aspx#comments</comments><description>&lt;p&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="7956075-control-alt-delete[1]" border="0" alt="7956075-control-alt-delete[1]" align="right" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-30-25-metablogapi/8816.7956075_2D00_control_2D00_alt_2D00_delete1_5F00_23AF1048.jpg" width="240" height="159" /&gt;It’s been a while – almost exactly a year – since I last wrote an entry for the blog. To tell the truth, I reached a point last summer where I felt as if I’d run out of steam: that I’d run out of new or interesting things to say and I needed to take an informal &lt;a href="http://www.answers.com/topic/sabbatical-year#Encyclopedia_of_Judaism_ans"&gt;sabbatical year&lt;/a&gt; from blogging. &lt;/p&gt;  &lt;p&gt;I actually began this blog seven years ago, back in July 2003, when the exciting topics of discussion were SQL Server “Yukon”, Windows XP, C# 2.0 and even &lt;a href="http://blogs.msdn.com/b/tims/archive/2003/07/30/57309.aspx"&gt;COBOL extensions for .NET&lt;/a&gt;. It’s been a long ride since then – an international relocation, several promotions and new roles, a plaque filled with “&lt;a href="http://blogs.msdn.com/b/mikhailarkhipov/archive/2006/11/24/microsoft-shipit-awards.aspx"&gt;Ship it&lt;/a&gt;” awards, and more than enough anecdotes and material for my memoirs one day. A couple of months ago, I celebrated my ten year anniversary with Microsoft, which in a tech company is pretty much “gold watch” tenure!&lt;/p&gt;  &lt;p&gt;The last year has actually been one of the busiest years for Microsoft client technologies, between Windows 7, Silverlight 4, Internet Explorer 9 and Windows Phone 7. As well as writing code, running developer labs, creating developer training kits, speaking at conferences, blogging, and helping run conferences like PDC and MIX, my team have increasingly been reinventing themselves as internet TV stars, with shows like &lt;a href="http://silverlight.tv"&gt;Silverlight TV&lt;/a&gt; and &lt;a href="http://channel9.msdn.com/shows/Inside+Windows+Phone/"&gt;Inside Windows Phone&lt;/a&gt; providing authoritative content and applied lessons on how to take advantage of our newest technologies. It’s an exhausting but exhilarating ride.&lt;/p&gt;  &lt;p&gt;Anyway, my sabbatical year has ended, and I’m excited about rebooting this blog and providing some hopefully insightful thoughts around how we plan, build and evangelize Microsoft client technologies. Over the coming blog posts, I’ll talk about HTML5 and Internet Explorer 9, what’s new with Windows, how WPF and Silverlight intersect, and cover some of the most interesting applications and content that people are creating. &lt;/p&gt;  &lt;p&gt;It’s nice to be back – thanks for sticking around!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10069553" width="1" height="1"&gt;</description></item><item><title>Live from LA, It’s the FREE Windows 7 Developer Bootcamp!</title><link>http://blogs.msdn.com/b/tims/archive/2009/09/23/live-from-la-it-s-the-free-windows-7-developer-bootcamp.aspx</link><pubDate>Wed, 23 Sep 2009 20:55:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9898564</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=9898564</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2009/09/23/live-from-la-it-s-the-free-windows-7-developer-bootcamp.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://microsoftpdc.com/Sessions/WKSP08"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px" title="Windows 7 Developer Boot Camp" border="0" alt="Windows 7 Developer Boot Camp" align="right" src="http://blogs.msdn.com/blogfiles/tims/WindowsLiveWriter/LivefromLAItstheFREEWindows7DeveloperBoo_9995/iStock_000008808151Large_3.jpg" width="280" height="192" /&gt;&lt;/a&gt; The PDC is the pinnacle of the Microsoft events calendar as far as I’m concerned: it’s the flagship event for developers, offering the most comprehensive, future-looking, technically deep, densely-packed set of sessions from Microsoft speakers you can find anywhere. This year is no exception: we’ve got a great line up and speculation is mounting about some of the new technologies we’ll be introducing. Lots of surprises await and I guarantee that you’ll miss out on some really cool stuff if you’re not there in person. Registration is going faster than we expected and the event is starting to fill up quickly. &lt;/p&gt;  &lt;p&gt;The PDC comes off the back of one of the most important product releases for Microsoft in years: of course, I’m talking about Windows 7. We’ve held back on announcing most of the deep Windows breakout sessions so far (stay tuned), but today we’re announcing something rather special: a &lt;a href="http://microsoftpdc.com/Sessions/WKSP08"&gt;Windows 7 bootcamp&lt;/a&gt; presented by key leaders from around the product engineering team and others who have been deeply involved in the product development process. This will be the single most densely-packed day we can put together on the subject of Windows development: we’ll take a bottom-up approach to our newest operating system, covering everything from kernel changes to new DirectX 11 features like compute shaders and the hardware-accelerated 2D and text rendering engines that will eventually supplant the venerable GDI libraries. &lt;/p&gt;  &lt;p&gt;Confirmed speakers include:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://channel9.msdn.com/shows/Going+Deep/Landy-Wang-Windows-Memory-Manager/"&gt;Landy Wang&lt;/a&gt;, a Distinguished Engineer in the kernel team who is responsible for the memory manager;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/shows/Going+Deep/Arun-Kishan-Process-Management-in-Windows-Vista/"&gt;Arun Kishan&lt;/a&gt;, a Principal Architect for the process management components, also in the kernel team;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/shows/Going%20Deep/Mark-Russinovich-Inside-Windows-7/"&gt;Mark Russinovich&lt;/a&gt;, Technical Fellow, the man behind &lt;a href="http://technet.microsoft.com/en-us/sysinternals/default.aspx"&gt;SysInternals&lt;/a&gt; and co-author of the wonderful &lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb963901.aspx"&gt;Windows Internals&lt;/a&gt; title;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/posts/yochay/Windows-7-Sensor-and-Location-Deep-Dive-into-Location/"&gt;Yochay Kiriaty&lt;/a&gt;, the author of the official &lt;a href="http://windowsteamblog.com/blogs/developers/default.aspx"&gt;Windows Developer blog&lt;/a&gt; and the &lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=1c333f06-fadb-4d93-9c80-402621c600e7"&gt;Windows 7 training kit&lt;/a&gt;;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/jaimer/"&gt;Jaime Rodriguez&lt;/a&gt;, one of the foremost authorities on Windows Presentation Foundation. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The bootcamp is the day before the PDC itself starts and takes place in the Los Angeles Convention Center. &lt;/p&gt;  &lt;p&gt;And the best part is – it’s absolutely free! Normally we’d charge several hundred dollars for a pre-conference event like this, but the Windows team has agreed to sponsor this event to ensure that nobody misses out because of the tough economic climate. You can attend the bootcamp free even if you haven’t signed up for the rest of the PDC (although we’d love you to join us for the rest of the event). &lt;/p&gt;  &lt;p&gt;We’ve got limited space, so &lt;a href="http://microsoftpdc.com/Sessions/WKSP08"&gt;don’t delay in signing up&lt;/a&gt;. See you there!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9898564" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/tims/archive/tags/windows+7/">windows 7</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/pdc09/">pdc09</category></item><item><title>A Developer’s Guide to Preparing for Windows 7</title><link>http://blogs.msdn.com/b/tims/archive/2009/05/06/a-developer-s-guide-to-preparing-for-windows-7.aspx</link><pubDate>Thu, 07 May 2009 04:13:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9592510</guid><dc:creator>Tim Sneath</dc:creator><slash:comments>17</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/tims/rsscomments.aspx?WeblogPostID=9592510</wfw:commentRss><comments>http://blogs.msdn.com/b/tims/archive/2009/05/06/a-developer-s-guide-to-preparing-for-windows-7.aspx#comments</comments><description>&lt;p&gt;As everyone must know by now, the Windows 7 Release Candidate is broadly released and available for &lt;a href="http://www.microsoft.com/windows/windows-7/download.aspx"&gt;download from the Windows site&lt;/a&gt;. The RC build is essentially our dress rehearsal: we’ve hit feature complete, stabilized the release, followed the active bug glide path down to zero, and the build is essentially at a point where we’re looking for any last remaining “showstopper” bugs that might be lurking. To switch metaphors, it’s our last chance to verify that all systems are go before we hit the big red ‘launch’ button and start manufacturing tens of millions of copies of the software for broad distribution. &lt;/p&gt;  &lt;p&gt;What does this mean for you, my esteemed developer readership? Now is the time when you really want to be putting the product through its paces: checking your own applications for any compatibility issues that might generate support calls, taking advantage of our test harnesses to ensure that your applications run well on Windows 7, and starting to take advantage of the new APIs in Windows 7 that can make your application feel like a native citizen of this new operating environment and enable new features that your customers will appreciate.&lt;/p&gt;  &lt;p&gt;Let’s split that apart into a little more detail.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Compatibility     &lt;br /&gt;&lt;/strong&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 10px 10px; display: inline; border-top: 0px; border-right: 0px" title="EN-w7-comp_rgb_L" border="0" alt="EN-w7-comp_rgb_L" align="right" src="http://blogs.msdn.com/blogfiles/tims/WindowsLiveWriter/ADevelopersGuidetoPreparingforWindows7_10053/EN-w7-comp_rgb_L_3.png" width="144" height="173" /&gt; Application compatibility is always something that’s on our mind when we’re building a new release of Windows. With many tens of thousands of applications that rely on both documented and undocumented behavior from the myriad APIs that we’ve introduced over the last couple of decades, it’s never easy to innovate while ensuring that nothing breaks. Raymond Chen’s blog is littered with &lt;a href="http://blogs.msdn.com/oldnewthing/archive/2009/04/23/9564015.aspx"&gt;examples&lt;/a&gt; of where we’ve had to go to extreme lengths to ensure that we even work around applications that relied on buggy behavior. &lt;/p&gt;  &lt;p&gt;In some cases, there’s a deliberate trade-off that has to be made between two important tenets. For example, in Windows Vista, we introduced User Account Control to increase security for end users even though we knew that it would pose a challenge to certain applications that assumed full administrative rights. We spent a lot of time attempting to mitigate that risk, adding ‘&lt;a href="http://en.wikipedia.org/wiki/Shim_(computing)"&gt;shims&lt;/a&gt;’ for certain applications that we knew in advance required privileged rights to run successfully, and introducing features like file and &lt;a href="http://msdn.microsoft.com/en-us/library/aa965884.aspx"&gt;registry virtualization&lt;/a&gt; to provide a fallback solution for other applications. &lt;/p&gt;  &lt;p&gt;The good news is that with Windows 7, we kept the bar very high indeed for breaking changes. If an application runs on Windows Vista today, there’s a very strong likelihood that the application will run unchanged on Windows 7; this has been borne out by early adopter tests running on the beta and release candidate to date. &lt;/p&gt;  &lt;p&gt;Nevertheless, there are four key steps we’d love every application author to take in the next few months to still further diminish the risk of any application issues:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Download (and read!) the &lt;a href="http://go.microsoft.com/fwlink/?LinkId=133393"&gt;Windows 7 Application Quality Cookbook&lt;/a&gt;. This is the ultimate guide to changes in Windows 7, offering 80+ pages of detailed guidance on the various different edge cases that might cause an issue with your application. (A quick perusal of the document will allay any fears of widespread change – unless the likes of ‘removal of &lt;a href="http://en.wikipedia.org/wiki/Microsoft_Agent"&gt;Microsoft Agent&lt;/a&gt;’ is of major concern to you.) Using this document as a checklist, you’ll be able to very rapidly identify anything that you should take care of. &lt;/li&gt;    &lt;li&gt;Install and use the &lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=24da89e9-b581-47b0-b45e-492dd6da2971"&gt;Windows Application Compatibility Toolkit (ACT) 5.5&lt;/a&gt; and &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=C4A25AB9-649D-4A1B-B4A7-C9D8B095DF18&amp;amp;displaylang=en"&gt;Application Verifier 4.0&lt;/a&gt;. These tools are valuable both for compatibility and quality, and are particularly helpful to renovate an older application that you never moved up to Windows Vista. The former provides automated tools for developers to check for issues like UAC incompatibility and setup problems, as well as administrative tools that can be used to apply and view other shims that may be in place. The latter tool is a runtime verification tool for applications that can be used to identify issues in the way native code calls into the Win32 API – in some ways, it’s the closest equivalent to FxCop for C++ code. &lt;/li&gt;    &lt;li&gt;Get your application &lt;a href="http://msdn.microsoft.com/en-us/windows/dd203105.aspx"&gt;certified for Windows 7&lt;/a&gt;. Applying for a logo for your application has historically been a somewhat painstaking process – it’s involved spending money on submitting the application for manual testing. Now it’s &lt;em&gt;much&lt;/em&gt; simpler: we’ve provided &lt;a href="http://go.microsoft.com/?linkid=9659417"&gt;an automated toolkit&lt;/a&gt; that tests the application for known compatibility issues, targeting application issues that we’ve seen in the wild and providing clear guidance on how to fix your application. And there’s no cost either, beyond signing up for a certificate for &lt;a href="https://winqual.microsoft.com/default.aspx"&gt;WinQual&lt;/a&gt; registration. Whether or not you actually care about using the Windows 7 logo for marketing purposes, this is a worthwhile step to validate that your application runs smoothly on Windows 7 and that your customers will get a good experience.&lt;/li&gt;    &lt;li&gt;Lastly, we’d obviously greatly appreciate it if you’d be kind enough to update the “system requirements” page on your web site to call out your support for Windows 7! &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;strong&gt;Taking Advantage of Windows 7&lt;/strong&gt;    &lt;br /&gt;Assuming your application &lt;em&gt;runs&lt;/em&gt; on Windows 7, the optional next step is to take advantage of one or more of the myriad new features in Windows 7 that can give your users a better experience, while of course still supporting Windows XP or Vista where appropriate. To call out a few specific examples:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Multi-touch&lt;/strong&gt;: enabling your application to take advantage of new devices like the &lt;a href="http://www.hp.com/united-states/campaigns/touchsmart"&gt;HP TouchSmart desktop&lt;/a&gt; and &lt;a href="http://www.hp.com/united-states/campaigns/touchsmart/notebook/index.html?jumpid=re_r602_ts_promo_body_psg_jun08_msg_tx2"&gt;notebook&lt;/a&gt; that support gestures to zoom, manipulate and control a user interface.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Taskbar&lt;/strong&gt;: adding support for new taskbar features in Windows 7 such as jump lists, progress bars, icon overlays and custom thumbnails.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Libraries&lt;/strong&gt;: taking advantage of the new common file dialogs in Windows 7 that support the library model of virtualized views over multiple physical folders.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Sensors and Location: &lt;/strong&gt;new APIs that enable suitably-equipped machines to report ambient light, user proximity, accelerometers and even geographic location.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Direct2D, DirectWrite and Ribbon&lt;/strong&gt;: replacement libraries for 2D and text rendering as well as the Windows 7 ribbon control that is an evolution of the ribbon in Office 2007. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I could go on, but but perhaps I’ll save a more comprehensive list of new developer features for another blog post!&lt;/p&gt;  &lt;p&gt;There are two main kits you’ll want to download and install on your developer workstation to take advantage of Windows 7:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;The primary resource remains the &lt;a href="http://msdn.microsoft.com/en-us/windowsserver/bb980924.aspx"&gt;Windows SDK&lt;/a&gt; (available both as an &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=6db1f17f-5f1e-4e54-a331-c32285cdde0c&amp;amp;displaylang=en"&gt;ISO image&lt;/a&gt; and for &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=F75F2CA8-C1E4-4801-9281-2F5F28F12DBD&amp;amp;displaylang=en"&gt;web-based installation&lt;/a&gt;) – this provides headers and libraries, tools, documentation and samples for building for Windows 7 (as well as older releases). We’ve recently updated this to support the RC; although we’ll ship an updated version for the final release of Windows 7, this release is more than suitable for use for production development. You’ll find API reference documentation for all the features listed above, along with some new tools (such as a ribbon XML markup compiler). Most developers have a subset of the Windows SDK already installed as part of Visual Studio, but you’ll need to install this later build if you want to target new APIs in Windows 7.&lt;/li&gt;    &lt;li&gt;If you’re a .NET managed code developer, then you might be a little nervous of using the new Win32 COM-based interfaces and rather low-level samples included in the SDK. We’ve made great strides in Windows 7 to ensure that these interfaces are easier to consume from managed code, but nevertheless this can be somewhat daunting if you’re not acquainted with the COM interop libraries in .NET. The good news is that we’ve invested in building some great interop assemblies and helper classes to provide a seamless experience for .NET developing against Windows 7, and you can find the first fruits of this project in the &lt;a href="http://code.msdn.microsoft.com/WindowsAPICodePack/Release/ProjectReleases.aspx?ReleaseId=2636"&gt;Windows API Code Pack for .NET&lt;/a&gt;, available today from the MSDN Code Gallery. The current version includes support for many of the features listed above, with more coming both in future releases of the code pack and in a forthcoming release of the .NET Framework.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;It’s an exciting time to be a Windows developer: as we enter the home stretch for this release, I’m enjoying seeing examples of applications that build on the platform from the largest software development companies down to individual ‘cottage’ developers. What are you up to? &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9592510" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/tims/archive/tags/windows/">windows</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/ui/">ui</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/windows+7/">windows 7</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/sdk/">sdk</category><category domain="http://blogs.msdn.com/b/tims/archive/tags/tools/">tools</category></item></channel></rss>
