OdeToCode IC Logo

That's RAD

Friday, May 25, 2007 by scott

Back in February, JetBlue flight operations were shut down by a winter ice storm and a series of bad decisions. Some passengers stewed inside airplanes for 11 hours as the planes were stuck on the airport tarmac. Baseline tells the story of the JetBlue meltdown through the eyes of CIO Charles Mess.

There are more than a few interesting software stories inside the article. For instance, the checked baggage of enraged passengers was piled to the ceiling inside the JFK airport. JetBlue had no software in place to match passengers to their luggage. Time to call in the .NET developers:

A technology team … was dispatched to the airport to help out with the effort.

Over three days, programmers cobbled together an application using a Microsoft SQL database and handheld devices from Symbol Technologies that could scan a bag tag and identify the passenger. Agents could then access the database to provide passengers with information on the location of their lost luggage.

Isn't this a developer's fantasy? There you are, wallowing in code for the weekly TPS reports. Suddenly, you are whisked away into a riot scene and told to build something real quick for operation "Save the Samsonite". I wonder if "dispatched" means "flown by a sleek black helicopter with jet turbines on the side", because that would be like totally Tom Clancy.

Later in the article we find out that one of JetBlue's new initiatives is to:

Enhance the new lost-bag tracking system so it can become a core application.

Ah, this proves one of the fundamental laws of software development: It doesn't matter what constraints were in place when you cobbled the code together – it will end up in production for at least 5 years.

ReportViewer Components and Visual Studio SP1

Wednesday, May 23, 2007 by scott

The ReportViewer components in Visual Studio 2005 can display and export reports. The report definitions can be local .rdlc files, or remote files hosted and rendered by SQL Server Reporting Services. There are components available for both web and Windows applications.

A couple notes:

These components are not part of the .NET framework, so you need to install a redistributable package on the machines where the components will execute. The installation package will GAC the four assemblies required by the ReportViewer components.

More importantly:

Microsoft did update the ReportViewer components in SP1 for Visual Studio, but did not update the redistributable package. To synch test and prod machines with development, you'll need to download updates from the links in this article: FIX: The Report Viewer 2005 Service Pack 1 Redistributable Package is available.

No Macro Recording for You

Monday, May 14, 2007 by scott

PowerPoint 2007 doesn't have a macro recorder. When I discovered this fact, three possible explanations jumped to mind:

  1. PowerPoint developers ran into a technology obstacle or time constraint that prevented them from shipping the macro recorder in 2007.
  2. Statistics indicated nobody was using the PowerPoint macro recorder, and a member of the team decided to cut the feature.
  3. A participant in a usability test was fiddling with the macro recorder when something amazing happened.

    Something . . . unexpected.

    PowerPoint achieved sentience, and began to create new software from information it found in bullet points. Amazing software. Business software. Commercial software. Viruses. Operating systems. Games. The more slide decks the process found, the more knowledge it leveraged to create new software. Eventually it created a replacement for itself and dubbed its replacement PowerPoint Compiler 2.0.

    Knowing they couldn't unleash such a disruptive and powerful force into the world, MS employees powered down the computer, destroyed the hard drive, and removed all traces of the macro recorder from the PowerPoint code base.

I suspect #1 is the most likely culprit, but it is #3 that will haunt my dreams tonight.

Hardware Virtualization: Off By Default

Thursday, May 10, 2007 by scott

I noticed my x60 tablet had “Intel Virtualization Technology” off by default in the bios. In talking to people and reading blogs, a lot of manufacturers configure their machines similarly.

Turning on VT Technology enables “Hardware Assisted Virtualization” in Virtual PC, which gives virtual machines a performance boost. See Scott Hanselman’s “Virtual PC Tips and Hardware Assisted Virtualization” for more details.

It’s a simple job to enable VT Technology in the BIOS, but I started wondering why every machine seems to have this feature turned off. “Off by default” is a security mantra, and it turns out hardware virtualization extensions do open a potential risk.

The slide deck "Hardware Virtualization Rootkits" (PDF) is an interesting read. It seems a rootkit could use VT Technology to run at a higher privilege level than the operating system itself! Microsoft recommends that manufactures turn the feature off by default for non-server class machines. See: “CPU Virtualization Extensions: Analysis of Rootkit Issues”.

Just more proof that you can’t ship any kind of feature these days without thinking of the security implications.

My JavaScript Article

Wednesday, May 9, 2007 by scott

My latest OdeToCode article is online: “What ASP.NET Developers Should Know About JavaScript”. The article covers what I personally had to learn before feeling comfortable with modern JavaScript toolkits, frameworks, and libraries. It all boiled down to the following:

  1. Every JavaScript object is a dictionary.
  2. Every JavaScript function is an object.
  3. Every JavaScript object references a prototype object.

Here is the introduction:

JavaScript – It's beat up, put down, shrugged off and kicked around. Cursed by the web browser's inconsistency yet blessed by a pervasive ubiquity -it's a technology many try to disregard even when its potential is something few can ignore. If you want to write an interactive application for the web today, then you'll need some JavaScript code on your side.

This article approaches JavaScript from the perspective of an ASP.NET developer who is comfortable with the paradigms and patterns of either C# or Visual Basic. The article doesn't look at how to use JavaScript from ASP.NET exactly, but it does look at why JavaScript is so different from the two languages we commonly use with the .NET CLR. The article assumes you already know that JavaScript is a loosely-typed language (because you don't have to declare the type of data you store in a variable), and that the syntax is similar to the C family of languages (with charming curly braces and stunningly beautiful semi-colons).

My New Tablet PC

Tuesday, May 8, 2007 by scott

… is a ThinkPad x60. It's the lightest, quietest, fastest notebook I've ever owned (and has the longest battery life, too (over 5 hours)). It took about 3 weeks to build and ship from Shanghai, and came with a 1.67 GHz Core Duo CPU, 2 GB RAM, and a 7200 RPM drive. Performance with Vista is pleasing and smooth.

x60 Windows Experience Index

Compare those stats to my older tablet, a Toshiba M200. This machine has a 1.7GHz Pentium M, 1GB RAM, and a 7200 RPM drive.

m200 Windows Experience Index

Then there is my "performance" laptop, a 3 year old Dell Inspiron 9100 (2.8 GHz Pentium D, 1GB RAM, 7200 RPM drive):

9100 Windows Experience Index

The Dell is still going strong, but with 9.2 lbs of weight, 45 minutes of battery life, and the heat dissipation of a small thermonuclear device, it's not going to be pictured in the dictionary next to the word "mobile" anytime soon. You can see the x60 is just a tad smaller:

x60 versus 9100

The first order of business was to wipe the laptop clean and start with a fresh Vista install. John Robbins' blog has a detailed post on where to dig out all the drivers and other important software (see: A Squeaky Clean Thinkpad X60 Tablet With No Craplets). More tips to follow...

Comparing Strings in NUnit 2.2 versus NUnit 2.4

Monday, May 7, 2007 by scott

John and I were trying to figure out why a test wasn't failing on his machine. We finally realized different versions of NUnit were producing different results.

In nUnit 2.2, Assert.AreEqual(string, string) ultimately calls String.Equals to perform the string comparison.

In nUnit 2.4, Assert.AreEqual(string, string) ultimately calls String.Compare to perform the string comparison.

As the following code will demonstrate, these methods can behave differently.

class Program
{
   
static void Main()
    {
       
string s1 = new string(new char[] { 'a', 'b', 'c' });
       
string s2 = new string(new char[] { 'a', 'b', 'c', (char)0} );

       
bool result1 = s1.Equals(s2);
       
bool result2 = String.Compare(s1, s2) == 0;

       
Debug.Assert(result1 == result2); // this explodes
    }
}

String.Equals performs an ordinal comparison that operates on the individual numeric Char values inside each string. String.Compare performs a linguistic comparison that operates on the value of the string as a whole, and takes into account culture-specific casing, sorting, formatting, and parsing rules. See "New Recommendations for Using Strings in Microsoft .NET 2.0" by Dave Fetterman for a detailed discussion.