# Wednesday, November 22, 2006

The Journey is Its Own RewardI read a very interesting post on Brydon's blog this morning. His post addresses an aspect of business that is very near to my heart. That is: life. When I graduated from high school and began working fulltime, one of the first reality checks I had was that there are no more summer vacations. It had never really occurred to me before my first real job that once you're out of school you don't get any significant time off. The second big reality check for me was the realization that I never was "going to arrive."

What I mean is this; without consciously thinking about it, I was always working toward sometime in the future when I wouldn't have to work again. My guess is most people are that way. Some may not even realize it until it's too late, but for most of us, we’re not going to ever “arrive.” For us, the journey is it’s own reward.

I realized this one beautiful spring evening as I drove home from work. The sun was just starting to cast late afternoon shadows and the temperature was perfect. As I drove home with my windows down I passed through what is known as restaurant corridor. The smell of various foods cooking all blended together with the perfect temperature and gorgeous sunset to provide one of those perfect moments. I immediately started dreaming of how nice it was going to be when I could experience this all the time.

That's when it hit me. This was a moment, not a lifestyle. The Lord gives you moments in life that are to be treasured. Instead of always looking for that time in the future when life will be perfect, I realized that I need to treasure 30 seconds here, 5 minutes there, whenever they come.

Work is like this. Unfortunately, no matter how much you like your job, for most people it is just that; a job. Either outwardly or secretly they’re looking for that time when they can do what they really want to do.

For instance, I *love* to write code. I still sit back sometimes and think "I can't believe I get paid to do this." On the other hand, there are many days I hate what I do. It's monotonous. It's frustrating. It sucks the life right out of me. On those days I want to quite and do something else. That's why I love Brydon's article so much. It addresses this reality of work being part of life.

Everybody needs change at some time. It doesn't matter how comfortable a chair is, you've got to get up and stretch after a while. It doesn't matter how much you like to sleep, you're going to get sore after being the bed for too long. Work is the same way. No matter how much you love what you do, you just need to give your brain a break sometime and do something different.

I really hope I can create an environment for the people who work with me that is like this. Whether it is my family in our home based business or others who come to work with us; I want to be able to provide an environment that breathes life into people not suck it right out of them.

Furthermore, I want to figure out how to extend this concept to our family. Surely there is a lesson to be learned here about encouraging our children to get the most out of life while at the same time being the most productive and helpful that they can be in their daily lives.

Thanks for the article Brydon. You've motivated me.

posted on Wednesday, November 22, 2006 12:12:52 PM (Central Standard Time, UTC-06:00)  #    Comments [1]
# Monday, November 13, 2006

This evening I was going to do something very simple: bind a couple of columns in a DataRow to a Repeater control on one of my ASP.NET pages. I coded everything straight through and compiled without thinking much about it. However, to my surprise I got a runtime error when I opened the page with the control on it. Much more to my surprise the error was stating that a column the DataRow I had bound to did not exist. Problem is, the column did exist and was spelled exactly like the column being reported as an error.

DataBinder.Eval: 'System.Data.DataRow' does not contain a property with the name dtCommentDate.

I looked at the documentation for DataBinder and it looked just like mine. My code looked like this:

<asp:repeater id="_rptComments" Runat="server">
   <ItemTemplate>
      <asp:Label ID="_lblDate" Runat="server">
         <%# DataBinder.Eval(CType(Container.DataItem, System.Data.DataRow), "dtCommentDate")%>
      </asp:Label>
   </ItemTemplate>
</asp:repeater>

which matched what the documentation said exactly. So, I beat my head against a wall for an hour or so trying to figure out exactly what was wrong.

After spending much time tweaking the syntax, getting some things to work, finding most failed, I noticed something about the above error that I had not caught my eye until this point. That is the word "property." I had assumed that the DataBinder.Eval() call was attempting to bind against a column or Item or something that used the "dtCommentDate" as a key. However, this error is telling me that "dtCommentDate" is being bound directly to the DataRow object as a property accessor. With this in mind I tried one last syntactical change:

<asp:repeater id="_rptComments" Runat="server">
   <ItemTemplate>
      <asp:Label ID="_lblDate" Runat="server">
         <%# DataBinder.Eval(CType(Container.DataItem, System.Data.DataRow), "(dtCommentDate)")%>
      </asp:Label>
   </ItemTemplate>
</asp:repeater>

Notice the parenthesis that surround the dtCommentDate. Since the contents of the second parameter are directly bound to the DataItem object, in this case that means that the Item accessor syntax of the parenthesis is necessary.

In my looking around the Internet for a solution to my problem I did not find an example like this so I wanted to post it here in hopes that it will help someone else.

posted on Monday, November 13, 2006 10:31:15 PM (Central Standard Time, UTC-06:00)  #    Comments [3]
# Friday, October 27, 2006

Today I didn't bill for my time. I couldn't. I finally hit the wall on hard drive space; a problem I've been ignoring for way too long.

Don't get me wrong, I'm not completely irresponsible on this front. I do run backup software and keep an up-to-the-hour image of everything that happens on my drive each day. The problem I'm talking about has more to do with the shear volume of digital stuff we keep these days. Mail, pictures, music, documents, code, notes, recipes you name it, seems like everything we do these days is stored digitally and the delima of what to do with it all is catching up with me.

On our last trip to Canada my children averaged 1 GB pictures per week. In and of itself that's not too much data, but what do you do with years of this stuff? I'm putting the temporary solution in place today: 400 GB drives installed in a Windows 2000 machine mirrored as one drive. In theory this should give me roughly 400 GB of storage with a redundant, always up-to-date, backup. However, we lost two drives in one machine last summer due to a power surge. Hmmmm... it's on a UPS now, but... still makes we wonder. So, my plan is to add one more 400 GB external drive via USB 2.0 and back up my storage drive at least once a week. I figure that's the best I can do, at least in my price range.

However, all of this still does not solve the long term problem; it just delays it. Whether it's a year from now or five years from now we are eventually going to run out of space on this 400 GB drive. Then what? Hopefully there will be larger drives at an affordable price, but this all seems somewhat absurd, not to mention volitile.

Thus the delima: how do we cope in a digital world? What are the right solutions? What are the wrong solutions? What do we do with all this digital stuff?

posted on Friday, October 27, 2006 3:37:45 PM (Central Daylight Time, UTC-05:00)  #    Comments [0]
# Thursday, July 06, 2006

I added a new option to our web.config file today under the appConfig section. There was nothing special about this entry. It used a key / value pair where the key was a string and the value an integer. Again, nothing special. I added a comment above and closed the file.

Next I ran the debugger to test my recent changes. To my surprise I got a message box stating that the Debugger could not attach to the web server.

"Error while trying to run project: Unable to start debugging on the web server. Server side-error occurred on sending debug HTTP request.

Make sure the server is operating correctly. Verify there are no syntax errors in web.config by doing a Debug.Start without Debugging. You may also want to refer to the ASP.NET and ATL Server debugging topic in the online documentation."

(Note to self: read message boxes more carefully the first time in the future.)

Odd, I just debugged this thing a few minutes ago. Unshaken I rebooted my machine and waited; thinking that IIS had just temporarily gotten hung up. After the reboot, however, I got the following error when opening my project in Visual Studio 2003:

"The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost'. 'HTTP/1.1 500 Internal Server Error'.

<Sigh> One of those days I see.

I opened up Google and began to search for the solution. However, after poking around a bit I hadn't found anything that cured my problem. <sigh again>

At this point I started considering what changes I had made. What possibly could have effected the opening of a Visual Studio project. Ah hah! The web.config. I had changed the web.config! So, I opened up the file to look for typos. Hmmmm... nothing there. Everything looked fine. I removed my recent additions anyway, just to see if it would help.

It did! The file opened right up without error. Alright! Now to figure out what the problem was.

As it turns out the problem was part of the comment I had made for my recent configuration key. In my comment I had added multiple dashes (-----) as a separator for a example text I had added. As it turns out these dashes seem to have caused the Visual Studio project launcher to croak. Furthermore, they cause the Visual Studio compiler to be unable to function properly.

Example:
<!--
  This is an example of what *NOT* to do in a web.config file.
  
  You should not use multiple dashes like I do below.

  Example:

  --------
  Blah
  Blah

  or it will cause problems
  -->

