'Sidebar' Articles

Dashboard and Sidebar Widgets on GitHub

,

I love GitHub, but for some reason I’ve been hesitant to put some of my older, smaller projects on there. In hopes of reversing that trend, I’ve moved all my surviving Sidebar and Dashboard widgets onto GitHub:

I also discovered that Bungie has shut down all their old Halo stuff, so I’ve removed my Bungie Card gadget from my site.

Windows Sidebar is officially dead at this point, and Dashboard doesn’t seem long for this world, so I’m unlikely to do anything with these myself, but they’re all open for pull requests, so hopefully if somebody’s still interested in them they can be improved.

Updates to Windows Sidebar Gadgets

I’ve made some minor updates to my Windows Sidebar Gadgets - the 360Voice.com Challenge gadget works again after 360Voice moved their API endpoints, TopProcess has gained a French translation and clearer text when used on systems with IE9 installed, and the Xbox Live Gamercard gadget has been resized to fit the new gamercard design. Please reinstall those gadgets if you’re using them. Note that I’ve tried them all out on a system with IE9 installed and they all work - there were some problems with the beta version of IE9 but those seem to have been resolved in the released version.

Updates to JSONView, XBList, and TopProcess

, ,

I’ve finally gotten around to doing some maintenance updates on three of my most-used bits of software (JSONView, XBList, and TopProcess), all in the last couple weeks. Now that they’re all approved and live, I thought I’d summarize what’s changed.

JSONView 0.3

JSONView 0.3 is now available at addons.mozilla.org. This fixes an error that was showing up when really large JSON files were being displayed, and adds a feature that displays empty arrays and object on one line instead of on two (and doesn’t display the expand/collapse button for them). I also put in some preliminary support for JSONP, based on a patch submitted by Gabriel Barros. The catch is that it only works with content served with the “application/json” MIME type, which is actually not the correct MIME type for JSONP - it should be “text/javascript” or another JavaScript type. Unfortunately I haven’t been able to figure out how to get Firefox to let me handle “text/javascript” the way I do with “application/json” - it seems to be special-cased or something. If any Firefox gurus are reading and know a solution, please let me know! I was holding onto this release for a while hoping to fix that, but I decided that releasing something was better than nothing, so it’s out there and you can play with it. You can see an example JSONP response with the callback highlighted here. I did notice a bug with the 0.3 release right after it was approved - if a value is 0 or false, it shows up as blank. I’ll have that bug fixed with the next release, which should be very soon. It’s great to see that JSONView has become so popular, with over 50,000 downloads and about 12,000 regular users.

XBList 3.2.4

Halo 3: ODST was released a couple weeks ago, and Bungie redesigned their site a bit to include ODST info in your Service Record. This included changing the pages just enough that XBList got confused trying to figure out emblems for people who had never played Halo, and started showing the wrong emblems for those people (only if you prefer Halo emblems to Xbox emblems, which isn’t the default). Not a huge bug, but I took the opportunity to clean up a bunch of stuff in XBList and put out a little release. In addition to the Halo emblem fix, I fixed a bug where your settings could get corrupted and you wouldn’t be able to start XBList. I also cleaned up the menus and settings, consolidating the Halo links into one item, and removing the option to choose a custom notification sound or turn off debug logging. The debug log is much easier to get to if you’re having trouble - previously I had people dig through their Application Data folders for the log, but now there’s an item in the Help menu that opens the debug log directly. Paired with some much more detailed logging, I should be able to fix future problems much more easily. I also changed the system tray icon to bring XBList to the front on a single click rather than a double click, since that feels much more natural in Windows 7. Lastly (and probably not too importantly for most people), I’m storing emblems in your local Windows profile now, instead of the roaming profile. For the few people who use XBList and have roaming profiles enabled, this should save you some sync time. Anyway, you should have been prompted to update when I pushed the update two weeks ago, but if you haven’t gotten it yet you should download and install it now. I still have plans for a major overhaul of XBList, but it’s low on my list of priorities - XBList is still pretty popular, but not as much as it used to be, with maybe 5,000 active users.

TopProcess 1.4

