Starcraft 2 Announced

By hagrin - Posted on 20 May 2007

Blizzard announced an early Christmas gift for gamers around the world when they confirmed the existence of Starcraft 2. The Official Starcraft 2 website has launched and actually holds a lot of important information concerning the sequel. Starcraft enthusiasts learned the following pieces of info:

  1. There will be no new 4th race and we will still have the Zerg, Protoss and Terran as the 3 races implemented in Starcraft 2. For years people speculated that there would be a 4th race, but Blizzard has kept the original's integrity and kept the racial balance simple.
  2. While there will be a new 3D engine powering the game's graphics, if one was to look at the screenshots you will see that while units have much greater detail, the engine still remains somewhat simplistic probably to not sacrifice network performance.
  3. Many of the unit names will stay the same; however, from the screenshots, you can see such units as battleships and other air units have been dramatically redesigned.
  4. At this time, I don't see any Brood Wars related units mentioned on the site.
  5. While only the Protoss profile has been completed by Blizzard, you can see the inclusion of new units such as the Immortal, Stalker, Phase Prism and Gateway/Warp Gate.

One note from their site that is slightly disappointing is that Blizzard will be selling a limited edition statue for the whopping price tag of $250 USD. I mean, does Blizzard think that Tychus Findlay is going to be the next ceramic hummel?

Most importantly - there is no scheduled release date for Starcraft 2 at this time. Blizzard has always released quality games and they take their time during the game creation process. Now, from a business perspective, I would guess that Blizzard is going to hold onto Starcraft 2 and release he game as they start to witness the downward decline of World of Warcraft subscriptions. There would be no feasible business reason to encroach on their WoW franchise until absolutely necessary. Therefore, if you're a Starcraft and Blizzard fan, you can put money on the fact that you won't hear anything about a Starcraft 2 release date until WoW has run its finanically successful course.

Starcraft 2 will be the only game I will play in the near future.

Dynamic SQL Cursors

By hagrin - Posted on 15 May 2007

Today, at work, I was working on creating an application that would perform validated, bulk updates to our accounting system software (Deltek Vision). So, I create a very simple Windows Form, create a real quick GUI, write all the necessary validation and then started writing the stored procedures needed to perform each of the functions. I had already written the SQL syntax as before this application I was manually changing the variables to fit the needs of our business units. However, as I was trying to "generalize" the statements to allow for different types of queries, I started to run into a SQL problem. I was attempting to use dynamic cursors that were being fed by dynamic SQL statements. Yikes.

In English, I had created two cursors - one to read through all the "target" projects and one for all the "source" information. I also gave the user the ability to specify whether or not the target was "equal to", "starts with" or "ends with" a certain criteria. This causes a problem since if you know general cursor syntax you know that a cursor is fed with a select statement as such:

declare wbs_cursor cursor for
select wbs1 as w1 from PR WHERE wbs1 LIKE @targetproject
open wbs_cursor
declare @w1 varchar(30)
fetch next from wbs_cursor into @w1
while @@fetch_status = 0

Now, by giving users the ability to dynamically change the entire WHERE clause (including the operator), you suddenly run into a syntax issue because you can't just store the entire clause in a varchar variable and then have it EXEC SQL (@stmt) because of later references to the cursor. Since that eliminates one major way of preparing dynamic SQL statements, I developed a very dirty solution that revolved around IF statements -

if @targetcondition = 'starts with'
      set @targetproject = @targetproject + '%'
      declare wbs_cursor cursor for
      select wbs1 as w1 from PR WHERE wbs1 LIKE @targetproject
if @targetcondition = 'is equal to'
      declare wbs_cursor cursor for
      select wbs1 as w1 from PR WHERE wbs1 = @targetproject
if @targetcondition = 'ends with'
      set @targetproject = '%' + @targetproject
      declare wbs_cursor cursor for
      select wbs1 as w1 from PR where wbs1 LIKE @targetproject

Pretty dirty right?

Most of the time when I post code here, it's generally the non-dirty version, but I really couldn't find a non-dirty version to this problem and would really like to see if someoone has any ideas on a better, cleaner solution. It seems that all of the sample code I saw online when searching "dynamic cursors" only made table names or WHERE criteria (not the operator) dynamic and therefore fails to appropriately address my issue. I got away with this solution since the problem was simplistic, but what about if I had to deal with 1000 conditions - I wouldn't want to write 1000 IF statements.


