Wednesday, August 27, 2008
 
   
 
Welcome to my site

First let me say thanks for stopping by my site. My name is David Hanson-Graville and I am a IT consultant working in the UK. Let me make it clear, I am passionate about technology and specifically .net and its various forms. I've programmed in a range of langages, but I can say, I am now at my happiest when coding with c#. I hope my blog is an enjoyable & educational read and please feel free to email me at David.Hanson@OnTheBlog.net if you have any questions. 

Search Minimize
Print  
Archive Minimize
Print  
Dipstick Survey Minimize
What technology are you most excited about?











Submit Survey  View Results
Print  
Contact me Minimize
Print  
Silverlight News Minimize
silverlight - Google News
  1. The Mojave Experiment website gets a Silverlight revamp - Ars Technica

    Published Wed, 27 Aug 2008 16:26:19 GMT by
  2. Silverlight surfing - Broadband TV News

    Published Tue, 26 Aug 2008 16:31:42 GMT by
  3. Microsoft invests in Move Networks - C21Media

    Published Wed, 27 Aug 2008 11:30:37 GMT by
  4. Flash vs Silverlight in Olympics race - TechRadar.com

    Published Wed, 27 Aug 2008 10:28:20 GMT by
  5. Olympics set the stage for emerging Web tech fight - guardian.co.uk

    Published Fri, 22 Aug 2008 21:09:05 GMT by
  6. Looking At A different approach to AJAX / Silverlight front-ends - ITProPortal

    Published Tue, 26 Aug 2008 15:14:23 GMT by
  7. NBC Viewers Not So Into Silverlight - Wired News

    Published Fri, 22 Aug 2008 20:24:43 GMT by
  8. Microsoft Investment in Move Networks: How Silverlight and Move ... - Beet.TV

    Published Tue, 26 Aug 2008 00:45:03 GMT by
  9. Why the UK was Wrong to Ban the iPhone “Just the Internet” Ad! - the iPhone Blog

    Published Wed, 27 Aug 2008 21:03:09 GMT by
  10. RE[3]: Speeding up javascript is a hit to MS? - Newmobilecomputing.com

    Published Wed, 27 Aug 2008 12:25:08 GMT by
Print  
OnTheBlog Minimize
Author: David Hanson Created: Wed, 02 Jan 2008 20:28:49 GMT
All things .net, wpf, XAML, C#, Workflow Foundation and many more.

SQL Server: How to page query results
By David Hanson on Thu, 31 Jul 2008 17:20:11 GMT

The application I am working on at the moment has a large number of complex search screens that allow the user to define either very narrow or very broad query's. A great deal of effort has been spent in optimising the queries in order to ensure they are performant. However, if a user decided to execute a very broad query, the result set that could be returned could be many thousands of records. Let’s take a look at a broad query using this simple SQL.

Select  ID, Forename, Surname
 FROM         Person Where Surname like '%DA%'

In this query we want to return everything from our person table where the surname contains the letter “DA”. Running this query gives us the following 99 results. I’ve randomized the data in our person data for privacy reasons.

Now this query is running on some test data but on a live system it might return 20,000+ records. Transferring this data from our DB server to our application tier, then into business entities and serialising them via soap to our client is going to be demanding process. This is not going to be a particulary great idea, a better approach would be to return results in pages so that we can maintain a responsive UI and reduced long running network calls.

Taking this example further, we lets say that we would like our page sizes to be 5 records each. The first page will return record 1-5 and when the user clicks next we require records 6-10 to be displayed. In order for us to be able to achieve this functionality we need to implement an index on our result set so that we can locate a particular page of data within the full results. To do this SQL server provides a handy function called  which ROW_NUMBER()provides an incremental index for each record in our result set. If we implement the  ROW_NUMBER()as part of our results we can see the results below.

SELECT     ROW_NUMBER() OVER (ORDER BY (SELECT 1)) as [Index], ID, Forename, Surname
 FROM         Person Where Surname like '%DA%'

