Thursday, May 12, 2011

XQuery Katas

After having several MarkLogic projects back-to-back, I haven't had a new one in far too long. So, to practice my XQuery in the hopes of having a new one soon, I've started a collection of XQuery katas.

The intent of these is less TDD and more brushing up on XQuery, but I'm also interested in testing my functions. To that end you'll see I have my tests built using:
  1. Visual Studio
  2. NUnit
  3. Saxon HE
Meager, but it suits my current needs.

My first kata is up now on BitBucket and I've gotten some constructive feedback from the xquery-talk mailing list. I hope to add more over the next few weeks.

Getting Capabilities from WURFL in ASP.NET

This is one of those things that took me a little too much time to find the first time around.

I'm using WURFL with 51Degrees for mobile device detection in an ASP.NET MVC application. I needed to also detect whether the device using the app is a tablet or not. WUFL has the "is_tablet" capability defined, but this is not a default property on the Browser object.

So how do you get at the value for the current request? It's pretty simple once you see it: