Thursday, December 20, 2007

If anyone is curious, this is what Big Sky Amber Ale looks like before partaking. Be warned, this is a hoppy beer!
Posted by Picasa

Tuesday, December 18, 2007

Debug symbols not loaded

I spent a frustrating hour yesterday trying to figure out why I couldn’t hit the breakpoints (“Debug symbols not loaded”) in my class library.  I added and removed references and build options until I could think of nothing else to do.  Then I said, even though it’s not pointing at the GAC version (this is a DLL shared by multiple apps), let’s see what happens when I remove it from the GAC…BINGO, problem solved!  I still don’t understand why it was using the GAC version since all the projects in my solution were referencing each other as “project references”, but that solved the issue.

Thursday, December 13, 2007

MasterPage tips

It pays to look around at what other developers are doing. Today I was reading SimpleTalk articles (see Phil Factor) and found the Master Pages Tips and Tricks: Specifically, I do not need to cast the Master page to be able to use my custom properties.
Fortunately, a strongly-typed solution is available that doesn't involve casting the Master property to the base class of the master page in order to access its members (keep in mind that any server controls defined in the master page won't be accessible even after a cast is performed, because they're marked as protected by default).
In cases where a control defined in a master page needs to be exposed to one or more content pages in a strongly-typed manner, a public property with a get block can be added into the master page class as shown in Figure 2. The get block returns a Label control instance named lblHeader.

A content page can reference members defined in the custom master page class by adding the MasterType directive immediately under the Page directive:

<%@ MasterType VirtualPath="~/Templates/WebsiteMasterPage.master" %>
This causes the ASP.NET compiler to use the custom master page class for the type of the Page class's Master property as opposed to the default MasterPage class

Word to Help Converter

I found a great little open source tool for converting Word documents to compiled HTML help files written by tonibo. It also generates a reasonably good HTML frames based help system – the purpose for which I am using it.  Rather than create a single large PDF file, I prefer to have a series of help files that can be consumed as a guide, or link directly to from the content.  If you download the source, you also get to brush up on your Spanish!  Mui Bien!


Tuesday, December 11, 2007

First beer - first impressions

For those awaiting the results of my first homebrew, the Big Sky Amber Ale (thank you Weekend Brewer) it made the debut tasting at a holiday party this weekend to rave reviews by the partakers.  The tasters were being charitable considering this was my first attempt: “wow, it doesn’t make me want to throw up!”  In all fairness, the beer is a bit young at only one week in the bottle.  Over the next few weeks the taste should improve and the hoppy-ness should mellow. 


If you are considering brewing, I strongly encourage you to jump right in.  The process is fairly straightforward and the satisfaction of brewing your own beverage is quite rewarding.

Wednesday, December 5, 2007

DefaultButton, DefaultFocus and UniqueID vs ClientID

Wow, now I just stumbled upon something rather confusing.  I discovered one of my screens was deleting records by default (confirmation prompt of course) when users pressed ENTER so I went to set the DefaultButton to something more appropriate.  While I was at it, why not set the DefaultFocus too?  So I added the following code:


Page.Form.DefaultButton = btnComponentSearch.UniqueID

Page.Form.DefaultFocus = txtComponentName.UniqueID


That fixed the button, but the focus wasn’t working so I changed focus to


Page.Form.DefaultFocus = txtComponentName.ClientID


To my surprise it worked!  Then I thought…what happens if I change the DefaultButton:


Page.Form.DefaultButton = btnComponentSearch.ClientID


That resulted in the following error:

The DefaultButton of 'form1' must be the ID of a control of type IButtonControl.


So it could no longer find the control, how confusing…until I read this article about Naming:


Rendered name attributes correspond to UniqueID property and id attribute to ClientID property.


So gist is: VB.Net understands UniqueID, but for Javascript-ish stuff, you’ll need ClientID (except for the DefaultButton – which uses both J ).  Pretty crazy!

Monday, December 3, 2007

Bottled my first brew

With the help of a little child labor (my 5yo son helped), the first batch of malted beverage is carbonating in 28 bottles (22oz each).  A quick sample revealed a hoppy amber liquid that tasted something like beer.  Two more weeks to wait for the final product…

Friday, November 30, 2007