This last update has been a long time coming. Ever since I installed Internet Explorer 8, the TopProcess sidebar gadget has been randomly crashing. I’m not sure what changed in Internet Explorer to make it screw up every so often, but it does. However, it only crashes after running for a few days, so for months I’ve been tweaking the code a bit, then waiting until it crashes, then tweaking some more, rinse, repeat. I’ve finally nailed it down to the point where crashes are very rare, and then I added some code that automatically resets the gadget when it crashes. So you should never see it mess up again. There is also a gadget log file in the gadget’s install directory that I’m using to store errors, so it should be easier to troubleshoot in the future. Lastly, Jean-Pierre van Riel contributed a patch that added IO tracking to TopProcess, so there is now a third way to view your processes. This view shows you the total IO usage (combined bytes in and out, per second) which seems to cover both disk and network access. Get the update from me or from Windows Live Gallery and be sure to rate the gadget. I’m excited to see that it’s been downloaded over 100,000 times from WLG (plus who knows how many downloads from my site).

360Voice.com Challenges Windows Sidebar Gadget

,

In my post introducing the Bungie Card Windows Sidebar Gadget I mentioned that I was making one more gadget that would be of somewhat more limited interest. Well, I’m finally finished with it: the 360Voice.com Challenges gadget! 360Voice.com is a fun little site that started off by giving your Xbox 360 a blog that would summarize each day’s gameplay. It’s since grown far beyond that, but the feature I like most is the “challenges”. Challenges are a little meta-game where you get some friends together and see who can win the most gamerscore via unlocking achievements over a set period of time.

I do a lot of these challenges, so I wanted to be able to keep track of their progress on my sidebar. The gadget shows you the time left in the challenge, the current standings, and the “live score”, which is the gamerscore each player has earned that day that hasn’t been counted in the official standings yet (gamerscore is sampled by 360Voice.com at midnight PST each day). Once the challenge is over, the winner is given a little crown and the gadget waits for the next challenge.

Fortunately, the 360Voice.com developers had the good sense to provide an XML web services API to their challenge data (and a lot of other stuff too!) so it’s not too hard to make cool things like this gadget that tie into their site. For this project I went ahead and included my favorite JavaScript library, jQuery, and a neat jQuery-based databinding library called chain.js. Using these made development a lot smoother - the old familiar Sidebar bugs and Internet Explorer weirdness was still there, but overall it wasn’t too bad. I’ve specifically designed it to be as light as possible on 360Voice.com’s API too, so hopefully it won’t impact their service.

I think this is the most attractive gadget I’ve made - it’s certainly the most data-rich. I’m really proud of how it came out. I hope everybody enjoys it, and if you haven’t ever done a 360Voice challenge, go start one! Also, if you like it, please rate it at Windows Live Gallery.

P.S.: While I was monkeying around with gadgets, I’ve made some minor changes to my Top Process gadget - the text-fade option is no longer there since it really didn’t add anything, and I may have fixed a couple minor bugs.

Bungie Card Windows Sidebar Gadget

,

I suppose I’m a glutton for punishment. After writing my last two Windows Sidebar gadgets, I really meant to swear them off entirely. They’re really a pain to develop. But when my favorite video game developer, Bungie (recently of Halo fame) launched their new “Bungie Cards”, I knew I had to support them. Bungie Cards are basically like Xbox Gamer Cards, but for Halo 3. I assume when new Bungie games get released, they’ll feed into the Bungie Card system as well. My new gadget is not terribly complicated - it just displays your Halo 3 Bungie Card, in either the small or wide form.

Bungie Card Gadget (thumbnail)

When it’s floating, you can choose either form of the Bungie Card. It’s a little weirder when it’s docked to the sidebar. First, it scales down to fit the sidebar. Then, to see the wide version, you just click on the gadget and the wide card shows up in a flyout. It’s a nice way to keep track of things without taking up too much space. As a bonus, double-clicking on either form will take you to your Halo 3 stats page.

Like the other gadgets I’ve done, this was much more difficult to develop than it should have been. The hardest part was getting the scaled-down card for when the sidebar is docked. At first I just zoomed out the page, like I had done for my Xbox Live Gamercard gadget, but it looked absolutely awful. With the exception of newer browsers like Firefox 3 and Safari, “resizing” an image by just changing the HTML element’s dimensions has always used nearest-neighbor filtering, resulting in a truly horrid image. My first instinct was to try and use the MS-proprietary “filter” CSS property to apply a Matrix DXImageTransform that would do the scaling, since that transform has an argument that’ll get it to use bilinear filtering, which is at least decent. However, Sidebar seems to think that that is a dangerous “active content” operation and blocks it. I tweaked it around for a while before stumbling on a workaround - the BasicImage filter was not blocked, and if I applied any transform at all, the basic zoom scaling would filter the image in a more pleasant way. So right now I’m using an opacity filter set to make the image completely opaque. It’s silly, but it works, and I guess this is what I should expect at this point. Trust me, you wouldn’t have liked it before - the image on the left is the way it looks now, the image on the right is with the original smoothing method:

I actually have another Xbox-related Sidebar gadget in development which is more complex but of limited interest. I hope everyone enjoys the Bungie Card gadget - feel free to send me feedback directly, and please rate the gadget at Windows Live Gallery.

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.

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.

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.

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.

TopProcess is pretty simple. It uses WMI, which is very straightforward, to get the kernel and user time for each process on your system, figures out the difference in times between now and the last time it looked, sorts them, and displays the top X (configurable) on the gadget. I got a little fancy with the display side of things, making the text fade between updates, and making the gadget scale correctly when you change the number of processes to display.

When I first got Windows Vista, I was pretty surprised that there weren’t more gadgets available. As time has passed, not a ton of gadgets have shown up on Windows Live Gallery. I was sure somebody would have made a top process gadget already. But after actually doing it myself, I understand why people haven’t been pumping these things out. Making a Windows Sidebar Gadget is really, really frustrating. First, instead of going with .NET and WPF, two awesome Windows-only technologies, the Sidebar team went with HTML and JavaScript as the basis of all gadgets. And if you do want more capability than JavaScript gives you, you need to start pulling in ActiveX objects, VBScript-style. So if you were dreaming of easy animation, drawing, and UI, and access to the power and ease of use of the .NET platform and Visual Studio, forget it. Think of it more like developing web pages for Internet Explorer (no Firebug here), but without even an error dialog to tell you if your script has failed. It’s a mess of HTML, CSS, and JavaScript bugs and quirks. Compounding this is the fact that the MSDN documentation for Sidebar is some of the worst documentation I’ve ever seen. It ranges from completely unhelpful to misleading, and it’s missing any examples or even code snippets that would give you an idea of how to actually use it. Who goes through the trouble to build what’s essentially an application development platform, and then not even bother to write half-decent documentation?

As an example of how frustrating it was to make this gadget, take the feature of fading text. This should be simple - the new text fades in while the old text fades out. Immediately I was hit by a problem - Internet Explorer doesn’t support the opacity CSS keyword. So I had to insert a filter key that put on some crazy DirectX filter on the text. The most immediate effect of this was disabling ClearType on the text, and inexplicably bolding my font. I still can’t explain this. Frustrated with my subpar text rendering, I turned to the gText object. It took me lots of searching just to figure out that, unlike gBackground, there is no corresponding HTML element for gText. It must be created, in script, from gBackground. So I made myself a gBackground, and struggled for a while before realizing that it’s essentially a stunted version of the canvas object in HTML5. So I needed a gBackground that spanned my whole gadget. But I didn’t have a single background image for the whole gadget - I intended to compose the background of multiple images, so it could scale correctly with more or less processes displayed. gBackground requires you specify a single image before you can add more images onto it. So I had to make a 1px by 1px transparent PNG that I stretched over the background of the gadget. Remember doing that from the old days with table-layout HTML design? It brings me back. Anyway, now I could add my gText objects. These guys do support an opacity property, and after working out how to track them between updates (they aren’t included in the DOM), I had replicated the fading behavior that I had done with HTML. The result? Exactly the same. Except it’s harder to use gText , and there’s no way to remove gText objects once you’ve added them to a gBackground unless you remove all the objects on the gBackground. It’s really nuts. I ended up rolling back all my changes and just going with the HTML fading. Sorry about the awful font rendering, but I think at this point it’s not my fault.

There are more problems with the Sidebar platform of course. For example, in the manifest for a gadget there’s a way to specify your copyright, but no way to link to a license. I know Microsoft is starting to get Open Source - they should understand that licensing is important. And if they want people to be able to find new gadgets for their Sidebar, Windows Live Gallery is not the way to do it. It suffers from the same confusion as all the Live products, including Live Spaces gadgets on the same page as Sidebar gadgets without really indicating which is which. It’s just really depressing that the Sidebar ended up being such a lame feature. I remember the coverage before the “Longhorn reset” that promised the Sidebar as a unification of the disparate notification methods in Windows, replacing the system tray as well as providing hosting for mini WPF applications. Instead we get a lame reimplementation of Yahoo! Widgets or Apple’s Dashboard, without any polish or documentation. It’s really just sad.

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