Tuesday, April 22, 2008

Why do we bother with Linux? Also, UIA status, and Twitter revisited...

The Question

My good friend Aaron is a PhD student in Geology at Penn State. We've known each other since we were toddlers, and connect on many levels. He uses Matlab and god knows what other crazy software to write molecular simulations for his experiments, but he's not the same kind of geek as I am. After reading about Banshee on my last blog, he comments:
I really like reading your blog. I click on all the links and feel like I'm learning something. I do have one question though. When you are working to create these programs for Linux does it ever feel like you are reinventing the wheel? It seems like a lot of time and effort is spent creating linux versions of programs that already exist. Sure there are a few new features that are neat but the bulk of the work seems like recreation. I'm totally missing the point here right?
I've been thinking about this for a few days now. I'm not going to waste time arguing specifics about Banshee, bringing up examples of truly new and unique software on Linux, or explaining how even when we are reinventing the wheel, it is a worthwhile and fulfilling endeavor. Instead, in the spirit of Passover, I will address the general question, "four children" style:

So, why do I spend so much time working on Linux, when a no-cost proprietary solution may already be available?

The free software zealot says: "I will not use software unless it is free (as in freedom). Whether or not a proprietary solution exists is irrelevant; I have problems I need to solve, and if there is no free software that solves it I will create a new project. It is simply unacceptable to sacrifice my freedom for the sake of convenience. As Benjamin Franklin said, 'Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety.'"

The pragmatic user or programmer says: "It is in my best interest to use free software. If I find a bug or wish there was a certain feature, I can talk directly with developers about it, pay somebody to fix it, or fix it myself. I don't have to wait until it's in the best interest of some corporation. I don't have to be afraid of being stuck with unsupported abandonware."

The young developer says: "Reinventing the wheel is half the fun of writing software! Even if there *is* an existing free software project that mostly does what I want, I'll probably start one from scratch because then I can do it *my* way. If it's useful to others, then that's great, too. Duplication is par for the course in the software world; after all, weren't there plenty of media players before iTunes, and aren't there still? If there are multiple operating systems, applications, or web sites that appear to serve the same need, then you just need to look closer to understand what niche each is for."

The user who does not understand enough to know the difference says: "My friend/child/administrator set up my computer with Linux. If popular software isn't available on Linux, I'm usually lucky enough to find a suitable free alternative. I get free updates and no weird restrictions on how I can use my computer."

My own answer is a mix of those. Sure, sometimes when I'm writing code that could literally be copy/pasted from some Microsoft engineer's workstation, it's a bit frustrating. It's frustrating that other companies rarely see fit to release their code. But in reality, most code that I write isn't like that at all. It's written to solve a specific, unique problem, and when I solve that problem I feel fulfilled. Using and writing free software gives me warm fuzzies. And as a developer and demanding user, it is very important to me to have access to source code, so that I can fix bugs and add features I care about. Nobody at Apple ever cared about the problems I had using iTunes to burn CDs (every version and OS), and I couldn't do anything about it. That's the opposite of feeling warm and fuzzy.

I'd be interested to see how other developers answer this question, though.

Yay, UIA

Andres has started adding support for firing ATK events, so now we can see Windows Forms appear and disappear, as expected, in Accerciser. It's been fun working with him on this...I get the feeling we'd be a good pair for XP, if he wasn't on the other side of the globe. :-P I've written a lot of unit tests against Microsoft's classes and fixed ours to match that behavior.

This week I'll be continuing with that, and probably working with Andres to expand our event support. I'm excited to be able to send and receive standard window and button events. But I guess I'm easily excited?

Yes, Twitter

