Monday, August 07, 2006

I wrote this function a long time ago, but stumbled across it again today when I needed the functionality.

I've been updating a custom installer wherein I needed the ability to programmatically enable/disable a control on the dialog.  Unfortunately, there is no mechanism built-in (I'm using InstallShield X) that provides this functionality.

This simple function takes a dialog box name (which is a string), the id of the control (an integer), and the desired enabled/disabled state (a boolean):

prototype void SetCtrlEnabled(STRING, NUMBER, BOOL);

function void SetCtrlEnabled(szDialogName, ctlId, enabled)
   HWND hWndDlg, hWndItem;
begin
   hWndDlg = CmdGetHwndDlg( szDialogName );
   hWndItem = GetDlgItem( hWndDlg, ctlId );
   if ( IsWindow(hWndItem) ) then
      EnableWindow( hWndItem, enabled );
   endif;
end;

You can call this function with the following code:

#define DIALOG_MYCUSTOMDIALOG "MyCustomDialog"
#define RES_CTL_TXTSAMPLE     1000

SetCtrlEnabled( DIALOG_MYCUSTOMDIALOG, RES_CTL_TXTSAMPLE, TRUE );

Monday, August 07, 2006 1:32:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Wednesday, August 02, 2006
I don't remember my interviews with Microsoft resembling these, but I would have loved to be asked them.  I'm sure I couldn't resist being a smart-alec on some of the answers.  What hilarious answers (and comments).
Wednesday, August 02, 2006 8:41:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Tuesday, August 01, 2006

Ok, this is ridiculous.  Do home builders just not care?

I've done my share of moaning and groaning about how well (or how poorly) my house was built.  Errant pipes here, wires run underneath ceiling joists in the basement, massive pipes protruding from various walls and supports, the non-squareness of the walls, etc.  I know that the builders are working with imperfect supplies and wood bends.  Sometimes the easiest approach looks like the best one.  Sometimes it is.  I don't think that's always the case.

I try to cut them some slack.  Coming in and doing work after someone was already there can be tricky and daunting.  It's a lot like software.  It's in pretty much every industry.

But today I found something in my house that is making me livid (and I don't usually get mad; frustrated, yes, annoyed, sure, but mad, rarely).  We've had issues with our air conditioning ever since we moved into this house.  The house gets pretty hot in the summer time.  For a long time we've attributed the problem to the air conditioner not working or needing more coolant, or whatever.  We've paid for people to come out every year (yes EVERY YEAR) and fix it.  The fix has been temporary at best.  There has always been one vent (in the small bathroom) that hasn't ever really worked.  I always assumed that there was blockage.

Well, to help mitigate the problems we've been having we hired a duct cleaner to come out today and do his magic (it's been long overdue anyway).  In attempting to clean out the bathroom duct he noticed that he wasn't getting any suction.  He reached his hand in and felt insulation.  No, it wasn't insulation that was in the pipe, it was insulation because the pipe wasn't connected to the boot.  He could see light through the vent.  Grrr.

Now it just happens that we just finished (and by just I mean yesterday) drywalling, taping, mudding, and texturing the walls in the basement.  This wasn't looking good.  The only bright point to this whole rant is that there is just one place in the whole basement that isn't finished: the utility room.  The bathroom happens to sit right above the utility room.  Thank heavens!

So we went down to have a look.  Sure enough, the boot is sitting there attached to the bathroom floor in the ceiling.  There's also a pipe that should be attached.  It's just sitting there.  The end closest to the boot had duct tape on it.  At the other end of the pipe was an elbow.  The elbow should be attached to the main air conditioning shaft.  Upon inspecting the elbow, however, it was never dove-tailed, cut, taped, screwed anything - it looked as pristine as it would be in the store.  Frustrated, I then felt around for a hole.  Sure enough, there it was.

But it gets better.  It wasn't that it wasn't connected - that would be an easy fix.  The builders, in their great wisdom, saw fit to run a floor joist smack over the middle of the hole - right in line with the boot to the vent in the bathroom.  There is no way it was ever connected, nor could it be.

Now it turns out that this hole is the hole nearest to the air conditioning unit.  Naturally it would receive the greatest amount of air pressure.  For seven years we've been venting the majority of our air into the insulation below our bathroom, robbing the rest of the house of much needed cooled air.  No wonder it's never really cooled off the house and our electrical bills have been astronomical.

I don't know how this ever passed inspection.  I wonder if it was even inspected.  I wonder how someone could just not care enough to finish the job.  I guarantee that had it been the builder's house things would have been different.

