AC install day 1

unico air handler

Yesterday’s first day of installation went pretty well. Our contractors spent the morning preparing the small air handler by installing an expansion valve, then managed to load it into our small attic (in spite of a very small access panel and a very tight roofline) and spent the rest of the day preparing and insulating the main ducts and marking the locations for the ducts on the second floor. I didn’t manage to get many photos, but that’s our air handler and the very tight space around it.

A word about our installation: we are going for a full conversion. As I mentioned before, we’re getting a Unico system installed. Our setup consists of two small air handlers, the aforementioned attic one for the upper level and one in the basement for the lower two floors. Our contractor is combining this system with a high efficiency gas boiler which will provide indirectly heated hot water to coils in the air handler that will provide heat in the wintertime. As a consequence, we get to eliminate the old boiler and all the radiators.

Of course, this means the installation is a little more complex than a straightforward AC installation. So the workers are doing it in two phases. Phase 1, which is this week, is the upstairs work, plus installation of the compressor and removal of the steam radiators. Phase 2 is installation of the downstairs air handler and ducts, plus installation of the new boiler and removal of the old one. That phase will occur the week of July 4—when I’ll be at Tanglewood with the BSO, keeping cool in a different way.

Whither VB? The withering away of a category killer

Rogers Cadenhead posts about something that has been on my mind recently, the ending of support for Visual Basic 6. A while ago Scoble and Dan Appleman blogged the opposing viewpoint: making customers move their apps off VB6 is the right thing to do because VB.NET is a far superior language.

Let me illustrate a real world perspective on the debate, rather than the strawman that Appleman provides. Say you are a small software company that makes a product that is written in a variety of languages, and a core part of the application suite having to do with automatically sending e-mails is written as a Visual Basic 6 application.

Now why would someone write an email notification process in VB6? I don’t know. Why would someone write the standard procurement system for the Department of Defense in PowerBuilder? This happens all the time: mission critical apps get written in less than mission critical languages, and then get maintained, more or less, forever.

So fast forward about eight years from the creation of this app. The mail landscape has changed, and the architecture of the mailing process, which used to leverage client apps for sending mails, needs to change too. Email viruses and spammers have made old approaches to writing mail functionality painful; organizations are abandoning POP/SMTP based mail and retreating to MAPI. Meanwhile your VB app, which relied on a once attractive piece of third party code to provide MAPI support, is stagnating, and has started to show issues with age (like memory leaks, and interop issues with the security measures added across the Microsoft mail stack). In other words, it’s time to freshen the app. So the natural thing to do is to look at Visual Basic.NET, the successor to VB6, right?

Um, wrong. VB.NET famously no longer supports the programming interfaces used by VB6. And the VB6 to VB.NET migration tools bite; in fact, the tool blows up prior to successfully migrating the VB6 project. And no one in your development team has expertise in the .NET framework. In the years since VB, the team has moved on to C++ and Java. So which language will be the natural choice for migrating the mail app? Not VB.NET. What might have been a no-brainer to move up the ladder to the next version of VB has turned into a major nightmare for our small software company, and the only clear loser is Microsoft.

Beaten to the punch.

I was very excited that I was going to be at our house for the first day of our AC install today, and that I would be able to document the whole thing, when I opened my RSS aggregator last night and realized that: The Old Man and the Street had posted a much more compelling set of first-hand observations of his AC installation than I could manage. Like our house, his is a high-velocity system being installed in an old house with no existing ductwork. Unlike our installation, it looks like the Old Man’s owners (yes, the Old Man is the name of the house) will be keeping their radiators. And I think our installation team will be moving the blower into the attic first, rather than cutting the runs for the ducts. But otherwise a very similar project.

Oh well. Being first isn’t everything, right? Hopefully our team will have the AC working as quickly and easily as The Old Man’s.

Daniel Lanois gets control

According to his web site, überproducer and occasionally brilliant ambient-roots solo artist Daniel Lanois has regained ownership of his first album, Acadie. It’s available from his site as well as from eMusic.

Lanois seems to be focusing some attention on his solo career after a long hiatus, punctuated only by his uneven 2003 release Shine (I liked the track “Fire,” which I included on my 2003 mix cd A page I was meaning to send her, but Lanois-does-reggae can only be described as a disappointment). He also released an instrumental album this week called Belladonna. I’m listening now; it strongly recalls the early 80s instrumental work that he did with Brian Eno and Harold Budd, which is in my opinion a Really Good Thing.

Weird tales of Weird Tales

weird tales oct 1993

Boing Boing: Weird Tales covers 1923-1942 gallery. When I read this post, I immediately thought about the album Weird Tales by alt-country supergroup Golden Smog. I wondered: did that mean that the oddly evocative cover of that album was derived from the magazine?

A little spelunking through the cover archive found the answer. Golden Smog’s album cover is based on the cover of the October 1933 issue of Weird Tales, and is an illustration by Margaret Brundage for the story “The Vampire Master” by Hugh Davidson. (The Golden Smog album cover hides the bat head on the woman’s mask.) No word on who in Golden Smog was the pulp fiction fan, though.

The “new Internet” and business

Interesting panel discussion from Wharton on “Wikis, Weblogs and RSS: What Does the New Internet Mean for Business?” Contrary to the title, there is very little discussion of the specific impacts of blogging or RSS, but a lot of good discussion about general business shifts: lowering transaction costs as a way to enable business process flexibility, the rise in importance of economies of scope, shared benefits from collaborative improvements in products, and so forth.

Ross Mayfield of Socialtext gets one of the killer quotes of the article:

It used to be easy to measure transaction costs especially when looking at economies of scale and speed. That’s what helped justify centralization in vertically integrated firms. In the more dynamic and decentralized world, the value shifts to economies of scope. The real problem that we have is we have no transaction-cost analysis like “build versus buy” for determining whether I should share an asset and cooperate with other firms to develop greater capabilities. To create such opportunities and convince managers and decision makers that they are worthwhile, you have to deal with the fact they have been schooled in a different kind of thought. Fundamentally they have been schooled in a competitive environment where you gain by hoarding information and where there’s no rationale for more open architectures and participation.

Jared, the Butcher of Widgets

jared, butcher of song

He’s back, and this time he’s in your Dashboard (on Tiger, that is). The infamous Jared, the Butcher of Song, is now available for Mac OS X 10.4 as a Dashboard Widget. From the release notes on the Freeverse blog:

Jared has long been an affront to the senses, an insult to the diatonic scale, an inappropriate “yo-mama” joke told over-loud at the elegant dinner party of internet culture, but never has Jared been as much of a waste of hard drive space as he is as a widget.

For full background on Jared, you’ll have to go to the Wayback Machine, or this old feature article from Wired. Briefly, though, Jared is a little round smiley face who lip-syncs to a wonderful, wonderful Guatemalan song, performed as though cats were being tortured in the vicinity. (Actually, his original biography stated, “Never has the mating of cats sounded so melodic as after one has listened to ‘El Carnicero de Canciones,’ the ‘Butcher of Songs,’ as Jared was known in Guatemala.”)

The Windows version of Jared appears to have gone the way of all flesh (the version I found on line doesn’t even run in Windows 95 compatibility mode under Windows XP), but if you download the Mac OS X version to a Windows machine, you should be able to unzip it, go into the directory, and play the song for yourself. Should you really wish to torture yourself, that is.

(Footnote: when I was working for AMS, I wanted to stress test our ability to embed arbitrary Windows files as documents in our procurement document management software, so I uploaded the WAV file of Jared’s song into our database. I wish I had thought to route the thing along for approval to my co-workers. I almost succeeded in embedding him as an Easter egg in the app, too, but cooler heads prevailed.)

Pops Flag Day concert: a correction

I thought the TFC performance at last night’s Pops concert went quite well, although it is quickly becoming clear that doing a lot of these concerts back to back on weeknights has the potential to take some of the magic from the experience—primarily by exhausting me. However, in the haze of the last few minutes of last night’s concert, I found out something: Saturday night’s audience wasn’t “roaring with approval” because the chorus stood to sing.

It was roaring with approval because an enormous American flag had just unfurled directly above us in front of the proscenium, ending some ten feet above our heads.

Heh. At least I wasn’t alone in my ignorance. The guy right in front of me found that out for the first time last night, and he’s been singing in the chorus for several years.

SQL refactoring: replace insert cursor with table variable

I lost my copy of the classic programmer’s cookbook Refactoring several years ago, alas, but its philosophy of careful replacement of smelly code with clean code to improve the performance and maintainability of a software program is one that has stayed with me long after I ceased being an active programmer. One regret I had about the book was that it primarily addressed refactoring for object oriented languages (all the examples were in Java). But one of the biggest opportunities for cleaning up code is in non-object oriented languages such as Transact SQL. Recently I had an opportunity to clean up some legacy stored procedure code that I was adapting for an integration project I was working on, and one particular refactoring struck me as especially useful.

A common mistake when writing stored procedures is to overuse cursors. The cursor provides a way to operate on one row of data at a time, which is logical to a programmer used to thinking about working with arrays by looping through them. But SQL is fundamentally a language that is about set operations, and you can realize tremendous gains if you can stop operating on one row at a time and instead operate on a bunch of them at once. Microsoft provided a way to do that in SQL Server 2000 by introducing the table datatype.

Table variables help us by giving us an entire rowset in memory that acts precisely like a table in the database. An article by Alex Grinberg on SQL Server Central illustrates some of the applications of the table variable. I used one of the ideas to replace a cursor that was being used to import data into a table in our system using a counter table.

In fact, the counter table probably caused the use of the cursor in the first place, because a developer had helpfully written a stored procedure to get the next ID value from the table (a common construct for database structures that need to be cross-platform and therefore can’t use features like ). Such a function is a good idea in a client application because it enforces a consistent method for creating IDs for new records, but because it enforces getting only one ID at a time it leads inexorably to row-at-a-time inserts and other abuses of SQL.

So the first step in converting this insert cursor into a sensible insert was to create a new procedure that allowed me to get a bunch of IDs out at once. Where the original procedure had as inputs the table for which the counter was being incremented and the new ID as output, this one also took the number of keys, the starting key value, and the ending key value. Thus even for a very large number of rows, I was only performing a single transaction to get a block of keys to work with.

Now the cursor replacement. The original logic of the stored procedure declared a select cursor against the staging table containing the data to be imported, then opened the cursor, got a new id, and inserted the contents of the cursor plus the ID into the destination table. So for each row of data to be imported we performed two transactions, an update on the counter table and an insert to the destination table. For 500 rows, this was taking about 25 seconds—not huge, but definitely a place where there could be a big improvement. Here are the steps I used to replace the insert cursor:

  1. Declare a table variable, @tbl, with the same columns as the cursor, plus
    an ID column defined with the IDENTITY property.
  2. Populate @tbl with an INSERT INTO…SELECT FROM statement that draws data from the staging table. Now each row in @tbl has the values from the staging
    table plus a temporary ID, ranging from 1 to the number of rows. (We didn’t specify a seed for the ID field; more on that in a second.
  3. Count the number of rows in @tbl (select count(*) from
    @tbl
    ).
  4. Call the updated counter procedure with the number of rows in @tbl, getting
    back the first ID in the range (call it @startid.
  5. Finally, insert into the destination table, selecting from @tbl and adding
    @startid to the identity column in @tbl. Since the IDENTITY column
    started at 1, we want to subtract 1 from @startid for each row as well, or else
    we’ll exceed the range of keys reserved.

Here’s some sample code:

DECLARE @tbl TABLE (col1 int, col2 int, col3 int, temp_id IDENTITY (1,1))

INSERT INTO @tbl (col1, col2, col3)
SELECT stagecol1, stagecol2, stagecol3 FROM staging_table WHERE ...

DECLARE @startid int
DECLARE @total int

SELECT @total = COUNT (*) FROM @tbl

exec p_increment_counter_multi 'dest_table', @total, @startid OUTPUT

INSERT INTO dest_table ( dest_id, destcol1, destcol2, destcol3 )
SELECT temp_id + @startid - 1, col1, col2, col3 FROM @tbl

So instead of two transactions for each row in the staging table, we end up with four transactions total, one of which is a select to populate the table variable and one which just gets the total number of rows. The performance benefits can be substantial: In my particular procedure, for 500 source rows, the time to execute the procedure went from 25 seconds to 6 seconds.

Of course, you could have done the same thing using a temporary table, though it appears that table variables are slightly more efficient in memory. But the basic principle is the same: an application-level counter column is no reason to insert one row at a time.

The same principle, with a twist, can be applied to update cursors as well; more on that in a while.

Tsar: Band – Girls – Money

tsar band photo courtesy tvt

Sometime in the mid 1990s a lot of bands stopped feeling good. Blame the rap-metal bands, blame Radiohead, but good old fashioned rock party music largely disappeared from the airwaves. If there is any justice in the world (a dubious proposition at best), the new record from Tsar should bring back the heyday of window-open singalong guitar party rock in a way it hasn’t been heard since that album that the guys from Guns ’n’ Roses never recorded with the kids from Green Day.

Tsar are very good at a very old rock and roll tradition: exploring someone else’s sound and making it your own. The band has been kicking around LA since 2000 (and has been a darling of the blogosphere for at least that long, thanks to Tony Pierce’s tireless hype), and releases its first album for TVT this month. So the big question is: does the band live up to the hype?

Do they ever. Band Girls Money is a straight-ahead high octane dose of jet fuelled ear candy. Tsar claim to be descended from glam idols T. Rex and sugar poppers the Archies (and they work the glamdrogynous look in the cover art), but there are equal parts John Lennon and Cracker-era David Lowery in Jeff Whalen’s insanely fluid vocals, and the guitars simultaneously recall the high points of pre-Thin White Duke Bowie, the Ramones, and the Jesus & Mary Chain.

Incidentally, if this reads like a critics’ game of “List the Influences,” that’s because every track invokes a different set of very specific rock references. “Superdeformed” is the most explicit, checking the Beatles in both the chorus (though this writer would dispute the claim that “the Beatles never got you high”) and in Whalen’s Lennonesque “all riiiight,” which sounds like an alternate take of the chorus for “Revolution.” But other tracks hit different reference points: “Straight” plays like the Ramones doing a “One Tree Hill” soundtrack song (in a good way), “Wanna Get Dead” has the aforementioned JnMC vibe (specifically, “Coast to Coast” from Automatic), and the rhythm section intro leading into the sustained guitar note that opens “The Love Explosion” plays for all the world like a sped-up version of the opening to Radiohead’s “There There.” But the songs are all clearly original—the reference points are there as hommages, not as imitations, and for the most part if you blink you miss them. You know, aside from the part where Tsar are reinventing the whole glam genre.

Then there’s Whalen’s lyrics… They aren’t deep, mostly cocky cock-rock (“He’s got the band, the girls, and the money”, “It’s hard to stand up with all the girls on your lap”), but they would probably be a lot of fun to sing along with if the band included a lyrics sheet.

Which is one of my only two complaints about this disc. The other, the DRM on it that prevented it from going on my iPod so I could take it with me everywhere, is a little less forgivable. But the rock is so good, I’m almost over that. And if you know me, you know that’s saying a lot.

If Spoon’s Gimme Fiction is this summer’s party album choice for the intelligent indie pop fan, Tsar’s Band Girls Money is this summer’s party album choice for everybody else—and for the intelligent indie pop fan when he thinks no one else is looking. This band is some serious rock’n’roll fun.

Originally posted on Blogcritics.

Exploding manholes = change of plans

Boston.com: Cambridge streets close after reports of exploding manholes. No one was hurt after a piece of N-Star equipment underground failed, causing manhole explosions in Central Square. More to the point, it also caused massive power failures, crippling the Red Line and bringing traffic to a standstill in much of Cambridge.

You know, tonight was going to be the night I went to Harvard Square for the Monday night trivia contest at John Harvard’s. I guess God doesn’t want me to go; the last time I had an opportunity to go, it was two days after my hand injury.

Can’t stand the heat

It was a great weekend, but hot. As in, I’m surprised I didn’t melt right off the stage Saturday night in my new tux. Lisa has business in New York this week and went yesterday with her parents back to NJ, taking the dogs with her. Definitely the right move. They would be having some trouble at this point, it’s so hot.

Yesterday I escaped the heat for a while by going to the movies, where I caught the Hitchhiker’s Guide at the Arlington Capitol Theatre (verdict: about a 3 out of 5. Marvin wasn’t as effectively used as he could have been, but there was a fair amount of magic in the rest of the story), then came home and napped in the air conditioning of the bedroom for a few hours. But the portable AC unit was having a hard time keeping up with the heat too.

Last night I dreamt that our new AC system had been completely installed and that we didn’t have to patch any of the walls afterwards. Oh well. Back to reality.