Monday, April 30, 2007

Precociousness

Hey, dad?
Uh-huh?
How many hours are there in a day?
There are 24 hours in a day, son.
Oh.
So how many hours are there in a night?
I meant, there are 24 hours in a day and night together.
Even in wintertime?
Huh?
In wintertime the nights are longer.
Yes, but the days are shorter too.
Oh.
So there aren't 24 hours in a day in winter?

What?
Well, you just said the days are shorter.
Well, that's true, but...say, why don't you go play with your toy cars for a while?

Friday, April 13, 2007

FastTrack seminar, part 2

Second session at the seminar was on the new features of SQL Server 2005; since I was at the launch party in Indianapolis I didn't feel like there was a whole lot that was really new; but since I'm currently employed at an Oracle shop it was interesting to compare the two. This session was given by George Huey, a Microsoft "Architect Evangelist", whatever that is; but he knew his stuff. The most interesting new feature from my admittedly database-illiterate perspective is the ability to write code in .Net and turn it into stored procedures and code that runs inside the server process. You can also set the code permissions: Safe, Unsafe, or External Access, which I believe means, "hits the file system", but regardless I don't know if anyone actually uses that feature. Another interesting feature is the ability to run "recursive queries", which sounds pretty handy: he gave a demo of calculating the number of levels of management by recurring up the tree until you find the guy with no manager.

A few other features he went over were: Native XML store; Pivots; Top; and Rank; they all seem very nice but I'm not really in a position to judge how useful they would be in my work. I guess we'll see.

The final session was on "Business Intelligence". I didn't have any idea what that might involve, but it turned out to involve reporting. I wasn't aware that you can configure SQL Server to give you a project type of "Report" in Visual Studio fairly easily, and there's also a "Report Viewer" control that you can add in to your own ASP pages. I have to admit that I lost some of this lecture, as the presenter was having some trouble with his computer and the wireless was working nicely - for a change - so I took the time to mess around with some more of the AJAX demos that I was really interested in.

The seminar was held in the Glick Center, where the Indy NDA holds its meetings. It was a good venue to hold the couple of hundred people who showed up. Microsoft sprung for donuts and pizza, and I liked the idea of having a couple of arcade games for people to check out between sessions. I would have traded them for better wireless, though. There were also only power outlets on one end of the room. But there's only one really important highlight: through the door prizes, I am now the proud owner of a Zune :) Welcome to the social! (Hello? Is there anyone else in here?)

FastTrack seminar

I’m blogging today from a Microsoft FastTrack seminar. Perpetual Technologies in Indianapolis is putting this on in some sort of collaboration with Microsoft. It’s a free seminar – and I’m always up for a free seminar – with a keynote and six sessions in three time slots.

The keynote was OK. Steve Thompson from Microsoft gave a roadmap presentation of where they expect enterprise technology to go over the next several years. The majority of audience were DBA’s rather than developers, so they may have had more interest than I did. As important things, Steve brought up Office, Microsoft Server, and mobile applications; and also Microsoft Business Solutions, about which I don’t know much. The goal, I guess, is to get enterprises on the Services Oriented Architecture bandwagon, and also to move towards virtualization as an important technique for scalability. He also discussed voice and VOIP near the end of the presentation, and how our standard voice data paradigm – blinking message lights and busy signals – is really out of date. This is something I’ve known since Interactive Intelligence was trying to get everyone out of that as well; don’t know how that effort is going, but we still have the copper wires at my last couple of jobs.

First session was on the Ajax.Asp.Net control library, which looks pretty cool. It was given by a younger guy from - I think - Crowe Chizek, and he did a creditable job, although I would have happily spent a couple of additional hours learning the subject, given the opportunity. It's interesting that most of the effects it allows you to create are already implemented in Javascript in the application I'm currently working on - a tribute to the skills of the original writers of this app, I think. But, you could certainly write a lot less code to get the same effects using this library. It looks pretty easy to use, although .Net 2.0 is required: one msi to install on your machine, and one zip file with controls and demos. It'll definitely be useful in my own web applications, anyway!

Monday, April 02, 2007

Javascript testing with NUnit

I've been looking around for a good way to test Javascript functions.

There are at least two if not more versions of JSUnit, one here and the other here. But there is one fundamental requirement I have for any unit testing framework, and that is that it has to integrate into an automated build script. For example, suppose you're using CruiseControl. It's got an NUnit step in it; once you write up your tests, it's the matter of a few minutes' configuration to get them running as part of the build, and it's very satisfying to watch the test counts grow as more builds are done. 117 tests run, no failures. 123 tests run, no failures. 135 tests run, no failures.

So if the framework doesn't work with automated builds, it's no good to me. Do they? I'm not sure. Edward Hieatt's version seems primarily to require a browser, although he does provide a JSUnit Server which appears to be designed to work from Ant or Java, but doesn't have any particular support for Nant or ASP.Net that I could find. Jörg Schaible's version is even less able to work in Windows; starting from the download which is only provided in tar.gz format. The documentation states that it can be run from the command line; if so that's easily adaptable to an automated build, but I didn't even take the trouble to download it, suspecting that it wouldn't even run on Windows.

So I was looking around for other alternatives, and I ran across this post. I'm sure that not everything you can write in Javascript can be evaluated by the .Net Javascript evaluator, but when you write a lot of tests you get used to keeping functionality nicely isolated.

I'm not sure what the best way to use this is. My first couple of tests have the Javascript in the ASP.Net codebehind file, where they can be unit tested at test time and Response.Write-n at runtime; but there's a few other possibilities; keeping all the Javascript in a separate file to be read in at test time, and using it as an include at runtime perhaps.

So I have a lot of work to do on this technique. But it seems promising!