Archive for Jan 7 2008

A small XBList update to 3.2.1

Yesterday I updated XBList to 3.2.1. This release is mostly bugfixes - it fixes a problem where Xbox Gamer Tiles wouldn't load because xbox.com changed the format they stored pics in, and it fixes an issue where gamers who are away but in a game would show up as on the dashboard. The only new feature is that I've changed the sound that's played when your friends come online. It's now the same as the Xbox 360's notification sound, and is much less jarring than the old sound. I hope that comes as a welcome change. Grab the new version and let me know what you think.

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.

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.

Posts I haven't written

I haven't been updating this blog too much recently. I never meant for this blog to run on a schedule, but I did intend to post more frequently than this. My original idea was that the blog would serve two major purposes. First, it is a place for me to announce new projects or updates to software and websites I've already released. It's done that quite well, though I haven't had much to announce recently. My job has been taking the majority of my development time, and most of the projects I've been working on at home are either private or haven't been released in the form I'd like to because my employer hasn't approved them for release yet.

The second major purpose for my blog is as a place for me to record the solution to problems I run across while developing software, so that others won't have to spend hours Googling or using trial and error to come to the same conclusion. I didn't intend to rehash things that were easily found or that had already been discussed - only to post when I felt it was something that added value to the internet that hadn't been there before. So a lot of the blog posts are not really a narrative or running commentary - they're not meant to be subscribed to, but found individually. It's for this reason that my most popular posts tend to include the exact text of error messages. This type of post has suffered both because I haven't been doing as much development, because I can't discuss a lot of what I've learned due to the nature of the projects I'm working on, and because I've been learning new stuff (like Ruby on Rails) and haven't done enough to have solved problems others haven't already posted solutions for.

The third reason I have this blog is to occasionally talk about my thoughts on different technical topics, from web development to video games. Again, I don't like to make a post unless I think I'm adding something new, and most of the topics I've wanted to talk about have already been covered. I had a lot of draft posts sitting around about web development, web standards, and the evolution of browsers, but then I discovered Alex Russell's blog and it turns out he's already said most of what I wanted to say, and better than I could. Other stuff, like my impressions of Windows Vista, critique of stackoverflow.com and suggestions for the Xbox Live Arcade lineup, have been covered to my satisfaction in plenty of places. Maybe some of them will end up posted, but probably not.

Another part of the reason I haven't posted much is the sheer weight of unfinished posts I have. Right now I have 64 drafts and only 52 real posts! So I'm going to attempt to clear things out by writing a little about what I haven't posted. A lot of this stuff wasn't posted because it fell under that third point above, but some of it I was just too lazy to flesh out into real posts. Some of it's just random stuff. So here's what's been happening in the last year:

PNGGauntlet 2.0.2

I thought everything was going well with PNGGauntlet 2 until I got a comment reporting some problems with it at the beginning of the month. It's taken me almost a month to get a chance to sit down and check out the problem (August is always really busy since people are usually visiting). When I started digging into the code, I realized that I hadn't actually made some key changes to the code that I thought I had made, and as a consequence, a lot of PNGGauntlet didn't actually work. For example, the whole PNGOUT Options panel wasn't actually wired up to anything, and the “Open With” functionality I added in 2.0.1 didn't actually call the right functions, and didn't work either. Wow. This is what I get for not having tests set up for this code (it was written before I understood how to write tests). So it is with great humility that I submit to you PNGGauntlet 2.0.2, which I have quite a bit more confidence in. Hopefully most people were using just default settings (like I usually do) and weren't bitten too bad by the problems in the earlier versions. As usual, you can check out the full list of fixes.

Interestingly, one of the two problems in the original comment that got me working on PNGGauntlet again wasn't actually a PNGGauntlet or PNGOUT bug. It turns out that Photoshop, Gimp, and Paint Shop Pro all don't support 8-bit PNGs that have an alpha channel. Who knew? I tend to use either Fireworks or Paint.NET, which both support 8-bit PNGs completely, so I never knew.

Supplying alternate credentials for a network printer

Another crazy little Windows tip – I can't remember if this was a Windows XP problem or whether I'd also seen it in Vista, but I'm cleaning out my blog drafts and wanted to flesh this out.

Basically I had a network printer set up that would work until I rebooted my machine, then it would fail. I couldn't figure out for the life of me what was going on (I think it said something about me not having permission, though – I should have written down the error message). If I removed and readded the printer it'd work again.

Anyway, the problem turned out to be that my user account name was different on my other machine, and the printer wasn't shared for just anyone to print on. Because of that, I'd had to present alternate credentials when I added the printer, and each time the computer reset, the credentials would get lost and it'd get confused. I don't know why it didn't just ask again, but it didn't.

The solution is convoluted. I browsed to a shared folder on the other machine, and added it as a mapped drive. There's an option in there to connect with alternate credentials. Since Windows shares the saved credentials between all shares and printers on a remote machine, and it'll reconnect the mapped drive at startup using the alternate credentials, the printer will start working again.

PNGGauntlet 2.0.1

