Friday, September 28, 2007

Tree Queries from the Database

Okay, I've stumbled onto an odd problem. Our System Analyst here at Techsoft is an Oracle guy. He does all these things in Oracle, and then expects us to carry out similar activities in our applications and in SQL SERVER.

Usually it's not a problem.

Oh, but when it is....

He created a table, and populated it in both the Oracle and SQL Server versions of our database. It contained ID, CODE, Name, Description and PARENT_ID columns, and basically was designed to store/output hierarchical data, like you'd find in a TREE control.


So, I spent a good half-hour banging my head, trying to figure out how to generate a SQL statement that would produce the relevant datasource in an easy to use format. So I went to the guy who knows more about SQL Server than me. While we're hashing out possibilities, in walks Mr. Oracle. He seemed to think it was no problem, and produced this ORACLE query:

Select LPad ( ' ', 2 * ( Level - 1 ) ) || Code Code, Name, Description
From JCA
Start With ID = 0
Connect by Parent_ID = Prior ID;

Yeah, and that's where I really started banging my head. LPAD doesn't exist in Transact SQL. Nor does CONNECT BY, and I have my reservations about START WITH.

Of course, what annoys me the most is the misleading GROUP BY. Despite the name, GROUP BY does not group things. It aggregates things. It's an important difference which gives me migraines. If I wanted to aggregate things, I'd look for a function called AGGREGATE BY. If there's a clause called GROUP BY I would expect it to group things according to the column I pass in. After all, that's the way it would work in a programming language.

But nooo... this is databases... :|

Okay, my rant is over, no to once more try to figure out the TSQL version of that evil ORACLE query.

Thursday, September 27, 2007

Why I have been silent...

As the three of you who consistently check this blog via RSS feeds know, I've been silent here for nearly twenty days. No updates, no dumps of knowledge, nothing.

The reason for this is because I'm in the process of moving.

I've gotten a new job with SAKS Inc. which I start about halfway through the month of October. It's a developer's position, doing a lot of the same stuff that I'm doing now (ASP.Net with a SQL Server backend).

Truth be told, there is still some issues on just what I'll be able to blog about in concerns to the new position, but in the end, I'll always have my freelance stuff to fall back on to bring out my thoughts and concerns.

I'll try to be more vocal here, but a lot of my energy is currently being spent on getting my projects at my current employer wrapped up into a state where someone can easily come in behind me and take them over, as well as getting everything packed up and even trying to find a house up in Jackson where we're going.

It's scary. I'm something of a home body, and am very comfortable where I live. I like Pensacola. I've been here for 26 of my 30 years. Yet, just liking a city isn't enough of a reason to pass up such a great opportunity, both career-wise and pay-wise, that SAKS is offering me.

Thursday, September 6, 2007

IE6 Makes me see red....

It's official.

I hate IE6. Back when it was the version that everyone was running, I did very, very little with CSS and I had just a general feeling of malaise related to it. I didn't hate it, I just prefered Firefox.

Yet now after the release of IE7 and it's great (though still not perfect) standards compliance with CSS, coupled with the fact that I'm working more and more with CSS, I realized just how much I hate IE6.

Why you ask?

Because I just spent nearly two whole days fixing my layout so that it would work in IE6. Why someone is still running IE6 I have no clue. They should have been upgraded to IE7 by now. Yet, for whatever reason, my layout fell apart in IE6.

First it just wasn't showing up, and then once I got it showing up, the text would be split duplicated across multiple lines. I have to give nods to a couple of other websites out there which helped me solve these problems:

  1. Hack Free CSS for IE
  2. IE Duplicate Characters Bugs
So, I have these thoughts on what could be causing my problems, and am doing things like destroying the functionality for the collapsing navigation system, and removing all comments and hidden fields from the page. Ultimately, my solution is two fold, and both things are aimed at IE6 where all other browsers will ignore them.

First to kill the duplicate characters bug that was appearing on nearly every link I had, was this bit of code:

Then I also added this to my longer links, to force a wrap and keep the display from hiding characters:

Goodness, I despise, IE hacks.

Wednesday, September 5, 2007

Silverlight v1.0

Silverlight version 1.0 has been finally released. Now to find some time to play with this. Oh well.

What is Silverlight? Well, the Silverlight web page describes it as thus:

Microsoft® Silverlight™ is a cross-browser, cross-platform plug-in for delivering the next generation of .NET based media experiences and rich interactive applications for the Web. Silverlight offers a flexible programming model that supports AJAX, VB, C#, Python, and Ruby, and integrates with existing Web applications. Silverlight supports fast, cost-effective delivery of high-quality video to all major browsers running on the Mac OS or Windows.
Basically, imagine a version of Flash where you can build and utilize ASP.NET web application within it.

Tuesday, September 4, 2007


Well, I find myself working on an application that deals with generating elections, and one of the issues is the fact that users need to be reminded to vote.

Well, I had the wonderful idea of using ICS files so that users can download and input them automatically into whichever calendaring application they prefer.

Well, a bit of searching turned up these classes on CodeProject to make implementation of the generation of the ICS files easier.

This makes the "Future Elections" page much more useful from the voter's point of view. Major points in the usability department.

Doctorow on DRM

The wonderful Science Fiction author has something very interesting to say about Digital Rights Management, and it's influence on the consumers.

It's in the Guardian.

As usual, he's right.

Monday, September 3, 2007


I know that I've been neglecting this blog recently, but there's a valid reason for this.

  1. I was on vacation, which meant that I was away from work, and totally not thinking about programming.
  2. See Above.
  3. I'm working on a pretty new layout
In all actuality, I'm plugging away on a number of different things, amusingly enough, most of the stuff I've been doing recently has been traditional programming. I'm not using the full power of .NET and it's abilities to create and destroy controls on the fly. What I've been playing with most has been AJAX via the PROTOTYPE library. Sure, I'm doing a lot of interesting things, such as hijacking links, but in the end, and if you take away the JS, it is literally a number of webpages which behave exactly like traditional webpages should.

To the two of you who routinely check this page, thanks!

Blog Widget by LinkWithin