P.S. - As I read through the SQL Books Online, it seems that the PREPARE statement might be able to solve this problem, but I don't have much experience with PREPARE.

VB.Net 2.0, SQL Server 2000 & Windows Application SQL Error

By hagrin - Posted on 11 May 2007

Today, I started working on an application to perform bulk changes to our Deltek Vision database to change tasks, sub-tasks, budgets and billing terms. So, as I go to write the SQL connection string, something I have done 100s of times, I kept getting the following error from my app:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

While the error is pretty descriptive, there is one slight problem - I'm not trying to access a 2005 SQL Server, but a SQL Server 2000 box. So, I do what any good programmer does - he searches the major search engines for a solution, but most of the examples are of users trying to 1) build a Web application and have a web.config error or 2) are actually trying to access a SQL Server 2005 database. Yikes, now what?

I can't stress this enough - check your connection string. I was actually passing a blank Data Source (I was using SelectedValue as opposed to SelectedItem) and since I have SQLExpress running on my development machine, I assume that's why I was generating a 2005 error when trying, in theory, to connect to a SQL 2000 machine. The lesson is - verify your connection string when getting this error and trying to access a SQL 2000 machine. If you're trying to access a SQL 2005 machine, follow the enabling remote connections info that you'll find on the hundreds of pages that come up in he search engines for this error.

Akismet Causing More Spam?

By hagrin - Posted on 10 May 2007

Recently, due to a few spam messgaes I would get every once in a while (no more than 5 a day with most days receiving no spam messages), I finally decided to install the Akismet here to curtail even the slightest amounts of spam to make managing even easier. What has happened since can only be described as the exact opposite of my intent as spam has increased, bot registration has increased and it has increased over 1000%.

First, let me provide you with some metrics. As stated before, on's worst day, I would receive about 5 spam messages, but most days saw no comment activity. Since installing the Akismet module 1.5 days ago, I have seen 65 new spam messages and almost as many bot registrations. While Akismet is definitely filtering out spam properly, the amount of spam traffic has increased at an alarming rate while site traffic hasn't increased at all. Now, I'm not exactly sure what this can be contributed to, but the timing of the module installation and the corresponding spam increase is undeniable. I'm going to continue to monitor the situation and maybe even disable the Akismet module to see if there is a spam drop off, but would like to hear from someone else who may have experienced this "problem".

Search Engine Ranking Factors

By hagrin - Posted on 08 May 2007

Although this article is already a month old, I have to applaud everyone involved at SEOmoz who created an extremely comprehensive list of Search Engine Ranking Factors. They provide you a great checklist of search engine optimzation factors to keep in mind and rank them according to what some of the more respected voices in the SEO industry deem as "important".

There isn't much "new" content here as much of what is covered should be pretty basic to the seasoned SEO, but it does provide a prioritized checklist for SEOs to follow and use to review client sites. Keywords in TITLE tags, inbound links, domain age and other factors are noted (obviously) as major factors contributing to SEO success. This SEO checklist provided me a valuable tool for performing site evaluations.

Convert .Net Code to HTML

By hagrin - Posted on 03 May 2007

When you're writing a development related blog, you're eventually (hopefully) going to write some code snippets that you want to share with your readers. However, in order to get the most out of that code snippet, you should make it easy to read and color coded so that potential users can quickly read through your code and evaluate its worth.

That's where CopySourceAsHTML will solve all your problems. CSAH is a plug-in that integrates directly into your Visual Studio IDE environment and allows you to highlight code, right click and choose "Copy As HTML". The tool is freeware and performs exceptionally - if you maintain a .Net developer blog, I would suggest installing this add-on.

SharePoint v3: Quick Launch Update

By hagrin - Posted on 02 May 2007

Just a FYI to the 3 of you reading this site (Hi Mom and Dad!), I made an update to the Recreating the SharePoint Quick Launch story I posted back in February. I made some code fixes that were mainly introduced with the release of the 40 Free WSS Application Templates made by Microsoft.

