Saturday, March 31, 2007

I realize that this is quite elementary and simple, however, it constantly eludes me.  Therefore, I'm documenting it here more for my benefit than anyone else's; though if it helps anyone out there - that's wonderful! :-)

I ofttimes find myself wanting to 'pin' an HTML element on the page.  This can be accomplished quite easily via the CSS position attribute with a value of absolute or fixed and a specified location.  More often than not, positions are specified in coordinated with the top and left attributes to designate the upper left corner of the element.  I find, however, that I frequently want to pin something on the right edge of the browser and/or the bottom.  When the user resizes his browser the element should move with the new dimensions.  For some reason, I always want to make this harder than it really is.

It's a simple problem really, if you can mentally depart from considering element position by the upper-left corner.  For instance, if you want to pin an element in the upper-right corner of the browser, simply specify the top and right properties.  It's that easy!

The CSS style:

#copyright { position:absolute; top:0; right:0; margin:10px }

The HTML:

<div id=”copyright”>
   Copyright &copy; 2007, Devstone Software<br />All rights reserved
</div>

Moving it to the bottom-right corner of the page is simple:  specify the bottom and right properties:

#copyright { position:absolute; bottom:0; right:0; margin:10px }

Along the same lines as this simple, yet somehow elusive mechanism, I frequently find that I want to define a DIV to fill the page.  You may be tempted to use the CSS attributes width and height with values of 100%.  This however is not the correct choice.  If you've tried it in the past you've probably become frustrated and perhaps even resorted to using a TABLE element to establish your page layout as a last recourse.

All is not lost.  You can simply use the same principles as above to define your DIV and fill the page.

The CSS style:

body
{ background-image:url(pattern.gif) }

#page
{ position:absolute; top:0; left:0; right:0; bottom:0; margin:5px; border:solid 2px black; background-color:white }

The HTML:

<body>
   <div id=“page“>Page content here</div>
</body>

Elementary, my dear Watson.  Now maybe by having jotted this down I'll remember it in the future.

Saturday, March 31, 2007 5:21:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [2]  |  Trackback
 Friday, March 30, 2007

Having recently moved my primary development environment over to Windows Vista I've been presented with a small learning curve when developing my ASP.NET applications. It's been good, however, as I've been forced to delve into IIS 7.0 and explore some of its capabilities and learn some of its nuances. To be sure, I'm very much enjoying working with it…but there's a lot to learn and become acquainted with.

I have a web application that I'd been working on in an IIS 5.5 (Windows XP) environment successfully prior to the migration so I thought I'd set it up and take it for a test drive in the IIS environment. I was pleased that I had but a few changes to make to make it operational. Getting it run from Visual Studio 2005 was a different story however.

I found that anytime I attempted to run my website by pressing F5 within Visual Studio I was presented with a dialog explaining that it was "Unable to start debugging on the web server. An authentication error occurred while communicating with the web server. Please see Help for assistance." I could, however, attach to the running process (w3wp.exe) and debug that way. In my case, while that would have worked most of the time, it didn't provide me access to some of the methods that I'd want to debug (like BeginRequest) and is a bit more cumbersome. Well, this was a bit disconcerting, but after a few minutes of tinkering in IIS to attempt to resolve it I resorted to running a quick Google search. It turns out I wasn't alone on this issue, not by a long shot. The first blog post I found was by Rajiv Popat and it was quite helpful, but not quite what I was looking for. In his post he recommends using the Classic Mode rather than the new Integrated Mode. NOTE: The Classic Mode that is provided with IIS 7.0 provides a runtime environment that mimics IIS 6.0. I could have used that happily, but as I'm not generally satisfied with workarounds or just settling for the first solution, er, band-aid that I find, I wanted to dig deeper and get my application working in the newer environment.

This is when I found a great blog post by Mike Volodarsky (a Program Manager on the IIS team). In his post he mentioned the key characteristic as to why I couldn't debug my site via F5: I had a global.asax file (though I deleted it – it wasn't necessary in my app) and a custom HttpModule that attaches to the HttpApplication.BeginRequest method. Apparently "there is a bug in ASP.NET Integrated mode that prevents authentication from taking place correctly for the debug auto-attach feature". Well, removing the custom HttpModule was not an option because it does some pretty slick URL rewriting for the site and is critical for its operation. That, combined with the fact that Classic Mode didn't really give me the warm fuzzies, led me to adopt his Debugging Assistant (64-bit Version). Man, what a life saver! This worked – though it didn't work at first for me when I tried it yesterday, but I hunkered down and resolved to figure out why tonight.

When running in IIS 7.0's Integrated Mode, the web server will not rely on settings within your section of the web.config file as it does in Classic Mode. Rather it relies on the new section. As per the instructions on Mike's site, I added the special debug module and handler to the appropriate sections in the web.config file, but I continued to receive the "An authentication error occurred communicating with the web server" error. It turns out that I was clearing the modules and not adding back in a module that is required for debugging: WindowsAuthenticationModule. Hey, I'm still learning IIS 7.0 here J This is approximately how my web.config appears:

<system.webServer>
   <modules>
      <clear />
      <add name="debugassistant" />
      <add name="WindowsAuthenticationModule" />
   </modules>
   <handlers>
      <add name="DebugHandler" path="DebugAttach.aspx" verb="DEBUG" type="System.Web.HttpDebugHandler" />
   </handlers>
</system.webServer>

It turns out the fix was quite easy once I knew what I was doing.

Friday, March 30, 2007 7:44:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [7]  |  Trackback
 Thursday, March 29, 2007

This post fulfills two tasks: 1) to demonstrate (to myself) that I could easily post an entry to my blog through Word 2007 J and 2) to provide a recap of the fun event that was held at the local Microsoft offices here in Salt Lake City.

We took the whole family to the event this evening. I was pleased by the number of people that showed up too; I was somewhat worried that we wouldn't get the turnout we had anticipated. The event was divided into two groups: one group spent some time with an instructor/presenter who talked about Windows Vista and Office 2007 while the other spent some time playing/experimenting with a cool Lego Mindstorm demo. We talked about the MS Robotics 1.0 toolset as well. The Mindstorm demos (which Scott Golightly's kids had put together) had the robot move forward, sense an object (a ball), and pick it up. While I've not had a chance to really see these things in action, they're apparently very versatile and programmable. I'm looking forward to experimenting with them more in the future.

All in all we had a great time, picked up a few tips and tricks, and walked away with a copy of Office 2007. One lucky kid won his own Lego Mindstorm. It was also fun to catch up with friends.

Thursday, March 29, 2007 3:44:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [2]  |  Trackback
 Tuesday, March 27, 2007

As a reminder, we're having a special .NET Bring Your Family event this Thursday, March 29th, 2007 at our local Microsoft Offices.

The event runs from 6:00 PM to 9:00 PM and is intended for you, your spouse/significant other, and children ages 6 or 7 and up. Sure, there's a geek aspect of the event, as there will be discussions on Office 2007 and Windows Vista for the adults/spouses but there is also a fun side with Lego Mindstorm Robotics stuff for the kiddos (and probably some adults too) with a Lego Mindstorm Robot as a raffle giveaway.

Food (probably pizza) and drinks will be provided by Microsoft.

So prepare for a fantastic time and come one and all. With your participation we can definitely plan on having a lot of fun!

Time: 6:00 PM - 9:00 PM
Date: Thursday, March 29th, 2007
Place: SLC Microsoft Offices (123 Wright Brothers Dr., Suite 100, SLC, UT 84116)

See you there!

Tuesday, March 27, 2007 2:42:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback

I had the fortune (or misfortune depending on how you look at it) of completely rebuilding my development machine from scratch last week.  The unfortunate circumstance of having a corrupted registry and destroyed network settings befell my laptop due to a bad install of a VPN client.  I was able to rescue 100% of my data however, off-loading it to an external USB drive which I love.  I've long been wanting to make the move to Windows Vista but for a grundle of reasons couldn't validate the time it would take to move to the new environment.  Perhaps this was the kick in the pants that I needed.

Once I blew the machine away (paved it, as they say) I set forth to install Windows Vista Ultimate on my Dell Precision M90.  The install went extremely smoothly - I had an operating machine in about 30-45 minutes.  With the exception of the built-in laptop monitor, I was very pleased that the OS correctly identified 100% of my devices.  It was peculiar that Vista insisted in setting the display rotated 90° counter-clockwise after a few reboots.  Until I installed the correct drivers I couldn't shake it of this habit.  Also, it's working great with my secondary Dell 2407WFP monitor :-)  Dual 1920x1200 resolution :-)

I've also installed my customary applications (Office 2007, VS Team Suite 2005 SP1 w/Vista Patch, XML MissionKit, SQL Server Express 2005 SP2 (I decided to use SQL Express rather than the full blown SQL Server AND Express for development purposes - it's proving to be perfect), Photoshop CS2, WinRar 3.7 (you'll need 3.7 for better Vista integration), Resharper, Invirtus VM Optimizer, et al).  Much of my development also requires VS2003 (.NET 1.1) which is not supported by MS on Vista.  I've therefore established a Virtual PC running XP SP2 as my primary .NET 1.1 dev platform and it's working great.  I have it open and running all day long with ne'er a hiccup.

All in all I can say that I'm very pleased with the upgrade and it wasn't the least bit painful.  Also, I can honestly say that I enjoy using Vista as a non-administrator (something I had been doing religiously for about 2 years on XP).  The periodic UAC warnings aren't the nuisance everyone seems to think they are.

That said, it is important to recognize when things are running under admin privileges and when they're not.  For instance, if an application launches following the install, chances are it's running under admin privileges so any settings made aren't going to be for the logged-on user but rather for the administrative account.

I'm loving developing on Vista - it's awesome! :-)

Tuesday, March 27, 2007 1:35:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, March 21, 2007

I had a rather unfortunate experience today.  For a variety of reasons which I won't go into here, I was obliged to install a particular VPN client on my laptop.  I was loathe to do so, but did it anyway.  That was a mistake.  Don't you hate it when you attempt to install software that 1) freezes, 2) locks your computer, 3) won't uninstall (opting instead to freeze the computer entirely), 4) hoses your registry, and 5) leaves your network adapters in a complete disarray?

Well, that's what happened today.  Consequently, I am unable to connect to any network (wired or wireless).  Nor can I remove the miniport adapters that it left behind.  As a result, I cannot reinstall any network drivers.  What a pain.

Well, I suppose I was looking for an excuse to pave the machine and install anew.  I've been wanting to get Vista up an running on it (being my primary development box).  I have Vista running on two other laptops here and I'm loving it.

On the bright side, I was able to backup all of my documents, databases, files, and dev projects to an external source and will be able to be up and running in relatively short order.

What a pain though.

Wednesday, March 21, 2007 5:27:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [2]  |  Trackback
 Saturday, March 17, 2007

A small application that I wrote some time ago just started acting up on me yesterday and today in a manner heretofore not seen.  The program utilizes WSE 2.0 and DIME to perform file transfers between the client and server.  The error was the following:

An unhandled exception of type 'System.Configuration.ConfigurationException' occured in microsoft.web.services2.dll

WSE032: There was an error loading the microsoft.web.services2 configuration section

I felt it bizarre that I'd never seen this error before, despite having installed and run my application hundreds of times in the past.  I was also having some networking trouble with my VPC (on which I was running this application) which correlates to the solution that I found online:

  1. Ohad recommends adding your local computer's host name (can easily be discovered/remembered by typing HOSTNAME at a command prompt) to the %WINDIR%\System32\drivers\etc\hosts. file.  (BTW: This fixed it for me)
  2. Also, if you have a configuration file (e.g. for controlling the timeToleranceInSeconds settings, et al), you need to ensure that you're using a fully qualified type name to the Microsoft.Web.Services2.Configuration.WebServicesConfiguration type.
Saturday, March 17, 2007 7:16:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Friday, March 16, 2007

I've been out of contact on my blog for several days now because I was in San Diego for Convergence 2007 with Experlogix.  This year we were a bronze sponsor for the event which, among other things, provided us with a 20'x10' booth and let me tell you, it was well worth it.  What a great event!

I've enjoyed the Convergence conferences the past two years for many reasons, but this one has, by far, been the best event for us.  Experlogix was well represented with 5 of our staff members in the expo hall booth at all times and we didn't even have but a moments rest.  Interacting with partners and customers is a great joy (despite the fact that it's also exhausting).  We unveiled our product configurator for GP 9.0 at this event as well as our latest version (with offline sync) for the CRM 3.0 family.

One of the most rewarding aspects of working on a product and interfacing with customers is when you see and hear how much they enjoy using the product.  It just doesn't get any better than that.

I can't wait until next year's Convergence in Orlando; but there still remains the Partner Conference in Denver in July and (fingers crossed) the Convergence in Copenhagen.  I don't think we're going to that one, but that would be a blast!

Friday, March 16, 2007 6:21:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Saturday, March 10, 2007

There are times where you may need to dig into the details of a SQL Server database to retrieve information / metadata about the database itself.  There are many built-in stored procedures that facilitate this (e.g. sp_helpdb), but they don't always provide the information in a SQL-friendly form.  In the case of sp_helpdb, much of the information is returned in a comma-delimited form and parsing it out is a headache, and and unnecessary headache at that.

Suppose you need to retrieve the collation order of the database.  This is quite easily accomplished by calling the built-in function DATABASEPROPERTYEX.  In fact, each of the settings found in the status column returned by sp_helpdb are individually retrievable via the DATABASEPROPERTYEX function.

SELECT DATABASEPROPERTYEX('DbName', 'Collation')

Saturday, March 10, 2007 6:35:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, March 08, 2007

Well, the last of the big hurdles that I was waiting for before moving to Vista on my primary machine was released a couple of days ago.  Microsoft released the Visual Studio.NET 2005 SP1 for Vista.  Now that SQL Server 2005 SP2 has been released, along with this service pack, I just want to get a good, stable Windows XP SP2 VPC representing my current development environment so that I can continue to support .NET 1.1 development (in VS2003) because that will not be supported on Vista.

If you're using VS.NET 2005 on Vista, you'll want to get this patch.  Download it here.

Thursday, March 08, 2007 8:18:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, March 07, 2007

Well, this has been a long time coming, but among the myriad of other projects and goings-on, I couldn't get it up earlier.  As many of you know I've been doing a lot of projects around the house.  In addition to finishing the basement we took it upon ourselves to have the kitchen and upstairs completely redone.  We've never liked the cabinets and flooring that was installed when we originally built the house almost 9 years ago.  So the kitchen, most of all, got an overhaul.

Below I've provided a visual progression from what it was to what it is now.  Note, there is still some work to be done (e.g. the water's not yet connected to the sink/dishwasher, I still need to mount the under-the-cabinet lighting, the baseboards aren't yet up...but it's a work in progress for sure.

I still don't have pictures of the basement up yet.  Those might be forthcoming, provided I can get it organized.  Too many things left undone in all the shuffle.

Wednesday, March 07, 2007 4:51:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Tuesday, March 06, 2007

You haven't experienced New York City properly until you've spent your first weekend there and:

  1. Gone shopping out the whazoo
  2. Seen Les Miserables on Broadway (with Lea Salonga :))
  3. Seen Chicago on Broadway (with Bebe Neuwirth :))
  4. Been to the Empire State Building
  5. Eaten a NYC pie (pizza for the uninformed)
  6. Been to Times Square, Rockefeller Center, etc
  7. Ridden the subway
  8. Been to The World Trade Center site (Ground Zero)
  9. Left your wallet in a taxicab on the day you're supposed to fly out, only to recover it in the nick of time
  10. And much more.

We had a great weekend (March 3rd-5th, 2007) despite the debacle of #9.  It's been a surprise trip I've been planning for our 10th anniversary for some time.  In fact, the trip itself was a well guarded secret for a while, until that fact was divulged by an over-eager daughter...though thankfully she got her North-West confused with North-East. :) ...a fact that I exploited fully.

We'd never been to NYC before and wanted to soak it up as much as we could.  We'd long wanted to see Les Miserables on Broadway.  It's far and away my favorite production.  Also, and this was a much unexpected treat, but upon arriving to the theatre we discovered that Lea Salonga was playing the part of Fantine.  For years I have followed Lea's work and absolutely LOVE her voice.  She played Kim (in Miss Saigon - another favorite), the singing voice of Jasmine (in Disney's Alladin) and Mulan.  But her standout performance, IMO, was when she, reprising her role as Eponine in Les Miserables, nailed the part in the 10th Anniversary on-stage production.  So as you can imagine, I was in heaven to be on Broadway to see her perform.

We also made an impromptu decision to see Chicago on Broadway as well.  We've enjoyed the soundtrack for years but had never the opportunity to see it on stage.  Playing the role of Roxy Hart was the amazing Bebe Neuwirth (Lilith from Cheers and Frasier).  Bebe played the role of Velma Kelly in the recording we own, so that was a particularly special delight.

We stayed at the Waldorf=Astoria towers, ate some great food, and had a great time.  We were on our way to see the Statue of Liberty when I realized that I had left my wallet in a taxicab 20 minutes earlier.  Fortunately, some good people found it and returned it to me a few hours later.  The cash (about $350-$400) was gone, but that's what I expected (how sad is that?!)...I hope it went to someone who needed it more than I.  I was a bit panicked because we were scheduled to fly out of town later that evening and without an ID I wasn't going to be able to get on the plan.  I'm glad it didn't come to that.  Well, our plans to see the Statue of Liberty were cut short, but all in all we had a wonderful time (we did see it at a distance).

I may call this experience "the full experience", but there is oh, so much more to do - already anxiously anticipating the next trip! :)

Tuesday, March 06, 2007 11:09:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, March 01, 2007

On March 8th, 2007 there's going to be a special event at the local, Salt Lake City Microsoft Offices: Windows Vista for Developers Clinic.  If you're using Vista, planning on using Vista, writing software that needs to run on Vista, or generally want to know more about it, please register and attend.

The event is an all-day event, running from 9:00 AM - 5:00 PM (just in time to get out to head to the Utah .NET User Group :)).  I'll be there and would love to see anyone else there as well.

(NOTE: I just found out about this event today - sorry for the late notice, but as I understand it not many are yet registered, so hurry up.  It should be a fun time.)

Here are the details:

Salt Lake City – March 8, 2007
Salt Lake City Microsoft Office
123 Wright Brothers Drive, Suite 100
Salt Lake City, UT
Registration: 8:30 am
Event: 9:00 am - 5:00 pm
Register:
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032329708&Culture=en-US
Event ID: 1032329708

Windows Vista for Developers Clinic

For developers who want to create connected applications with visually appealing and highly-differentiated user experiences, Windows Vista provides the most productive, secure and reliable platform.  Developers can take advantage of the .NET Framework for rapidly building connected and secure applications or websites, leverage native Windows APIs for additional functionality and performance or freely mix between the two models.

This one-day instructor-led clinic and hands-on lab for developers introduces students to high-level information and facilitated discovery on the Microsoft Windows Vista platform, maintaining and enhancing their productivity and driving them to further study and adoption of Windows Vista as their preferred application development platform.

AGENDA

Session 1: Introduction to Windows Vista Application Development

The session provides an overview of the major goals and benefits related to developing applications for Windows Vista. The session focuses on the new features available in Windows Vista and on an overview of the application compatibility issues for deploying existing applications that might not be Windows Vista compatible in a corporate environment.

Session 2: Introduction to Microsoft .NET Framework 3.0 Technologies

The session provides an overview of the .NET Framework 3.0 programming model. After explaining the basic concepts of .NET Framework 3.0, the session describes how to develop applications using Windows Communication Foundation and Windows Workflow Foundation as well as how to use CardSpace.

Session 3: Introducing Windows Presentation Foundation

The session provides an overview of how the Windows Presentation Foundation provides the foundation for building applications and high fidelity experiences in Windows Vista, blending together application user interfaces (UIs), documents, and media content.

Session 4: Introducing the Windows Vista APIs

The session provides an overview of the new Windows Vista APIs and demonstrates how to use the new APIs to develop applications for the RSS platform and to query the Windows search engine.

Hands-on Lab: Developing Applications for Windows Vista

The hands-on lab provides students an opportunity to work with developing applications for Windows Vista in a hands-on environment. This lab focuses on new application development features in Windows Vista.

Thursday, March 01, 2007 7:41:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback