OdeToCode IC Logo

How To Stop a Team Foundation Server Build with Samurai Style

Thursday, May 31, 2007 by scott

This afternoon I kicked off a Team Build and waited...

.. and waited ...

... and waited...

... and then realized something was terribly wrong with the TFS server. A general sense of panic swept into the office when we couldn't bring up the login dialog box on the server's console. A recent rash of hardware failures made us jumpy and we feared the worst. Just a couple months ago, 2 out of 3 drives in a RAID 5 array died in a single afternoon. What are the odds?

The server came back to life after a hard reboot, but the last build was "stuck". There wasn't any activity on the build server, yet TFS thought the build was still in progress. I couldn't find a way to stop the build in Visual Studio, so I turned to the Internet. My first search brought up KillBill.exe – a utility in the TFS PowerPack that "Stops a Team Build currently running on a build server". Perfect!

Afterwards, I found out you can also stop a build from the command line, but that's not nearly as entertaining as an application that evokes thoughts of a hyper-violent kung-fu cinematic mashup.

The other utility in the TFS PowerPack is the "Work Item Terminator". There is a theme at work in this project, and I like it. I hope future versions include the "Clockwork Orange Build Timer" and the "Check-in policy Robocop".

Swinging In Silverlight

Tuesday, May 29, 2007 by scott

Note: this sample is now updated to work with Silverlight 1.0

I decided to catch up with the latest Silverlight release. With the WPF/E release last year I dabbled with Conway's Game Of Life, but instead of porting old code I decided to try something new. During my short stint in the video game industry I found Gamasutra to be a great source of technical articles, and the article "Advanced Character Physics" by Thomas Jakobsen gave me an idea. The article describes the verlet integration algorithm used in molecular dynamics models. The subject matter sounds intimidating, but the algorithm turns out to be relatively simple.

Verlet integration (pronounced vehr-LEY (think French)) doesn't track the velocities of each particle in a system. Instead, Verlet calculates a particle's next position using its current and previous positions. The nice feature of Verlet is that enforcing a constraint (like not allowing a particle to move outside of a wall, or not allowing a particle to move too far away from another, attached particle) is almost as easy as repositioning the particle – at least there is no need to calculate a new velocity.

I built a simple, swinging "rope" in Silverlight. The "rope" is composed of 12 Pluralsight logos. Gravity pulls the rope downward, while a left-to-right breeze can blow the rope across the screen. Credit Ian Griffiths for building the Pluralsight eye in XAML . A static screen shot doesn't show the realistic motion ...

... so if you have the Silverlight 1.0 beta install, try the sample here.

You can download the source code here.

Note to Karl Seguin: don't download the code. This was a late night hack on a holiday weekend. If you break into tears then it's not my fault! :)

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).