When is a class not a Class?

When it’s a structure, DOH!  I couldn’t figure out why my For Each loop wasn’t saving the value of my Reference objects.  Turns out they were Structures (treated like value objects) so they were copies, not references.  I discovered that with the help of Google Answers!

Troubleshooting the FCKing Editor

TestLink relies on FCK for rich-text editing.  Well the File Upload and Browser weren’t working – initially b/c then needed to be enabled, then I was getting a popup that said “XML Request Error : Internal Server Error (500)”.  I used the FCK Editor test page: editor/filemanager/browser/default/connectors/test.html  to determine the /userfiles/ directory needed to be created.  I ended up just putting it in the root to save time/trouble.

Administering SQL Express without Management Studio

Call me a glutton for punishment, but today I endeavored to create a database and user w/o the aid of SQL Management studio.  Why would you do something so ridiculous you ask?  First, my new shop is more of an Oracle group that tolerates MS, so I don’t have Management Studio installed yet.  Second, I think you learn more about a product when you start using it command-line.  No hand holding, point and click stuff here.  Just raw ascii and endless error messages.  Anyway, I got it working so here’s the script to create a database and a login for it:


create database TestLink


create login testlink with password = 'abc123', DEFAULT_DATABASE = testlink


use testlink

create user testlink with default_schema = dbo


sp_addrolemember 'db_owner', 'testlink'



Btw, if you’re SQL Express install is fresh then it is in Windows Authentication mode and needs to be changed to Mixed mode (restart SQLEXPRESS service required):



LoginMode = 2

Thursday, November 29, 2007

PHP + MSSQL working

I have learned much more than I wanted to about PHP trying to get TestLink working with MSSQL 2000 so here’s what I did:


  1. Downloaded ntwdblib.dll from and overwrote the c:\PHP5 version and copied to SYSTEM32 (this seems to be a key to solution)
  2. Enabled the MSSQL extension (extension=php_mssql.dll )
  3. Restart IIS
  4. Visited PHP page with the info code in it: <? phpinfo(); ?> to verify the extension loaded.
  5. Ran test code that connected to a SQL server (I just Googled it).



Wednesday, November 28, 2007

Dynamically create a DataTable for Oracle Stored Procedures results

I recently had to write a report that flattened 20 joined tables to “dump” the contents for ad-hoc-i-ness; probably 100+ columns.  Well, I did not want to have to build a fixed DataTable (Table.Column.Add(“Col1”)…), as was the standard in our shop, so I wrote a routine to do it instead:


    Public Shared Function BuildDataTable(ByRef dr As OracleDataReader) As DataTable

        Dim table As New DataTable()


        Dim colName As String


        ' Create the table from the DataReader columns

        For i As Integer = 0 To dr.FieldCount - 2

            colName = dr.GetName(i)




        ' Populate the table

        While dr.Read

            Dim row As DataRow = table.NewRow()


            For i As Integer = 0 To dr.FieldCount - 2

                row.Item(i) = dr(i)




        End While


        Return table

    End Function

Tuesday, November 27, 2007

Fermenting Update 1

As of Tuesday at 7am (30 hours), the fermenting has slowed to a very occasional bubble (1 in 30 seconds).  Once it stops I’ll wait 24 hours before bottling.  Unfortunately I discovered (actually read ALL the directions) that I put the Dry Hops in before I was supposed to.  Don’t know what effect that will have…only time will tell.

Monday, November 26, 2007

MySQL Backup & Restore

Just wanted to document how to backup and restore my shiny new MySQL database since I’ve got some real data in it.



mysqldump -u sadmin -p pass21 Customers > custback.sql



mysql -u sadmin -p pass21 Customers < custback.sql

Brewmeister C

Well, I jumped feet first into hobby-brewing.  After plunking down some bucks at the local homebrew store for their economy kit, I created a sweet smelling “amber” wort – beer jargon for boiled hops & sugars.  By the next day, the air-lock was bubbling, so I guess the yeast are alive and well in that plastic bucket (aka fermenter).  Only time will tell if I followed enough of the directions in enough detail to have a consumable beverage.

Thursday, November 15, 2007


After find what looked to be a great QA utility, albeit written in PHP, I endeavored to install PHP and then MySQL, and then...the utility. After much wrestling with the PHP + MySQL config I was finally able to get it working with the help of this guy and another suggestion that you MUST reboot to have environment variables like PATH take effect...doh!

Still can't get testlink working though...

Wednesday, November 14, 2007

Good find: HttpContext.Current.Items

Thanks to Mike Duncan for a good tip and lots of laughs:


Generally, HttpContext.Current.Items doesn’t get all that much hot blog press, but let me tell you, I’m here to change all that. For those out of the know, System.Web.HttpContext.Current.Items is a sweet key-value pair collection you can use to pass objects around up and through all components that participate in a single HTTP request.

Array.ForEach (also works for )

Thanks to the .Net Tip of the Day for this little gem:


    Sub HandleClick()

        Dim myFam As String() = {"Chris", "Sue", "Matthew", "Annie", "Samuel"}

        txtResult.Text = ""

        Array.ForEach(myFam, AddressOf AddSeperator)

    End Sub


    Sub AddSeperator(ByVal name As String)

        txtResult.Text += name & "|"

    End Sub

MVC .net?

The release of the MVC framework may be worth watching:

One of the things that many people have asked for over the years with ASP.NET is built-in support for developing web applications using a model-view-controller (MVC) based architecture.

Last weekend at the Alt.NET conference in Austin I gave the first public demonstration of a new ASP.NET MVC framework that my team has been working on.  You can watch a video of my presentation about it on Scott Hanselman's blog here.

We'll be releasing a public preview of this ASP.NET MVC Framework a little later this year.  We'll then ship it as a fully supported ASP.NET feature in the first half of next year.

MaintainScrollPositionOnPostback is cool (and easy)

New to me is the


setting for the Page control.  It's a little "jerky", but it gets the job done.  It pays to troll the 4Guys site from time to time.  They really know their stuff!

Tuesday, November 13, 2007

GridView DataItem and Sorting NameValueCollections

I wanted to reuse the data that I was pulling for my Gridview (rather than make a separate call to the DB) so I put this code in the RowDataBound event to collect all the distinct server names:
Dim testServerList As New NameValueCollection
Dim name, value As String
If e.Row.RowType = DataControlRowType.DataRow Then
    name = CType(e.Row.DataItem, DataRowView).Row.Item("TestServerName").ToString()
    value = CType(e.Row.DataItem, DataRowView).Row.Item("TestServerId").ToString()
    If Not name.Equals(String.Empty) AndAlso testServerList(name) = Nothing Then
        testServerList.Add(name, value)
    End If
And then I wanted to sort the data:
Dim sortedKeys() As String
sortedKeys = testServerList.AllKeys

Monday, November 12, 2007

Ntelos 8K

What a cold day.  The start was about 38F which is pretty cold for a cotton T and running shorts.  My hands didn't warm up until mile 2.  For some reason I had it in my mind that an 8k is only 4.6-4.7 miles which ended up being a good thing since I started picking up the pace at about 3.5 miles since I thought I only had about 1 miles left.  Here are my split times for future reference:
37:55 HR: 173avg 197max
Mile 1 - 7:36 158avg
Mile 2 - 7:49 174avg
Mile 3 - 7:53 175avg
Mile 4 - 7:34 177avg
Mile 5 - 7:01 180avg

Friday, November 9, 2007

How (NOT) to winterize an irrigation system

Note: you should not follow my advice. This is how a computer programmer winterizes a system and is clearly what not to do!
Do not:
  1. attach a compressor without understanding how your pressure regulator works (mine is loosen = less pressure ?!?!?) if you're asking what's a pressure regulator just stop now
  2. open the city water valve with your compressor attached!
  3. assemble cast iron fittings without lots of teflon tape
  4. walk back and forth to the timer control
  5. expect things to go as planned
I should have known I was in for trouble when things went relatively smoothly at Home Depot. I purchased two cast iron adapters to take my 1.25" PVC fitting to 3/8" compressor fitting - after we found the "real" plumbing associate.

I assembled my "adapter" and when connecting it to the system the pressure instantly shot up to 80psi - the danger zone for PVC. You don't want to be above 60psi - city water pressure. Anyway, I figured lets see what happens to that zone I don't use that turned on and worked like normal. The big zone never did lift the sprinklers, so I'm a little worried it didn't get blown out enough. Hopefully we'll be okay here - south of the mason/dixon.

My valves have little manual override tabs that I discovered after walking back and forth a bunch of times to the control in the garage. Next time I'd use them! Make sure you use lots of teflon tape, since the iron didn't seem to seal well with the PVC.

Thursday, November 8, 2007

Good thing I've got 2GB and a Duo


Flip-Flop - GIMP for President

After wrestling with Expression Design to do a simple screen capture + crop (and w/ the $$$ factor mentioned earlier) I went looking for something better - that's free.  Meet, GIMP. aka "The Free PhotoShop".  So far (read: 10 minutes) I haven't found anything that I don't like.

Great DIV hide JavaScript code

 My thanks to Lobo235 for his code that helped me with the collapsible fieldset:

<legend onclick="toggleLayer( 'divComponentInfo', 'expandImg' )" onmouseover="'hand'">
<img alt="expand" id="expandImg" src="images/expand_plus.gif" style="vertical-align:middle;padding-right:5px;" />Component information</legend>
<div id="divComponentInfo" style="display:none">

function toggleLayer( whichLayer )
var elem, vis;
if( document.getElementById ) // this is the way the standards work
elem = document.getElementById( whichLayer );
else if( document.all ) // this is the way old msie versions work
elem = document.all[whichLayer];
else if( document.layers ) // this is the way nn4 works
elem = document.layers[whichLayer];
vis =;
// if the style.display value is blank we try to figure it out here
vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
vis.display = (vis.display==''||vis.display=='block')?'none':'block';

Phil Factor is hilarious

It's got to be the funniest tech-blog...gets a laugh every time.

Heater fix - blown fuse

If you're blower fan is running and won't turn off, you just may have blown the fuse inside the control panel - that's what the "heater guy" had to fix.  Note to self: turn power to heater off before replacing the thermostat.  It would help if the breaker box were labeled correctly...disposal and heater were cross labeled!

Expression Design

I needed to create some icons and I don't have PhotoShop installed so I thought I would check out Expression Design.  I am pleased to report that they have faithfully copied Adobe's interface and hotkeys and in some ways improved on the tool.  I particularly like the scrollable properties window (much need at laptop resolution - 800px high).  Unfortunately MS Marketing apparently decided to make it painful to get Design b/c you either buy the entire Studio retail or have Team Suite MSDN ($10k).  That will probably keep most developers I know from using/switching...

Wednesday, November 7, 2007

Testing results of REF CURSOR in PL/SQL and Toad

I'm new to .Net development with Oracle procedures and today I just discovered the PL/SQL to call a procedure that returns a REF CURSOR and print the output in Toad. 
Many thanks to Littlefoot for the answer to making this work in Toad:
In such a case, check that DBMS Output is enabled (turn red button to a green one) and, possibly, set "Frequency of polling" to a minumum value (2 sec) - otherwise, you'll have to wait (default) 5 seconds for anything to appear.
   C1    NUMBER;
   C2    VARCHAR2(10);
   C3    VARCHAR2(100);
   C4    VARCHAR2(20);
   T1    VARCHAR2(100);
   T2    NUMBER;
   P1    VARCHAR2(100);
   P2    NUMBER;
    DBMS_OUTPUT.PUT_LINE('base_id: ' || C1);

Useful tools

A tip of the hat to a couple of the free tools that use often:

Crazy day

Boy was yesterday a tough one!  Kids throwing up, code blowing up, interpersonal issues, and to top it off…I broke my mother's heater trying to install a new thermostat (blower motor would not stop running).  Today is looking much better by comparison!

WPF experiences

Like many, I've been experimenting with SilverLight and that led me to look more into WPF. Installing the CTP seemed dicey, but it was the only way to get Visual Studio to create WPF projects. Even then, following the NetFx3 lab was tricky and frustrating. Perhaps Visual Studio 2008 will make things easier.

Rockford Lhotka said it right:
From early on, my consistent feedback to Microsoft has been that the technology is a failure if developers have to learn XAML to use WPF. By that measure, the current release of WPF is not doing well.