media, windows comments edit

I just had a bit of a scare with a misbehaving Windows Home Server add-in where the upgrade process went frightfully wrong. As such, I ended up with:

  • The .msi for the add-in in the \\server\Software\Add-Ins folder.
  • The list of add-ins saying the add-in was installed.
  • No add-in actually installed.

Thank goodness there’s a great article over on HomeServerLand that tells you how to manually uninstall an add-in. I followed that process and the crisis was averted.

process comments edit

A few blogs I read have started experimenting with video blogging and it’s made me realize that I’m not a video blog… watcher(?).

If content is written, I can read it at my leisure. I can search through it, I can get it on my Blackberry during a boring meeting, I can do pretty much whatever. I can read a few paragraphs, switch to something else, and come back. Worst case scenario, I forget where I was and I can very quickly skim the article again to jog my memory.

Audio content is OK, but not great. It demands a bit more attention.

I’m not one of those folks who can write a term paper and watch a movie and talk to someone all at the same time. The result of me trying to multitask my I/O like that is nothing gets my full attention. I won’t know what’s going on in the movie, my paper will end up taking a long time to write and won’t make sense, and the conversation will dwindle.

I bring that up because with audio content, I can’t listen while I’m working. I’ll lose my train of thought. (I can listen to music, but generally stick to stuff that doesn’t have words or stuff I’ve heard so many times I don’t focus on it.) I can’t listen while I’m home, either, because generally the audio blogs/podcasts I’m into aren’t things my wife’s into.

That leaves my 15-minute-each-way daily commute. Given that, it takes me two or three days to get through an hour-long show like This American Life. Five days per week means I get about one-and-a-half podcasts in. I have to really pick and choose. In many cases, I end up doing a lot of deleting without listening because I can never catch up. (I’m looking at you, 30-minutes-three-times-a-week-Planet-Money. And has Hanselminutes been getting longer or is it just me?)

Which brings me to video blogs/podcasts/whatever. This is the worst of all worlds.

  • I can’t do anything with them while I’m working because it’s not even just audio content, it’s video, too.
  • I can’t do anything with them on my commute because it’s video. Plus, most times the video is on a site like YouTube where you can’t even download it and listen to the audio.
  • I can’t do anything with them at home because, frankly, if I’m going to sit down and watch something, there are plenty of more entertaining things I can watch to help me unwind than technical videos.

It’s the same problem I have with the phone. Instantly single-threaded. I might be able to do something that doesn’t require much brainpower at all, but basically, phone + me = useless.

GeekSpeak, net comments edit

Before I even get into this, let me preface it by saying Scott’s a friend of mine and he’s a great guy. I told him I was posting this before I did it. It’s just some interesting data that I got in an interesting way and thought folks would be interested. It’s also intended to totally crush Scott’s spirit. (I kid! I kid!)

So.

I was just writing about how I was seeing more and more video blogs and was thinking about the earlier days of Hanselminutes when it seemed like the show was shorter. I wanted to make sure it wasn’t just my mind playing tricks on me so I did some data gathering. This is actually about the process I went through.

The idea: create a graph of the Hanselminutes podcast duration over time so a trendline can be established.

At first I thought it would be pretty straightfoward - I could grab the RSS feed and just parse out the duration info. Turns out they don’t actually list how long each show runs, so I had to change my tack and analyze the MP3 durations directly.

Step 1: Getting the MP3s.

I’m not a Powershell guru but this sounded pretty Powershell-ish to me. The thing is, I already had some tools that would do some of the job for me, so I didn’t write the whole thing in Powershell. It went like this:

  • Grab the RSS feed for the show by just right-click and save-as from the site.
  • Get the URLs for the MP3s. I used a command-line XPath query tool for that, looking at /rss/channel/item/enclosure/@url. That gave me a nice list of the URLs to the show.
  • Get the MP3s. This is where I did a little brute force Powershell scripting. I suppose I could have saved the list of URLs to a text file and then wrote a script that read in the lines from the text file, but I didn’t. I did a regex search-and-replace to create a script that looks like this:
$client = new-object system.net.webclient;$client.DownloadFile("http://perseus.franklins.net/hanselminutes_0185.mp3", "hanselminutes_0185.mp3");$client.DownloadFile("http://perseus.franklins.net/hanselminutes_0184.mp3", "hanselminutes_0184.mp3");$client.DownloadFile("http://perseus.franklins.net/hanselminutes_0183.mp3", "hanselminutes_0183.mp3");$client.DownloadFile("http://perseus.franklins.net/hanselminutes_0182.mp3", "hanselminutes_0182.mp3");...

Like I said, pretty brute force… but I’m not running this a bunch of times, I’m just doing it once.

Step 2: Getting the Duration from the MP3s.

This was harder than I thought. What you actually have to do for this is get the MP3 tag info and get the duration from that.

I used the open source TagLib# and wrote a tiny console app using SnippetCompiler that looked like this:

DirectoryInfo dir = new DirectoryInfo(@"C:\Documents and Settings\tillig\Desktop\Hanselminutes");FileInfo[] files = dir.GetFiles("*.mp3");foreach(FileInfo file in files){  TagLib.File tag = TagLib.File.Create(file.FullName);  Console.WriteLine("{0}\t{1}", file.Name, tag.Properties.Duration);}

Again, could I have done that with Powershell? Sure, but I’m not too strong in Powershell and I haven’t had a chance to get too far beyond pretty basic stuff. And, again, I’m running it once.

So that gets me a tab-delimited text file with the name of the MP3 file and the duration.

Step 3: The Graph.

This was a simple import into Excel and add a graph. I won’t go through that.

The Result:

Hanselminutes Duration
Graph

I was right - there is an upward trend in the Hanselminutes duration.

So… interesting.

UPDATE: If you want the data for your own enjoyment, here you go.

net comments edit

I just spent a couple of days debugging a weird problem. We have a fairly large product that has several Visual Studio solutions in it, all of which target .NET 3.5. No, that’s not the problem. The problem was that we were able to build each solution separately in the correct dependency order just fine, but when the whole thing ran together in an automated fashion, the build would fail.

The failure message indicated that an extension method was not being recognized. Something like:

'Foo' does not contain a definition for 'Bar'

Again, it would build on its own, but not in the larger environment. What gives?

I figured the problem had to be the targeted .NET environment - that the project was targeting .NET 2.0 when run in the larger build but .NET 3.5 when run alone. And I was right, but not how I thought.

As it turns out, a custom build task run in an earlier build was setting an environment variable called COMPLUS_Version to v2.0.50727, which forced everything after that to run in .NET 2.0.

I had no idea such an environment variable existed. Doing a quick Google search on it, the only documentation on it has to do with build and test environments forcing things to run in different .NET versions, like if you’re building something for .NET 1.1 and want to see how it runs in .NET 2.0. I searched MSDN and other sites, but I can’t actually find any “official” documentation on this. It’s just one of those things you figure out.

Valid settings for COMPLUS_Version seem to be the same as the names of the folders you see when you go to the %WINDIR%\Microsoft.NET\Framework directory, like:

  • v1.1.4322
  • v2.0.50727
  • v3.5

…and so on.

Setting the value will force future processes in that space to use the specified .NET runtime, like:

set COMPLUS_Version = v3.5

That would force everything to run in .NET 3.5.

And we tried that - doing a set to .NET 3.5 to force everything to that runtime, but we then ran into another issue: We were using the vsdbcmd.exe program to do some database work during a build (that’s another story) and if you force it to run in .NET 3.5 you get the error:

To run this application, you must first install one of the following versions of the .NET Framework: v3.5 Contact your application publisher for instructions about obtaining the appropriate version of the .NET Framework

That made no sense to me since I obviously have .NET 3.5 installed.

The answer was to get rid of COMPLUS_Version entirely. After the custom build task ran, set the variable, and completed its work, we used the MSBuildCommunityTasks “script” task to unset the environment variable:

<PropertyGroup>
  <SetCode>
<![CDATA[
  public static void ScriptMain() {
    System.Environment.SetEnvironmentVariable("COMPLUS_Version", null);
  }
]]>
  </SetCode>
</PropertyGroup>
<Script Language="C#" Code="$(SetCode)" Imports="System" />

Doing that removes the variable from the process space and later executables can allow the CLR to choose which environment to target automatically.

media, windows comments edit

A little over a year ago I was looking for a storage solution for my tags: [media] center and landed on Windows Home Server. A year in, is it still all I thought it would be?

Mostly.

The Good Bits:

  • Expandability. I’ve upgraded the RAM in it and added a bunch of drives to it. It just keeps getting bigger, and that’s awesome. I don’t have to mess with partitioning things or allocating space to this or that. It just works.
  • Computer Backup. The fact it backs up all of the Windows computers on my network is great. It’s almost worth the price for that peace of mind alone.
  • Redundancy. The “file duplication” thing it uses to store two copies of a file on two physical spindles is great. I don’t worry about a drive going out because I won’t lose my important data.
  • Photo Sharing. I can get to my photo library from anywhere - computer, Xbox 360, Playstation 3 - and it just works.
  • Appliance-Like Functionality. Stick it in the corner, attach to network, plug it in, turn it on. It really is that simple and maintenance-free.

The Decent Bits:

  • Music and Video Sharing. While the photo sharing works great, the whole DLNA/UPnP media sharing bit of Windows Home Server is built on Windows Media Connect, which is unacceptably old. To get newer music types working, you need an additional plugin like Asset UPnP or you need to be accessing the music like a file from a network share. Same thing for video sharing (though I’ve not found a plugin like Asset UPnP for video).
  • Online Backup. Since Windows Home Server is built on Windows Server 2003 but has some differences to it, it’s hard to find an online backup service for it that’s affordable. Mozy, for example, classifies it as a “server OS” so you have to pay the expensive business pricing for it… even if you’re only storing the same stuff on there that you’d normally have on your PC. You end up either paying through the nose or rigging up something to get around the backup restrictions.

The Not-So-Great Bits:

  • File Access Time. Streaming music or pictures works pretty well and I’ve seen no hiccups there. On the other hand, the original intent for this system was to store and serve my DVD library. I’ve got somewhere around 800 discs in my collection (considering a TV season might be six discs, give or take). With 100
    • 200 movies in there (which is where I was testing things), the speed is reasonable and except for a few network hiccups, you could play a full DVD image over the network to a Windows Media Center. Looked beautiful. You get 6TB of storage on that thing with 800 disc images on there and the file access time tanks. I thought my network was just getting bogged down or there was bandwidth trouble since I was seeing a ton of the little “hangs” where the picture and sound would freeze while watching a movie. I upgraded my network equipment and got no better result. It’s totally file access time. As such, I’m going to have to reinvestigate which video format to store my movies in and switch to something a little more network-and-file-access-time-friendly. Unfortunately I think that’ll mean giving up some of the features I was hoping to keep (like the menus and “special features” videos).
  • Developer Resources. I’m a developer and I’ve considered developing a plugin for Windows Home Server (not sure what, but thought it might be interesting) and… there’s pretty much nothing out there on this. Not the major use case for people out there, but still - lame.

Knowing all of that, would I still recommend a Windows Home Server? Sure. The good things far outweigh the bad things. The file access time thing leaves me with a little egg on my face as far as my wife is concerned, though. (“So we bought that and it’s not working?”) Seeing as how the point was to get a functional video library and that’s the part that’s failing right now… well, I’ve got some more work to do.