Tuesday, April 10, 2007

Tablet PC!






Yay! I just received my Lenovo (IBM) Tablet PC that I've been wanting for years. I hope they are as good as advertised, since it certainly wasn't cheap.


I also just updated my Dell Laptop to Vista, and I hate to say it....I actually like it. I thought I was going to hate it, but its actually pretty nice.

Sunday, January 14, 2007

5 Things You Didn't Know About Me.

Or may have, but forgot.

1) I have a commercial driver's license. While attending A&M, I was a student bus driver for the campus. I was also a trainer for the student driver corps, which included 400+ drivers. I worked there for ~3.5 years.

2) I proposed to my wife while on a spring break trip to Europe. We were in Paris and I popped the question on top of the Eiffel tower. Tom Cruise copied me. So, suck it Cruise. :)

3) While in High School I was dead-set on attending the Univerity of Texas (to be in the band). However, at the last minute, one of my friends said he would only go to college if I went to A&M with him. So, I did, and I joined the corps of cadets and was in the Fightin' Texas Aggie Band for one semester as a bass player. I ended up quitting after the Nokia Sugar bowl in 1998 due to my grades. If I didn't leave the band, I wouldn't have graduated. I'm 100% sure of that.

4) I have a network policy named after me at my old high school. I figure that's enough details. :-)

5) I wear a size 16 shoe, but I never played basket-ball. In fact, I'm pretty awful at it. I'm just a tall white boy who can't jump or play ball. I did, however, play football (middle line-backer/nose guard/corner back) while in middle school. Likewise, I was played soccer for 3 years and was a soccer referee for 2 years while in High School.

Red Card! You are ejected from my blog.

New Year, New Title

I was recently called into my boss' office and was told that I was being promoted to Sr. Programmer/Analyst, effective immediately. I was very surprised.

So, I now have a little more responsibility at work and have gained the respect of my co-workes. I've only been at my job for 8 months, so getting a promotion to the Sr. level (which is the highest at my job), really took me by surprise. Especially since I'm the youngest and newest programmer at my job.

So, yay me and stuff. It is definitely a great way to start off the new year. Now it's performance appraisal time. Woo-Hoo.

Monday, October 23, 2006

Load Testing Error ASP.NET

This is going to be a boring blog post, but since I had the hardest time trying to figure out a somewhat usable solution to this problem, I figured I would share the wealth and see if anyone has a better way of handling this problem.

Background:
This is an ASP.NET 1.1 e-commerce web app written in VB.NET with SQL2000 as the backend DB. The architecture of the site consists of most of the reusable data being stored in the ASP.NET cache that expires each night at midnight and is recompiled/cached at that time or on request of a developer.

There is a user control that is utilized twice on a particular page that calls this cache for two separate datatables stored within the cache. The page will get the cached datatable, assign it to a new instance of a DataView, assign a row filter to that view, and then run through the data in a For..Each loop.

This approach works great under a normal load of the site. However, as soon as I throw the code onto a test server and then run Microsoft's Application Center Test with a load of 200 simulated users on this page, with each user requesting the page three times during the session, it starts to throw application errors. And a very specific one.

System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown. ---> System.IndexOutOfRangeException: There is no row at position 4.
at System.Data.DataView.GetRecord(Int32 recordIndex)
at System.Data.DataView.IsOriginalVersion(Int32 index)
at System.Data.DataRowView.get_Item(String property)

The code that causes this error is:
objSingleShipMethod.Item("ShipCode")

in the following summarized snippet of code.

    1  For Each objSingleShipMethod In objDV

    2 

    3             Dim dtEstDate As Date

    4             dtEstDate = estDate.EstimatedDeliveryDate(objHPProductInfo.ProductType, objHPProductInfo.ProductFormat, objSingleShipMethod.Item("ShipCode"), False)

    5         Next



objSingleShipMethod is a DataRowView and objDV is the instance of the DataView from the cache that I collected for use in this function.

Like I said, this works flawlessly under a light or moderate load on the server and will not throw an exception. So, what I ended up doing, which worked for a while is the following:

Each time the particular cached objects that I need for this page is called, I set an application variable that "locks" the Dataview until the process utilizing it is completed. When it is completed, the application variable is unlocked and the next thread can then utilize the DataView. The only problem with this, is I had to set the checking of the state of the application variable to essentially "time-out" after a given period so that thread wouldn't be waiting for eternity. So, under a somewhat heavy load, this code will execute and restrict the thread from grabbing the same DataView that is being used.

So, that worked up until a few days ago. Now, I added some more code to the control that makes the page execute a little slower and this error started to happen once again. The solution I found that finally worked (which I am open to criticism and re-working) is:

    1  'Set the application lock on the Shipping View

    2         setApplicationLock("ShippingViewLocked")

    3         Dim newDV As New DataTable

    4 

    5         Dim objDV As DataView

    6         If IsNothing(HttpContext.Current.Cache("DVProductShippingMethod")) Then

    7             objDV = New DataView(Me.GetTable("ProductShippingMethod"))

    8 

    9             HttpContext.Current.Cache.Insert("DVProductShippingMethod", objDV, Nothing, GetExpirationDate, TimeSpan.Zero)

   10 

   11             If Trim(rowFilter) <> "" Then

   12                 objDV.RowFilter = rowFilter

   13                 newDV = objDV.Table.Clone

   14                 For Each dvRow As DataRowView In objDV

   15                     newDV.ImportRow(dvRow.Row)

   16                 Next

   17 

   18             End If

   19         Else

   20             objDV = CType(HttpContext.Current.Cache.Get("DVProductShippingMethod"), DataView)

   21 

   22             If Trim(rowFilter) <> "" Then

   23                 objDV.RowFilter = rowFilter

   24                 newDV = objDV.Table.Clone

   25                 For Each dvRow As DataRowView In objDV

   26                     newDV.NewRow()

   27                     newDV.ImportRow(dvRow.Row)

   28                 Next

   29             End If

   30         End If

   31 

   32         Return newDV.DefaultView



So, basically what I added to the call to get that view is to create a new "temporary" dataview, determine if the cache is present, if it is, apply the row filter to the cached dataview. Then clone the cached dataview into the temporary dataview (cloning only takes the structure, not the underlying data), loop through the cached dataview and import each resulting row into the "temporary" dataview. Then, return the temporary dataview to the page requesting it.

What was happening, as far as I can tell, is by passing the other dataview, it's not creating a new instance each time during the page execution and is somehow still grabbing ahold of the dataview located within the cache, and when you try to apply a row filter or really do anything with it, it starts to error out if commands come in simultaneously. The goal of this function was to return a brand new object with the data in it that is not tied to the cache or any other commands that could cause this error. The only way I could find to do that was to create a new view and add the columns that way. It seems crazy and weird, but it's what eventually worked.

Sorry this was so boring. I figured I needed to write it down and make it available on the internet just in case someone else has encountered the same problem and either can get some help from this or tell me I'm an idiot and should have approached it this way instead.

Monday, October 16, 2006

TiVo + FaceBook

So, it appears that I have taken the plunge and ordered a TiVo. Now, don't get excited. I didn't get the Series 3...yet. I got the Series 2 DT 180-hour one for our bedroom. When we had Dish Network in College Station we were able to watch TV until we got tired, hit pause, and watch the same show in our bedroom since it was accessing the same box. We, apparently, really miss that. So, to get us back on that trend, this TiVo will be in our bedroom and I'll keep the TimeWarner crap-tastic HD-DVR on our main TV downstairs until the Series 3 a) comes down in price and b) includes multi-room viewing. I'd really like to see the Series 3 eventually be able to push the recordings to our Series 2DT TiVo upstairs and down-convert the HD into SD (or something) so we can share the recording space.

I don't think that will be completely possible, but it's fun to dream, right?

This concludes another boring and useless update to my blog. And now Facebook users can see it too! Oh boy!

Thursday, August 17, 2006

Checks now takes Checks

Yay! So, probably my biggest project at my job finally went into production on Wednesday. I got to work at 5:45am and at 8:10am we completely launched it on all three of our servers. The preliminary results are really good.

I was hired to make the company an extra $1Million this year on the website channel; and with this one project it looks like that goal will be reached. I'm pretty stoked about it. (Obviously I am, since I took the time to write my thoughts down on here, although I never update this blog).

So, it looks like I get to keep my job there for a little bit longer. :)

I'll try and get some pictures up of our house and such sometime in the future...we are just about totally moved in now, so I don't mind taking pictures for once.

Wednesday, April 19, 2006

I can print checks, yes I can I can print checks, how 'bout you?!?

Ok, so maybe that didn't work so well. Remember in high school with the spirit thing...We've got spirit, yes we do, we have sprit...how 'bout you? blah blah blah, then it turns into "We've got more! We've got more! We've got more!" and then everyone cheers on both sides of the stands because they think they "won". Yeah, that's what I was going for. So, it failed. Sue me.

Well, we're moving along at getting into our new house...we should be closing on the 28th, and I'm getting excited to start to get settled there. It's an expensive house, but it will be worth the payment to see Kristen happy with it.

So, today I learned how we print checks at work today. It was actually very interesting, and amazing at how fast it can be done. I also listened into a few calls in the call center today. I'm so glad I won't have to worry about that any more. I certainly feel their pain, so anything I can do to help them out; I'll certainly do it.

That's about all of my update for now. Kristen did find a dog door built in to a storm door that we are considering buying...it should make our lives easier (or so one would think)!

Adios!

Tuesday, April 18, 2006

Checks doesn't take Checks?

So, the new company I work for is in the Check business. However, you can't pay for your order using an ACH/EFT payment. I find that highly ironic. Apparently that will be my first project, so at least I know what I'll be doing! Yipee!

In other news:
- We sold our house in College Station in 4 days
- We found a house in New Braunfels in one week
- Kristen got an interview at a bank in San Antonio
- The next day she got a job offer from that bank
- The day after that she got a phone call for an interview for a company, literally, 1 mile from our new house.

So, it appears that some one, somewhere is trying to tell us that we are doing the right thing by moving. Everything is seeming to fall into place in relatively short order. I have an interview on Friday, get a job offer on Saturday and our house is on the market by Friday and sold by Monday; then Kristen's quick turn of events with her gainful employment.

It's stressful at times; but we know that we'll get through it. I know we're both looking forward to moving into our house in New Braunfels. It's a "small town" and has that vibe that Kristen and I are going for. If you'd like our new address, please send me an email!