aspnet, net, books comments edit

The ASP.NET 2.0 Anthology by Allen, Atwood, Barnett, Galloway, and
Haack.I just got through reading The ASP.NET 2.0 Anthology and I have to say, I liked it.

Anthology is a “cookbook” approach at showing different tips and tricks for working with ASP.NET 2.0.  If you’ve never set foot in ASP.NET land, this isn’t for you - it’s not a “newbie trying to learn ASP.NET” book.  It’s more of a “moderately experienced ASP.NET developer trying to sharpen the saw” book.

The voice of the book is fairly informal, which makes it nice - like you’re learning tips from a friend, rather than being dictated to.  Even some of the code snippets - which are shown in a nice, easy-to-read format - inject humor (watch for the Office Space references in the “Working With Email” chapter).  It made the book really easy to get through and understand.

The book covers a large range of topics, from error handling to membership and role providers to form validation.  What was a pleasant surprise to see is that it covered a lot of things many other books don’t, like project format, source control, and usage of popular third-party libraries (e.g., log4net and SubSonic).  There’s discussion of non-ASP.NET issues like design patterns and practices, data access layer usage, and basic SQL Server query optimization - things that a reasonably experienced ASP.NET developer bumps into on occasion but may not have had time to delve into.  It even addresses differences for users of the Visual Studio Express Editions, who normally get sort of “left by the wayside.”

There were really only a couple of minor issues that I found with the book.

First, there’s a chapter in there called “.NET 2.0 Core Libraries” that looks as though it’s intended to give an overview of, well, the .NET 2.0 core libraries… but in the 30 pages allocated to the topic you can barely scratch the surface, so it generally comes off as slightly schizophrenic, hopping from topic to topic.

The other issue I found is that there are some surprisingly good “nuggets” of information that seem misplaced and, in some cases, outright hidden, in the book and deserved a little more time in the sun.  For example, cross-page postbacks were sort of hidden in the “Component-based Development” chapter and asynchronous pages were hidden in the “Working With Email” chapter.  Interesting and valuable information that just sort of felt ”out of place.”

Overall, the content of the book far outweighs any of the minor organizational problems you run into.  If you’re looking for something to learn from and spark ideas of ways to make better ASP.NET applications, this is a great book.

[In the interest of full disclosure: I was sent a review copy for free from one of the authors, Jon Galloway.  Thanks, Jon!]

media, music, windows, net, downloads comments edit

I’m in the process of re-ripping a lot of my CD collection in a higher quality format and I noticed that iTunes doesn’t necessarily detect that I already have the song in my library and offer to copy the metadata from the old version to the new one for me.  But I need that - I need to be able to copy all the metadata (including artwork and playlist membership) from the old version of the track to the new one so I can delete the old version and keep on truckin’.

It’s doubly difficult when you realize that the iTunes UI doesn’t actually allow you to modify all of the metadata - things like play count don’t have an interface.  So - time for a program.

The CopyTrackMetadata program I wrote allows you to copy any or all of the metadata from a source track to a destination track.  Just open iTunes, open the app, choose which metadata you want to copy, select the source and destination tracks, and click “Copy.”  Done.

Here’s the main window:

CopyTrackMetadata main

And the myriad options you have on which metadata to copy:

CopyTrackMetadata options

It’s totally free, and it works great for me, but if it somehow destroys your music collection, you’re on your own - this is totally unsupported.

Download CopyTrackMetadata 1.2.0

Download CopyTrackMetadata 1.2.0 Source

Version History:

  • 1.0.0: First release.
  • 1.2.0: Updated for .NET 3.5 and fixed a breaking change in the way tracks get selected in iTunes 9.

gaming, xbox comments edit

I got my fourth Xbox (the results of the third repair) and steeled myself for the hoop-jumping madness that is the digital rights management system on Xbox Live.

In my two previous bouts with this, the process has been basically:

  1. Create a brand new Xbox Live Silver account.
  2. Delete all your stuff.  Try to re-download it because that’s supposed to re-authorize the console.  It doesn’t work for me.
  3. Call in for “points after repair.”  (Get codes from Microsoft that you can redeem for points.)
  4. Apply those points to the Xbox Live Silver account.
  5. Re-purchase and re-download all of your stuff.

