Saturday, July 05, 2008

Two Years Later

I'll try and bring you up to speed on life as it is now.

It's been a long time since I've bothered to post anything, due to a number of reasons I won't go into here.

So the last post was November of 2006. Sometime in early 2007, I ran out of work with my previous company, primarily because they sold the business unit I was working directly for, but failed to sell me along with it. They figured they could use me for other things, but those things just never seemed to materialize. Finally, in October of 2007, after nearly a year of not doing much of anything, they decided to stop paying me outrageous amounts of money every month for sitting around and playing.

In December of 2007, I got to see Boyz II Men again, but this time it wasn't quite as memorable as the first show I saw in Vegas.

I went back to work as an electrician from October until May of 2008, when I got a call from a recruiter who said he had the perfect job for me. It's just a programming position at a huge company, but the work is challenging and close to home.

In other news, my wife and I sold our house to my father (it's "Pending Sale" now) and he gave us a deposit on the house, which we applied as a down payment on a new house that we're having built. It will be around 2200 sq ft and will have a geothermal hvac unit. It cost a lot to have that unit put in, but it will pay for itself in time, as the energy costs from month to month to operate it will be substantially lower than running a traditional unit. The biggest savings will be in the summer months, where we shouldn't have outrageous electric bills just to keep the house cool.

It will sit on 3/4 of an acre, in a new subdivision in Broken Arrow, actually right on the BA/Coweta border. The kids will attend Coweta schools.

We're cleaning out the garage over the holiday. We rented a 20 ft3 dumpster that is sitting in the driveway and we're moving junk from the garage to the dumpster as fast as possible. It's about half-way full now, and it looks like we're not going to be able to get all of our junk into it.

Today, while cleaning the garage, I managed to step on a nail sticking up out of a board. It went through my foot and sent me crying to the urgent care clinic to get a DT shot in the arm. Now, my arm and foot hurt like crazy. Great day for me...

At work I'm dealing a lot with VB6 and as such find that I'm forgetting .net a little more each day. I have two projects in .net that I work on once or twice a week, but I find myself having to take a little time and re-adjust when I switch from one language to another. It's easier if I switch back a forth often, because then I don't get too "into" one language or the other, but sometimes I get stuck on one project (usually a VB6 one) for a few days in a row, and then it's difficult to switch back into .net work. I'm also still doing a lot of work in TSQL, but I find it isn't hard to switch into and out of that language at all, probably because it is so different from VB6 and VB.NET.

The most enjoyable project I've done so far is an application (in VB.NET) that takes a list of VB6 UDTs and converts them into SQL table definitions, with PK and FK constraints. It also adds a "[Created]" field to the end of every table and sets the default to GetDate() so that when the record is populated there will be an easy-to-access record of the date and time that it came into being.

The two things I'm having trouble with is how to handle the array types that are arrays of non-UDTs, for example,

Public Type Widget
Name as String
X() as String
Y() as String
Q() as Integer
End Type

causes four tables to be created and three foreign keys. The tables are named TBL_Widget, TBL_WidgetX, TBL_WidgetY, and TBL_WidgetQ. The Widget table has 6 fields:

WidgetID [int] not null identity (1,1)
WidgetQID [int]
WidgetXID [int]
WidgetYID [int]
Name [varchar] (100)
[Created] [datetime] default (getdate())

The X, Y, and Q tables look basically like this:

WidgetQID [int] not null identity (1,1)
ValueOfQ [int]
[Created] [datetime] default (getdate())

And the FK constraints lock each record for a Q,X or Y record to it's parent Widget record.

This isn't a problem in itself, but I know that in a lot of conditions the "X" and "Y" values should have been another UDT, like this:

Public Type Widget
Name as String
Cords() as XYCords
Q() as Integer
End Type

Public Type XYCords
X() as string
Y() as string
End Type

and the XYCords table should actually end up being one table with two ValueOf fields (one for X and one for Y) but I don't have any way to programatically figure these sorts of things out, and there are too many types (about 140 in my currency project) to do it manually.

The other problem is the VB "String" type. It converts to a SQL varchar, but how long? I initally just set them all to (1000), but this causes some of my records to have "room" for 22,000 bytes, whereas a SQL record is limited to 8060 bytes. So I have to figure out a way to programatically determine the maximum length of every String field in every type.

The whole idea is to build a SQL database to support the existing application, which is currently using XLS, DOC, Cad, TXT, and a few MDB files for storing data. But everything seems to be pretty well defined in the user defined types. So, if I can just convert those, it will save me a few months' work of figuring the schema out manually. I realize there will still be a lot of manual "tweaking", but I hope to automate the biggest part of this.

I'll try to post a little more often. Maybe once we get the new house finalized and we're moved in, I'll try to remember to post an update!

Ciao,

Jeremy