devLink Conference


Posted on 27th August 2008 by r2 in CSS |Presentations

This past weekend a few of us Wintellectuals made the trek Atlanta to Murfreesboro TN to present at the annual devLink conference. I really can’t say enough about the level of professionalism and obvious preparation that went into devLinkJohn Kellar, Tommy Norman, and Leanna Baker and the entire team that made it happen are well deserving of accolades for their accomplishment.  The conference was held on the campus of Middle Tennessee State University which was also perfectly suited for the task. All of the rooms were nice, large, and well-equipped (even though said equipment was apparently timed to shut off exactly at the 1-1/2 presentation mark).  As a vegetarian, I can’t say too much for the food, but that’s pretty much on par with any gathering…I’ve learned to carry plenty or protein bars over the years. Bottom line, for $50 this absolutely has to be best value for your buck in training (other than Wintellect’s DevScovery,of course *smile*).

While my colleagues, Steve Porter and Keith Rome, offered four really great talks on Silverlight topics,
I was there to present on all the new things available with Cascading Style Sheets (sarcasm off).  Actually, my CSS talk went really well and I received lots of good feedback which I’ll continue to roll into that presentation.  All sarcasm aside, most web developers (especially those in Enterprise positions) are stuck with CSS for the foreseeable future and this presentation really aims to go through the major areas where I see developers struggling and try and cast some light on how all those pieces play together.  Thanks to all that made it to the talk (standing room only!) and for the emails that I’ve received since.

I’ve updated the slides and code with this past weekend’s revisions and you can get it here:

CSS Deep Dive for the ASP.NET Developer

I believe that the other presentations will be posted on the devLink website, so keep an eye out for them.  There were a lot of good ones!

Updated Deep Dive CSS code


Posted on 1st April 2008 by r2 in CSS |Presentations |Visual Studio 2008

Thanks to all the folks that came to my Deep Dive CSS for the ASP.NET Developer session at this past weekend’s Atlanta Code Camp.  I got some really great feedback from the evaluations and will definitely
incorporate some suggestions into this presentation in the future. The abstract, updated code and slides are available here:

DeepDive CSS for the ASP.NET Developer


Top-10 Application-Design Mistakes


Posted on 20th February 2008 by r2 in Silverlight |UI and Usability

We saw it when the world first discovered Flash and I’m sure we’ve got a lot of it left to live through with Silverlight, so this is pretty timely advice from the "Godfather of Web Usability" himself, Jakob Nielsen.  This should be required for every web developer.  There are some great links within the post as well, so be sure to click around.

Top-10 Application-Design Mistakes

Painless Free Annual Credit Reports


Posted on 25th January 2008 by r2 in Random

There is finally a (relatively) painless way to receive your Free Annual Credit Report from the Big 3 Credit Agencies.  It is a really good idea to keep your eye on your credit report these days.  The folks at have integrated the registration processes for the three Credit Agencies into a seamless wizard type experience.  I was able to print all three of mine in less than 10 minutes.

Weather Widget now in the Showcase


Posted on 25th January 2008 by r2 in Silverlight 1.0

The Silverlight Weather Widget made it to the Showcase and is mentioned in the News section of the Home Page.  WooHooo.

The New Generic Kid on the Block–HashSet<T>


Posted on 25th January 2008 by r2 in Generics

In mathematics, a Set is typically thought of as a collection of distinct objects that is usually defined by some rule that determines whether they are a member of that particular Set.  For example, a Set could be defined to contain "all the odd numbers under 100" or "every number divisible by 2" or whatever.  The main points here being that the objects in a Set are distinct (i.e. NO duplicate objects are allowed) and the objects are not ordered or sorted in any way.  (If you really feel the need to geek out on Set Theory, be my guest).

According to the MSDN Documentation for HashSet, "a set is a collection that contains no duplicate elements, and whose elements are in no particular order."  Sound familiar?  In the .NET Base Class Library, there has never been a true Set class until now with the release of .NET 3.5 and the brand-spanking-new System.Collections.Generic.HashSet<T> class.

In the past, when we needed to implement a Set in .NET, we sort of bastardized the List<T> or other unsuspecting Collection classes into something like this:

  1. int[] intArray = new int[]{ 1, 2, 5, 7, 4, 1, 7, 9, 8};
  2. List<int> intList = new List<int>();
  3. foreach(int theInt in intArray)
  4. {
  5.   // checking to make sure that the object is not in our List before adding
  6.   //  so we are calling Contains() and then Add() on every time through the loop
  7.   if (!intList.Contains(theInt))
  8.     intList.Add(theInt);
  9. }

What we needed was a Set that would let us just keep adding objects to it and free us from having to worry about it being there first.  A recent example of when I really needed a true Set class was while working on the Weather WidgetThe Weather Channel provides some 40+ images for use in their SDK, yet in the Weather Widget I never need more than maximum of 11 (and usually less as there is usually duplication).  So, I had the idea to dynamically zip the images that I actually needed for a given Zip Code and use that file for my image assets in Silverlight via CreateXamlFromDownloader. Obviously, I don’t want these images duplicated in the zip file.  So, I came up with this:

  1. HashSet<string> assets = new HashSet<string>();
  2. foreach (ForecastDay day in forecast.Days)
  3. {
  4.   // no Exception here if duplicate…it just doesn't add it.
  5.   assets.Add(Server.MapPath(String.Format("~/images/{0}", day.IconDay)));
  6. }
  7. Utility.WriteZipFile(assets.ToArray<string>());

