Monday, October 29, 2007

LOLCatz has LOLCodez nowzz

lolcatsxkcdIf you haven't yet seen Lolcats (lolcats.com) or icanhascheezburger.com, consider yourself lucky that your brain has not been infected (don't visit those url's!).

If you're not so lucky (or infected so badly you can't admit your addiction), a new programming language has been developed by analyzing lolcats speak: LOLCode.net.  LOLCode.NET utilizes the .NET Runtime and can even be debugged in Visual Studio.

You always wanted to write the following code and have it run, right?

IM IN YR LOOP
VISIBLE COUNTER
I HAS A DIFFERENCE
LOL DIFFERENCE R COUNTER NERF MINIMUM
IZ MINIMUM UP DIFFERENCE LIEK MAXIMUM OVAR 2
YARLY
VISIBLE "Half way there" NOWAI
I HAS A NEXT COUNTER TIEMZD NEXTCOUNTER!!2
KTHX
[....]

Comic from xcd:  http://www.xkcd.com/262/

Evidence based scheduling

FogBugz (lead by famous blogger Joel Spolsky) just released version 6.0.  With it they are making waves due to the inclusion of evidence based scheduling.

Evidence based scheduling tracks developer estimates per feature against actual time spent (including interruption time) to determine estimate accuracy and plot a distribution curve of likelihood of shipping software on time. 

My question is:  how can we leverage this type of mechanism at a  company that does many, many small projects?  Are the projects similar enough that this would help?  Could each project be treated as a sprint (or sprints) in an overall continued effort?

Read this post for an overview of evidence based scheduling:

http://www.joelonsoftware.com/items/2007/10/26.html

Read some reactions to the feature:

http://www.joelonsoftware.com/items/2007/10/29.html

SubSonic (MS sponsors open source)

Rob Conery of SubSonic famehas just joined on with Microsoft (http://blog.wekeroad.com/2007/10/26/microsoft-subsonic-and-me/).

This is very interesting as he will continue to work on SubSonic, and SubSonic will continue to be open source.

Also it appears SubSonic will be deeply integrated in the new MVC framework that's been announced.

 

What are you thinking about SubSonic?

Monday, October 22, 2007

Silverlight building steam

Silverlight is an incredibly interesting direction for teams building web applications, especially those with .NET skill sets already in place.

This site: http://silverlight.net/showcase/Default.aspx now is live, hosting some of the cool new work being done in silverlight.

The Home Shopping Network is actually innovating - they are offering video streaming via Silverlight, but overlaying controls on the video for the user to easily jump into ordering.  For example clicking the "buy" button takes the user to the product purchase page with all the details of what they were just watching filled out.

Silverlight is enabling this by allowing meta data to be carried with the video (including timeline based metadata) and UI controls that can integrate and utilize the meta data, including overlapping and interacting with the video.

Very cool.

Configuration Tool for CCNET.Config

This looks like it has some potential to make setting up projects on cruisecontrol faster and easier:

http://ccnetconfig.org/gallery/117.aspx

Thursday, September 27, 2007

Javascript variance in mouseclick events

You probably think that capturing mouse-click events in javascript would be a pretty easy, standardized thing these days. But personal experience has proven this not to be the case, and led to finding this excellent article about the difficulties of mouse-click events in a number of browsers. http://unixpapa.com/js/mouse.html (*note no mouse click events were harmed in the creation of this post)

Tuesday, September 25, 2007

URL rewriting

In the past I linked to an article on URL rewriting and how to do it.  This past weekend I finally modified my personal web site to use URL Rewriting.

 

I tried a couple different methods of URL Rewriting and finally settled in with http://www.urlrewriting.net as the documentation was good and the implementation fit my needs.

Essentially all that was required was to drop the urlrewriting.dll into my bin directory (adding it as a reference for my website) and adding rewriting rules to my web.config.

 

The power is in adding rewriting rules to the web.config.

You create the functionality you want as query string variables, and then create a rewriting rule.  The rewriting rule defines a regular expression of the "to be" URL and how it maps to the real url.

For example:  I am using an imagehandler.ashx file to resize images on the fly.  It takes query string parameters:

dir: the subdirectory of my pictures directory to use

file: the picture in that directory to use

width (optional): how wide to make the output picture

height (optional): how tall to make the output picture

This results in a url like this:

http://www.jessandrob.com/imagehandler.ashx?dir=Alberta-Aug-2007&file=DSC00105&width=800&height=600

Which clearly isn't to friendly.

After adding the reference I added this to the web config:

<urlrewritingnet xmlns="http://www.urlrewriting.net/schemas/config/2006/07">

<rewrites>
<add name="picture_web" 
ignorecase="true"
virtualurl="^~/gallery/web/([\d\w\s\-]*)/([\d\w\s\-]*).aspx"
destinationurl="~/ImageHandler.ashx?Path=$1&amp;File=$2.jpg&amp;width=800&amp;height=600"
rewriteurlparameter="ExcludeFromClientQueryString" />
</rewrites>
</urlrewritingnet>

After this the url becomes:

http://www.jessandrob.com/gallery/web/Alberta-Aug-2007/DSC00105.aspx

 

You can see my regular expression is matching digits, letters, whitespace, and dashes for both the directory name and the file name, and they are passed to the query string as "$1" and "$2" per standard Regex notation.

Notice its .aspx instead of .jpg - this seems to be a limitation of IIS.  using ".JPG" actually works in the Visual Studio built in web server but fails in IIS - that's something I'll have to look into in the future.

Yes its that simple.  I repeated the process for a couple other dynamic pages.

The one thing that did effect me a bit was URL's on the rewritten pages - you'll notice that the rewritten pages are deeper directory wise than the original - this is my design choice.  This caused issues on the pages mapping relative urls - specifically I needed to utilize the ASP.NET "~" operator and have the url as runat=server (this was ASP.NET figures out the relative url for me).  Where this isn't possible I have to manage the urls a bit more manually.