They must have been getting people abusing the system (like getting the points and buying different things) because the process has changed.  My understanding of the new process is:

  1. Call in to get points after repair, as before.
  2. Explain to the new technician what you mean by “points after repair” and why you want it.  (For me, it’s because my account can play the content still but it won’t work for any other profiles on the machine unless I’m logged in, so my wife is screwed if I take my profile and go play at a friend’s house.)
  3. The technician will ask you if you’ve tried deleting and re-downloading the content.  Try it and find that it doesn’t work.
  4. The technician will escalate the call to a supervisor who will ask you if you’ve tried deleting and re-downloading the content.  Somehow the result of the earlier trial hasn’t changed in the last three minutes.
  5. The supervisor will give you a new reference number and schedule a call for a few days hence to get a resolution.
  6. Before the scheduled call, another technician will call you and ask you if you’ve tried deleting and re-downloading the content.  Because they didn’t, like, write that down or anything.  Explain the results of the previous attempt and that you’re waiting for the call.  The technician will tell you to keep waiting for that scheduled call.
  7. The scheduled call occurs and the technician on the other end will ask you if you’ve tried deleting and re-downloading the content.  Sigh.
  8. The issue will be escalated again, this time to someone who supposedly can do something about it.  In two to four weeks, you’ll get a call with a resolution.
  9. When you get the call, you’ll delete all of your content and re-download it through the Xbox Live Marketplace tab, under the area called something like “Previously Downloaded Content.”  The resolution is, basically, that someone flipped a bit in a database somewhere so that this time when you re-download, it will not just re-download but also re-authorize your console for the content.

I am not all the way through this process.  I am currently on step eight, waiting my two-to-four weeks to get the call that says someone flipped the bit and I can re-authorize my console.

I’m not sure the new process is better.  I can see that it would stop the folks abusing the system, which I think is good, but I think it’s pretty crappy that I’ve gotta sit for weeks waiting for this to happen.  There has got to be a better way.

General Ramblings comments edit

It was four weeks since my second hair removal treatment and eight since my first as of this past Saturday, so once again I headed in to get my face zapped.

My second treatment used the Aesthera Isolaz IPL in an attempt to get me some reasonably pain-free results.  While it was far, far lower in pain magnitude, I really didn’t see much in the way of results.  In fact, I could barely tell anything was done at all.  As such, this third treatment we went back to the Dermo Flash since that had a reasonable balance of pain and results.

My normal technician was sick, so I got a different lady zapping me.  She said she totally didn’t blame me for sticking with the Dermo Flash - the MeDioStar does get overall better results but she has yet to find any guy who can take the pain involved (it’s apparently that much more intense when used on coarse male hair).  She did one guy’s beard and by the end was almost in tears herself with watching how much pain the guy was in, and he was on his own pain killers.  So… no MeDioStar laser for me, thanks.  I’ll stick with Dermo Flash.

gists, net, csharp comments edit

Some friends of mine at work, Vish and Peter, found this one.  It’s tasty.

We work on a web application that has a lot of external dependencies.  Generally speaking, we have pretty decent luck upgrading these external dependencies when the interfaces don’t change - swap in the new assembly for the old one, do any binding redirects or what-have-you, and you’re off.  Unfortunately, one particular upgrade wasn’t working too well and we had a heck of a time figuring out why.

The problem was in a particular switch statement that was based on an enumeration value.  We get the value from the external dependency then pass it through the switch statement so we know how to behave based on the value.  The problem we were seeing was that we could watch the logging through the system, see that all the way through the service layer everything was fine, then suddenly when it hit our application, our app was receiving the wrong value.  There wasn’t any serialization problem, there wasn’t any caching issues, it was just somehow getting the wrong value.

The answer lies in what I’m going to call “The Old Enum Switcharoo.”

Turns out that if a third party dependency changes the order of an enumeration, that’s an interface-breaking change.  Even if they don’t add or remove any values - just re-order the same values inside it (which is exactly what happened to us) - things fall apart.

I put together a reproduction so you can see what’s going on.  It’s a small console application that has an external dependency with three enumeration values.  Instructions for how to build/run your own repro are included in the source file; I’ve also included two folders with pre-built binaries so you can just run it and witness, if that’s all you’re up for.  Here’s what it looks like:

The Old Enum Switcharoo - in

Go ahead and grab the reproduction code here:

Reproduction Code for The Old Enum Switcharoo [ - 15KB]

The solution to the problem is to either get the external dependency to put their enumeration back (which is a possibility for us, since we control it) or recompile your application against the new version of the dependency.