Friday, June 16, 2006

A buddy of mine had an interesting experience with bad customer service, after which he decided to take matters into his own hands.  After repeated attempts to contact them to no avail, he decided to write his own automated system to bombard their email server with email - at least this time it worked (I don't know if I'd recommend it as a customary practice but rather as a last resort).

When, as individuals, we get unsolicited, undesired email we refer to it as spam.  We have spam-blockers, junk mail filters, etc all aimed at eliminating spam.  However he coined the term (albeit accidentally in IM) smap.  I like it - hence the post.

smap ('smap)
n. smap·
per
v. smapped; smapping

1: n. A virtual 'slap', usually in the form of an email, intended to arouse a response.  Frequently sent en masse.
2: v. To incite via email correspondence
example: I sent some smap to customer service, let's see if they respond for once.
example: I smapped my brother today - he's been ignoring me for weeks.

Friday, June 16, 2006 4:00:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, June 15, 2006

We had the treat tonight of having Aaron Skonnard present at our Utah .NET User Group meeting.  The meeting was delayed a week so we invited the Utah County .NET User Group to attend.  I was really impressed with the turnout.  Getting a speaker like Aaron out sure pulls people out of the woodwork that haven't been there for a while. :-)

Aaron talked about BizTalk 2006 and it was great!  His presentation focused on use-cases and scenarios for BizTalk and then he delved into creating schemas, maps, and pipelines.  We then took the published assembly and set up the ports and subscriptions within the BizTalk environment.  It sure is easier now in the 2006 timeframe than when I first did this stuff in BizTalk 2000.  I kind of followed the progress of the product through the 2002, 2004, and 2006 timeframes and it sure has made great strides.

It was a great presentation and everyone had a great time.

Thursday, June 15, 2006 5:24:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, June 14, 2006

Here's an interesting one.

I was futzing around today with the various classes in the System.IO namespace that deal with the file system (e.g. File, Directory, Path, FileInfo, etc).  Is it just me or does it seem like an omission to not have something like an .IsEmpty property?  Granted, this functionality doesn't exist even in the Windows API as such, but still...the .NET framework is all about making the task of developing software easier, more accessible.

Sure, there are a few strategies that one could employ to determine if a folder is indeed empty (none of which I like).  They usually involve getting the list of files and subdirectories and determining if there are none.  I don't really like these approaches because they involve getting the full list of files and folders first just to compare the count to zero (0).  For example:

private bool isDirectoryEmpty(string path) {
   string[] subDirs = Directory.GetDirectories(path);
   if ( 0 == subDirs.Length ) {
      string[] files = Directory.GetFiles(path);
      return ( 0 == files.Length );
   }
   return false;
}

Suppose the directory contained hundreds or thousands of files and/or directories?  A bunch of cycles are wasted simply enumerating all of the files only to discard the results.  Is there a better way using the .NET framework?

I propose there is and I have a better solution, but I'd like your thoughts and ideas.  I'll post my answer in another post.  (I'm hoping there's something built-in that I'm simply overlooking, but I'm not holding out for it)

(BTW: I really think you should be able to have code that resembles the following and be done with it.  I guess I could propose it to the .NET team (which I'll do).  If nothing else, we could wait until .NET 3.0 when we have extension methods at our disposal.)

if ( Directory.IsEmpty(@"C:\SomePath") ) {
   // happily proceed knowing that it was empty at the moment we called the method
   // ...but might not be at this moment :)
}

Wednesday, June 14, 2006 8:54:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [2]  |  Trackback
 Friday, June 09, 2006

I was writing code all day yesterday, reorganizing some projects, refactoring code, etc, etc.  Lots of work - something I would be very loathe to have to repeat.  A lot of the code I had written over the last few weeks and hadn't yet checked into source control because it was still undergoing testing and analysis.

Upon shutting down Visual Studio it crashed.  More accurately, an Add-In crashed, bringing down VS.NET with it.  I really thought nothing of it...that is, until today when I opened my project.  Some of the key files I had been working on yesterday  were missing.  A little perturbed, I selected the 'Show All Files' option.  There they were so I reincorporated then into the project and I figured all was well.  I investigated the files and saw they were empty except for the basic, empty class definition - no code!  I started to sweat, but I figured that if it didn't save those files, I could recreate the refactorings from the files from which I extracted the code originally.  No dice!  I went back to the old files and saw that all the code had been deleted.  In other words, it saved my changed to the original files, but died before saving my changes to the new refactorings.  All of the code was gone.

Now I was a little more than sweating, you know that feeling when you're watching a scary movie and you just know that someone is about to jump out, but you don't know when or where?  Well, I was going through that.

My saving grace was that I hadn't recompiled (nor would I have been able to with the compiler errors it would have introduced).  I could open the library that I had built yesterday in Reflector and see all my source code.  Phew!  Granted, I've lost my XML comments (which were plentiful and abundant), but that's nothing compared to the code I would have lost.  I simply need to reincorporate the code, rename the variables, and I should be back in business.

Friday, June 09, 2006 5:59:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Wednesday, June 07, 2006

We have the distinct honor this month to welcome Aaron Skonnard to the Utah .NET User Group.  We were all too happy to bump the meeting back a week (to the 15th) to accommodate his hectic schedule.  We hope this doesn't put undue contraints on everyone's schedules and that we have some great attendance.  It looks to be a fantastic meeting.

Aaron will be talking about Biztalk 2006 - something to which he's been devoting an inordinate amount of time :).  We invite all to attend.  Enjoy the meeting, the pizza, the comaraderie!

Time: 6:00 PM
Date: Thursday, June 15th, 2006
Place: Neumont University (10701 South River Front Parkway, South Jordan, Utah) (click for a map)

Wednesday, June 07, 2006 8:08:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Tuesday, June 06, 2006

I've been playing lately with a lesser-known feature of Virtual PC called a Differencing Disk.  Essentially, this feature allows you to have multiple virtual machines that drive off of a single 'base' virtual hard drive (vhd).  You can, therefore, set up your base OS on a stand-alone VPC and then create a “differencing disk” over it.  All of your changes get written to your disk and not the base.  In fact, it's recommended that you go and mark your base disk as readonly so you don't inadvertently alter it, thereby causing your differencing disks to run amok.

A major advantage of this approach is you don't need to have multiple copies of your OS VPC floating around.  They tend to get very large, very quickly.  Case in point, I have a VPC that I use that is roughly 10 GB.  Making multiple copies of that beast to test various configurations and changes is nightmarish and takes a frighteningly long time to copy.  This approach is so much more manageable.

Provided multiple parties have the same base VPC, it also gives you the ability to share your changes/differences seamlessly and with a much smaller, more manageable footprint.  It's easier to download a 250MB archive than a 6 GB VPC image.

The steps to create a differencing disk are pretty easy:

  1. Create a new Virtual Hard Disk (File --> Virtual Disk Wizard).  Note, this is NOT the same as creating a new virtual machine.  When creating a Differencing Disk you must create the disk before you create the virtual machine.
  2. In the wizard, select 'Create a new virtual disk'.  Click Next.
  3. Select to create 'A virtual hard disk'.  Click Next.
  4. Identify the location for your disk (this will be the differencing disk storage location).  Click Next.
  5. Select to create a 'Differencing' disk.  Click Next.
  6. Select the base VHD file - the OS disk to base your differences on.  Click Next.
  7. Click Close.

NOTE:  I also found this great resource which identifies the steps above graphically: http://dotnet.org.za/matt/articles/2413.aspx  Way to go Matt!  Great resource.

At this point, you simply need to create a new Virtual Machine using your differencing disk you just created as the hard drive.

It's pretty easy and it makes working with VPC much more of a pleasure.  Your hard drive will thank you - and so will your customers/team that can use your differencing disk without having to download a whole stinking image.

 

Tuesday, June 06, 2006 8:08:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, June 01, 2006

The other day I took the opportunity to install Microsoft Windows Vista Beta 2 on my 'old' laptop.  The old one is a pretty decent machine too: Dell Inspiron 8600, 2.0 GHz Centrino, 2GB RAM, 60 GB drive, etc, etc.  In fact, it was my primary laptop until just recently when I upgraded to a Precision M90...but's that's a different story.

I've got to say I LOVE Vista.  It is awesome.  I'm not just saying that because I have drunk the Microsoft Kool-Aid, but rather in spite of it.  Even for a Beta, the OS is slick, reasonably fast (though it's sure to be much faster once it hits RTM).  But talk about polish.  No, I don't mean sausages.  I'm talking about shoe-shine.  I have seen demos of the OS before, and many screenshots, but it doesn't quite hit home until you actually use it and have first-hand experience.

Granted, there is now another learning curve as many things in the core OS have changed, been renamed, or been moved, but so far I think it's all been for the best.  It is remarkably easy to navigate and the controls at your fingertips are so much more usable.  I particularly enjoy the bread crumbs navigation bar where each step is a selectable button with an associated drop-down menu of other options at that step.

Sure, I can see how many believe that MS took note (finally) from the Mac world and others (and with good reason), but they managed to keep the nice, sleek Windows look and power and stepped it up a notch visually, more so than the other OS's.  You remember the scene from Jurassic Park where Dennis (the computer geek) was so excited upon seeing the shaving cream can via which he should smuggle the dinosaur DNA?  I used to think that was pretty over the top, but that's how I feel.

I'm hooked and eagerly await the RC versions and RTM.  It's like moving to VS.NET 2005.  Once you're there, it's hard to go back to VS.NET 2003 (though I have to work in it daily).  I fear the same holds true for Vista and XP.

Thursday, June 01, 2006 7:29:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [6]  |  Trackback
 Wednesday, May 31, 2006

We ran into a peculiar issue today at work were we had a new laptop that simply could not see other computers on the network.  We could ping them by IP address, but no name resolution was occurring.  We troubleshot it as one normally does (e.g. making sure that the DNS server was right, checking NetBIOS settings, etc, etc).  Upon running ipconfig /all, however, we saw that the Node Type was set to Peer-Peer rather than Mixed or Hybrid.

This setting cannot be changed via the Windows UI (at least not as far as I'm aware), but you can set it in the registry.

All we had to do was open the registry (via regedit, regedt32, etc) and change the following setting:

Key:     HKLM\SYSTEM\CurrentControlSet\Services\NetBT\Parameters
Setting: DhcpNodeType
Value:   8

Valid values include 1 (Broadcast), 2 (Peer-Peer), 4 (Mixed), and 8 (Hybrid).

Once the box was rebooted all was hunky-dory.

Wednesday, May 31, 2006 7:04:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Friday, May 26, 2006

I had the privilege today of conducting a “Brownbag Session” over lunch at SelectHealth today.  The topic was Visual C#.  For the most part the team is new to .NET (and C# for that matter), though some in attendance did have some limited exposure.  We hit on several topics mostly revolving around language and syntax, but we talked about classes, partial classes, properties, generics, iterators, anonymous methods, delegates, and quite a bit more.

There's only so much you can do in a 1 hr block, but I think it went over pretty well and I hope they were happy with the results.  I was.  Thanks for the opportunity to present - as always, it's a great pleasure!

Friday, May 26, 2006 8:19:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback