Sunday, June 28, 2009

LBJ Can Haz Pants?

A friend on Facebook posted a link to this classic recording of a phone call made by then-president Linden Johnson: Linden B. Johnson orders some new Haggar pants

In this telephone call, which has become one of the more famous exchanges LBJ
recorded, the President asked a leader of the Haggar clothing company for some
custom-made pants, providing specific (and sometimes graphic) instructions on
how they should be customized for him.

Never let it be said that I don't post educational information on this blog!

Chris Walker cameo in "Inked"

Chris Walker, of the Contemplative Programmer blog, recently was involved in the 48 Hour Film Project in Seattle, getting to act in one of the entries, titled "Inked". You can watch "Inked" here, and see prior films from various cities around the world here.

He has a single line in the film, a single word in fact, and it's very apt if you know him. In the security team at Microsoft, Chris had a knack for spotting bugs in code, and would often send out gems to the team with the email subject line "Code du jour". I miss those mails...

Wednesday, June 24, 2009

"Nothing up my sleeve" numbers

I just came across the term "nothing up my sleeve number" today, and it made me smile. Sometimes geeks chose pretty cute names for things :) See the Wikipedia entry here.

The related entries on differential cryptanalysis and S-boxes is interesting too. I am not a crypto geek, so the intricacies of this stuff is beyond me, but the higher-level descriptions and the history are fascinating.

Spam, spam, spam, bacon, egg and spam

One wonders what the advertising folks were smoking when they came up with this new TV advertisement for SPAM.

Monday, June 22, 2009

Attaching a VHD to a Windows 7/Server 2008 host from managed code

This past weekend I had "fun" working on a project to attach VHD files to a Windows 7/Server 2008 host machine. My aim was to have a C# app be able to do this and then read the files off the VHD...

It turns out the easiest part was opening and attaching the VHD file. The VHD APIs are pretty straight-forward, and a simple managed wrapper lets you call these from C#. (I chose a Managed C++ wrapper, but there is a C# wrapper here)

By default AttachVirtualDisk will mount all the volumes on the virtual disk, which is what I wanted. (You could also tell the VHD API to not mount them and do it yourself for the partitions you cared about, but that sounded like a lot of extra work to me...)

Now came the fun - which drive letters were assigned to the mounted partitions on the VHD? It turns out the VHD API doesn't provide this information - the most it will give you is the physical path for the drive device (see GetVirtualDiskPhysicalPath)

I looked around and found some examples of people using Powershell to mount VHDs and figure out the drive letters. Some folks were using the Virtual Disk Service (VDS), which has a managed wrapper in Server 2008 (Microsoft.Storage.Vds.dll) - Taylor Brown talks about this on his blog.

That wouldn't work on Windows 7 though, so I was left considering writing a managed wrapper for the VDS COM interface. My head was beginning to hurt... :)

Luckily I found some hints at using WMI to get the info - using WMI from .NET is not too complicated once you figure out which objects and queries to use. Here's the resulting code (Managed C++) which retrieves the logical drive for the first partition on the VHD:

// Return the logical disk for the VHD's first partition
property String^ LogicalDisk
String^ get()
String^ physicalPath = this->PhysicalPath; // Calls GetVirtualDiskPhysicalPath API wrapper
String^ logicalDisk = nullptr;

// Use WMI to get the logical drive for the first partition on the VHD disk
RelatedObjectQuery^ q = gcnew RelatedObjectQuery(String::Format("\\\\.\\root\\cimv2:Win32_DiskDrive.DeviceID='{0}'", physicalPath), "Win32_DiskPartition");
ManagementObjectSearcher^ searcher = gcnew ManagementObjectSearcher(q);
String^ firstPartition = nullptr;
for each (ManagementObject^ o in searcher->Get())
firstPartition = o->Path->ToString();
if (firstPartition != nullptr)
// Now see which volumes are related to the partitions
q = gcnew RelatedObjectQuery(firstPartition, "Win32_LogicalDisk");
searcher->Query = q;
for each (ManagementObject^ o in searcher->Get())
logicalDisk = o->GetPropertyValue("Name")->ToString();
return logicalDisk;

"Molecular biology for computer scientists"

I just saw this rather intriguing post on Bunnie's blog: On Influenza A

In it he muses about the similarities between the influenza virus and computer virii. Some really interesting stuff, and some links to other reading.

A snippet to entice you to click on the link above:
If you thought of organisms as computers with IP addresses, each functional group of cells in the organism would be listening to the environment through its own active port. So, as port 25 maps specifically to SMTP services on a computer, port H1 maps specifically to the windpipe region on a human. Interestingly, the same port H1 maps to the intestinal tract on a bird. Thus, the same H1N1 virus will attack the respiratory system of a human, and the gut of a bird.

Tuesday, June 16, 2009

The non-sucky re-finance experience

After complaining about my experience with WaMu/Chase, I'm pleased to report we've closed on our re-finance with Quicken Loans.

I called them the afternoon that I realized WaMu/Chase were not going to work out, and within a day I had received spoken to a loan officer and received an estimate. The next morning I signed forms electornically locking in our rate and starting the credit reviews, etc. Within a week of applying the property valuation was done, and the loan was approved. During the whole process I was able to easily speak to my loan officer (email and phone calls answered within a day). Title search took about a week and a half, and we then signed the papers at our house. The whole process took under 4 weeks.

I was also really impressed that Quicken Loans sent us the full set of papers we would be signing the day before, so we could review them and ask questions if needed. No other lender I've worked with has done that, or offered to do signing at a location that's convenient for you instead of them.

Another nice thing: The property valuation report was very detailed and has some great info, such as comparable properties in the neighbourhood that have sold or are listed for sale now. More data than most estate agents give you when you are considering listing your home and trying to figure out a realistic price...

All in all I was really impressed with these guys and would recommend them to my friends. If you are thinking of re-financing or purchasing a home, give them a try.

Saturday, June 13, 2009

Abita Beer in Seattle

So, I have been a bad muppet and not posted anything about our trip to New Orleans. {A} has been much better and posted several entries already, so I recommend you read them in the meantime :)

One of the highlights of the trip for me was the discovery of a local brewery - Abita Beer.
Their Turbo Dog beer was quite nice and already had made an impression, but one night we had dinner at a cute cafe and I tried the seasonal Strawberry Beer from Abita. Wow.... Love at first taste?

This is one of the best summer beers ever - light, crisp and refreshing. The Strawberry refers to local, Louisiana strawberries. (The beer is a spring/early summer speciality, made in small amounts).

When the waiter suggested it, I thought "Ugh, it'll be too sweet". (I am not a huge fan of sweet beer or hefeweizen, although I do like some Belgian lambic beers like Kriek and Framboise).
I would say the Abita Strawberry beer captures the aroma and flavour of strawberries without picking up the sweetness - the beer is still nicely balanced and almost tart.

Now, on to Seattle. Not surprisingly, given the distance between Louisiana and Washington state, I have not seen Abita beer available here. Until I visited New Orleans, I had never heard of them. Looking at their website, though, it appears a few places in Seattle stock their stuff. On the eastside where I live, the only option seemed to be Larry's Market, which recently became a Top Food.

I can happily report that the Top Food in Redmond does sell Abita beer - only the Purple Haze was out when I was there, but there may be hope of getting Turbo Dog or some seasonal beers too... I will update this post if I find out more! :)

Update: 6/13
I spoke to the beer & wine buyer at Top Food in Redmond, and he said he'd be happy to order other kinds of Abita beer if I would be willing to buy a case. Sadly, though, the Washington State distributor, Columbia, only sells Purple Haze, Turbodog and Amber. No seasonal ales like the strawberry or satsuma.

I also found this discussion on Chowhound, which mentions that the Bellevue Whole Foods is an option. (I can report that the one in Redmond doesn't have any Abita beer...)

Thursday, June 11, 2009

New Iain M. Banks book, "Transition"!

Ooh, goodie! I enjoyed The Algebraist and Matter and can't wait to get started on this one!

It sounds like a bit of a departure from his Culture and far-future sci-fi, as this one is set on Earth in the (near?) future. It sounds like it may be more like some of Ken Macleod's books (or dare I say it, "The Diamond Age"). There's not really enough info on Amazon's page to know, though. So I guess I should be patient :)

It's available now for pre-order from Amazon (hardcover)... The softcover version will be out later in the year.

There is also an interesting article featuring Banks and other sci-fi authors on the BBC website here. The topic is "Can science fiction keep up with modern science?"

Tuesday, June 09, 2009

Meet the Contemplative Programmer

Chris, who until very recently worked in my team at Microsoft, started a great blog. The official description is "musing about programming, management and old computers". He has lots of interesting anecdotes, such as the current post concerning Guest accounts, and an earlier post on core memory.

You can read the blog here:

Monday, June 08, 2009

Powell's Sci-fi Recommendation

The kind people at Powell's Books in Portland offer expert advice on science fiction books, as this sign shows.

I think I've seen this guy moonlighting where I work too...

Thursday, June 04, 2009

What's Sue McCown been up to?

It turns out Sue McCown of Coco La Ti Da and Earht & Ocean dessert fame has not been hiding under a rock for the past few months. This blog post describes her work with Seattle's Cupcake Royale to help them improve the texture and longevity of their cupcakes. (They noticed that many people bought them to eat the next day, and they tended to dry out overnight...)

For some reason when I read the description of Sue making batch after batch of cake mix, tweaking one variable each time, I picture a female Alton Brown doing a "food science is fun" routine. I'm not sure Sue would like to be labeled "the female Alton Brown", though :)