# Saturday, 21 April 2007

When I first saw WPF/e in action, a thought ran through my head "Cool, this is MS's Flash like rich UI strategy where I'd be designing in XAML and coding the logic in any .NET language"

Now that WPF/e has been revealed as Silverlight, I've finally managed to sit down and take a closer look at it. And after my run throught the quick start and the various examples on the net, I realized something... Silverlight is NOT a Flash killer. Silverlight is not meant to be what Macromedia Adobe Flash is, Flash is an entire mini application platform (and a pretty nifty one at that) But Silverlight isn't that, Silverlight is more of a PRESENTATION technology than an entire platform. It doesn't even come with it's own script interpreter, all the logic is coded in Javascript (DAMN! I really really thought I could get away with .Net on this one) and the Silverlight plugin basically just handles the displaying of data.

This is exciting to me as a developer because now I have access to a rich presentation framework that I didn't have access to before (cause I didnt have time to polish up my Flash/ActionScript skills)

Confused as to why this is the case? Picture this scenario (ok.. I'd love to actually MAKE out the demo, but I've just started out here, so give me a break) Let's say I wanted to make one of those snazzy bar graph animations, say a list of mobile phones sold grouped by phone manufacturer. I want the bars to start extending from 0 to their values, and each bar to fade in following the complete extension of the previous one.

This animation is ridiculously simple to achieve in Flash, but the question is.. what if the data is not static? What if the data is supposed to come from a dynamic server generated source? Ah.. yes.. we can just use Flash's capability of performing HTTP GETs to a server page and grab a CSV file containing the values! But then what if the data is complex? We could probably just use XML to represent then data, and then walk through it with Flash's DOM explorer. But then.. here comes a huge problem, your Flash designer with his l33t actionscript skills doesn't understand the concept of how XML files work, he can't grasp the concept of an XML Element, Attribute, etc. etc. As a developer we'd waste time trying to hammer out a way to paste data to the Flash designer, while the Flash designer tries to work out how to read our data.

How does this change with Silverlight? First the designer will create the template of the animation  (he'll be DESIGNING which is what he's good at.) And then the developer will take the XAML which he generated and then using the template the developer creates an ASP.Net file capable of generating the full XAML of the graph and displaying it on a page (the developer will be CODING which is what he's good at.)

It's not that this kind of server side generation of rich animation like content wasn't available previously, Adobe has a product called FLEX which essentially (if I remember correctly) allows you to generate Flash files with server side backend code. Silverlight essentially opens the door of rich content generation to the other developers out there, without having to buy another server, or application platform.

Why did I mention OTHER developers instead of Microsoft technology based developers? As I mentioned, Silverlight is a PRESENTATION plugin, it reads and displays XAML, and all logic for client side interactivity is in Javascript (the language of choice for web client side interactivity coding... damn I miss VBScript.. curse those ;s!) So you don't have to be using ASP.Net to take advantage of Silverlight, you can use anything you like.. PHP, Java, PYTHON anything as long as you can deliver the XAML to the plugin.

There are still some hurdles that need to be jumped through first though, the main one being...

There Aren't Any XAML Editors Out There That Supports Silverlight Yet!

There isn't any *official* way to create the loose XAML files that Silverlight uses yet, you can probably rely on tools that create XAMLs for use with WPF, but there might be issues since there are certain extensions in WPF XAML files which aren't used in Silverlight. The current version of Microsoft Expression Blend which is THE application to create XAML with doesn't yet support Silverlight files, but with some slight tweaks I was able to use it to make XAML files suitable for Silverlight so I do believe that it's quite possible that Expression Blend will be released with support for Silverlight files.

Can't display HTML styled formating in it's textblocks

One really sad thing is that the text block doesn't support text that is HTML formatted, I don't mean anything like ACTUAL HTML formatting, I just want the <b>,<i> and <a> tags to work that would be super useful. Flash has this feature though, which is cool.

No Intellisense For Client-Side Scripting in VS2k5

Yes.. it's not essentlal.. but hey it'd be a VERY welcomed addition!

An end user probably wouldn't see what the big fuss about Silverlight is about other than MS trying to knock Flash off, but to developers who understand what can be done with Silverlight the possibilities are astounding. I personally can't wait to put Silverlight and Atlas together and take them out for a spin!


Saturday, 21 April 2007 08:45:40 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Thursday, 19 April 2007

As I was mucking around MSDN a few days ago I came across the article "Data Storage Architecture with SQL Server 2005 Compact Edition" It was essentially talking about where you could use the ever nifty SQL2k5CE. It also mentioned that you could use it with websites, something which I read from the SQL2k5CE Books Online that it wasn't supported. But the golden line in the article was this

If you choose to use SSCE for Web applications, some configuration is required to allow SSCE to be hosted in the Web application process.

I quickly rummaged through the documentation for SQL2k5CE more carefully this time, and I found this:-

AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", true)

Aaaa.. the magic key! My eyes must have glazed over the paragraph the moment I read the part about ASP.Net not being a SUPPORTED host for SQL2k5CE. Essentially all you need to do is throw that line in your Application_OnStart event of your Global.asax file and you'll be able to use it in your ASP.Net application.

Wonder how performance is though, since the article mentions that SQL2k5CE should only be used on websites with a low performance of oh... <300~500 request an HOUR. I guess that would mean most personal websites that dont get slashdotted! ;)


Thursday, 19 April 2007 10:03:25 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Tuesday, 17 April 2007

TNB cut power to my house for the WHOLE morning!! And because the fans, didn't work, and there was no lights at all... my mother couldn't really put WZ in the mosquito tent which is hot cause it has poor air flow. As I was on the way home my wife calls me and sounded very distraught...

And I came home to see this...

WZ's right arm was RAVAGED by mosquitos!!! There were also bites on his head, and some on his leg, but his arm was definetly the worse affected. I ran out and got some more mosquito repellant and killing devices!


Tuesday, 17 April 2007 23:30:29 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [1]  | 
# Monday, 16 April 2007

I learnt a few things following yesterday's power failure incident.

  • I need a new battery for the UPS which is connected to my modem and router, darn thing only lasted 30 mins last night.
  • Get a USB powered fan, preferdably one that has a stand so I can use it to cool WZ.
  • Get one of those shake powered flashlights, preferdably the original Forever Flashlight.

Monday, 16 April 2007 11:15:12 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Sunday, 15 April 2007

Phew... luckily power is back already.. phwer


Sunday, 15 April 2007 22:10:54 (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  |