Hope the bug fixes help!

Dan Osman Speed Rock Climbing

By hagrin - Posted on 24 April 2007

After going to a bachelor party this weekend in which we did some rock climbing at the Shawangunks Mountain Range in New Paltz, NY, I have an amazing amount of respect for rock climbers. Days afterwards, my forearms are still burning, my body is still sore and I have battle scars all around to remember the experience.

During the rock climbing adventure, we kept talking about Dan Osman. The late Dan Osman, who died cliff jumping, was the closest thing to Spiderman I have ever witnessed. For any of you who haven't seen what Osman could do, watch this video below -

The guy was sick - letting completely go of the mountain face (around the 1 minute mark) with no ropes, no harness, no backup is simply incredible.

2007 Umstead 100 Mile Endurance Run Race Report

By hagrin - Posted on 02 April 2007

Here's my humble recap of my first attempt at 100 miles.

I drove solo from Long Island, NY for 8 hours on early Friday morning to head towards Raleigh, North Carolina for my first attempt at a 100 miler. However, I had injured my ankle about a month ago which really limited my running to about 20 miles a week, but I continued to do 2-4 hours of elliptical work so I was in good cardio shape, just not good runner's shape. Needless to say, I was a little worried about how my ankle would hold up especially when dealing with the downhills which seemed to hurt the most during my training sessions. I didn't stay at the park (although I paid for a cabin) and decided to make the Comfort Suite on US-1 my home for the night (great hotel btw). When I come back next year, I plan on flying into the Raleigh Airport instead of driving to make things a little easier.