Chalk that up for yet another problem :-(

  • The entire circuit breaker was wired backwards (we had incessant breaker tripping for years just running the microwave and a blender at the same time) which had led to countless computer hardware issues and crashed drives because of surges.
  • I had to furr down almost the entire basement because of pipes and wires running beneath all of the joists.
  • Air conditioning ducts never even connected.  The pipe was just laying there, never even connected - venting the majority of air into the insulation beneath the bathroom.

I know that there's pressure to get stuff built.  There are time constraints, but do we just not care about the quality of anything anymore? Everything is disposable, nothing is made to last.  This is ridiculous to saddle someone with a half-baked, not even working product and call it good with a clean conscience.  Had I not been doing this inspection I never would have known the problem and would have lived on, ignorant of the problems within the system, tolerating the output.

It's a lot like crappy software.  I'm sick of a lack of quality.  Where's the pride in what we do?

Tuesday, August 01, 2006 5:18:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [4]  |  Trackback
 Monday, July 31, 2006

There comes a time in software development when enough is enough.

As developers we (I'm not excluding myself from this group) will design and create toolsets called frameworks to support the software that we're writing.  It's natural.  It's easy (usually).  Of course, much of the code we write tends to be specific to a particular problem domain...but that's completely unacceptable.  We must abstract away any hint of specificity and genericize all aspects of our applications.  We then create support libraries that create objects and provide services of some generic, not-known-until-consumed-by-an-application type for some mystical reuse that probably will never happen...but just in case.  Heaven forbid that our framework have any knowledge or insight into what our application will do or how the information might be utilized.  These frameworks then tend to get bloated and so generic as to lose all sense of meaning.

We create frameworks to support some greater project or set of projects.  If new functionality needs to be added to our application it's inconceivable that the functionality should be applied directly to the program.  Rather, the supporting framework should be enhanced in a generic manner such that the program can consume some service provided by the framework to supply the functionality.  Inevitably, the project scope balloons and the framework bloats to support some obscure functionality, further diminishing the framework's usefulness.

As developers we lose sight of what we were originally trying to achieve: the writing of software.  Instead, we like to focus on the innards that supply functionality to our software.  Sometimes that enough - but not always.  Oftentimes, the creation of the framework is too specific.  It would be better if we got down closer to the metal and wrote the supporting code for the framework.  By identifying the services the framework needs to properly function we can add new, even more generic functionality, thereby enabling our framework to support more theoretical applications.

You know, there's really no end to the insanity.  All we wanted to do in the first place is create a simple program.  But we couldn't simply use the functionality already available to us, we had to go reinvent the wheel rather than simply pumping up the tires.  All I wanted was a Universal Hammer.

NOTE: Joel Spolsky's blog post is a great read.  If you write software, read it and take it to heart.

Monday, July 31, 2006 5:27:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Wednesday, July 26, 2006

I've got to get me one (or two, or three) of these when I finish my home theatre/entertainment center downstairs.  My media collection (presently mostly WMA, but I have others as well) is well over 20 GB and having something like this that I can just plug in (or even use wirelessly over the 802.11g network) and hook into my sound system at home would be awesome.

I know there are other ways of doing this too.  I'm looking into modding one of my XBoxes too, for a very similar purpose, but this sure seems lighter-weight and easier to deal with.  If my budget would allow, I might even consider a Transporter (which includes one of the Squeezeboxes).  Well, that's still several weeks off, but I can sure dream.

Anyone have any experience with this product to recommend it?  I discovered this product via the endorsement on Robert Anderson's blog and he seems to like it.  Thoughts?

Wednesday, July 26, 2006 5:28:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback

The DevUtah Geek Dinner tonight was a lot of fun.  I carpooled down again with my buddy, Nate Jones, and we were two of about 35 attendees who showed up to the Brick Oven restaurant in Provo.  We all enjoyed some great conversations and meals and had a great time.  Due to the atmosphere and not having our own dedicated room we weren't able to accomplish all that we had wanted, but we did have Jeff Rust of Corporate Alliance take us through some networking tips and drills.  They were a good deal of fun especially as they were a break from the norm and helped us become more acquainted with the other attendees.

Can't wait until the next one.

Wednesday, July 26, 2006 3:42:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback

I'm an avid fan of ReSharper by JetBrains (as many of you are very aware).  It wasn't until today, however, that I discovered that the team at JetBrains has an official JetBrains .NET Tools Blog where the various .NET products are discussed.  Fortunately, I'm not too far behind as the blog was only started on June 1, 2006.

What a great idea.  I'm subscribed!

Wednesday, July 26, 2006 8:14:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback

I saw this post on Craig's blog today and thought I'd give the test a whirl.  It's kind of fun.  After an initial, free registration, the online face recognition software matches up your face with those of celebrities and provides a list of approximate matches.

My first photo yielded these results:

Julia Roberts (66%)
Howard Dean (64%)
Cary Grant (60%)
Roy Keane (59%)
Zsolt Baumgartner (58%)
Jason Donovan (58%)
Hillary Rodham Clinton (55%)
Dennis Hopper (55%)
Jack Brabham (54%)
Luis Figo (53%)

Whereas the picture on the left (on my blog homepage) matches the following:

Joi Ito (59%)
Sugar Ray Leonard (54%)
Matt Damon (51%)
Karl of Austria (48%)
John Deacon (47%)
Neil Sedaka (46%)
Jesse Metcalfe (46%)
Tiger Woods (45%)

Maybe I'll try to channel some of that Cary Grant, Matt Damon, and Tiger Woods charm that runs so prevalently in my blood. :)

Wednesday, July 26, 2006 7:25:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Tuesday, July 18, 2006

I've had an issue on my laptop that's been plaguing me now for about a month, but only today (this evening) have I really had a chance to dive into it and figure out what the problem was.

Almost everytime I would reboot and log in to my machine one process (svchost.exe) would peg the processor at 100% for about 3-4 minutes.  I have a dual-core, so it effectively was pegging my system at 50%, but I still couldn't do too much with one processor being hogged so much.  The crazy thing about this is that it wouldn't happen every time; it was very intermittent.  Even then, it would also occur out of the blue during the normal course of my work.

As any self-respecting Windows developer, I like to have the fantastic Process Explorer as my CTRL+ALT+DEL replacement for viewing processes, threads, memory, and much more.  This tool allows me to double click on the process in question to view information about the process.  Svchost.exe is a special system process that runs Windows Services, so there are many instances of this process on my laptop, each running one or more services.

This particular process, for instance, runs about 24 different services.  I found, by brute force method (e.g. stopping services one by one until the CPU was restored to normal), that the offending service was the Automatic Updates.  Now, I enabled this service long ago (and always have enabled this service) and the issues didn't arise then so it was a bit trickier to nail it down.  I like to have this service running, but not at the cost of losing so much productivity.

NOTE: Earlier I mentioned that I traditionally use Process Explorer to see what services are running in a svchost.exe process.  You can also list services by the following command line:

TASKLIST /SVC
this will list each process and any services running within them

TASKLIST /SVC /FI “PID eq XXXX“
this will list just the services running in the process whose PID is XXXX

PS:  I also just found this blog entry after having written the above post, that I wish I had seen before.  This may very well prove to be helpful in the future.  Thanks, Joel.

Tuesday, July 18, 2006 3:57:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback

Well, it's been announced now for a little while, but I thought I'd add my two cents.

We had a great time last month (June 2006) at the Utah Geek Dinner with a slight departure from the norm; we went out to eat at Tucanos and then out to see Superman Returns.  This time, however, we should be back to our normal form (maybe 3rd Normal Form).  The Utah Geek Dinner will be held on Wednesday, July 26th, 2006 at 6:30 PM at the Brick Oven in Provo (111 East 800 North).  Please RSVP up on the wiki if you plan to attend.

Come out and join in the fun.  It's free and open to all!  Let's get some of the .NET community out to these wonderful events!

Tuesday, July 18, 2006 3:21:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Monday, July 17, 2006

This past week was a bit on the crazy side.  I had the opportunity to go to Boston, MA for the Microsoft Worldwide Partner Conference representing Experlogix, Inc.  We had a booth there and had a great show.  Perhaps as a downer for the company I was, unfortunately, the best we could come up with for a booth babe.  How unfortunate.  Seriously, though, the show was great and we had a fantastic time.

While I was there in Boston, a tragedy occurred in which a large cement slab fell from the tunnel ceiling killing a woman.  How terrible!  And to think that I had passed through that very tunnel just the day before (if I'm not mistaken).

We also had (back in Salt Lake City), our monthly Utah .NET User Group meeting.  Aaron Skonnard presented the second in a back-to-back series on Biztalk, this time focusing on Orchestrations.  I wish I could have been there.  I'm a big fan of Biztalk - maybe I'll blog about it someday as well.  They also sang “Jon Boy Jon“ which is to a few of the tunes from Les Miserables and “Uncle Earl's Hairpiece“ which was quite funny.  It was a great time!

Tonight we had the opportunity to take a family outing to the 'Arts in the Park' in Lehi with some great friends.  We attended a concert by the a capella group Moosebutter.  They're a lot of fun and we had a great time.  We heard about Moosebutter several months ago with their clever renditions of Star Wars and Harry Potter.

I'll get back to technical posts here in the coming days.  Conferences seems to drain some of my tech-blogging powers.  Usually, I'm armed with my Gauntlets of Blogging +1, but I left them in my suitcase as they don't let me bring them into the tradeshow floor.  I'll see if I can't find them here somewhere...

Monday, July 17, 2006 3:21:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, July 12, 2006

We're very excited to have Aaron Skonnard back to the Utah .NET User Group for a second month of Biztalk.  This time, the focus is on Biztalk Orchestrations, whereas last month, he targeted an overview of Biztalk and Messaging, etc.

Therefore, you are encouraged to come and participate on July 13th, 2006 at 6:00 PM at Neumont University.  It'll be great fun.  Bring your buddies, find your friends, persuade your pals, convince your comrades and companions, venid con vuestros vecinos, and let's gather as a gang of geeks! - or is it gaggle of geeks :) ?

It'll be a blast.

Aaron's a great speaker - you won't want to miss it.

(Don't forget to join us afterwards to hang out, chill, and have a great time!)

Wednesday, July 12, 2006 5:01:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback