Archive for Jan 27 2007

Updated RIAA Radar Greasemonkey Script

Some time ago I came across the RIAA Radar site, which uses Amazon's E-Commerce Web Service to cross-reference the labels musical albums are published under with known RIAA members. The idea is that you can use the service to help restrict your music purchases to labels that do not affiliate themselves with the RIAA, and by extension the RIAA's strongarm tactics against music fans. I liked the idea but didn't want to have to visit the site every time I looked at an album. Fortunately the site had a Greasemonkey script called RIAA Radar that would automatically insert a little icon on the Amazon detail page indicating whether it was from an RIAA label or not. Unfortunately, the script was broken. I went ahead and fixed up the script, as well as optimizing it and expanding its functionality. Since the site's maintainer never accepted the revised version, so I've been maintaining a fork ever since.

RIAA Radar Greasemonkey Script example

Anyway, with the launch of Amazon's new MP3 Downloads store, I figured I could get RIAA Radar working with that too. It turned out to be pretty easy, and I was able to fix a bad URL in the script while I was at it. So the script should serve music fans even better as they browse the DRM-free music available at Amazon.

TopProcess Sidebar Gadget - Now with memory usage display

I didn't think I had anything more to do with my TopProcess Windows Vista Sidebar Gadget after its minor update a couple months ago. However, I got a suggestion emailed to me from a TopProcess user that was easy to implement and adds a lot to the gadget. So, TopProcess now allows you to choose between measuring the top consumers of CPU, and the top consumers of RAM. So all you need to do is add two copies of the gadget to your sidebar, and set one to track memory and one to track CPU. Check it out (Firefox users will not be surprised that it always sits at the top):

In CPU mode it displays percentages, and in RAM mode it displays absolute memory footprint values. Remember that some apps (like .NET or Java apps) look like they're taking a lot of memory, but will give it back when you get low on RAM, so it's not a worry if they gobble up some extra RAM when you've got it. Of course, for most native apps (like Firefox or Photoshop), the value displayed in TopProcess represents a less flexible chunk of resources.

A couple of bugs and less-than-desirable behaviors have been fixed, too. Whenever you change settings the changes will be reflected in the gadget immediately, and turning text fade off and then on again won't cause text to overlap in a big mess. Also, some of the comments on the Windows Live Gallery page for TopProcess suggest that people have been seeing performance problems with the gadget. I haven't actually seen any problems myself, but I went through the code and tightened it up a bit here and there - hopefully it'll work better for those people.

So pick up the new version, rate it on Windows Live Gallery, and enjoy the new functionality.

PS: I was holding this back until my friend could come through with the Russian and Japanese translations, but he's just too busy and I had to fall back to Google Translate. I apologize if the translations are awful. If you would like to help fix them, or to translate TopProcess into your favorite language, please contact me.

Eclipse NoClassDefFoundError near installFont on startup

At work and at home I use Eclipse as my IDE of choice for Java development, along with Eclipse-in-disguise Aptana for web development. I've never had a problem with Eclipse on Windows or on my Mac, but on my Linux machine (and many of my co-workers' machines) Eclipse tends to crash rather violently. I suspect that it isn't Eclipse at all, but the primitive P4WSAD Perforce plugin. I don't use Perforce at home, so that might be the difference. Anyway, what happens is that in the middle of doing something Eclipse will run out of PermGen memory, throw up some errors, and die in the least pleasant way possible. When you try to start it back up, you get something like this:

 !SUBENTRY 1 org.eclipse.team.core 4 0 2007-08-20 16:58:25.979
 !MESSAGE Could not instantiate provider com.perforce.team.core.PerforceTeamProvider for project SampleProject.
 Exception in thread "Thread-1" java.lang.NoClassDefFoundError
         at org.eclipse.ui.internal.themes.ThemeElementHelper.installFont(ThemeElementHelper.java:101)
         at org.eclipse.ui.internal.themes.ThemeElementHelper.populateRegistry(ThemeElementHelper.java:57)
         at org.eclipse.ui.internal.Workbench$28.runWithException(Workbench.java:1426)
         at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
         at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
         at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
         at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3296)
         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2974)
         at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2309)
         at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
         at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
         at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
         at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
         at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
         at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
         at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504)
         at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
         at org.eclipse.equinox.launcher.Main.run(Main.java:1169)

Further digging reveals that the culprit is definitely the Perforce plugin. To fix it, you need to go to where Eclipse is installed, and move the plugins/com.perforce.* files away. Then start Eclipse, which will start but complain about the missing plugin. Then shut down Eclipse, move the plugins back, and start up again. You'll need to reconfigure any Perforce windows you had open, but at least Eclipse will start.

This seems to be caused by Eclipse crashing after running out of PermGen memory. To prevent future crashes, edit eclipse.ini in your Eclipse install directory. It should look something like this:

-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Xms40m
-Xmx512m
 -XX:MaxPermSize=256m
-Dosgi.bundlefile.limit=100

The -XX:MaxPermSize is especially important for preventing Eclipse crashes. The other option, –launcher.XXMaxPermSize only works in Windows.

WebLinkLabel Windows Forms Control

While I was updating my PopupNotify control today, I realized that I had created another useful little control for XBList that I hadn't released, the WebLinkLabel Control. This simple control wraps the standard LinkLabel control to make it easier to embed multiple hyperlinks in a label, each of which will load up a URL in the user's default browser when clicked. It's not the most complex thing in the world, but it has proven useful for inserting help links into XBList's error dialogs, so I suspect it might be of some utility to others. Using it is about as simple as using a standard Label. Just drag the WebLinkLabel onto your form, customize it however you like, then assign a specially-formatted string to the Text property. You use “url” tags to specify where you want links, like this: “Hello, this is text <url=http://benhollis.net>with a link in it</url>.” You can of course have as many links, pointing to as many different URLs, as you would like. If you want to get that formatted string back out, use the LinkText property, or if you want to get a flattened view out (“Hello, this is text with a link in it.”), use the Text property.

This code is licensed under the LGPL, like the other XBList bits I've released. As usual, I would appreciate it if whoever uses this code would email me to let me know how they're using it, just for my own amusement. You can download the control right here.

New Version of the PopupNotify Windows Forms Control

A couple years back I posted the source of XBList's tray notification control on my site as the PopupNotify control. I licensed it under the LGPL so people could use it for their own applications. While I requested that whoever used it should let me know, I've never received any email about it until this week, when somebody wrote to tell me that they had been using it but it didn't work on Vista, and they wanted some help getting it to work. Despite the fact that I would rather they had told me about this beforehand, I've taken this as an opportunity to update the component. I just pulled out the current version of the control that I'm using for XBList, which has a much prettier Vista-style look, less P/Invoke calls, and other .NET 2.0 improvements. I've left the 1.1 version of the control around for anyone who wants to use it but hasn't updated to .NET 2.0 yet.

The new, Vista-style popup

Hopefully this component will continue to be useful to other developers, and they'll let me know if they're using it in their projects, since it's just so much more fun to release stuff for free when you get to see it in action.

Collapsible Amazon Greasemonkey Script Update

I've taken another crack at my Collapsible Amazon Greasemonkey script, and I think it's pretty complete now. Once you've installed the script, you'll be able to click on the orange title of any section of an Amazon product detail page to collapse it out of sight, and the script will remember your preference for other pages. So you can customize your product page however you like, and it'll stay that way. This new version makes it possible to collapse any of the orange-titled sections in the page (in older versions, a couple of them weren't collapsible), and collapsing a section will now get rid of everything in the section, not just the main part. It should be a much nicer experience overall, and result in cleaner, more relevant product pages for everyone.

An Example Screenshot of Collapsible Amazon

Top Process Windows Sidebar Gadget Updated

Just a quick update on the Top Process Windows Sidebar Gadget I made a couple months ago. First, I've added an option to disable the crossfade effect whenever the list of processes is updated. When this setting is checked, there's no more smooth fade, but your text is also not bold. I actually prefer it without the fade, and based on some feedback I've gotten, this will be a welcome change.

The second change is that Top Process has been translated into 3 more languages. This is the first software I've ever written that has been localized, and I'm super excited, even though there wasn't that much to translate. User Stefano Pirovano contributed an Italian translation, and my multilingual college buddy Mitch provided Japanese and Russian translations. If anyone else wants to take a crack at it, just email me. Hopefully some of my .NET stuff can be ready for localization at some point too.

MSN Messenger needs to be able to sign in from multiple locations at once

Like most Americans, I've been using the AOL Instant Messenger IM network for the last 10 years or so. As I've made more friends who prefer other networks, I expanded to multi-platform IM clients that let me sign into all the major IM networks at once. I've used Trillian, Adium, Meebo, and Pidgin over the years, and I have active screen names on AIM, MSN, Yahoo, GTalk, and various Jabber services. So when it was announced that the Xbox 360 would include an MSN Messenger client with the Spring update, I was excited. I'm already signed in to MSN all the time, so I thought this would just be another great way to stay connected.

Unfortunately, MSN has a pretty big problem. Whenever you sign in to your MSN account from one location, it signs off, all the other locations. If I'm running Pidgin on my desktop and I open Meebo on my laptop, my desktop gets signed out. And when I start my Xbox, it automatically signs on and knocks everybody else off. The end result is that I'm almost never signed in to MSN, which pretty much defeats the purpose. My buddy list reflects this - my friends are online only when their Xboxes are on. It's worth pointing out that Yahoo Messenger suffers from this problem too, but it doesn't bother me as much since I don't have many Yahoo friends.

MSN getting kicked off

With more and more devices getting IM capability, I can't see how this restriction can continue. My desktop is always on and signed in to my IM client. My phone will have an always-on IM client. Another one on my Xbox. Another on my laptop. Another at work. And I'm switching between them all the time. And with more and more people using multi-protocol clients, they're less likely to notice the one account that's decided to sign itself off. It's especially frustrating on the Xbox, since it means I can't just use my laptop to send IMs to my friends while I play and still get notifications on my TV. IM has the potential to be awesome on the Xbox, but not as long as it's stuck with a one-device-at-a-time protocol.

Required driver signing in Vista x64 cramps my style

The other day I tried to move my Hogmonitor application to my Vista x64 machine, so that I could shut down the XP machine that has been running it. I thought it'd be a nice way to save the power used by running the XP box 24/7, since it is otherwise used infrequently. However, I quickly hit up against a brick wall - Windows Vista 64-bit doesn't allow you to run drivers that haven't been digitally signed. Since the Hogmonitor uses the InpOut32 library, which relies on a custom driver, I'm out of luck. InpOut32 even has a 64-bit port, so I could have used it fine on a Windows XP 64-bit machine, and it would work on a 32-bit Vista machine. But on 64-bit Vista, there is no way around driver signing.

I understand why Microsoft chose to require driver signing - it's to keep home users from messing up their systems with weird drivers. But making signed drivers a requirement on 64-bit only is really weird. Aren't the 64-bit users going to be the power users? I'd be fine with requiring signing by default if I were allowed to turn it off through Group Policy or something, but as far as I know there's no way to disable this at all in Vista RTM (in the Betas there was a way to disable it, but it doesn't work anymore). This is the first thing I've hit that I can do with an XP machine that I can't do with a Vista machine (OK, printing too, but that's HP's fault). And I don't hold out hope for the drivers getting a signature, either - those certificates cost $895! That basically prevents any drivers written by people in their spare time from being used in Vista x64. This includes stuff like InpOut32, overclocker fan and temperature monitors, hardware tweakers, and a host of other goodies.

This is really awful, Microsoft. I want to use my computer's hardware however I want. And if that involves voiding my warranty by installing unsigned drivers so I can communicate with my hobby-project hedgehog sensor, then let me do that. Don't make me keep around another computer just so I can use simple hardware.

JavaOne 2007

I had the opportunity to go to the JavaOne conference two weeks ago, in San Francisco. It was quite an experience for me as I had never been to a technical conference before, let alone one of that size. I'm not exactly a Java enthusiast, but I am a Java developer. I spend most of my day writing Java code, so going to all the presentations about making better Java code, as well as interacting with Java developers from all over the world, was really educational.

I noticed a few things from the conference that I wanted to write down before I forgot. The first is that even in Java-land, scripting languages are hot. Lots of people were talking about JRuby, Groovy, JavaScript, JavaFX Script, and more. JRuby in particular was getting a lot of excitement from everyone who's been hearing for the last couple years about how cool Ruby on Rails is. I've seen a lot of Rails demonstrations and they've failed to impress me but the Ruby language itself is very appealing, especially to someone like myself who mainly scripts in Perl or JavaScript. I've definitely been convinced to use Ruby for my next personal web app project, and the combination JRuby's speed and native access to Java code will make me feel a lot better about it.

There were a lot of talks about static analysis tools, and FindBugs in particular. I've been using FindBugs on my Java code (and FxCop for my .NET code) for quite a while, but a few of the presentations gave me a much better idea of how powerful static code analysis can be. One of the best ideas is using special annotations that more clearly document the intended behavior of your code. Not only does this serve as additional documentation, it helps you design your classes better and helps out your code analysis tools. One of the first things I did when I got back was grab the latest FindBugs release and start sprinkling those magic annotations all over my code, and from now on I'll be writing them in whenever I write new code.

I also got more in-depth exposure to the REST philosophy, which I had heard a lot about but not really thought about too much. I really like the idea, but until the tools get to the point where I can write up some sort of service description and generate client code like I can do with WSDL, I'm going to hang back a bit. Maybe WADL will catch on. I also got a better explanation of OpenID than I had gotten previously, and I'm really impressed. I like that it's so simple, and that it can still integrate with technologies like CardSpace in a way that adds value to both sides. I searched for an open implementation of an OpenID provider that uses CardSpace, but it doesn't look like any exist yet.

Another, less explicit theme at the conference was that the Java community has noticed the great design of C# and the .NET framework and are trying to fit some of that back into Java. I've always felt that C# was “Java done right”, and the number of JSRs (Java Specification Requests) that I saw for C#/.NET features is a testament to that. JavaSE 5 already added annotations (attributes), generics, foreach, enums, variable length arguments lists, and autoboxing, all features from C# 1.0 or 2.0. The stuff that's being discussed for JavaSE 7 and beyond includes “superpackages” that look a lot like assemblies, continuations, a “using” statement, generics that don't use type erasure, indexers, and switching on strings. I think this is great - C# made a lot of great improvements that were no doubt based at least in part on experience with Java, so it's natural for Java to get back some of that. I didn't see much talk of any of the C# 3.0 features like LINQ, object and list initializers, extension methods, etc. I did see some talk about incorporating lambda expressions, though, which would be pretty nice.

Despite the fact that the Java language has some catching up to do, one glaring advantage of Java over .NET became apparent to me while I was there. I'm not talking about the platform-independence advantage, though that is certainly there - I don't think I could imagine building a large, scalable distributed service with Windows machines. No, what I'm talking about is the community. That's not to put down the large and active .NET community, it's just that the Java community is huge. And especially through open source, there's just a lot more going on. I feel like a large part of this is that Sun and other Java leaders have been willing to incorporate the community's best products into the standard toolset. Products like ant, Eclipse, Spring, JUnit, and even JRuby are accepted tools. Meanwhile on the .NET side, you're basically taking whatever Microsoft gives you. And while that can usually be good, Microsoft runs the risk of ignoring the direction people are actually heading in.

In the end, I left the conference with much the same opinion of Java that I had in the beginning. Java is a tool, and a good tool, but not a particularly exciting tool. It does have some exciting features (I love JMX), and after my week in the Moscone Center, I feel like I can be more competent at creating Java-based software. Maybe I just haven't worked on the right Java projects. I hope as my experience with the platform grows, I'll be able to contribute more, either through this blog or through open-source projects. And who knows, maybe one day I'll really feel like a Java Guy.

XBList 3.1 released

I've been sitting on this one for a while, but it's finally time to push it out the door. XBList 3.1 doesn't have any revolutionary changes, but it's got a lot of polish and nice little fixes and features that are sure to make life better for XBList users. The most noticeable new enhancements are that I've gotten XBList to use your system default font now (this means Vista users get the lovely Segoe UI font), and the popup notifications have been transformed from Windows 95-style to Windows Vista style.

I also added a lot of little features people have been asking for. There are now options for XBList to be on top of all windows, to start up with Windows, and to start minimized. You can compose a new message to your friend by just double clicking their name. I've also fixed a bug where two people who share a computer couldn't both run their own copies XBList.

This release also includes some nice features for Vista users. First, it includes a manifest, so there will be less compatibility warnings and such. Next, it'll offer to fix your Internet Settings automatically so that signing in under Vista is smoother. I've also built a completely new installer using WiX, which is prettier, smaller, and more functional.

I encourage anyone who's interested to look at the changelog for the full list of updates. One thing you might notice is that I've added some backend support for making a Windows Sidebar Gadget that displays your friends list. I can't promise I'll get around to it (I've had bad experiences with Gadgets before), but it's nice to know the capability is there.

I really thought that by now I'd be announcing that XBList is totally obsolete, for two reasons. The first is Games For Windows - LIVE, which aims to bring the Xbox Live experience to PC games. I tried out the beta, and while it's neat, there's no indication Microsoft is coming out with an XBList-style application for the Windows desktop that'll show you your friends. The second reason was the new Windows Messenger integration in the Spring Dashboard Update. I love this, but half my friends aren't on Windows Messenger anyway, and I can't see people's Xbox status from Adium, Trillian, or Meebo, so I'll keep using XBList to know who's ready to play some Halo 3 (beta). I hope everyone else continues to find it useful as well.

Why you can't access Mac file shares from Windows Vista

Update: It does work! See the note at the bottom of this post.

I've had this post in my “drafts” for about a month now. Originally it was titled “How to use Macintosh shares from Windows Vista”, but I was waiting to actually figure out how to get them working. Unfortunately it looks like it's simply not going to happen.

Here's the problem. You've got a Vista machine, and you try to visit a network share on a Mac OS X machine that has been shared using Windows Sharing. This share worked just fine with your XP machines. However, in Vista, you try to log in and it just spits back, again and again, that your username and password are incorrect.

The problem lies with the fact that in Vista, Microsoft made the gutsy but correct decision to go hardline on security. One of the targets on their list was the weak Lanman and NTLM network authentication schemes that were the default on earlier versions of Windows. The main problem with these authentication schemes is that, if a hacker can get ahold of your password that has been hashed for Lanman or NTLM (and it's just sitting there on the drive, by the way), they can connect to remote machines using your credentials without even having to know your unhashed password. Pretty scary. So in Vista both of these schemes are disabled in favor of the much more secure NTLMv2 scheme.

There's a problem with this on the Mac's side though - it doesn't support NTLMv2. Rather, the version of smbd that ships with MacOS X, even 10.4, does not support NTLMv2. You should be able to configure your smbd.conf file like Jon Belanger explains in this forum post, but it doesn't actually work.

The problem with this is that if you do a Google search on why your Mac shares don't work in Vista anymore, the suggestions that come up all tell you to simply decrease the security of your Vista machine. That's really not the best idea - it just brings you back to the old insecure XP level. Unfortunately, until Apple ships a new smbd, this isn't going to be fixed. So far I've just mounted my Windows shares from the Mac and it's good enough, but I hope (and expect) that Apple will fix things in 10.5.

Update (7/16/07): In the comments, Osvaldo points out that by entering your username as “machinename\username”, with machinename being the name of the remote Mac, it works. So for me, logging in from Daedalus (my Vista machine) to Samus (my Mac), I need to type “SAMUS\brh” and it works! Thanks Osvaldo!

What do the different Vista toolbar colors mean?

One of the first things I noticed in Windows Vista were the toolbars. Certainly they're prettier now, and the fact that the main menu is on the way out is exciting. But the most interesting thing is that they're different colors. Windows Explorer gets a blue-green toolbar, Windows Mail and Windows Calendar are blue, Windows Media Player and Windows Photo Gallery are black, and Internet Explorer gets a silver variant. This seems like a cool way to divide up the built-in apps, but the question that comes immediately to my mind is what color a third-party app should choose. It turns out that the Vista User Experience Guidelines are silent on this issue.

Vista colored toolbars

Fortunately everettm over at the Shell:Revealed blog was able to answer this question in the comments. To summarize, the recommendation is that all third-party apps use the silver toolbars. The colors are reserved for Windows branding, with blue-green standing for core Windows components like the shell, black for media apps, and blue for PIM/organization apps.

While I appreciate the response, I'm not sure I like that answer. I really like the colored toolbars, and I'd love to have my apps integrate more with the general look and feel of Vista by picking the toolbar color that is most appropriate to my application. For example, if I went to a toolbar-only UI for PNGGauntlet, I might consider going with the black toolbar, since it is an image manipulation app. Hopefully by that time the UX Guidelines will have been updated to give more explicit (and more permissive) guidance on toolbar colors.

Xbox Live Gamercard Windows Sidebar Gadget

I guess I didn't learn my lesson with the TopProcess Sidebar gadget, because today when I got home from work I was itching to make another. This time I figured I could stick to something much simpler. I had looked around for a Sidebar Gadget that would display an Xbox Live Gamercard, but none of the ones I wanted fit the bill. So I quickly whipped up my own.

This one is pretty standard. It lets you set which gamertag to use, and you can drop any number of them on your sidebar. When the gadget is docked, it scales down to fit into the sidebar, but when it's undocked it displays at full size. Really, there's not a lot to it. Once again, please check it out at my Sidebar gadgets page and go rate and review it at Windows Live Gallery.

I have a new backup strategy

This weekend I came pretty close to losing all my blog posts. My hosting provider moved my site to a different host, and ended up screwing up my MySQL database in the process. I've actually got a lot more than just my blog posts in that database, and it was pretty scary for a while there as they restored things from backup. It made me realize that I don't do nearly a good enough job keeping my own backups. So I revisited my backup strategy, and made a few changes. First, I'm now using automysqlbackup to make a complete backup of my MySQL databases every day. Of course, I'm still using SyncBack to do incremental nightly backups onto an external hard drive, in case my main hard drive crashes. The other new addition is that I'm using S3 Backup to copy all my irreplaceable data to Amazon's Simple Storage Service every month. This little app is still in beta, but it does a good job of putting incremental backups to S3. I was really surprised to find out just how cheap S3 is - I can back up gigabytes of data and have S3 hold it for just 15 cents per gigabyte. At that pricing I have no problem backing up tens of gigabytes of photos, code, and documents, knowing that if my house went up in a fire I'd be able to get back everything my insurance can't replace.

Top Processes Windows Sidebar Gadget

Last weekend I decided that I would try my hand at developing a Windows Sidebar Gadget. I've got a few ideas about gadgets that I'd like to make, so I thought I'd whip up a quick, useful gadget to get familiar with the platform. I ended up making the TopProcess gadget. It's basically a version of the standard UNIX top command. It'll show the top X processes on your computer, which are the processes taking the most CPU. It just sits there in the sidebar updating that list every few seconds, letting you know what's chewing up your dual cores.

TopProcess Screenshot

You can grab it from me on my new Sidebar Gadgets page, or from Windows Live Gallery. If you like it, please rate it or review it on Windows Live Gallery, so more people get to see it.

Trouble downloading the new Halo 2 maps from an Xbox 360

The new Blastacular map pack for Halo 2 launched today, and being a huge Halo fan I raced to pick them up. I'm happy to see new content coming out for a game that's over two years old, and Hang 'em High (remade as Tombstone) was easily my favorite Halo: CE map. I'm also really glad that Bungie decided not to make the maps Xbox 360 exclusive, a move that would have greatly simplified purchasing and downloading the maps at the expense of fragmenting the player base between Xbox 360 players and original Xbox players.

Blastacular Map Pack - Tombstone

I chose to download the maps to my Xbox 360 (I love the 720p upsampling), but the purchase process was not particularly smooth. When I tried to buy the maps, I got this message: “Premium purchases are not enabled for this Xbox Live account”. This was a confusing error since I've bought plenty of things through Xbox Live Marketplace before without any problem, and I knew I had no parental restrictions in place. My friend Mark figured it out though, and clued me in. Like many Xbox 360 users, we'd created Xbox Live Silver accounts in non-US regions to get access to foreign game demos. This came in really handy back when the Chromehounds demo came out everywhere but in the US. However, for some reason it messed with the backwards-compatibility-mode Xbox downloader. I'm not sure if it's because the accounts were from a different region, or because they were Silver accounts and the original Xbox has no concept of Silver accounts. Anyway, the solution was to sign in with the Silver account and attempt to purchase the maps. This will fail, but then you can sign in with your regular Gold account and download the maps. Hopefully this fix will let more people enjoy these great maps.

Why do I need to crack a game I own?

I haven't really played PC games for years. Sometime in college I bought my first console, an Xbox, and ever since, I've preferred the gamepad to the mouse. However, there are just some games that you can't get on a console - strategy games. I loved StarCraft, Homeworld, Command & Conquer, and Myth. But as my poor old machine became more and more obsolete, I stopped being able to play even budget titles. Beyond that, the quality and selection of PC games was dropping fast - I think I finally swore off PC games when I bought Unreal Tournament 2003, new, and it came as 4 CD-ROMs in paper sleeves in an otherwise empty cardboard box, required 3 patches and 2 driver updates to work, and wasn't even a very good game!

However, as the time to build a new machine approached, I got excited about being able to catch up on some of the titles I had missed, like Darwinia, DEFCON, Galactic Civilizations II, Supreme Commander, and Civilization 4.

When I finally built my new machine, the graphics card I ordered actually came with a copy of Civilization 4. I figured it would be a great way to get my strategy fix, so I popped it in and installed it, which took quite a while. I started up the game and got about 10 seconds through the terrifying virtual-Sid-Meier-led tutorial before it crashed. I found out later that this was due to heat issues on my graphics card, but at the time I just chalked it up to flaky 64-bit Vista drivers, ejected the CD, and worked on something else.

A couple weeks later I had a new version of the ATI Catalyst drivers and I figured I'd give Civ4 another shot. I popped the disc in, and it spun up… and spun down. And spun up. And whined a bit. And spun down again. This continued for a few minuted before the drive gave up. Windows never got ahold of the disc. After about 10 minutes of polishing the disc, trying it in other machines (they could read it), and blowing air into my DVD drive, my wife suggested uninstalling Civ4. I was frustrated enough at that point that I actually tried it, at the same time thinking that there was no way the game's presence on my hard drive could have anything to do with the CD not spinning correctly in the drive.

It worked. Once the game was gone, the disc was recognized right away and cheerfully asked me to install Civ4. A bit more warily this time, I reinstalled the game. It started up just fine after the install finished, but when I ejected and reinserted the DVD I got nothing but airplane noises again. After some research online, I learned that the disc wasn't being recognized, most likely, because Civ4 employs tricky techniques to stop people from stealing the game. However, I was pretty sure I had a legitimate, purchased game. How could I get my game, which I own, to work? I cracked it. One Google search and 3 or 4 clicks later, I had downloaded and installed a patched executable that bypassed the CD check, and my copy of Civ4 was up and running, sans DVD. It turns out that there is no reason at all for the DVD to be in the drive, other than to “prove” that you own it.

So to summarize, if you own a legitimate copy of a game, it might not work because of the content protection devices in place to protect it from piracy. However, if you are stealing the game, you don't need to put in the CD, and it'll work right away. Add in the fact that you get spiffy digital content distribution. It gets better - some companies use “protection” like Starforce that's so invasive that it installs hidden device drivers and mucks around with your machine at the kernel level. Who would put up with this? It's no wonder that console games, which offer drop-it-in-the-tray ease of use, are beating the pants off of PC games.

That's not to say that nobody's doing it right. My retail copy of Darwinia installs right off the CD then never asks me for it again. And it's available over Steam or directly off Introversion's online store if I don't want physical media. I just hope more publishers realize, like Introversion and Stardock have, that this sort of copy protection only hurts paying customers, and sours everybody on the PC as a gaming platform.

Setting the correct default font in .NET Windows Forms apps

I was working on XBList the other night when I realized something - the font used in its dialogs and the friends list wasn't Segoe UI. Segoe UI is the very pretty, ClearType-optimized new default dialog font in Windows Vista. In Windows XP and 2000, it's Tahoma, and in earlier editions it was Microsoft Sans Serif. You can see the subtle differences between them:

Microsoft System Fonts

In .NET and Windows Forms, the default font for controls is actually Microsoft Sans Serif, not the operating system's default dialog font! Kevin Dente explains this on his blog. This is not the only time Microsoft's dropped the ball on this - if you go through some dialogs in Vista you'll see that many of them use Tahoma or even Microsoft Sans Serif instead of Segoe UI. This is pretty funny, especially when Rule #1 of the Top Rules for the Windows Vista User Experience is “Use the Aero Theme and System Font (Segoe UI)”. Mitch Kaplan offers up a pretty good explanation for why getting it all right is very hard, but having a mix of old and new fonts still looks shoddy.

I don't want my apps to look shoddy. Embarrassingly enough, I've been hardcoding Tahoma in all my apps to get the more “modern” XP look. Now that Vista's on the scene, it's clear that I want to select the correct default font for whichever OS my app is running on. As Kevin points out, Control.DefaultFont is no help here - it's what's driving Windows Forms' default choice of Microsoft Sans Serif in the first place. After some digging I found this Visual Studio feedback ticket (sign in required), where the Visual Studio guys explain that, while they couldn't fix the default, they did create a SystemFonts class to help out. They recommend putting this code in your Form's constructor:

[csharp] this.Font = SystemFonts.DialogFont; InitializeComponent(); [/csharp]

Unfortunately, this doesn't work in a number of ways. The first is that on Vista, SystemFonts.DialogFont is… Tahoma! Closer, but not quite right yet. If you pop open SystemFonts in Reflector, you'll see that the DialogFont property just does some simple platform-detection, and then just hardcodes Tahoma. This worked when it was just 2000/XP vs. 9x, but Vista throws it for a total loop. Fortunately the fix is easy - use SystemFonts.MessageBoxFont instead. This one seems to always return the correct default dialog font.

However, I ran into one more problem. If I set the default font on the Form, like the code above does, I get weird, bloated controls:

Setting the default font on the form screws up controls

Fortunately I've got a solution for that one too. Instead of setting the font on the Form and letting it inherit, just loop through the Controls property, and individually set the right font on each control:

[csharp] // Set the default dialog font on each child control foreach (Control c in Controls) { c.Font = SystemFonts.MessageBoxFont; }

// Use a larger, bold version of the default dialog font for one control this.label1.Font = new Font(SystemFonts.MessageBoxFont.Name, 12f, FontStyle.Bold, GraphicsUnit.Point); [/csharp]

Now I get a more familiar-looking dialog:

Setting the default font on each control looks fine

I could always make a subclass of Form to do this for me, but I'm OK with copying it into each new form. With this code, all my controls come up with the pretty new Segoe UI font in Windows Vista, and Tahoma in XP.

Using MyODBC with ASP.NET in IIS7 on Vista x64

That's a heck of a title, but it's a problem I hit recently. I have a bunch of ASP.NET sites that use MySQL as their datastore, but I hadn't tried the on IIS7 yet. It took a while to get them to work at all (I had to set permissions on web.config and the other website files so that they could be read by both the Users group and the IIS_IUSRS group), but then I was left with an error about my MySQL connection. “ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified” - another very general error that basically means “Something is wrong with your ODBC driver, somewhere.”

After some searching, I learned two things. The first is that if you're running 64-bit you can't use the standard ODBC Data Source Administrator in Administrative Tools with MySQL. You've got to go to C:\Windows\SysWOW64\odbcad32.exe and set up your DSN, if that's your thing. The other thing is that the MyODBC driver is 32-bit only. So to use it at all, you need to make sure you're calling it from 32-bit apps only. That means you've got to tweak the Application Pool you're using to run all its ASP.NET applications as 32-bit. To do this, go to Administrative Tools > Internet Information Services (IIS) Manager (or just hit the Windows key and type “IIS”). Then go to “Application Pools” and select whichever application pool your ASP.NET app uses (or create a new one just for your MySQL apps. Click “Advanced Settings…” and set “Enable 32-Bit Applications”. Now the AppPool will use the 32-bit .NET CLR to run your app, and it'll be able to see your MyODBC driver (whether you use a DSN or not).

IIS7 32-bit Application Pool

Installing Aptana on Windows Vista with Aero Glass

I've recently given up Dreamweaver entirely in favor of Aptana, a great (and free!) Eclipse-based web development IDE. It features great JavaScript IntelliSense, document outline view, AJAX library function autocomplete, and an FTP component that should make Dreamweaver users very comfortable. Even better, with plugins like Subclipse, you get source control for your websites. Basically, it's one of my favorite programs.

However, all is not rosy. The Aptana documentation's guide to installing and running Aptana on Windows Vista recommends turning on XP compatibility mode, disabling desktop compositing, and always running it as Administrator. If you haven't had an app turn off Aero Glass for you before, you're in for a shock - it really sucks after you've gotten used to Glass. And running as Administrator isn't that great an idea with a product as connected as Eclipse.

Fortunately, all is not lost. First, go to Sun and download the JavaSE 6 JRE (32-bit). It's a huge upgrade from the Java 1.4.2 JVM that Aptana usually comes with, and it includes some major Vista compatibility features. Next, download and install Aptana minus the JRE from the Aptana downloads page. Already installed Aptana? Just go into the program directory and delete the “jre” folder. Now, make sure the Aptana shortcut doesn't have any compatibility features checked. (Disclaimer: you might actually need to run as Administrator the first time you use Aptana, but certainly never again.) Start up Aptana, and everything should be glassy and smooth.

Aptana with Aero Glass

If Aptana complains that it can't find the JRE, go into your Aptana program directory and open up aptana.ini. Add the line -vm='C:\Program Files (x86)\Java\jre1.6.0\bin\java.exe' to the top of the file, and save it. I had to do this mainly because I have both the 64-bit and 32-bit JREs installed, and while most Java apps work on the 64-bit JRE, Eclipse (and thus Aptana) doesn't support 64-bit yet.

Update: Newer versions of Aptana come with Java 1.6, so this isn't a problem anymore.

Media sharing has been turned off because a required Windows setting or component has changed

A little while after setting up 64-bit codecs for Windows Vista, my Windows Media Sharing suddenly died (taking my ability to connect to Windows Media Center from my Xbox 360 with it) with what might be the most infuriating error message ever displayed:

Media sharing has been turned off because a required Windows setting or component has changed.

Great. Which Windows setting or component has changed? Why does that stop sharing from working? How do I fix it? The “Web Help” link is no more useful. On top of this, whenever I tried to launch Windows Media Player from the Start menu, nothing would happen - inspecting the Task Manager, I could see WMP running, but it wasn't doing anything. Killing that process would allow me to start Media Player, but if I selected the sharing option, all I got was that despicable error dialog. Anyway, after a ton of trial and error, I found a way to fix things. Seems neither a Windows setting nor a component had changed - the Windows Media Player library database had gotten messed up. Simply going to C:\Users{username}\AppData\Local\Microsoft\Media Player and deleting all the files there allowed me to start up Windows Media Player. I had to re-specify which folders I wanted to watch, and let it re-create my library. Then I could start sharing again, and re-register my Xbox 360 as a Media Center Extender. I don't know whether switching Windows Media Player to 64-bit killed things, or whether it was some crashes I had (related to improperly set memory timings), but I'm glad to have music in my living room again.

Update: Apparently this happens on Windows XP, too. On XP, you can find the same folder at: C:\Documents and Settings{username}\Application Data\Local\Microsoft\Media Player

Remote Desktop 6.0 for Windows XP cannot use Network Level Authentication

A few months ago Microsoft released an update to the Remote Desktop client that, among other things, added compatibility with Vista. I've just recently had the chance to try this out, and it's pretty neat - it looks better, and seems to perform better too. I did hit one snag though. When I enabled Remote Desktop on my Vista machine, I checked the box that said only clients using Network Level Authentication (NLA) could connect. I thought this would work, since the release notes for the new Remote Desktop client said that it supported NLA. However, upon connecting from my XP laptop, I got this:

Remote Desktop does not support NLA on XP (thumbnail)

“The remote computer requires Network Level Authentication, which your computer does not support. For assistance, contact your system administrator or technical support.”

I did a little research, and here's the deal. NLA simply isn't available on XP (or at least, isn't installed as a part of the new Remote Desktop). So to connect to Vista from your XP machines, you'll need to uncheck the “requires NLA” box in Vista. After that it's smooth sailing.

Vista Windows Media Center and Tablet PC don't play well together

Getting my Xbox 360 to work as a Media Center Extender was no walk in the park. The first major obstacle I had (before even worrying about how to get XviD transcoding working) was a strange error message I got every time I connected to the Media Center from my Xbox. The Media Center interface would load, show me everything for half a second, then switch to a screen that just said “Connection Terminated. The Xbox 360 has been disconnected because an application has launched UI unexpectedly. Would you like to reconnect?” A few seconds later it would reconnect, go through the startup sequence, and drop right back to that error. Over and over again.

I checked out Event Viewer on my Vista machine, and this is what I saw: “An unauthorized window was detected while running the Windows Media Center Experience, 'Tablet Driver', with file name ''.” What? So after poking around the Internet a bit, I came across this newsgroup post. It looks like the problem is that the Tablet PC Input Panel gets activated even though it shouldn't on a Windows Media Extender. I thought it was really cool to hook up my Wacom tablet and use the Tablet PC functionality, but until the Tablet PC team fixes this bug, I've had to uninstall my tablet drivers so Windows Vista no longer bothers with any Tablet PC parts. It's a pity, but at least Windows Media Center works now.

Getting Windows Media Center to stream DivX/XviD to an Xbox 360 from Vista x64

I've been spending the past couple weeks playing with a brand new machine I made for Windows Vista, and it's been great. One of the things I've been looking forward to the most is Windows Media Center. Aside from the fun I can have developing WMC addons, I've been meaning to try out the Windows Media Extender functionality of my Xbox 360. Hooking up my laptop to my TV every time I want to watch things just doesn't cut it. Unfortunately, I have one problem - most of what I watch is already encoded in XviD format, which the Xbox 360 lacks a codec for.

But that's not my only roadblock. Being a sucker for the bleeding edge, I decided that my shiny new Core 2 Duo, being a 64-bit processor, should run Windows Vista Ultimate x64. Right off the bat this presented a problem - after installing DivX and XviD, Windows Media Center would complain that any file I threw at it was unreadable. This didn't make any sense, since those same videos played just fine in Windows Media Player. Perplexed, I happened upon Task Manager, where I noted that Windows Media Center was running in native (64-bit) mode, while Windows Media Player was running in 32-bit mode. The problem was that I only had 32-bit video codecs, and Windows Media Center couldn't use them from its 64-bit ivory tower.

However, no problem is a problem for very long. Both of my issues can be resolved with freely available software, and here's how it works. First, you need to install the ffdshow Vista Codec Package. This will put video codecs for just about every known video format onto your machine. No worrying about downloading this codec and that codec - they're all here. Next, install the ffdshow x64 components. This makes all those codecs usable from 64-bit programs, as well as giving you a handy shortcut that will set Windows Media Player to always run as 64-bit, too!

Now all your videos work in Media Center. To close the gap with the Xbox, you need Transcode360. This app will transcode your videos, on the fly, into a format the Xbox 360 can understand. It takes a hefty machine, but you've got a 64-bit processor anyway, right? Once this is installed, just fire up Media Center from your Xbox, navigate to a movie, hit “Info” on your remote, select “More…”, and select “Transcode 360”. It'll pause for a while as it crunches through the first few minutes of your video, then it'll start. Voila!

Get that Vista feel on XP before you upgrade

I'm still waiting for enough free time to build a brand-new machine for Vista Ultimate. While I dream about a computer that isn't over 5 years old, I figured I could still get a head start on the Vista look & feel. First, install the Zune Desktop Theme to get that black, shiny Vista look. Next, go to Display Properties » Appearance » Advanced and set all your menu, title bar, and dialog fonts to “Segoe UI”, the default UI font in Vista. Make sure you've got ClearType turned on or Segoe UI will look awful. That's as far as I've gone - I'm sure you could get icon packs and cursors and such, but I really just wanted to get used to the dark colors and more rounded font.

No Xbox Live Arcade Demos - Greasemonkey Script

Last night I hammered out a quick Greasemonkey script (poetically called “No Xbox Live Arcade Demos”) to solve one of my pet peeves in the otherwise awesome Xbox.com website. The problem is that while you can check out the list of games you've played, and all your achievements in them, it will also include Xbox Live Arcade demos that you've played but not purchased. Since you haven't purchased them, you can't earn achievements or gamerscore, so it's kind of useless to have them in the list. All my script does is go and look for games with “0 of 200” points - indicating an Arcade game you haven't played (or a new one, which is a problem but unfortunately that seems to be the best way to find them). As a bonus, the script also removes these games from your “total games” count, and removes their score from your total possible gamerscore. The total gamerscore thing in particular annoyed me, since you'd have to buy every demo to realize that “potential”. The script also works on the “Compare Achievements” page, removing any Arcade games that neither you nor your friend have played from the list. I hope everybody enjoys this!

XBList 3.0 released

Well, I've finally gotten around to releasing a version of XBList that's good enough to call 3.0. Last year I posted a look at what I thought should be in the next XBList. The most major has been the transition to .NET 2.0. Besides the increased stability and power of the new framework and doing things “the 2.0 way”, I ended up rewriting most of XBList's innards in an effort to make it more maintainable, cleaner, faster, and more stable. That's all in there, even though you don't see it. Emblem loading, in particular, is much more robust. I also went out of my way to simplify the app and put in those little features that had been bugging me forever. For example, XBList now remembers if you've collapsed a category (like “Offline”) instead of expanding it each time. And a list refresh won't always scroll to the top like it used to.

XBList Vista icon

However, there are a couple of very visible changes. First, you'll now get a little tray icon and message bubble whenever there are new messages waiting for you at Xbox.com. This is really exciting for me, since it means that friends can invite you to a game and you'll know about it right there on your desktop. It's a new feature, and I'll be working on it more, but I hope everybody likes it. The other thing is that XBList has a new icon and a new set of graphics. There's an animated sign-in screen, a chilling error screen, and better indicators in the system tray. I never liked the old XBList icon (which was just the old Xbox logo, cut out), and this one feels much more professional, as well as having its own identity, which isn't to say that it doesn't owe a lot to the Xbox 360 UI team.

One last thing: I never got a chance to try it, but people complained that XBList 2.2 didn't work on Vista. I think XBList 3.0 might (and I created a spiffy Vista icon for it) so please give it a shot and let me know if it works!