Tuesday, May 31, 2005


Improving XML performance with the LZO real time compression library

LZO is an impressive real time compression library. I got great performance improvements when compressing XML messages several years ago. The following graph shows the results on a 10Mb LAN with multiple clients using lzo 1.08:

The X-axis shows the different compression configurations. "Val 0" is the original code that does not use any compression. The other values show the results with different compression levels.:

  • 81: very fast but low compression

  • 111: standard compression

  • 982: high compression

I expected a performance improvement but the results impressed me:

  • it uses less cpu, since it does not have to manage a lot of large strings

  • drastic increase in transactions per second: it jumped from 35 to 140!

  • it uses less network bandwith (as the data is compressed)

LZO 2.0 has just been released. Real time compression of DataSets returned by WebServices will my first test case when the .NET bindings are released.

Thursday, May 26, 2005


Getting rid of the worst tasks on your to do list

I started reading “Getting Things Done” this month as an eBook on my Pocket PC. I completely agree with its main point: get the to do items of your mind as soon as possible and onto a trusted medium (i.e. the Pocket PC). I have done if for years (since I got my first PDA, a Palm Pro). It frees up the mind to work on more creative issues (a very important aspect if you are an architect) and in my case it makes me sleep better.

But, in the past I did two things wrong:

  1. Everything went into the to do list, even reference material that did not require any further action. As a result I passed 1.200 items in my task list :-(

  2. With a large to do list it is tempting to scan for the most “pleasant“ tasks to do

43 folders has some great tips for getting the worst items of your to do list that nicely complements Getting Things Done.

I tested it on some things that have been on my todo since Christmas. It wasn't fun to do the tasks, but it feels great to have them out of the way!

Friday, May 20, 2005


subText extends the life of .TEXT

It is great news that Phil Haack has forked the .TEXT code base and created subText and I cannot wait to try the first official release. I am sure Community Server is great, but I gave up upgrading and friends who have tried it went back to .TEXT. Several neat improvements are under development.

I had a look at the latest .TEXT code base when I got hit by comment spam earlier this year. It looks fairly different from the 0.95 version my site is currently running so I did not risk installing it. I ended up implementing a customized version of DB based .TEXT anti spam system using MT-blacklist..

There are several changes I will submit when I get around to explaining myself a bit better:

  • Built in, configurable, anti spam. The DB system I am using kills my poor MSDE. I have already improved the stored procedure but it can be made even smarter by only evaluating regular expressions when needed. It would be better to have support for anti spam in the front end though. Personally I don't see any need for anchors in comments. People may post URLs but they should not be rendered as anchors. People who want to follow the link can cut and paste but search engine crawlers will not follow them (I hope)

  • Fix broken links in RSS feeds in the source code instead of in the DB (either by default or by config)

  • Implement the missing hits/statistics page

  • Better "ping" support. At the moment it pings weblogs.com but there are tons more out there.


Tuesday, May 17, 2005


The latest add for Renault Scenic gives me flashbacks

The latest adds on TV for Renault Scenic plays Buddy Holly by Weezer in the background.

I will never forget that song or the video with scenes from Happy Days as it was on the Windows 95 CD. I played it countless times at full volume during the final rush for RTM while making nightly international builds of Windows 95.

You can view the video on the Weezer site

Monday, May 16, 2005


Blog Feed Overdose

I just had a serious blog feed overdose. Things have been busy at the home front so I have been collecting RSS feeds rather than reading. The result? 430, mostly unread, rss feeds in my bloglines account!

Time to do some spring tidying and get down to a manageable number of feeds. I have deleted most of the high traffic feeds with a high noise/value ratio and ended up with the following feeds in my "read first" category:

I still have 300 other feeds in various categories that I still have to deal with in my blogroll.


Mommy Microsoft will release OneCare

Windows OneCare will go in beta soon, but not after being tested on lab rats Microsoft employees first. OneCare includes:

  • Antivirus

  • A real two way firewall

  • Data backup/restore

If you feel lucky, you can even nominate yourself as a tester:

  • Sign in to BetaPlace

  • Use OneCare as the Guest ID (use the “Sign in as Guest“ link in the top level menu)

Via [B2Tblog]

Tuesday, May 10, 2005


Fix for broken images in .TEXT RSS feed

.TEXT replaces links to images on the local site (http://text2blogger.appspot.com/static/egilh/Images/something) with a relative urls (/blog/something). This is a feature in some scenarios as you can move the blog to a new domain without problems. It causes a problem for me though: some RSS readers are not smart enough to render images with relative links. The problem got worse after I moved my feeds to FeedBurner as my RSS feed http://feeds.feedburner.com/egilh uses relative urls to images (/blog/images/something). Some RSS readers use the link element in the RSS to correctly compose the url as http://www.egilh.com/blog/images but not all.

The links are changed before the post is insert in the DB. The latest .TEXT code base adds some new features like search, so recompiling it may add new problems. Luckily the RSS feed uses the stored procedure blog_GetConditionalEntries to extract the data so the issue can be fixed there.

I changed the stored procedure for RSS feeds (PostConfig=17). The text of the post is a text field so I could not use the tsql replace function :-( Converting to a varchar, and truncating at 8kb, is not nice as it may leave invalid XML so I had to do it the hard way:

  • Create a temporary table with the records we should return
  • Use UPDATETEXT to replace /blog/image with blog root + /blog/image
  • Return the data in the temporary table

Replace the existing blog_GetConditionalEntries stored procedure with this one after you have taken a backup to use fully qualified url to local images in .TEXT RSS feeds:

CREATE PROCEDURE blog_GetConditionalEntries
 @ItemCount int,
 @PostType int,
 @PostConfig int,
 @BlogID int

 @FindString varchar(8000),
 @ReplaceString varchar(8000),
 @TextPointer varbinary( 16 ) ,
 @DeleteLength int,
 @Offset int

IF @PostConfig = 17
 -- Insert the top ItemCount records into a temporary table
 set rowcount @ItemCount
 SELECT blog_Content.BlogID, blog_Content.[ID], blog_Content.Title, blog_Content.DateAdded, blog_Content.[Text],
  blog_Content.[Description], blog_Content.SourceUrl, blog_Content.PostType, blog_Content.Author,
  blog_Content.Email, blog_Content.SourceName, blog_Content.DateUpdated, blog_Content.TitleUrl,
  blog_Content.FeedBackCount, blog_Content.ParentID, Blog_Content.PostConfig, blog_Content.EntryName,
  Blog_Config.Host, Blog_Config.Application
 INTO #fixImageUrls
 FROM blog_Content inner join Blog_Config on (Blog_Content.BlogID = Blog_Config.BlogID)
blog_Content.PostType=@PostType and blog_Content.BlogID = @BlogID
  and blog_Content.PostConfig & @PostConfig = @PostConfig
 ORDER BY blog_Content.[dateadded] desc
 -- Construct the find and replace strings using the NAME and HOST of the blog
 SELECT TOP 1 @FindString = '"/' + Application + '/image', @ReplaceString  = '"
http://www.' +  Host + '/' + Application + '/image'
 FROM #fixImageUrls
 SET @DeleteLength = len( @FindString )
 SET @OffSet = 0
 -- Replace all the occurences of FindString with ReplaceString
 WHILE ( SELECT count( * )
  FROM #fixImageUrls
  WHERE patindex( '%' + @FindString + '%', [Text]) <> 0) > 0
  SELECT @TextPointer = textptr( [Text]), @OffSet = patindex( '%' + @FindString + '%', [Text]) - 1
  FROM #fixImageUrls
  WHERE patindex( '%' + @FindString + '%', [Text]) <> 0
  UPDATETEXT #fixImageUrls.[Text] @TextPointer @OffSet @DeleteLength @ReplaceString
 -- Return data and drop temp table
 SELECT * FROM #fixImageUrls
 DROP TABLE #fixImageUrls


 SET rowcount @ItemCount

 SELECT blog_Content.BlogID, blog_Content.[ID], blog_Content.Title, blog_Content.DateAdded, blog_Content.[Text], blog_Content.[Description],
  blog_Content.SourceUrl, blog_Content.PostType, blog_Content.Author, blog_Content.Email, blog_Content.SourceName, blog_Content.DateUpdated, blog_Content.TitleUrl,
  blog_Content.FeedBackCount, blog_Content.ParentID, Blog_Content.PostConfig, blog_Content.EntryName FROM blog_Content
blog_Content.PostType=@PostType and blog_Content.BlogID = @BlogID
  and blog_Content.PostConfig & @PostConfig = @PostConfig
 ORDER BY blog_Content.[dateadded] desc


Friday, May 6, 2005


Moving a .TEXT blog rss feed to FeedBurner

There are many benefits of using FeedBurner but the main reason I have moved my RSS feeds to FeedBurner is to free up some bandwidth. Please give me a shout if you have any problems with the new feeds.

I had a moment of panic when I did not find any RSS.aspx or atom.aspx files in my blog directory before I remembered that .TEXT uses HttpHandlers. Three steps later and my .TEXT RSS feed was moved to FeedBurner:

  1. Create two new files: rss.aspx and atom.aspx. Both of which should have this content:

    <%@ Language="C#" %>

    <%Response.Redirect ("http://feeds.feedburner.com/YOUR-ID-HERE");%>

  2. Modify Web.Config

    <HttpHandler pattern = "^(?:\/(\w|\s|\.)+\/rss\.aspx)$" type = "Dottext.Common.Syndication.RssHandler, Dottext.Common" handlerType = "Direct" />

    <HttpHandler pattern = "^(?:\/(\w|\s|\.)+\/atom\.aspx)$" type = "Dottext.Common.Syndication.AtomHandler, Dottext.Common" handlerType = "Direct" />

    <HttpHandler pattern = "^(?:\/(\w|\s|\.)+\/rssFeed\.aspx)$" type = "Dottext.Common.Syndication.RssHandler, Dottext.Common" handlerType = "Direct" />

    <HttpHandler pattern = "^(?:\/(\w|\s|\.)+\/atomFeed\.aspx)$" type = "Dottext.Common.Syndication.AtomHandler, Dottext.Common" handlerType = "Direct" />

  3. Modify your FeedBurner account, or create a new one, that points to yoursite/blog/rssFeed.aspx instead of yoursite/blog/rss.aspx


Thursday, May 5, 2005


Free eBooks: The Best of SQL Server Central

SQL Server Central gives away the the best, most read and most popular articles in eBook format. The Best Of SQL Server Central Vol 1 and The Best Of SQL Server Central Vol 2 cover a lot of issues that SQL Server developers and admins should know like design, performance, administration and security. It also covers "myths" like the Count(*) vs Count(column name)

...many people believe COUNT (columnname) is faster than using COUNT (*), because COUNT (*) would have to read all columns of each row (just like executing a SELECT * FROM MYTABLE statement), while COUNT (columnname) only need to read the specified column. This is not true though, for several reasons…

The Best of SQL Server Central has a lot of screenshots and source code like any good reference.

Via [Gianluca's Blog]


Free development eBooks from apress

apress gives away several free eBooks on development:

  • COM and .NET Interoperability

  • Programming VB .NET: A Guide For Experienced  Programmers

  • Dissecting a C# Application: Inside SharpDevelop

  • A Programmer's Introduction to PHP 4.0

  • Writing Perl Modules for CPAN

Via [Gianluca's Blog]


Regex Builder tool

The Regex Builder is a great help when you work with regular expressions. It evaluates the regular expression in real-time as you enter it, displays the matches and highlights the matching text:

Regex Builder v1.10 has several new features

  • expression matches are highlighted

  • support for Regular Expression XML files

  • you can run all or part of an expression

Tuesday, May 3, 2005


Worthless Microsoft Certifications

I have no doubt that a 9 year old passed a MCP exam. It does not surprise me one bit as I have worked with Microsoft Certified Solution Developers that were not able to write a simple for loop (note that I say developers)

Don't get me wrong: there are a lot of smart people with Microsoft certifications. But having a certification does not mean that someone is smart or knows how to do something. All it shows is that they remembered the answer to the majority of the test questions (or brought along the book).

Monday, May 2, 2005


Rain dance required

I try to keep up to day with what the different vendors have to offer for developing mobile applications. I was hoping to check out the Extend your applications to mobile devices web cast by IBM but I it looks like I will have a hard time logging in as I am a bad dancer:

The contents look pretty interesting though, so I hope I pass the rain dance required login without a web cam:

Giving the mobile enterprise easy and immediate access to information and applications is the key to improving productivity of the mobile workforce. Using standards-based middleware, IBM enables application developers to easily build rich disconnected client applications while leveraging prior investments in J2EE and Eclipse skills and application architectures

IBM Workplace Client Technology, Micro Edition (WCTME) is an integrated platform that provides the runtimes and tools to extend enterprise applications to a broad range of client devices such as desktop computers, laptops systems, personal digital assistants (PDAs), and other mobile and pervasive devices. By leveraging open standards and a new server managed client architecture which enables central management and provisioning of diverse clients, WCTME helps customers reduce risk and lower total cost of ownership.