May 2010 Blog Posts

My current CI setup

I was asked by email what my current CI setup is, and did I have a blog post about it.  Um, actually, no.  Oops.  So, here it is.  As always, it's a work in process, and there are lots of unfinished rough edges.  It's also got some phenomenally cool stuff too  Thus, without further ado, my current setup for Continuous Integration: CruiseControl.NET which runs on SVN commit that runs an NAnt build script which runs: - MSBuild on one or more solutions - aspnet_compiler.exe on all the websites (to validate the code in the markup) - Use YUI Compressor to compress CSS files and...

.IsNullOrEmpty() for List and Dictionary

string.IsNullOrEmpty() in C# for strings is awesome.  I pass in a string, it tells me if it was null or blank.  Pre-trim it with something like this : string.IsNullOrEmpty( ( var ?? "" ).Trim() ) and I know if I'm toast or not before the null reference exception or blank screen. Well, what if I have a List<T>?  Or a Dictionary<T,U>?  Here's extension methods I wrote for checking blank-ness:     public static bool IsNullOrEmpty<T>( this IList<T> List ) {         return ( List == null || List.Count < 1 );     }     public static bool IsNullOrEmpty<T,U>( this IDictionary<T,U> Dictionary ) {        ...

Validating web content in CI

If I had another 257 hours in the day, I'd love to build the ultimate web content validator into the continuous integration process I now have.  After a successful build, I'd start by kicking off a WebDev.WebServer instance of the site, then fire the SEO toolkit by wrapping it into a .net library.  Then extend it with custom tasks run on each page download: like validating the HTML and CSS via W3C, validating the JavaScript via JSLint, and for html content, I'd regex out script and style tag content, padding the top of a temp file with whitespace to keep...