This just scratches the surface of what HashSet<T> is capable of.  There are member methods available for most Set operations, such as IntersectWith(), UnionWith(), IsSubsetOf(), IsSupersetOf(), RemoveWhere(), etc.   Here’s a link to all of the HashSet<T> Members.

Recall that being a member of a set depends on some rule that determines this membership.  With the HashSet<T>, you can define your own rule of what it means to be in a Set.  For a good example of defining your own EqualityComparer, see Introducing HashSet<T> from Kim Hamilton on the BCL Team Blog.

So, welcome the New Kid on the Block to the Generic Collections.

One last random link I had on the subject for those interested in LINQ:

Good side-by-side comparison of the HashSet and LINQ Set Operations

A Better Way to Remove a Trailing Slash from a Path


Posted on 18th January 2008 by r2 in C#

How many times have you written this to trim a trailing slash from a path:

  1. if (myPath.EndsWith("\\"))   /* or "/" in the case of a URI  */
  2.   myPath = myPath.Substring(0, myPath.Length-1);

Next time, try this:

  1. myPath = myPath.TrimEnd(new char[]{'\\', '/'});

In addition to String.TrimStart() and String.TrimEnd(), there is an overload on String.Trim() that accepts a character array. There are good examples of usage in the MSDN Library. Here
are the links:

System.String Trim(char[]) TrimStart(char[]) TrimEnd(char[])

My First Look at the (Silver)Light


Posted on 7th January 2008 by r2 in ASP.NET Ajax |Expression |Silverlight 1.0

Over the holidays, I was finally able to catch up on some reading and take some time to play with Silverlight 1.0.  The two books that I spent the most time with are

ASP.NET Ajax in Action and Silverlight 1.0 Unleashed.  Both of these, I HIGHLY recommend!

My first project is a Silverlight 1.0 application that I call Weather Widget (for lack of a more exciting moniker).  The Weather Widget will accept a 5-digit US Zip Code and return a 5-day forecast from The Weather Channel.   You can see it in action here: 

WeatherWidget.  (Note:  This will require the Silverlight 1.0 plug-in).

I also took the time in this project to use (experiment) with a lot of new toys such as: 

·         LINQ to XML (and the XDocument/XElement classes)

·         New C# language enhancements including Automatic Properties, Object Initializers, Implicitly
typed variables, etc.

·         Javascript key events – some hard-learned (and forgotten and now painfully re-learned) lessons
to share here

·         Integration of ASP.NET Ajax and Silverlight – my implementation here is rudimentary right now as I’m still sorting through the most efficient blending of these two technologies

·         Integration of DOM Elements with Silverlight (good post from Keith on that topic here)

·         Expression Studio (mostly Blend) –  I have much to say about this (some of which you can read in this discussion in Shawn’s comments here).  Overall, I really like a lot of things about Blend.  I am finding myself there more these days though I miss a lot of things about working in Macromedia (now Adobe) Fireworks (which I have used for MANY years for all of my design work).  One upcoming post I’m working on here is “Top 10 Things I miss from Fireworks while working in Blend”.

·         Using JSON – I had never used it so now I have



Guess that about covers it. I’ll link back to the above points as I blog about each.

I have several things I’m planning to add (and am open to suggestions), but wanted to get it out there in its current state.  Once I am happy with it, I’ll post it to the gallery on the site.

Let me know if the Widget blows up…at this point, I’ve tested only on IE7 and Firefox on my laptop (Windows Vista64). 


Sharing Folders in Remote Desktop


Posted on 17th October 2007 by r2 in Windows Tips

Today, I was struggling with getting some code deployed to a client’s test server and called him to double-check FTP credentials and such.   He casually mentions having the ability to share your hard drive (and other devices) with a Remote Desktop session.  How many times would that have come in handy?!?!  Anyway, I dug into it further and it works!

Check out Dan Mork’s blog posting on the topic as he does a great job of walking you through the process.  (Make sure and check the comments as there is another really good tip there about saving your Remote Desktop connection with your configuration).

Deep Dive: CSS for the ASP.NET Developer


Posted on 8th October 2007 by r2 in CSS |Presentations

Thanks everyone for the comments and tips offered after I gave this presentation at Alabama Code Camp, as well as, at the Atlanta Cutting Edge .NET group last week. I received several "so that’s how it works" comments and that was exactly the point of this talk.

Here is the abstract of the presentation:

This will be a thorough discussion of all that is CSS.  Whether you know it as the necessary evil or the great enabler (that just hasn’t quite clicked for you yet), you should walk away with something valuable from this discussion.  I will begin with the basic box model and travel all the way to the holiest of grails (the no tables here, two and three column ASP.NET Master Page layout…yours to take home for free!).  Along the way, we’ll touch on some CSS Best Practices and gotchas in ASP.NET and take a look at the new CSS tools in Visual Studio 2008 (Orcas).

Get the download here.

Note: The solution file provided is from Visual Studio 2008 (Orcas) Beta 2.  There
is nothing .NET 3.5 specific (as most of it is HTML anyway). 

Update 04/01/08:  Updated the download to compile under Visual Studio 2008 RTM