I've been experimenting with twitter, because it turns out people I care about are using it in non-masturbatory ways. I'm looking for a better client that I can read on *my* time (instead of being IM'd whenever a friend updates). Gtwitter isn't getting updates for some reason and Twitux requires newer GNOME libraries. If I start checking for new tweets more than twice a day I'll have to do something about this...

Wednesday, April 16, 2008

LugRadio Live 2008

First off, I want to thank John Anderson (sontek in IRC) for letting me join his motley crew of Utah Linux hackers this weekend. Ellery was a little concerned that I might wake up in a tub of ice, but instead I woke up in a bed with Joe. Who would've thunk? Trevor (heartsbane) was a blast to chill with all weekend. My only regret is that the weekend went by so fast that I didn't have much time to hack. John, however, managed to find the time to completely rewrite Tomboy's printing addin to use GtkPrint, which really rocks considering our cross-platform focus for this cycle. Also, we were possibly violating the GPL with borrowed GEdit code, so I feel a lot more warm and fuzzy about the new code. ;-) Joe started working on classic bug #350990, which has caused a few users to really bork their notes by making a few renames. This is awesome because that bug is evil and Joe went through the pain of reinstalling his laptop and getting the whole Mono stack set up so that he could help.

Joe, John, Trevor
Banshee 1.0 was a massive hit at LRL. I worked the openSUSE booth for a few hours each day, and lured dozens of people into my Banshee spiel/demo with the new absolutely rocking Banshee tee-shirts. I spread the word that Aaron and Gabriel would be giving a sweet demo, and sure enough, even though they were relegated to the hard-to-find lightning talk room (only 30 minutes, WTF?), we managed to pack in a full house. Watching Aaron and Gabriel is really an experience. I'm not going to use the word synergy because it's against my religion, but I'm amazed at the flow these two have even though they work half a continent away from one another. The talk was a hit, the demo was a hit, and you can check it out on Google Video.

The only thing that sucked, and yes I will call this out, is that network availability at LRL was complete crap. It's pretty hard to demo podcasts, bitchin' Last.fm integration, internet radio, or DAAP support without an IP. Incidentally, it's also hard to submit patches, live blog, or get the latest source from SVN. For shame, guys, isn't there a solution for this? This was the one shitty thing at LRL and I would gladly pay ten times the entrance fee if it would help fix this.

On Sunday, it seemed that half of the people at LRL were wearing Banshee tee-shirts. Hells yeah!

Gabriel Burt conquers a tower of food
The best thing for me was just meeting everybody and hanging out. I got to talk a lot with Christian Hammond, but I was bummed to miss his Review Board presentation. I finally met Alex Graveley and Miguel, who are such a blast to hang out with. Some people really get it, and it's just refreshing to talk to them. Alex gave a pretty sweet demo of streaming virtual machines, which is actually something I've spent a lot of time thinking about so I was glad to see somebody doing something about it.

Miguel twitters, as I snap a pic for my blog.
I didn't really get to talk to Robert Love, unfortunately, but his Android talk was fairly convincing. I asked him if Android was going to be a real community-driven project, with non-Google folks having commit access, making architectural decisions, etc. I was thinking of the transition Apple has made with WebKit from "here's a code drop" to having a really great community project. Rob assured me that Android would be like that, and I trust him because he knows about economics and hawks and stuff. I'm not much of a Java fan, but I think I'll download the SDK and start messing around a bit. Hell, I may finally be convinced to buy a smartphone.

Travis Reitter (Soylent), Gabriel Burt (Banshee), Erinn (Debian)
You can see all of my pictures on my picasaweb.

Monday, April 14, 2008

LugRadio Live Rocked, and UIA progresses

So I'm on the plane back to San Diego after spending all weekend in San Francisco at LugRadio Live, and HOLY CRAP that was an awesome time. It could be that it was my first open source conference, or that I stayed with some awesome Utah hackers, or that I got to meet a ton of colleagues in person for the first time...but man I'm glad I went. Soon I'll post about the details, but for now I'll talk a bit about how the UIA implementation is going.

UIA Continues at a Reasonable Pace (watch out for dangling participles!)

For now we're sticking with the design approach I discussed last week for connecting the Winforms UIA providers to the UIA<->ATK bridge. But I didn't work much on that, because there are some issues with atk-sharp that Andres is busily hacking away at. Instead, I've been writing unit tests against Microsoft's implementation to pull out a ton of constant values that we need. This was really boring so I wrote a little program to automate it, though it's not very general. I think it would be cool to expand it to parse through MSDN documentation for some given classes and generate the boring unit tests for the appropriate fields/constants/etc. As it is it probably took me as much time to write the test generator as it would have to write the tests manually, and it's not terribly reusable. :-P I'll write more about it if it grows.

This week I'll continue writing unit tests, though I have some catching up to do because I spent Friday largely offline, and ditto today, so I've got to see where the team is. There's still plenty of work to be done in the providers and the core; they're just harder to test right now.

Tune In Next Time...

I started writing about LRL but it just got too damn long and I have work to do. But for now, I will fire the first volley in what is sure to be an extensive character debate. Here's young Aaron Bockover to share with you his impressions of LRL, through the magic of the karaoke Rickroll:

Monday, April 7, 2008

Moving, UIA Progress


Looks like we'll be moving from San Diego to Las Vegas some time around May 1st. We're having some trouble finding a decent home to rent, but I'm hoping that will all resolve itself in the next few days.

UIA Progress

Last week, Andres committed a ton of fixes to get stuff working in the UIA<->ATK bridge. I spent a few days working on my end (winforms and providers), until we finally got this:

Screenshot of a winforms app showing up in Accerciser!
So that was exciting. Our friends on the Mono team helped us figure out that some of our problems were caused by the fact that Winforms actually has a current dependency on GTK+ to get theme colors! The initialization of GTK+ before we load our UIA<->ATK bridge was causing runtime failures. We have filed a bug on it, and will probably be removing the GTK+ dependency in Winforms (see bug for details). Currently we work around it in our patch to Winforms.

Of course, the implementation to achieve this wasn't really too great. My providers were depending directly on Andres' bridge. So now it's time to start working more on the "core". I'm experimenting with it now. Here's an updated version of my old diagram, color-coded to differentiate between MS assemblies and our new assemblies:

Diagram of dependencies in UIA-related assemblies
Notice that I have removed the core, and in its place is the MS-defined UIAutomationProvider assembly. I played around with different designs, but there is a fundamental problem in that MS intends all interop between providers and *their* core to happen via a static class called AutomationInteropProvider, that lives in the UIAutomationProvider assembly along with a ton of useful interfaces. Well, we can't add new public interfaces to that assembly, but when messages come to the AutomationInteropProvider they need to somehow get to the bridge. And I'm trying to avoid excessive reflection.

So right now I'm assuming that I can define a good bridge interface in a new assembly, UIAutomationBridge, that only depends on MS's UIAutomationTypes assembly. A class in the UIA<->ATK bridge assembly implements that interface, and the AutomationInteropProvider uses reflection only once in order to find that class. This prevents me from using interfaces in the UIAutomationProvider assembly in the bridge interface, but I think this will be okay...we'll just have to pass a few things around as plain old objects, and document what the client can expect from them.

I'm thinking that this AutomationInteropProvider class is already designed to represent the "core", so I'm just going to run with that idea this week and see where it takes me. It's all happening in the olive and uia2atk projects.

My winforms providers are a little nicer now, but they're not much use until the bridge grows a little bit. So this week I'll focus a lot on these design issues, and also I need to write unit tests against MS's implementation to derive a bunch of constant values.

It should be a fun week; I like this sort of stuff.

Friday, April 4, 2008

Yahoo releases alpha del.icio.us Firefox extension, with Firefox 3 support!

2.0.39 alpha released! Check out the announcement. Please keep in mind that this is an alpha...if you want something guaranteed not to eat your bookmarks please wait for the beta which they will announce more widely.

I think I'm all out of excuses now, time to upgrade to Firefox 3!

Tuesday, April 1, 2008

Just (GNOME) Do It!

GNOME Do is da bomb. 0.4.0 makes me a better man.

That is all.

(Sorry for the ridiculously lame title, btw)