Just a quick update, I just uploaded a new version of PNGGauntlet that fixes a couple of annoying bugs, as well as making it so you can use the “Open With” menu to open files in PNGGauntlet. Just right click, select “Open With”, select “Choose Default Program”, and browse for PNGGauntlet.exe in its install folder. Be sure to uncheck “Always use the selected program to open this kind of file” if you want PNGGauntlet to just show up in the menu instead of always opening for that type of file.

Grab the updated file from the PNGGauntlet homepage and enjoy your smaller PNGs.

Announcing PNGGauntlet 2.0

It's been about three years since I last released an update to PNGGauntlet. This PNG image optimizing tool has been very popular, but has been sorely in need of a refresh. Today I'm excited to announce a major update, PNGGauntlet 2.0.

The most important new feature of PNGGauntlet 2.0 is that it runs on .NET 2.0 (and 3.0, and 3.5). This means that Windows Vista users can just install it without having to download anything else. This has also allowed me to use some more modern .NET features in order to smooth out the program's internals. I've also done a few more things to make PNGGauntlet explicitly compatible with Vista, including the new, high resolution gauntlet icon.

PNGGauntlet Screenshot

The UI is pretty different, making better use of space and finally making every single PNGOUT option accessible. Check out the old 1.1 interface to compare. You'll see that most of the controls have been moved over to an “Advanced Options” window where you can tweak PNGOUT to your heart's content. The main window has been greatly simplified and gives much better feedback on the compression job, with individual progress bars for each file, highlighting of the currently compressing file, and a status bar that keeps track of the total kilobytes you've saved.

The program itself has had a lot of bugs fixes and inefficiencies stomped out, and some less obvious features have been added. One of those is that dropping a directory onto PNGGauntlet will recursively add all the files in the directory (and its subdirectories) to the current optimization job. Also, you can copy (Ctrl-C) files in Windows Explorer and paste (Ctrl-V) them into PNGGauntlet. This should make it much easier to get the files you want into the app. If you want to see everything that's changed, take a look at the full changelog.

I wrote PNGGauntlet nearly 5 years ago as my very first C# program (and my first Windows app!). At the time, I wanted to be able to run PNGOUT (a commandline tool for optimizing PNGs) and pngrewrite (another commandline tool that could mess with PNG palettes to make PNGOUT more effective) together on large sets of PNG images easily. Then PNGOUT added the features of pngrewrite and I no longer needed that, so I modified PNGGauntlet to run PNGOUT multiple times in order to search for the smallest file size. Since then, PNGOUT has added that feature too. So now PNGGauntlet is really just a fancy GUI for running PNGOUT.

I never really intended for PNGGauntlet to be anything more than a learning exercise for me, but it's become moderately popular, so I felt obliged to update it (and make it easy for me to install on my own Vista systems). However, in the intervening time Ken Silverman (creator of PNGOUT) has released his own commercial PNGOUT GUI, called PNGOUTWin. I haven't looked at it too closely, but the program runs PNGOUT in a much more elegant way, and can even compress multiple files at once to take advantage of modern multicore processors. It's only $15, so I suggest you pick it up if you use PNGOUT or PNGGauntlet a lot. It's also nice to see that Ken has released Linux and Mac OS X versions of PNGOUT, so I can use it at work too!

Thanks to everyone who's been emailing me asking about PNGGauntlet and giving me suggestions. I hope this is what you were wanting.

Website work

I've been pretty quiet on the blog lately, partly because I went on a long vacation and partly because I've been too busy with real work to do anything much on at-home projects (at least, at-home code projects). Another reason is that I've been working on a couple websites that hadn't launched until recently. The first project was a website for Butterfly Haptics, which is my parents' new company. They're producing a really cool magnetic levitation haptic interface - a sort of super-high-tech 3D mouse that lets you feel virtual objects as if they were solid. I'm really excited about what they're building, and I'll be at SIGGRAPH this year manning their booth in the New Tech Demos area.

Butterfly Haptics Screenshot

The other site, which just launched, is my wife's new art site. She makes wood-fired ceramic sculptures of bizarre, cute creatures, and the new site was hand-drawn by her to reflect their style. It's implemented as a Wordpress theme, which gives her a much easier way to manage the content of the site, and it also means that she can now blog about her process and other art topics. Check out some of the cool time-lapse videos of her sculpting the critters.

evafunderburgh.com Screenshot

Anyway, that's what I've been up to. Hopefully soon I'll be able to get back to building more cool things and talking about them, as well as clearing out my backlog of draft blog posts.

XBList 3.2.0 works with the new Xbox.com

I read today that Xbox.com had gotten a redesign. I had hoped it wouldn't impact the friends list page, which XBList uses to get its friend info, but unfortunately it had. The friends list is now split into 16-friend chunks. That meant I had some work ahead of me to make sure XBList could work with the new format. I'm pleased to announce that after only a few hours of work, XBList 3.2.0 has been released, which works just fine with the new site. I'm glad that all the refactoring work I had put into the software in the past allowed me to make a change like that without breaking anything. There is now the possibility of some slight weirdness if a friend changes status in the split-second between XBList loading one page and another, but I don't think much can be done about that.