Actual Race
Loop #1
I met up with Jesse Leitner (who finished 11th in the 100 and PRd a 50 time too - congrats!) at the Comfort Suite and we headed over to the race site together. While it was cold the previous night and we were expecting temps in the 30s-40s when the race started, I was surprised to find myself perspiring while warming up in just a tee shirt and shorts (i.e. not a good sign - I'm 5'11", 185 - not exactly the prototypical long-distance runners body). We had heard in the pre-race meeting that most runners go without a flashlight at the beginning, but I decided I definitely needed one after trying to navigate back towards my car before the race (I highly recommend a light if you plan on running alone in that first hour). The race started and I went out at a very comfortable sub-10 minute pace and found myself in the top 25 or 30 I think. At around mile 3, I found myself running with one other runner - Jesse! (odd how I had never met him before and now I was running with him). We kept a very comfortable pace even talking a bit while running as we cruised into the first manned aid-station (right before the 7 mile marker). This was easily my favorite aid station in any race with all the volunteers being extremely helpful (more on that later), but it also signified the hardest part of the course was upcoming. For anyone running this race, miles 7-10 are the hardest in the loop with the steepest, longest hills on the course. Even though I felt good, I started to walk these uphills as everyone cautioned me to make sure to take the uphills easy so I was able to walk easily up the hills and most of the runners behind me followed suit. By mile 10, I started to purposefully slow myself down some as I was on sub 2 hour pace for the loop so a few runners including Jesse passed me. I entered the Start/Finish at around 2 hours exactly and felt great - no perspiring, no heavy breathing, heart rate low, no cramps, no blisters and my ankle feeling great (in fact, I hadn't thought about it once until Jesse actually asked how my ankle was doing).

Loop #2
This loop was pretty uneventful, but again I decided that since my goal was to just finish the 100 in any time (dream goal was sub 22 hours, realistic goal was 24 hours), I decided to slow myself down again and run an even slower pace - especially with how the heat was starting to turn itself up. I ran pretty much by myself the entire time, took my time at all the aid stations to drink plenty (I didn't carry water since this course has water every 2.5 miles and it seemed pointless to me, who didn't really care about my finishing time, to carry water unnecessarily). I ended up finishing this loop in about 2.5 hours - still really good pace, no complaints, no blisters, no cramps, ankle holding up well.

Loop #3
Here comes the heat. By this time, it's about 10:30 and I won't finish this loop until 13:40 or so and while the time is extremely unimpressive, it was more a personal decision to slow down as much as possible while not getting demoralized that runners were passing me (it's hard to go in with a goal of racing against the course and then not being affected by your competitiveness when runners pass you). Everything was working well for me, but by the time I got to the manned aid station at mile 32, a few volunteers noted to me that there were dried white sweat streaks down my face and my hat had a white ring around the top of it. I spent 5 minutes eating pretzels and one of the volunteers gave me a paper towel ice bag to put under my hat and on the back of my neck to cool off some. As I left this aid station, I decided to walk as much as possible because I sweat a lot and it would be smarter to save myself for the cooler hours and not fight a losing battle keeping myself hydrated and fueled properly. I finished this loop without incident, albeit very slowly and headed out for the 4th loop after calling home to let them know I was feeling great. In fact, I think I even said "I call you in about 7.5-8 hours after I finish another 3 loops". Yeah, oops.

Loop #4
Now, I believe the temps are up to 80 degrees and this is easily 30 degrees warmer than any temp I have run in for 7 months. Even still, I was feeling great - no cramps, no blisters and the heat was bad, but not to the point where I was sweating badly so I decided that when permitted I would continue to run to make sure I didn't get tight and to find shade as much as possible. In my effort to find shade, I would run on the edges of the trail where the trail is a little softer. At around mile 41, I stepped in a soft spot, twisted my ankle and it was all downhill from there. I came into the manned aid station slightly lipping and I took my time, ibuprofen and debated what I should do. I figured I would continue to move forward, hope that the aspirin would kick in and try and run the flats and slight upgrades (oddly, the downhills hurt my ankle a lot more so walking the downhills was my only option). The last 5.5 miles of this loop were sheer torture. I didn't see any runners during this time except who I assume was the female leader Jamie and when I saw her coming up from behind, I decided to try and run some which was a huge error on my part. I started to overcompensate for my ankle and the rest of my body didn't like that much at all. I ended up limping the last 2.5 miles into the Start/Finish and was faced with the following decision -

50 miles completed in 10:30ish.
Could I walk 50 miles in 19:30 hours?

I definitely could if I wasn't injured - heck, I could probably walk it in a lot less than 19 hours. However, faced with the tasks of having to drive home alone 8 hours and then recovering from an additional 50 hours on a bum ankle, I decided to drop at 50. Although I was so pissed I couldn't go on that I skipped the aid station and a volunteer actually chased me into the cabin to ask if I wanted anything (the volunteers were so amazing, I didn't know people that nice actually existed), in retrospect it was the right decision as 2 days later my right ankle is so tender I can barely touch it no less walk around.

I ended up finishing 33rd of 107 50 mile finishers in a time around 10:25ish - slower than I would have liked, but I was happy considering what I went through for the last 8 miles.

What I would do Differently?
Next year, when I come back I plan on -
1) Flying down to the Raleigh Airport - the driving was way too much to do solo.
2) Bring thicker shoes - I ran with North Face Arnuva 50s which kept my feet in great condition, but the miles directly in and out of the Start/Finish are ripe with rocks that bruised my feet through the thinner bottoms. I almost switched to my XCRs, but decided that they weren't broken in enough and that the risk of blisters was too great.
3) Basketball Taping the ankle - I play a lot of basketball and I should have taped the ankle in much the same way I do for basketball to prevent rolling it. I was worried that running 100 miles with it taped would be a bad idea, but maybe it would have slowed me down even more while offering me protection.

Thanks goes out to everyone involved in pulling off this race - it's highly organized, the trail is amazingly easy to follow (only in one spot did I see runners stop and get confused which was right by mile 4 or 5 where you could either correctly go left uphill or right downhill and there were pink signs down both directions), the aid stations were incredible and everyone was super friendly. I'll be back next year without a doubt.

withEvents variable Header conflicts with property ... Error

By hagrin - Posted on 26 March 2007

Today, as I was converting some web applications from .Net 1.1 to .Net 2.0 I received the following error on the source pages of most of my ASPX pages -

withEvents variable 'Header' conflicts with property 'Header' in the base class 'Page' and should be declared 'Shadows'

Huh? That's what I said. However, the fix is relatively easy. What the error message is saying is that you probably have some element in your HTML code/script that has a value of "ID=Header". By giving this element a new ID name, the error message will be resolved.