So, the lesson here is: do not use multiple dashes (-----) in your comments for a web.config (or I'm guessing any .NET config file) or it will cause problems that are VERY difficult to track down.

posted on Thursday, July 06, 2006 4:36:25 PM (Central Daylight Time, UTC-05:00)  #    Comments [0]
# Wednesday, June 07, 2006

We write a lot of code around here. As a result we often run into strange things that seem impossible to figure out. However, over the past 18 years, I have come to realize that with very few, if any, exceptions (no pun intended) the cause of even the most complicated errors can be determined.

Yesterday one of those very odd situations arose. We have a large application that is written in VB.NET and C#. When calling one of the the web methods on a web service written in C# I found that I was getting back nothing instead of the large set of data that was expected. Upon investigation I realized that this was only happening when the code was compiled for release and that the error does not occur in debug mode. Although this is odd, it is not complete unbelievable since it is possible that something was put into the debug only portion of the code that should not have been there. However, this time, that was not the case. The same exact code was getting executed in both modes.

The exception that was occurring was: "Invalid attempt to Read when reader is closed." The code block looked something like this:


Hashtable htObjects = new Hashtable();
SqlDataReader sdrObjects =
null
;

try
{

   sdrObjects = objectRepository.GetObjects(true);

   int intObjectId = 0;
   COurObject theObject =
null
;

   if (sdrObjects != null)
   {
      
while
(sdrObjects.Read())
      {
         intObjectId = sdrObjects.GetInt32(1);
         i
f
(intObjectId != 0)
         {
            
theObject = new
COurObject();
            theObject.Load(intObjectId);

            
AddObject(theObject, htObjects);
         
}
      
}
   }
}
finally
{
   
if ((null != sdrObjects) && (false
== sdrObjects.IsClosed))
   {
      
sdrObject.Close();
   }
}


When I examined the logs I found that the SQL exception was being thrown in the loop over sdrTrades.Read(). So, I added a bunch more log entries to track exactly where things were breaking down since I could not trace things in the debugger. What I found was quite intriguing.

I discovered that if I put a log entry in the finally block that the code worked as expected; even in release mode. This is very odd considering that the actual exception was being thrown in the try block above. As I was explaining this to a friend of mine I told him that it seemed as if this were some sort of code generation error. Then it hit me: this piece of code didn't have a catch block.

So, I went back and added a catch block to the above code and walla! It worked in both debug and release mode. Furthermore, it didn't matter how much or how little error code I put in the catch block or whatever other changes I made to the code. As long as the catch block was in place the code works in both debug and release modes with out any strange errors.

I would really like to go back now and examine the IL code for both of the cases to see exactly what is going on. However, I don't have the time right now to do that because we are trying to get a product out the door. If I find the time in the future I'll post the results of that research here.

So, if you find yourself with a strange SQL exception in your C# code that only happens when you compile for release mode, you might just check to see if you are using a try / finally block without the catch. If you are, this might just be what is happening to you also.

posted on Wednesday, June 07, 2006 2:38:05 PM (Central Daylight Time, UTC-05:00)  #    Comments [1]
# Monday, May 08, 2006

My primary source of income is from comtract work that I do for Trade Settlement, Inc. Next week we have development meetings in Toronto. I'm supposed to fly in on Wednesday evening for meetings onThursday and Friday. However, I convinced my family that it would be more fun to go together, so we're going to drive!

We live in Texas so it should take us about 3 days to get there. We plan to stay with friends in Missourri and Michigan along the way. When we get there we will stay in a vacant rent house owned by one of the men I work with. The trip should be about 1,500 miles one way from Texas.

posted on Monday, May 08, 2006 10:46:42 AM (Central Daylight Time, UTC-05:00)  #    Comments [0]
# Monday, March 27, 2006

Yesterday I heard the fire alarm go off in our small town. I didn't think too much about it as I sat in a small meeting that had assemble at 10:00 am that morning.

Not long after the alarm I heard a low flying helicoter rush by over head. Again, the incident caught my attention, but nothing raised an alarm.

About 10-15 minutes later one of the the ladies in our group said she had to excuse herself. She had received a phone call and said that her dear friend's house was burning to the ground as she spoke. Furthermore, she explained, one child had died and another was currently being Careflighted to the Parkland Hospital burn unit in Dallas.

Needless to say the tone of the meeting imediately changed. We prayed for this family and wept at the shock. The meeting was adjourned shortly after this.

The lady who lost her house and one child is a friend my wife has recently met. She is a single mother of 12. Most of these children are adopted. She is a single mother because her husband left her as her convictions to care for orphans grew and he did not share the vision.

The most recent aditions came when she drove all the way to Atlanta, GA ( from East Texas) to pick up 5 children who were unwanted by their birth mother. Shortly after returning home she received a call from the birth mother letting her know that she had just given birth to a 6th child and that she could have that child too if she wanted him. So she got back in her car and drove to Atlanta to pick up the 6th child. This is the baby that died in the fire yesterday.

We decided to drive by the house on our way home to see if there was anything we could do. As we arrived the house was still on fire. There were people eveywhere. As I approached the scene I overheard a young man say "well I lost another brother." He was one of the older children in the family and he was referring to another brother who had died a few years ago. This child was also adopted, only he was adopted with a terminal illness and loved until the very moment he died, by a woman who is the very embodiment of selflessness.

As we left the central question on our minds was: How? How can the Lord allow something like this to happen? How can this woman carry on? How?

Shortly after I returned home I received a phone call from a friend who said they were having a community meeting at the house across from the Baptist church. As I arrived I could see cars everywhere. I walked in the house to realize the owner had offered it as a home until the family was able to rebuild their own home.

This house which had been empty for quite some time was now alive with a flurry of activity. The lawn was being mowed, old junk that was being stored was hauled out. Beds, dressers and food were being brought in. Toilets were being cleaned and windows were being washed. By the end of the day the home was fully decorated all the way down to bright green and blue comforters on the girls' new beds with a matching string of lighted plastic flowers draped around the window.

On the way home we stopped by the supermarket for a few things. At the check out the young lady pointed to a box on top of her register that had a sign that read "Please help..." She explained that they had been collecting money for this family and asked me what they should do with it. I put her in contact with the right person.

As I drove home I marvelled at what this community had done. Although this family had just lost both a home and a child, before the sun set they had a new home, a glimmer of hope and a community to surround them.

We are told in Galatians 6:2 "Bear one another’s burdens, and thus fulfill the law of Christ". I saw this lived out yesterday before my very eyes. People gave of their time, reources and money without ever being asked. None of this can come close to taking away the pain of losing a child. However it can take away a large portion of the other stress associated with such an event.

Pray for this family. They have suffered unimaginable loss. Pray also for our town, that this event would be a seed which would produce much fruit for the kingdom of God. Finally, pray for Christians all over the world that the selfless life demonstrated by this lady would be our living testimony of a risen Saviour.

posted on Monday, March 27, 2006 10:10:58 AM (Central Daylight Time, UTC-05:00)  #    Comments [0]
# Wednesday, March 22, 2006

I didn't have this blog in place at the time we received text for the ESV from Good News Publishers. So, I wanted to put the announcement up here now.

We have the full text of the ESV and are working to get it prepared to work with i-Know It Bible Memory. I will post another announcement here as soon as it is available.

Thank you Good News! We're looking forward to working with you.

posted on Wednesday, March 22, 2006 1:38:10 AM (Central Daylight Time, UTC-05:00)  #    Comments [0]

We just received the full text of "The Message" from NavPress today! We will now begin work needed to prepare that text to work with i-Know It Bible Memory. I'll post another announcement here as soon as it is available and ready to ship!

Thank you NavPress! We're looking forward to working with you.

posted on Wednesday, March 22, 2006 1:34:49 AM (Central Daylight Time, UTC-05:00)  #    Comments [0]

I have spent days trying to figure out why my Visual Studio 2003 debugger hangs when trying to debug an ASP.NET application. The symptoms are that after pressing the debug button the application will act like it is going to get into debug mode, but it hangs somewhere in the process, never quite launching the application and never quite returning back to normal when the stop debugging button is pressed.

The error message I was receiving said something like "Auto-attach to process" aspnet_wp.exe Failed. Error code 0x80010012.

After searching and searching newsgroups online, I finally found one small line of advice that solved all of the problems. It simply read: "Sometimes enabling Unmanaged Debugging in your ASP.NET project settings will cause Visual Studio to hang." Walla! Eureka! that was it!

Last week I was trying to debug some historical COM objects and tried turning on this option to see if I could step into that code. However, I had forgotten that I had enabled this and have been struggling ever since.

Praise the Lord for this person who left the advice above. You made my week!

posted on Wednesday, March 22, 2006 1:32:19 AM (Central Daylight Time, UTC-05:00)  #    Comments [1]