Friday, December 08, 2006

This past week was very exciting.  Not only did I have the opportunity to work with a potential customer on a pilot, proof-of-concept integration to our existing product configurator, but I met some great friends in the process.

As I mentioned in my post a few days ago, I was down in Longmont, Colorado (a delightful place on many levels) working with a prospective customer and demonstrating some very cool software.  I also had the distinct honor to meet some great developers: Hailu, Praveen, Jvalin, and Atul (all of various Indian heritages).  I hope they had as good a time working with me as I did with them.

Perhaps the highlight of my entire time there was spent with my best friend of over 20 years, Erik Peticolas, and his wife Nancy who live in Denver.  I haven't had the chance to see them since my days at Microsoft when I would travel to Denver on a monthly basis for our monthly District Meeting and would purposfully make it a point to see them and have dinner at the very least.  We had the chance to go our four times this past week which was quite a treat.

Now I'm home and very tired, but very satisfied at a great week.

Friday, December 08, 2006 3:18:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Tuesday, December 05, 2006

December has already been a very eventful and exciting month.  It's also been a semi-difficult time to blog because there are so many things that I'm doing that are NDA and I find it difficult to derive topics from thin air.  I'd rather post about things that are relevant and applicable in what I'm doing.

I have the opportunity this week to spend time in beautiful Longmont, Colorado.  And when I say beautiful, I mean it.  It's not a luscious, colorful place (at least not in December), but it's definitely pleasant and rural.  It's not too far from the city (45 minutes north of Denver) and about the same to the airport.  I understand that the population here is quite a bit more than it lets on, but I'm constantly skirting around it on SR-119 that I don't get to see too much.  I really like it here.  I like that the houses are not 20' apart.  I like open space, trees, and mountains.  It's definitely nice.

I have the opportunity to work with some pretty sharp developers here on a custom integration prototype.  Things are going really well.  In a matter of two days we've gotten a lot up and running.  It's going to be fun to demonstrate its functionality at the end of the week.

Tuesday, December 05, 2006 11:42:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, November 30, 2006

Along with Scott Golightly and Pat Wright, I had the opportunity today to particpate in a SQL Server 2005 all-day training at our local Microsoft offices.  The day was broken into three parts: Pat covered SQL Server Management, Scott discussed Business Intelligence, and I tackled Development.

While I can't speak for the others (as I was not able to attend their presentations unfortunately), my presentation went very well - I even threw in some off-the-cuff demonstrations (as I am want to do) of returning tabular information from a .NET stored procedure :)  We covered a variety of topics, most notably the SQLCLR, TSQL enhancements, and ADO.NET 2.0 along with a smattering of data encryption.  All in all I'm fairly happy, though I can always look back and nitpick some things that I should have done better.

I had a great time and I believe those in attendance did as well.  I look forward to the next one.

Thursday, November 30, 2006 11:09:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Wednesday, November 29, 2006

I was going though some old code that I wrote a few years ago and stumbled upon a little nugget that might prove to be useful.  Back in my VB 2.0-6.0 days there was an event on a Form called QueryUnload.  This handy little event proved to be very useful because not only could it be cancelled (effectively stopping the form from unloaded), but it also provided some information as to how the form was closing (e.g. whether the user clicked the 'X', code closed it, or the OS was shutting down).

Unfortunately nothing exists in the .NET Framework out of the box that provides this functionality.  I had this need a long time back and drummed up some code that may prove to be useful out there, so here it is.

Essentially, I have a base form class (appropriately named FormBase) which exposes an UnloadMode property that you can query in the _OnClosing event (note that the OnClosing method is sealed so you need to add the handler rather that override the OnClosing method directly).  The UnloadMode property indicates how the form is closing down.

Here's the code:

using System;
using System.ComponentModel;
using System.Windows.Forms;

namespace Devstone.Demo.Forms {

#if ( DEBUG )
   public class FormBase : Form {
#else
   public abstract class FormBase : Form {
#endif

      public enum FormUnloadMode : int {
         None,
         FormControlMenu,
         Code,
         OperatingSystemShutDown
      }

      private bool _closeButton = false;
      protected FormUnloadMode ulMode = FormUnloadMode.None;

      public FormUnloadMode UnloadMode {
         get { return ulMode; }
      }

      protected sealed override void OnClosing(CancelEventArgs e) {
         // set the flag back to false so as to not prevent the WM_CLOSE message
         // from changing the UnloadMode

         _closeButton = false;

         // ensure that the event will be properly raised in the derived classes
         base.OnClosing(e);

         // reset the UnloadMode flag
         ulMode = FormUnloadMode.None;
      }

      protected override void WndProc(ref Message m) {
         
const int WM_CLOSE = 0x0010;
         const int WM_SYSCOMMAND = 0x0112;
         const int WM_ENDSESSION = 0x0016;
         const int SC_CLOSE = 0xF060;

         switch ( m.Msg ) {
            case WM_CLOSE:
               if ( !_closeButton ) ulMode = FormUnloadMode.Code;
               break;

            case WM_SYSCOMMAND:
               if ( m.WParam.ToInt32() == SC_CLOSE ) {
                  _closeButton = true;
                  ulMode = FormUnloadMode.FormControlMenu;
               }
               break;

            case WM_ENDSESSION:
               ulMode = FormUnloadMode.OperatingSystemShutDown;
               break;
         }

         base.WndProc(ref m);
      }

   }

}

I hope this proves helpful in some small way.  In terms of future enhancements, I may go ahead and implement a QueryUnload method on this to hearken back to the older programming model (which is perhaps a bit more clear in some instances).  If I do, I'll be sure to update the blog accordingly.

Wednesday, November 29, 2006 6:18:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Sunday, November 26, 2006

I had an interesting set of experiences today while setting up some Virtual PC images.  I had an older, unused desktop machine sitting around and decided to set it up on Windows XP with the sole purpose of playing games.  I had a lot of fun setting it up and getting it ready.  Several games, however, won't run from within Windows (even in Windows 95-compatibility mode) as they are DOS-based games.  I therefore set out to create a VPC to run MS-DOS 6.22 and Windows 3.1.  This turned out to be a bit more challenging than I had originally expected.

The crux of the issue was that I didn't have 1) a working 3.5" floppy drive (depite having tried to install 2 different drives) or 2) my original MS-DOS installation disks.  To acquire the installation disk images I went to the Microsoft MSDN downloads site and found the 6.22 installation disks.  The images are in an .IMG format and cannot be mounted as disk images within Virtual PC.  VPC expects the disk images to be a valid/complete 720KB, 1.2MB, or 1.44MB image - none of these were.  In order to mount them in the VPC they need to be valid .VFD (Virtual Floppy Disk) files.  This is quite easy to do with a Virtual Floppy Driver.  The one I used can be downloaded here.

The MSDN download of the disks includes a batch file which (using dskimage.exe to copy the .IMG files to a disk) expects a floppy disk as the destination.  I had, therefore, to create virtual disks seeing that I didn't have any functioning hardware.  This was easily accomplished as follows:

  1. VFD.exe INSTALL
  2. VFD.exe START
  3. VFD.exe LINK a /L
  4. VFD.exe OPEN c:\Dest01.img (creating the new image when prompted)
  5. FORMAT A:
  6. Copy the disk image to the virtual A: via DSKIMAGE.exe
  7. VFD.exe SAVE c:\Disk01.vfd
  8. VFD.exe CLOSE
  9. Repeat steps 4-8 for each of the three MS-DOS disks.

Once created, I also created a blank 3.5" floppy disk image to have for archival purposes (which you can download here).

Now that I had booted up my VPC using the new .VFD files and installed MS-DOS 6.22, I saw that it was consuming 100% of my processor (well, 50% of the Core 2 Duo).  I had to install the Virtual PC Additions for DOS.  I simply had to set the machine up to recognize my CD player (via MSCDEX.exe) and I was off to the races.  The VPC is only 6.1MB - compared to > 5 GB for a base Vista VPC.

I'll look into the licensing and post my VPC of MSDOS 6.22 if possible, though I'm not optimistic.

I had a lot of fun setting this up and reliving my DOS days from years ago.  Dealing with all the little nuances like autoexec.bat, config.sys, et al was quite nostalgic and enjoyable...but I'm glad I don't have to go through it on a daily basis any more. :)

Now that it's all set up and running, though, I've had a lot of fun installing and playing my old DOS games.  Oh, and it was a blast to reinstall Windows 3.1 (which only took a minute or two) and play with it.

Sunday, November 26, 2006 1:19:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [4]  |  Trackback

It's important to be considerate to users of your applications.  I've discussed in the past a very simple technique to detect if the application si running in a Terminal Services (aka Remote Desktop) session.  Users appreciate it when certain aspects of the application gracefully degrade in such an environment.  For instance, a splash screen could be replaced with a less-graphically-intensive one, sound effects might be reduced or eliminated, color schemes can be changed, animations eliminated, etc.

Though I've not investigated it previously, I've been interested knowing if an application is running within a virtualized environment (e.g. Virtual PC, et al).  Today, I stumbled upon a nice link that illustrates a technique that has merit within the Microsoft virtual environments.  It involves checking the manufacturer of the motherboard on the VPC.  In a VPC it is identified as Microsoft.  Unless MS decides to get into the motherboard industry this technique might last.  I'm going to be testing this technique in the coming days to see how reliable it is and whether it also works in a Virtual Server environment.  I don't believe that it will work in a VMWare virtual machine, but there are also techniques for testing therein as well.

Sunday, November 26, 2006 3:59:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Monday, November 20, 2006

I've been officially called on the carpet as being a "critter" and having "the most hilariously awful prose style [that this guy's] ever endured".  The commentor (whose name is simply Oof) obviously dislikes the way I write, which I apparently do to sound smart.

In my defense, the blog post to which he's referring was a rant that I had composed in one pass and posted almost two years ago.  It did contain several typos and misspellings, some run-on sentences, and was generally disorganized, I agree.  To say that I, as a subnormal type, go straight to malapropisms is a bit far-fetched.  Did I include any malapropisms in my text? I don't believe so.  Partial thoughts and sentences?  Sure.  It was a rant, written the way I was thinking it as I was thinking it.  I didn't go back and proofread it (though perhaps I should have in retrospect), nor did I reorganize it.  It was a stream of consciousness jotted down.  It was not written in a manner to win a Pulitzer.

That said, however, I would like to get a consensus.  Is my writing style (my prose) difficult to read?  Is it awful?  Does it sound like I'm trying to be pretentious and self-absorbed?  Is it difficult to understand?  Unapproachable?

I'd like an honest set of constructive responses so that I might better target my future posts and comments.  It is sincerely my goal to make the blog approachable and if I've not been achieving that to this point then shame on me for missing the mark.

Monday, November 20, 2006 1:17:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Sunday, November 12, 2006

I've been a little quiet on the blogging front lately, but it's not without good reason.  I've been working feverishly with the rest of my team at Experlogix, churning out the next version of our awesome web-based product configurator: Version 4.6.

Despite the small number revision (over 4.5), 4.6 represents a major step forward on so many different levels.  I am very excited about this next version.  We've added some fantastic functionality and substantial performance improvements - and there's more coming in the next versions as well :)

Now that it's code complete I can rest a little easier.  In fact, this week I'll be in Redmond, Washington on campus at Microsoft to assist in a special project.  I'm very much looking forward to interacting with the CRM team (of which I am acquainted with several members).  It should be a great week.

Sunday, November 12, 2006 1:26:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, November 08, 2006

The Utah .NET User Group's meeting for November 2006 has been postponed 6 days to Wednesday, November 15th.  Neumont University, our long-time generous sponsor, has a quarterly Career Night on our regularly scheduled night, but they have allowed us to come in on a different evening. :)

This month we'll be pleased to hear from Justin Long on the topic of Reflection.  This will undoubtedly prove to be a great meeting as Reflection plays such an important role in the life of a .NET developer.

So don't forget: 6:00 PM on Wednesday, November 15th, 2006 @ Neumont University (10701 South River Front Parkway, South Jordan, Utah).

Be there or be sq..like me - in Redmond on the Microsoft campus.  I wish I could join the group, I'm sure everyone will have a great time.

NOTE: If you haven't already done it, go to the new website (which has been upgraded to CS 2.1 SP1) and register there.  Going forward, all activity will take place on that website.  Forums, blogs, photo galleries, etc are forthcoming.

Wednesday, November 08, 2006 6:39:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback