Friday, October 03, 2008

I’ll slowly try to start blogging again :)  It’s been extremely hectic, and I am slowly ramping up. Lately I’ve not been blogging or been just scribbling non-technical jibberish here. Let’s get back on the train!

Loading assemblies in Silverlight can be a bit hard because everything is packaged up in a Xap file. If you want to get to all the assemblies and start instantiating types, you’ll quickly run into a wall.

However, Windows is about living without walls, and thus there is a workaround! :)

  0    string assemblyname = "System.Windows.Controls";
  1
  2    AssemblyPart part = Deployment.Current.Parts.SingleOrDefault(asmpart => asmpart.GetValue(FrameworkElement.NameProperty).ToString() == assemblyname);
  3
  4    StreamResourceInfo streamInfo = Application.GetResourceStream(new Uri(part.Source, UriKind.Relative));
  5    Assembly asm = part.Load(streamInfo.Stream);
  6

It appears there is a very nice class available: Deployment. It is a list of the deployment section of your App.Manifest. The manifest describes all the ‘DeploymentParts’ in the Xap file. It thus also describes the filenames of the dll’s that are included.

If you know the dll name, that is great, and you can easily load it; skip to line 4.
In my case, I just had the assembly name (which does not mean I have the dll name) and on line 2 you can see me running through the parts that are available to me. The x:Name in the deployment file is the name of my assembly, so I get to it by using the DependencyProperty system: querying for the FrameworkElement.NameProperty.

Once I have an assembly part, I have the actual filename: part.Source. So, on line 4, I can now setup a stream to it, and on line 5 I can easily load my assembly.

From this point on, I can do everything you would expect.

Happy sailing!

Friday, October 03, 2008 7:55:38 AM (Romance Standard Time, UTC+01:00)  #    Comments [12]  |  Trackback
 Sunday, August 31, 2008

I’m kind of a tool freak, and when mouse gestures were added in some browsers, I really felt they added value.
I was interested in using gestures in more applications (like Visual Studio) and found the tool ‘StrokeIt’. It is a great tool, fast, accurate, highly configurable and when I introduce it to team members they tend to giggle. So that’s all cool.

However, it does not work well with UAC and X64, much to the dismay of many users on the strokeIt forums. The tool hasn’t been updated since 2005, so that does not bode well.

Now I have found gMote and it is everything I could ever ask for (well, except for a more fun name).
It works very well and has a very nice workflow for defining gestures and assigning tasks for it. I already setup gestures for navigating tabs, paging up and down, minimizing windows and closing tabs/windows.

One tip: I used to use the right mouse button to draw gestures, but that seems to work less reliable. Instead, I now use the middle mouse button.

Go and download gMote now! I couldn’t be happier.

Sunday, August 31, 2008 7:25:56 PM (Romance Standard Time, UTC+01:00)  #    Comments [0]  |  Trackback
 Thursday, August 28, 2008

I installed IE8 beta 2 yesterday and it rocks. It is much faster than IE7, seems rock stable (fingers crossed) and has all kind of nifty new features. It has taken away my need for Firefox at the moment.

In FF I had a button that allowed me to subscribe to a blog in google reader and it works in Internet explorer as well:

javascript:var%20b=document.body;var%20GR________bookmarklet_domain='http://www.google.com';if(b&&!document.xmlVersion){void(z=document.createElement('script'));void(z.src='http://www.google.com/reader/ui/subscribe-bookmarklet.js');void(b.appendChild(z));}else{location='http://www.google.com/reader/view/feed/'+encodeURIComponent(location.href)}

Basically, you can navigate to a page with a blog in it and just press this bookmark. It will open up reader and it will show you the feed it finds.

But, given those cool accelerators in IE8, I thought it would be a nice exercise to create an accelerator that I can click when I am on a blog.
Here it is:

<?xml version="1.0" encoding="UTF-8"?>
<os:openServiceDescription
    xmlns:os="http://www.microsoft.com/schemas/openservicedescription/1.0">
    <os:homepageUrl>http://www.google.com</os:homepageUrl>
    <os:display>
        <os:name>Subscribe to rss feed </os:name>
        <os:description>View the feed in google reader</os:description>
    </os:display>
    <os:activity category="Blog">
        <os:activityAction context="document">
            <os:execute action="http://www.google.com/reader/view/feed/{documentUrl}" method="get">
            </os:execute>
        </os:activityAction>
    </os:activity>
</os:openServiceDescription>

Since the accelerator api will not recognize an url like this: http://www.sitechno.com/Blog/SyndicationService.asmx/GetRss as a ‘Link’, I had to use the document context. When you install this accelerator, you can navigate to the actual feed and then rightclick anywhere in the page. There should be an option to ‘subscribe to rss feed’ and hitting that will take you to google.

These accelerators have potential: it was very simple to write this and it is well integrated into IE. I hope they extend it so we can get accelerators to work on more ‘stuff’!

Install googlereader subscription accelerator

Thursday, August 28, 2008 8:09:13 PM (Romance Standard Time, UTC+01:00)  #    Comments [7]  |  Trackback
 Wednesday, August 27, 2008

[intended public is not the silverlight guru’s, but rather my friends and others that do not understand the coming of a new web :) ]

As I am preparing for our adventure in Canada, I’m meeting up with loads of old friends to have ‘one last beer’. That always seems to take place in my local Irish Pub, where I have spent way too many nights drinking their lovely Irish Red beer. I prefer it to Guinness, although it was quite nice to visit the Guinness factory in Dublin…

But I digress.

The discussion of the evening always, at some point in time, touches on Silverlight and how I think the web will change because of it. It’s quite a good feeling for me to see that I get all jazzed up talking about it :)
The current reigning web technology is obviously html. It has been king ever since the first webbrowser was introduced and for good reason. It is multi-platform, fast, easy to deploy and well-understood. Most importantly, it is stateless.

However, it can not compete against a desktop application when judged on UI richness and interactivity. Now, I am not talking about a simple mail-client or an rss-reader, but I’m talking about a big client application where quite a bit of information is processed. Is a stateless architecture appropriate for such an application?
No, it is not.

To be more exact: a large part of the application would be best to run on the client, where it can cache data and do processing. That application could (should) still talk to a back-end in a stateless manner.

The html-world has been working hard to ‘fake’ interactivity and has done so remarkably well. However, they will always be fighting against a technology which just wasn’t created to support the scenario’s they are trying to accomplish.

With the introduction of AIR, Flex and Silverlight 2, the kind of scenario’s I am envisioning are becoming a real possibility. It is now possible to create an application that is as rich as a desktop application, without all the hassle of deployment.
But, and this is what amazes me most, many of my friends don’t ‘get’ it. Ouch!! They fail to see how a RIA could do much better than a html based application. It is curious to me how we now all have a powerful desktop computer, and are still using it as a terminal. And even liking it!!

There are things html is perfect for: bringing text and even images in a nice layout. But that’s about it. Asp.Net, Ruby, Php and the lot, are all trying to add programmability to html. Since that is not what html is designed for, they have to process on the server. This model is slow and wasteful.

The only way it seems to really show people how a different web could look like, take a look at the work of thirteen23. Here they show a few different designs of how facebook could look like. It only shows off some nice visuals, so take a look at the incredible photosynth application.
My all time favorite in showing people what the world could look like is still the microsoft health patient journey demonstrator. If that doesn’t make it ‘click’ for you, check out another demo of woodgrove financial or a different way of browsing amazon.

The next few months or years, html will still be king. But it is inevitable that the web will transition towards the richness the new technologies are able to offer. I’m looking forward to seeing that happen and I hope that the current batch of html/ruby/asp.net/jscript/whatever developers are not missing out on the incredible opportunities it presents.

Wednesday, August 27, 2008 1:36:18 PM (Romance Standard Time, UTC+01:00)  #    Comments [8]  |  Trackback