We can now see from executed query above that our results contain and INDEX column which uniquely identifies each row returned from our results. By adding this index to our results we now have a way of navigating batches of records within our results set.  To do this is not as simple as just adding a WHERE to our SQL statement, instead we must execute the full que ...

Comments (0) More...

Silverlight 2: Control Templating & The Visual State Manager - PART 2
By David Hanson on Mon, 28 Jul 2008 09:02:56 GMT
In my previous post we took a quick look at some of the support blend offers for skinning controls in Silverlight 2. Within only a few minutes we were able to take an existing textbox control and extend its visual tree using a custom template. In this post I plan to take our previous skinned control example further by implementing some simple animations. This is a good chance to check out the new VisualStateManager which greatly simplifies the development of animations in Silverlight.
 
For the basis of this tutorial we are going to extend our textbox template so that when a users places their mouse over the textbox the control will grow to make the text more readable. When the mouse leaves the textbox control the text will shrink again back to its normal “State”. It’s the word “State” here that really matters.
 
If you are observant and you haven’t moved all your panels around in blend, you may have noticed a new panel called states on the left hand side of your IDE. The states panel is a visual interface for managing the different states your control can be in. To help make this clearer, we can take a look at the control template for a button control (See previous post for how to do this in blend).
 

 
As you can see the standard Silverlight button control has a number of visual states that it can placed into. If we click on one of these states in the designer, our design surface will reflect what the look control will be in that state. As an example below, if we click on the disabled state we can see that the button looks greyed out.
 

 
What is important about the VisualStateManager is that it allows us to focus in a design centric way what each state looks like when the state is changed. In order to manage states more effectively you can see that Blend provides State Groups in which we can hold multiple visual states. We are not concerned with how we get to a particular state, we are just focused on the final look once we reach it. Some of the magic behind the VisualStateManager will be covered later.
 
So if we move back to our previous textbox example, we specified that we want the control to increase its size when a mouse rolls over the control and when the mouse leaves, the control should return to its original size. Given this, we know that our control can be in 1 of 2 states. Using blend, we are going to create a new state group and add two states to our control. Shown below.
 

 
Comments (0) More...

Silverlight 2: Control Templating & The Visual State Manager - PART 1
By David Hanson on Thu, 24 Jul 2008 21:48:24 GMT

In this blog I wanted to provide a simple overview of some of the features provided as part of the June 2.5 Blend preview  and Silverlight 2 Beta 2.  Two of the key features that have been made available as part of this release is the ability to easily template controls in order to create your own custom skins as well as the new Visual State Manager which helps aid int the development of animations.

So lets get started. The first thing we want to do is have a look at how easy it is to create custom templates for controls using the June preview of Blend. We are going to create a simple Silverlight Application using the default project template provided by Blend. (Shown below)

Once Blend has created our project we need to create some very simple XAML. As this example is going to be VERY simple all we need to do is drag a textbox onto our design surface. Below shows the XAML of our form once this has been done.

<UserControl
       x:Class="VSMDemo.Page"
       Width="640" Height="480">
 
       <Grid x:Name="LayoutRoot" Background="White" >
              <TextBox Height="23&qu ...
Comments (5) More...

RIA's and Search Engines 2.
By David Hanson on Wed, 02 Jul 2008 15:35:17 GMT

A while back I blogged about the the trend in web content being developed using  Rich Internet Application technolgies such as Flash & Silverlight. Previous Blog

Well an interesting announcement comes from Adobe which looks to address some of these issue going forward. Snippet below. Full article on business week here. Story.

"Flash, software, Adobe, Google, Yahoo, search engine, Web, Macromedia, photos, animationIf you're trawling the Web to buy a pair of Nikes, shop for a Volkswagen, or get a glimpse of Walt Disney's Wall-E, chances are you'll end up viewing graphics built with Adobe Systems' Flash software. Good luck finding them with a search engine, though. Turns out Google and other Web-search tools can't easily recognize pages laden with Flash-created images.

