An inspirational poster

sense.jpg

SequoiaView and friends – disk space tools

SequoiaView is a great (and free) tool you may have seen before. It graphically shows you how big each file is in a given drive or folder. This is so much better than using Windows Search to find large files to delete – and it’s more fun too. You can bet I’ll be getting rid of the Visual Studio Orcas Beta 1 image that’s consuming over half of the map below:

SequoiaView
WinDirStat is a similar tool, and also free. It seems to take quite a bit longer to scan a drive than SequoiaView, and you can’t just type in a folder path, which would be nice. However, the tree view is an easy alternative for drilling down to specific folders, and most people would probably prefer this option (but I think a hybrid approach would be better). When you select a folder in the treeview, a rectangular area that represents the folder is highlighted in the treemap. So you can easily tell how much of the total drive space is consumed by a particular folder. The color coding in this tool is great: because it’s based on file type, you can quickly see which file types are taking up the most space.

Innovatools diskSpace explorer 3.0 is not free; the Home edition for use on a single PC. The [more expensive] Network edition allows an administrator to view disk space usage across multiple PCs, and manage/delete files remotely. One unique feature: this application can predict how much space could be saved by using a different file system.

Innovatools diskSpace Explorer

Sales Weasels

The sales weasels are at it again.  Sometime last week they set up a little mini-golf game behind my cube.  Every 20  minutes or so, a I hear a “whack!” and then a little ball will come tooling past my doorway.   There’s nothing like being snowed in with work, and hearing, “come on baby, hook! hook it! yeahhh!!!” just as you’re starting to figure out a complicated problem.

Developers’ Night Out

My team leader gathered all of us into the CEO’s office early this morning.  We learned that the company is not doing well, and we may be having a “Developers Weekend” to try and get more work done.  I’ve heard of events of this sort at large consulting firms, but have never experienced an all-weekend coding extravaganza for myself.   To make it fun, we can play music as loud as we want, and then go bowling or drinking afterwards.  But I hate loud music, bowling and drinking, and suggested that we just go home afterwards.  Maybe that’s not “team spirit”, but on weekends, I prefer to play for the “home” team.   Hey, I might as well be honest.

Bambi Eyes

I’ve learned that the “damsel in distress” effect is real.  My father-in-law once offered some good advice to one of his daughters whose car needed a small repair: park it next to the door at Advance Auto Parts, raise the hood, and wait!  Plenty of help was soon offered to her.

A comely young damsel recently joined our firm and wasted no time asking pretty much everyone for help.   She made her way to the cube next to me today, and I overheard: “hey, do you know anything about site maps?”  “Me? Yeah yeahyeahyeah,” came the reply.  “Great! can you show me?” she said.  ”Um… um… Lemme see here, I think, yeah… watch this!”  

What followed for the next 30 minutes was so disgusting that I got no work done until it was over.   Mr. fleet fingers was happily banging out code for his damsel.  A few minutes would pass before she would say something motivational:  “wow… what a great site map!”  And then: “wow… I don’t have to do any work now!”   And so it went.

When it was finished, she came over to my cube and said, “hey, YOU never write code for me!”.  And honestly, I felt a little guilty.  If she were a guy, she would have no job. 

Must.. make… client…. happy…..*

I have posted nary a thing since early this month, but I have a good excuse!  But first, a question for you:

In consulting, is it possible to make a client too happy?  Whenever there is an agreement between buyer and seller, the overall goal is always that both parties walk away satisfied.  But if party A is drastically more satisfied than party B, then chances are it’s because the project was underbid by party B, who I work for.

If you answered yes, then you probably have worked for on projects that somehow quietly crept out of scope and nobody noticed until it was too late.  Decision makers probably told the developers to try to do whatever it takes to “cram” those extra features in there, and avoid disappointing the client. 

Or, in my case, the scope was well defined during the planning phase, and a detailed estimate submitted.  But lo and behold, after all of this work, the client announced that someone in sales had predicted it shouldn’t cost more than $50,000.  So our schedule / timeline is currently based on that number, and not the true cost of the project.  Our CEO is somewhat infamous for keeping the client happy at all costs.  But I would argue that if the consulting firm is losing money, the client might be too happy.

Unless they are cash strapped, clients will respect consultants that communicate genuine risks, and will sometimes agree to pay more if need be to ensure a successful project.

All that to say… I’ve been working a little overtime lately.

Christmas Sharking

This Christmas I did something every 29 year old boy dreams of; shark fishing from a kayak!  This boy had been planning on it ever since his family decided to rent a beach house for Christmas.

The technique is simple enough: buy a bucket of frozen chum from wal-mart, and a bag of sardines.  Paddle out a quarter mile or so, throw out an anchor, tie a rope around the chum and let it drift behind the boat.   After just a few minutes shark should be swarming around the boat.  I caught a couple but was starting to get seasick, so brought one to shore for my nephew to see.

The shark pictured is a spiny dogfish, only a few feet long, and I caught it at Garden City Beach.  A guy who works at the pier advised that the big ones (6 footers) are away for the winter.  So maybe I’ll try again sometime in warmer weather… or maybe not…

.NET Framework 3.0 Training Stuff

Microsoft will often provide some sort of free training for major rollouts.  They are kindly offering 3 2-hour e-learning clinics to help us get ramped up quickly to 3.0.  I just completed the WPF course, which was a pretty good treatment of the fundamentals of WPF.   But there’s nothing like a little hands-on coding to really figure out how things work. 

Here’s the link: https://www.microsoftelearning.com/eLearning/offerDetail.aspx?offerPriceId=109340

There are also various other free courses at Microsoft’s Visual Studio 2005 E-Learning Catalog.  

Now, the really hot item is WPF/E, a XAML based cross-platform runtime that can deliver rich vector graphics, animation, video, runs on any browser and can that can hook in to client-side [java]script also loaded on the page.  It has a small 1mb download size (up to 2mb planned in the final release), and could prove to be Microsoft’s answer to Flash.   Even better is that this technology has evolved as a natural progression of WPF, and does not seem to be a hostile attempt to compete with Flash… even though… it probably is  :)

Also check out the samples at WPF/E.  Warning!  The page turn sample might make you drool a little.

Here are some other WPF sites worth looking into.:

AEROSOLGRAFIA

Check out this video of a spray paint artist from Portorož, Slovenia doing sci-fi paintings in less then 10 min.   There are more videos of this guy (Janez Jevnikar) on his web site: http://www.sprej.com/.  Street performers are some of the most talented people on the planet.  They HAVE to be good.  Imagine trying to write code for an audience… that would be worse than pair programming :)

A Framework for Application Level Impersonation Using the ASP.NET Membership Provider

In web applications that allow users to create accounts and login, it’s very common for developers to provide some way for an administrator to impersonate / emulate another user.  Below is a framework for doing this using the ASP.NET Membership and Profile provider classes.  This solution is simply a wrapper around these same classes that will produce cleaner code if you need to include an impersonation feature in your app.  I recently used this in a 100K eCommerce application for one of my clients with great success.  Hope you like it!

Below are a couple of examples.  Scroll down even further for a description of the members of the two CS files: AppMembership.cs and AppProfile.cs.

Example 1


//This line displays the name of the currently logged in user using .NET membership provider:
Response.Write(Membership.GetUser().UserName);

//…and this line does the same thing using the AppMembership wrapper class:
Response.Write(AppMembership.User.UserName);

//Until you start impersonation:
AppMembership.StartImpersonation(“bob”); 

//Now, this line displays the name of the impersonated user:
Response.Write(AppMembership.User.UserName);

//…and this line uses the wrapper class to display the name of the currently logged in user:
Response.Write(Membership.GetUser().UserName);



Example 2


//display current user’s username
Response.Write(AppMembership.User.UserName);

//start impersonating Bob
AppMembership.StartImpersonation(“Bob”); 

//the same code now displays Bob’s user name
Response.Write(AppMembership.User.UserName);

//display current user’s name (while still impersonating Bob)
Response.Write(Membership.GetUser().UserName);

//end impersonation
AppMembership.EndImpersonation();

//the same code now displays the current user’s name
Response.Write(AppMembership.User.UserName);

File (1 of 2): AppProfile.cs


// Returns boolean value indicating whether a user is currently being impersonated.
static bool IsUserBeingImpersonated

// Returns a MembershipUser object for either:
// a) the logged in user
// b) the user currently being impersonated, regardless of who is logged in.

static MembershipUser User

//Returns the MembershipUser object of the impersonator
static MembershipUser Impersonator 

// Returns boolean value to determine:
// a) Whether the logged in user is in the specified role
// b) If impersonating a user, whether the user currently being impersonated is in the specified role
static bool IsUserInRole(string roleName) 

// Returns array of strings containing:
// a) Roles the currently logged in user is a member of.
// b) If admin is emulating a user, roles the emulated user is a member of.

static string[] GetRolesForUser(string roleName)

// Start impersonating the specified user
static void StartImpersonation(string UserName)

// Stop impersonating a user
static void EndImpersonation()

File (2 of 2): AppProfile.cs


// Gets the profile of the current user.
// Since this may not always be the logged in user, query the ProfileCommon object
// for the AppMembership.User user, which will always be:
// a) the logged in user
// b) the user currently being impersonated, regardless of who is logged in.
static ProfileCommon UserProfile

// Gets the profile of the specified user.
static ProfileCommon GetUserProfile(string UserName)

// This will cause it to be retrieved and cached again when the UserProfile property is accessed again.
static void Clear()