OffBeatMammal

Searching for monkeys in Cyberspace

Silverlight Inplace Install

clock October 24, 2007 16:28 by author OffBeatMammal

I've been playing around with Silverlight again in the last few days (I know - coding rather than talking about things. It's going to do my reputation no good at all) and I wanted to do something a little neater than the basic workflow where the user is directed off to the Microsoft.com download page and has to go from there.

A quick search and I spotted Laurences article on using inplace (aka direct aka inline) install for the Silverlight control and that made for a much better user experience - the control could be put where I wanted it and the user didn't have to leave my page to install it.

That then left the little challenge of what happened after they'd installed the control. In Firefox because of the architecture you have to restart the browser to activate plug ins so there's nothing I could do about that, but in IE7 the control is usually available straight away. The problem was the page didn't know the control had been installed.

Luckily the Silverlight Javascript libraries include a test for the plug-in being present (and you can check the version number) which means it's a simple enough task to write some Javascript that loops around every 5 seconds or so and tests to see if the plug-in is there and when it is stop showing the install prompt and show the goodness that you were after in the first place.

You can download my very simple sample from here or see it in action here



Safari on Windows

clock June 11, 2007 19:27 by author OffBeatMammal

A few years ago I bought a Powerbook for one reason – to do compatibility testing of websites I was developing on the Mac.

Okay, so I was seduced by the dark side and still enjoy the occasional foray into their sleek and shiny hardware and (thanks to the likes of Parallels and Fusion) software … all without having to leave Vista for very long.

Now though Safari is available for Vista and at first glance it's good. On the first few sites I've visited rendering is mostly fine with performance maybe not quite as good as they claim but pretty swift.

I had one un-reproducible crash (but that's happened to me in IE and Firefox as well) and one XML DOM related error (that I clicked the "bug" button and reported. I love the "bug" button and wish MS would put it in all their products)

I wonder if they view iTunes and Safari as “teasers” for OSX… in which case I hope the Safari port has a lot more going in its favor than iTunes for Windows (that app does a good job of convincing me that Apple don’t know how to develop a good user experience!) and if it's going to help or hinder adoption of their new platform.

Alternatively Safari on Vista might just be a way to make sure PC developers can compatibility test their apps for the iPhone without having to buy a Mac...



Popfly - it's mashups for the rest of the world

clock June 1, 2007 03:52 by author OffBeatMammal

When I first heard about Popfly I didn't really grok it but now I've had a week or so to play with it and try to make sense of it... it's really cool.

Everyone talks about mashups and how they're changing the rules on the interweb... but too often it still means a lot of laborious programming and testing and delving through API documentation.

Yahoo! Pipes was supposed to make it all better, and if fact from a programmers perspective it's certainly made things easier.

Where Popfly really shines though (and I totally agree with Chris Pirillo on this) is that it makes mashups a totally graphical, drag'n'drop no-code experience that even I can get my head around....

15 mins after signing in I had my first mashup running (Virtual Earth showing the 5 latest Twitter posts updated every 30 seconds)

Once you've built a Popfly mashup you're not limited to running it on the Popfly site. You can embed it on your own site, or on Spaces or even download it as a Vista gadget.

Even at this very early alpha stage the capabilities of the basic no-code tool are pretty fantastic. Add to that the very simple coding language they've implemented and anyone who can code in JavaScript, PHP or VB/C# is going to have no problems extending this.

I can only imagine the power that's going to roll into here as the team add more blocks (wrappers for APIs or output/display mechanisms) and fine-tune the UI.

As an example of what Silverlight can do (itself still a product in development) it's even more impressive - a Microsoft team really eating our own dogfood (and finding that it tastes just fine!)



It's all about performance

clock May 19, 2007 05:24 by author OffBeatMammal

I've mentioned performance a couple of times before in the context of specific technologies (SQL Server and Javascript) but looking at a recent rebuild of a site I'd been involved in it occurred that there are a number of things that can affect performance that are easy to overlook yet can have fairly drastic results.

  • Make fewer HTTP requests
    Every roundtrip costs time. If you can bundle everything into a few requests it helps performance. Of course too much bundling (eg putting your javascript and CSS inline) doesn't always help long term (as it makes caching hard) so there's a balance.
    Combining Javascript and CSS files into fewer larger files can help, but if there's a lot of differing usage depending on the page or user type across the site consider dynamically combining and caching these (so you only have to work on the master files and let the server generate and deliver cachable specifics).
    On the homepage it might be worth having them inline, and also reference them (via an onload) as external scripts, so they're pre-cached for subsequent pages. If you set a cookie when the external files are loaded you can determine when the page is accessed if you should put the code inline or rely on external cache to speed things up. 
  • Reduce DNS lookups but maximize effective use of domains.
    Every time you have to do a DNS lookup to find a domain name it takes time that could be used to deliver content. If you include the full URL in every href then lots of DNS checks can occur. Most browsers cache these, but how many and for how long. Having lots of lookups required on the homepage can reduce the impression of performance. Flip side though is that most browsers will by default only make a certain number of requests of a given server, so you may be well served by splitting content over more than one domain name (but only 1 or 2... too many and the lookup overhead outweighs the value of the technique)
  • Use a CDN
    If your business relies on getting content to users and you can get that content intelligently cached and closer to the user, it's work paying a Content Distribution Network like Akamai to help. Some of the larger ISPs today with multiple data-centers can even offer a CDN capability without needing to use one of the big players. There are even free peer-to-peer CDNs like Coral available (and really easy to implement). Use tracert - count the number of hops to random users in your server logs... how far away (and how long a round trip) is you request/response reaching?
  • Make use of the Expires header
    You know how static your content is going to be. Tell the proxies, caches and users browser so it can make an informed decision. If they can cache an image forever... let them. You can always cache bust by changing the filename if you need to refresh something urgently. 
  • Put CSS at the top
    Ideally in the <head> where it will be loaded before the rest of the page. If you're not going inline use <LINK...> not @import. These tricks avoid the funky page flicker as the content loads and then the style gets applied.
  • Move JS to the bottom
    If you don't need it straight away get it out of the way. Parsing javascript will block the page rendering and so make things appear to run slower. If you need a function straight away define it in the <head> and call it with a <body onload="..."> but minimize what you put there
  • Avoid CSS expressions
    If the rendering engine has to do some heavy lifting before deciding what colour to make your text it's going to slow things down. Make it explicit and use rules when you're generating the page to select appropriate classes for content
  • Compress JS, CSS and HTML
    The less you send over the wire the better. Whitespace is not your friend in production (though helpful for debugging). I like the w3compiler from Port80 but there are many options out there (and for dynamic page generation I wrote some ASP code that compressed news stories to the bare bones). Most servers can also zip content on the fly (either on-demand or zip and cache for static content) so make sure it's enabled
  • Avoid redirects
    Put your content where you say it is. Every time a page or content item needs to go hunting it's a wasted round trip. Don't rely on the server to hunt for a document, point to it explicitly. Look through your server logs for 300 status codes - every one of them is a wasted round-trip
  • So... what should you do next?

    The biggest / easiest wins come from making sure your content is optimized - compressing and making sure your Javascript and CSS are cacheable (especially relevant in the JS rich world of Ajax apps) and referenced from the right part of the page. You can control that no matter how or where you're serving content.



    Silverlight in XULRunner

    clock May 17, 2007 06:00 by author OffBeatMammal

    Now I'm not sure if this is useful, or even clever but it seemed like a good idea at the time...

    There's a lot of words about the different RIA platforms at the moment and everyone has their own idea of what's going to do what and how it's going to do it - which is funny given they're all in alpha/beta right now and got a lot of evolution to go. Personally I like the goals and capabilities in Silverlight (but then again even though I'm a pragmatic evangelist - I'm biased!)

    One of the earliest frameworks out there was XULRunner (used in Firefox, Thunderbird, Songbird etc) - it supports applications designed in XUL (and XML markup language) and scripted with Javascript.....

    It reminded me of Silverlight. Now, although SIlverlight is browser based the philosophy appears to be complementary rather than competitive (I'm sure there must be a word that combines the essence of both. Update: This is. It's Coopetition!) so I started to wonder how well the two would play together....

    So I dived in feet first and dumped a sample project into a framework XULRunner project.

    Big fat zero :(

    The background appeared, but no Silverlight goodness. So time for debugging.

    First problem was the Silverlight browser check... it looks for "Firefox" in the UserAgent, and XULRunner returns a pretty sparse UA. Now I know I've seen somewhere that there's an option to override the US that XULRunner produces, but it was quicker to tweak the Silverlight.js to look for Gecko ;)

    That little hiccup out of the way, it still didn't want to load the external XAML, so the easiest approach was to drop it inline in the main source file.

    Success! The clock sample happily running in XULRunner :)

    Have a look at the sample SilverlightXUL project here (it assumes you have XULRunner already installed in the directory above where you unzip this sample - have a look at the .bat file to make sure the path is right)

    Okay, so it's cool... but does it help? It actually opens up a bunch of questions around what's actually possible

    • Can we embed a Silverlight control in the midst of XUL UI elements?
    • Can we fire events from the XUL layer into the Silverlight element and vice versa?
    • How do I fix the UserAgent string so the Silverlight detection works right?
    • How can I get the Silverlight control working with external and dynamic XAML
    • How can we make these two things place nice together to do some really cool stuff!

    So now I just need to find someone who knows XULrunner, and spend some more time experimenting with Silverlight in the framework ;)



    Fiddling with HTTP

    clock April 24, 2007 23:49 by author OffBeatMammal

    In my quest to find better ways to debug and understand what's going on with various sites I've tried a lot of tools and techniques, but at the end of the day it's the simple ones you keep coming back to.

    Fiddler is one of those really simple but powerful apps that fills a niche.

    Want to know what's really going on when your browser talks to the server? Care about the headers, the cookies, every byte in the request, the number of connections - all of which are important when debugging and performance tuning.

    Curious about what information your server is sharing without you knowing - vital when trying to lock a site down and not give crackers too much information that you don't have to share.

    Fiddler makes that job a lot easier.

    It's an HTTP Debugging Proxy which logs all HTTP traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP Traffic, set breakpoints, and "fiddle" with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language.

    Fiddler is freeware and can debug traffic from virtually any application, including Internet Explorer, Mozilla Firefox, Opera, and thousands more.

    And it's developed by a Microsoft employee and supported as an unsupported PowerTool (ie - use it entirely at your own risk!)



    Expression at MIX07

    clock March 20, 2007 20:19 by author OffBeatMammal

    Visit MIXSo, you already know that we're giving copies of Vista Ultimate to MIX07 attendees, and of course you'll get a chance to hear from both Microsoft folks and people from the real world about how the UX game is hotting up and delivering real benefits to developers, users and everyone else in the ecosystem.

    What you might not be aware of is the other half of the equation.... while we support developers with WPF/E, Ajax.asp.net and (of course) Visual Studio we also have tools aimed at designers

    Expression Studio includes Expression Web, Expression Blend™, Expression Design and Expression Media. Whether you are designing standards-based web sites, creating rich user experiences on the desktop, or managing digital assets and content, the professional design tools and innovative technologies in Expression give you the flexibility and freedom to bring your vision to reality.

    To reflect Microsoft's belief that Design is an essential part of the development process, all MIX07 attendees will receive a Commemorative Edition of Expression Studio, complete with the first version of Expression Studio and one-of-a-kind artwork (in addition to a copy of Windows Vista Ultimate!).

    Check out  www.visitmix.com for more details right now... tickets are going fast.

    I hope to see you there....



    RIA frameworks as gaming consoles

    clock March 19, 2007 23:44 by author OffBeatMammal

    I've been trying to get my head around the three most interesting players on the Rich Internet Application front, and in a conversation today a really good analogy surfaced. Compare them to game consoles.

    So, who are the players:

    First comes XulRunner from the Mozilla foundation. This often overlooked environment is ticking along quite quietly but gaining quite a following out there. Unlike it's two main competitors it's actually got some real world applications built with it (even though, like the other two it won't be at a production release until the end of the year). Open and fairly approachable it's got a lot going for it.

    Next if Apollo from Adobe. This all singing, all dancing behemoth builds on the underpinnings and learnings of Flash, ColdFusion, Flex and Photoshop. Sadly it's legacy may make it rather hard (and expensive) to develop with.

    Third contender in the ring is WPF/E (Codename) from Microsoft. Surprisingly given it's parents track record this is probably the easiest of the three to get started with. Cross browser and platform support, an open object model that's addressable from Javascript in the browser (it's as easy to work with as the basic browser DOM) and an XML based vector markup language (XAML) that shares a lot of heritage and maturity from it's Windows only cousin WPF.

    Just discovered a fourth entrant worth having a look at. Dekoh is a Java ased platform supporting everything from JSP to ASP.NET to Flash on Windows, OSX and Linux. It's free and Open Source.

    So ... what consoles do these guys match up to, and why (and I expect the fanbois to abuse me over some of these) .

    XulRunner has to be a Wii - it's lightweight but surprisingly powerful and a real underground hit because of its no-nonsense all-round solid performance.

    Apollo is, IMO, the PS3 of the space. It will probably look great but it's expensive and some would say over-engineered. The barriers to entry (from a developer perspective) are high and the legacy of some of its components (Flex for instance) raise some questions about how much fun it's going to be.

    WPF/E is, almost by default, the Xbox360. Popular, great capabilities, fairly approachable (eg with the arrival of XNA the Xbox became the most open of the consoles. In a similar manner the open XAML based model of WPF/E makes development easy).

    Dekoh is harder to pick a platform to compare it to but I think given the portability and wide range of options but I think it's closest match is to the DS Lite. Fairly frill and pretension free but ballsy enough to do well in the game..

    Oh okay, so maybe there's a fifth but Java, like the Atari 2600, while ground breaking at the time is no longer state of the art or fun to develop for.

    Wonder what RIA platforms would be if they were cars....



    I made a Gadget!

    clock March 1, 2007 08:18 by author OffBeatMammal

    As part of the learning curve in my new gig I decided this week to build a gadget.

    So in between everything else I've got on my plate at the moment I picked a collection of buzzwords and technologies and decided to wrap them all up into one gadget.

    So...

    • it's a Vista Sidebar gadget
    • It consumes an RSS feed (defaults to the Technorati WPF/E feed but you can over-ride that)
    • It uses Ajax functionality (okay, the xmlhttp object) to periodically refresh the feed
    • It's primary display technology is WPF/E (so you'll need the WPF/E runtime installed)
    • It's got a flyout (that closes automatically after 6 seconds)
    • It works docked and un-docked

    It's not very pretty (I'm not a designer after all!) but it was an interesting first experiment. There's still a bunch of rough edges and further tweaks that it needs when I have the time:

    • Some mouse-over effects on the title list
    • Use WPF/E to display the flyout content
    • Allow the refresh time to be customized
    • Allow the number of items returned to be customized (at the moment displays everything it gets)
    • Make it look prettier!

    As a learning exercise it was great. Combining WPF/E and Gadget technology is pretty much a no-brainer (WPF/E at the moment can only access items in the Gadget file, no external assets) - there's nothing mysterious in gadget building... it's just HTML, JavaScript (with a few extra properties to control the gadget settings and layout) and one XML file to define the assets.

    Oh, and you can download it from here if you want to have a play...



    WPF/E delivered from an Ad Server

    clock January 18, 2007 05:59 by author OffBeatMammal

    The third little challenge in my self-set WPF/E niche was to see if it was possible to deliver an all-singing all-dancing WPF/E experience from an ad server to a page that had no WPF/E code in it at all.

    Well, this turned out to be a little harder than the earlier video re-sizer and overlay samples but again like both it turns out that WPF/E is really fun to work with - doesn't matter if you're hacking code in Notepad or working in a full Visual Studio environment (and don't forget the free Visual Studio Express) it's quick and easy.

    Remember, this is only the first technology preview of WPF/E with a lot more goodness to come! More functionality, performance, stability will only make these things easier.

    If you want to see this (and the other samples) full screen you can open them in their own window.



    Calendar

    <<  August 2008  >>
    MoTuWeThFrSaSu
    28293031123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    View posts in large calendar

    Sign in