At least not yet. Adobe (ADBE) announced steps to solve those problems on July 1, providing Google (GOOG) and Yahoo! (YHOO) with software that will make pages inside Flash-powered sites show up higher in search results and infuse those results with more relevant details. Adobe's moves could persuade more consumers to visit its customers' sites and make Flash software more attractive to Web site developers. Adobe's agreements with the two biggest search engines on the Web is also a competitive slap at Microsoft (MSFT), which makes Web software that competes with Adobe's."

Comments (0)

Free Download Manager
By David Hanson on Sat, 21 Jun 2008 11:35:45 GMT

Over the last few weeks I have been using the following product found here (http://www.freedownloadmanager.org/features.htm) which provides some cool features for downloading. Since using it I am starting to get the most of out of my 20mbps cable connection. The reason is due to the fact that the when downloading, the software creates multiple HTTP connections to the file. Check this download speed for the Silverlight 2 Beta 2 tools. Awesome.

Great speed for downloads

Key features

  • Multiple HTTP connections for a single download (Make downloading ALOT faster)
  • Automatically resumes on broken connections
  • Torrent support
  • Media Previews for partially downloaded files
  • Download only certain files held in a zip file.
  • Download entire sites

Screen shot

Comments (0)

Cross-Platform DRM Support for Silverlight 2 Beta 2
By David Hanson on Sun, 08 Jun 2008 16:32:14 GMT

I was having a read through of the feature set for Silverlight 2 Beta 2. One of the items that instantly stood out for me was the fact that with Beta 2 Support for DRM (Digital Rights Management) has made it, and more importantly...........IT’S CROSS BROWSER AND CROSS PLATFORM! Now let me be clear on this, I am not a fan of DRM as I believe as a consumer I have the right to use the content I have paid for in anyway I choose. I’m not suggesting copying and passing on too friends is fairplay but I do feel I should be able to duplicate the media for all the devices in my home. That said, although I am not a fan of DRM personally, I can greet this news with optimism and here is why.

About 18 months ago I was working on a contract for Siemens who were developing the packaging and delivery of the BBC IPlayers content. This was interesting work and really opened my eyes to the amount of effort that must go into launching a platform like the IPlayer. 18 months ago none of us working on the project had any idea as to how successful the IPlayer would be, therefore the application was built with performance and scalability in mind. A good thing too given the way it panned out.

While working on the project, one area I felt was seriously lacking was the cross platform support. All content delivered via the VOD system is encrypted using Windows DRM. As the name suggest, the result that decision was that all content inevitably becomes locked into the windows platform. Therefore unless you’re on a windows platform, the IPlayer would be useless to you.

The BBC were not the only ones to adopt this approach, SKY, ITV and Channel 4 have all built their VOD platforms on the Kontiki P2P system using Windows DRM. So as a guy with a Mac (Yes I run windows vista on it) I could consider myself up shits creek! So the question is, why is this good news? It’s good news as whether we like it or not DRM is essential for large media conglomerate when it comes to delivering their content over the web. Whether we like it or not, I still cannot see them dropping it due to public demand. Therefore, with Silverlight providing the tools necessasary for cross-platform DRM, adaptable streaming and the ability to generate amazing RIA’s there are very little hurdles left to overcome.

I expect to see the BBC move this way as they have previously confirmed that Mac support was on their todo list. Also some of the demo’s from MIX07 with the BBC Radio 1 site delivered via Silverlight show the potential. I am hoping to have a play with the new Silverlight 2 Beta 2 features in the next few weeks so expect some posts then.

Comments (0)

Isle of Wight Festival and my technology addiction!
By David Hanson on Sat, 07 Jun 2008 17:37:29 GMT

I'm off to the Isle of Wight festival this week and as usual I have spent the weekend getting all the essentials together. I've got my tent dusted down, wellies, wet wipes beer and much more ready to go. However I am starting to think that I am a little to addicted. Here is a rundown of the gadgets i'm taking.

  • IPod Touch
  • ITrip
  • Stereo to transmit music from IPod too.
  • Solar Charger
  • Camera
  • Mobile Phone
  • Walkie Talkes
  • Windup torch
  • Smartphone

Something tells me I may need to lock my tent up!

Comments (0)

The power of Silverlight vectors
By David Hanson on Fri, 23 May 2008 10:58:53 GMT

As you probably know the power of WPF and its subset Silverlight is its ability to render images using vector graphics. I am not a graphic designer myself, I can usually get a decent design together but it’s usually more evolutionary rather than revolutionary.

As all images in vector graphics are expressed using mathematics they provide computers with some superior processing capabilities that are not possible with common binary formats. We can transform them, scale them, animate them to name just a few . However, with the advantages of having an image represented in mathematics, we also suffer with increased complexity when trying to create them from scratch.

With the current release of Silverlight, we have the power in the framework to represent near photo realistic images purely in vectors. Take for example the photo of me  shown below, this image, running in Silverlight, has been built using only vectors. You can see this running in Silverlight here.

Bad Mood

If we take a closer look at the structure of the eye, we can see that the complexity of the XAML path objects, which are the basic building blocks used to compose the image, are far beyond the capabilities of any human designer using tools such as Blend or Visual Studio.

The image was actually constructed using the cool site  vectormagic.com. On this site you can upload any photo and it will convert the image to vectors. This covered off the majority of the grunt work of converting the image into vectors.  VectorMagic offer you two free downloads in a range of formats.... but no XAML option. Therefore, I downloaded the file in Adobe Illustrator format, from there it was a simple process of exporting the image into XAML using Mike Swanson’s awesome AI-XAML converter.

Hope this quick example has helped illustrate the power of Silverlight’s graphical capabilities and gets you thinking about what other assets you could convert into XAML.

 

 

 

Comments (0)

.NET 3.5 SP1 & Visual Studio 2008 SP1 Beta released
By David Hanson on Tue, 13 May 2008 08:31:57 GMT

It seems .Net 3.5 SP1 and Visual Studio 2008 SP1 beta are now available from Microsoft for download. This release brings a number of fixes for hundreds of bugs that have been reported by customers.

This download installs Visual Studio 2008 SP1 Beta. Visual Studio 2008 SP1 includes support for SQL Server 2008, new ADO.NET features such as the Entity Framework, improvements to the WPF designers, WCF templates for Silverlight projects, debugger support for the .NET Framework public symbols and source release, control improvements such as the DataRepeater for Windows Forms and Office 2007 Ribbons for C++, and several general updates for debugging and IntelliSense. SP1 also enhances the stability, performance, and security of many features.
 
The included .NET Framework 3.5 Service Pack 1 adds many new features and fixes, including the following:
.NET Framework Client Release (“Arrowhead”)
·         ASP.NET Dynamic Data
·         ASP.NET Routing
·         ADO.NET Data Services
·         ADO.NET Entity Framework

I’m just hoping that it resolves the constant OutOfMemory exceptions I get when working with the WPF designer. You can find the downloads here.

Comments (0)

Oldest running code?
By David Hanson on Mon, 12 May 2008 09:08:03 GMT

Slashdot poses an interesting question asking what is the oldest code still running today. Of the 600+ comments so far I have cherry picked a few that I thought were good choices.

·         The software on the Voyager and Pioneer SpaceCraft 1977
·         Digital watches
·         Heavy machinery used from the late 50’s
·         Babbage Difference Engine (Currently running in the science museum London)
·         Worryingly – Air Traffic controls system code from the 60’s
·         DNA – At least 2 billion years old! J
 
 
But my personal favourite!
 
1 "Let there be light"
2 create universe()
3 while (1)
Comments (0)

Print