Monday, February 16, 2009

Adding a Canonical Link Element in ASP.NET

Google, Microsoft and Yahoo announced support for a new "canonical" link element in the header of a page that will help clean-up duplicate url's that have been indexed from your site.

The canonical link for this page, for example, would be:

<link rel="canonical" href="http://guyellisrocks.com/coding/adding-a-canonical-link-element-in-asp-net/">

To add this link tag to your header tag programatically using C# add the following to your Page_Load() function:

        protected void Page_Load(object sender, EventArgs e)
        {
            HtmlLink link = new HtmlLink();
            link.Attributes.Add("rel", "canonical");
            link.Attributes.Add("href", "http://guyellisrocks.com/coding/adding-a-canonical-link-element-in-asp-net/");
            this.Header.Controls.Add(link);
        }

 

Friday, February 6, 2009

Why Silverlight is the Future

Rockford Lhotka wrote a good post post yesterday Why Silverlight is the Future.

I'm a Silverlight fan and agree with him. The sheer volume of .NET developers alone make Silverlight a highly likely candidate for success.

One thing that he didn't mention and that I think will push Silverlight to mass acceptance is that it will, at some point in the future, be hostable on mobile devices. Silverlight is just a control (or collection of controls) on a web page. The browser, and the Silverilght runtime/VM host the control. So mobile devices only need a host for Silverlight and then Silverlight will become ubiquitous.

Will Moonlight 2.0 be that host for most mobile devices?

Neil McAllister wrote yesterday The case for supporting and using Mono in which he says:

There's no need to code in C++ for Windows and Objective-C for the Mac -- the same project can be built for either platform from the same C# and JavaScript sources.

And that's the crux of it.

Wednesday, February 4, 2009

Training a text classifier

When writing a text classification system you need to train it. Typically you have a corpus of good data that has been accurately pre-classified and this is what you throw at the system while it is learning the classification.

I came up with what I thought was a good analogy for an untrained text classifier: A genius amnesic. i.e. someone who initially knows nothing but learns lightening fast.

Ultimate Dogfooding

Visual Studio 2010 (VS2010) is being re-written using Windows Presentation Foundation (WPF). I was just listening to Scott Hanselman's 165th podcast in which he interviews Noah Richards about the editor in VS2010. What impresses me is that they're building VS2010 using VS2010. I can only assume that the first couple of builds of VS2010 were done with VS2008 and then I guess that once they had a working version they switched.

This must be the ultimate dogfooding exercise. Building a product using the product.

Tuesday, February 3, 2009

Text Classification References

I'm currently working on a text classification system. This is requiring a fair amount of research and background reading so I'm going to create a list of references that I'm using:

A Plan for Spam by Paul Graham

Better Bayesian Filtering by Paul Graham

Bayesian Filtering: Beyond Binary Classification [PDF] by Ben Kamens

Ending Spam: Bayesian Content Filtering and the Art of Statistical Language Classification by Jonathan Zdziarski

CRM114 Discriminator by Bill Yerazunis

A free online Bayesian Classification service that I recently found and tried is called uClassify. I found that it was remarkably accurate and contacted the owner and exchanged some emails with him. Unfortunately he uses a proprietary data store that he bundles as part of the commercial package that he sells which makes his product unscalable and impossible to fail-over. Hopefully one day he'll move the datastore so something like SQL Server to make this product more usable by more people.