Of course, I couldn't just make the fix and call it a new release. I've neglected XBList in the last year as I've been deep into work and other projects, but I've been accumulating little fixes, and as long as I had the code open today I added a much-asked-for feature: Halo 3 integration. OK, it's not the best integration, but there are now menu items that link straight to your friends' Halo 3 Service Record page, and better yet, Halo 3 emblems are now loaded in preference to the old Halo 2 emblems. If your friend has both, they'll just get the Halo 3 emblem. I was amazed at how many people on my friends list (who hadn't had Halo 2 emblems) popped up with Halo 3 insignia once I finished the feature. I hope this is enough to tide people over for a while.

I also improved the detection of Xbox.com outages. They seem to be better now, but around December the site was down all the time, and now XBList will be pretty clear about when it's Xbox.com's fault that you can't log in. Hopefully that'll reduce some confusion.

Please pick up XBList 3.2.0 and let me know what you think! The full changelog may be of some interest also.

Setting up IIS7 (with bonus PHP instructions!)

Every time I try to set up IIS7 on a Windows Vista machine I run into the same series of problems. You'd think I'd have learned by now, but I usually just struggle through the cryptic error messages and get it working one way or another, then forget about it until the next time I need IIS7 on a machine that doesn't have it. Finally I'd had enough and so I decided to write myself a little guide here so I won't waste as much time next time. These instructions are basically the same as these, but with additional detail and screenshots.

Better concert experience with ear protection

One of the advantages of living in Seattle is that I get to see great live concerts from my favorite bands. The last week has been a good one for concerts. Last Saturday I got to see The Presidents of the United States of America, who were fantastic, and on Wednesday I saw The Decemberists, who are one of my top 10 favorite bands.

The Presidents of the United States of America playing in the Sky Church

I went to a lot of shows in college, too, and I was even in my own band, which was at the very least loud. After a couple particularly noisy concerts left me feeling uncomfortable about the idea of hearing damage, I (and the rest of my band) picked up some earplugs.

Foam Earplugs

You may have used earplugs like these, foam pellets that block out all noise. These are great for sleeping through construction or operating loud machinery. But using them at a rock concert completely misses the point. Instead, we went to Guitar Center and picked up some earplugs that are designed for musicians.

Hearos Rock n’ Roll Ear Filters

I bring my pair with me to every concert I go to. They don't just block out sound, they actually make concerts sound better. First, they reduce the volume to a comfortable level, not quiet but not painful either. More importantly, they filter out a lot of the “shimmery” noise you get in a big crowd - the random static of the crowd yelling, the echoes of the room, and the highest part of distorted guitars. Once you've gotten those out of the way, lyrics become understandable, individual instruments pop out of the noise, and bass becomes richer, without as much rattle. It's really a better way to listen to concerts. And of course you're protecting your ears from permanent damage. They are definitely a win all around.

Firefox bug rendering list items next to floated elements

I was working on a web app a couple weeks ago when I hit a weird problem. I had a sidebar floated right, and an unordered list right next to it. What was weird is that each list item was getting “pushed aside” by the floated sidebar. This went against what I thought I knew about how floats work in CSS. My understanding was that floats should be removed from the page layout, and appear above any other block level elements, like my list items. Reading CSS Float Theory: Things You Should Know and the W3C spec on floats only backed up what I thought. Floats should always appear above block boxes, like LIs. I wrote up a minimal test case and tried it out. What I expected was something like this, where the green boxes are LIs, the red box is my floated DIV, and the purple box is a normal block element like a P:

CSS compliant float rendering

Instead, what I saw in Firefox 2 was:

Firefox bug 163110

It actually took me a very long time to get to this point because I hadn't even bothered to try it out in non-Firefox browsers, since I assumed Firefox was right and I was missing some arcana in the spec. I had tried it out in Internet Explorer 6, but I had taken that as even more evidence that Firefox was right (if it differs between IE6 and Firefox, it's usually IE6 doing it wrong). However, when I finally popped my test case into Safari 3 and Opera 9 and they agreed with IE, I realized that it was really a Firefox bug. Not too much searching later I came across this css-discuss post which pointed out the bug and offered two solutions. Either I could force my LIs to take up the whole space by setting “width: 100%” on them, or I could use the proprietary Mozilla CSS property “-moz-float-edge: content-box”. Either one made the list items act like I expected them to, though you give up some flexibility with the first method, and the second won't validate.

This bug has been filed as Bug 163110 since August 2002, and many duplicate bugs or similar-but-not-quite-duplicate bugs have been filed since. Unfortunately, it doesn't look like anyone is working on fixing it, and I don't expect to see this problem go away in Firefox 3, which should be shipping relatively soon. I'm just going to have to add it to the list of bugs and workarounds I need to keep in mind whenever I'm navigating the minefield of modern web design.

Update (5/29/08): This has been fixed as of Firefox 3 RC1. Yay!