Keeping an eye on what matters

Maybe I am just getting older, but I’ve found that my perspective on what matters in software has shifted quite a bit.

I see so much discussion and thought about things that really in the end, don’t matter a whole lot. Or if they do at all, they only matter to developers. For example, an IRC discussion about whether packages should have capitals in the names. Revision control choices. Whether packages are sharing code enough. Whether files go into /usr/lib or /usr/lib64.

I think what I’ve realized now is that in software, these kinds of things are actually endless. You could spend your entire lifetime doing things like making sure every package in Fedora accepts CFLAGS correctly, or making sure that all the modules in GNOME share as much code as possible.

What I personally have been trying to do recently is keep in mind a target user when I’m thinking about problems. Last night while eating at Boloco I walked by a guy running Linux, so I stopped to talk to him. Turned out he was a programmer working for Tripadvisor. I actually used their site recently when scheduling a trip to Portland; they have an awesome Google Maps mashup with their hotel rankings that I found incredibly useful.

How much would this guy care about capitalization in package names? Not at all.

I know I’m not saying anything new here; it’s a well known problem. And I’m not saying none of this matters at all (in particular Subversion annoys me a lot); but you have to have a good sense for when to tackle things and when not to. I won’t complain if I have to use Subversion, it’s just not worth arguing over.

Some random thoughts on how to avoid technical holes:

  • Write in Python or another high level language. In C, just getting a socket open or something can make you feel like you accomplished something. It’s pretty hard to reinvent the wheel in Python, because so many awesome wheels already exist.
  • Never write the library first. Or at most, write the application (what matters to users) hand in hand with the library.
  • Get something running on to the screen as quickly as possible.
  • Make it cool. Make it something that someone wants as soon as they see it.

I’m sure if the younger Debian developer version of me of years ago had seen this blog entry now I would have thought I’m on crack =) I guess I do have to admit I learned something from that time.

Python object definitions and threading

I posted a brain dump of some random thoughts recently about Python object attribute definitions and threading: another thread on Python threading

One thing that I really appreciated about this was that Python uses a newsgroup (reflected in Google Groups) instead of a mailing list. The experience is so much better than a mailing list. I was able to visit the Google Groups page, click “New message”, and type it in, and it appears. In contrast starting or contributing to a discussion for a typical free software project mailing list if you aren’t already subscribed is an enormous pain; you have to subscribe to it, do the dance confirming your address, and then for a busy project it’s like having a fire hose in your mailbox, so you need to set up filtering – ugh! Even if it’s not a busy project, you will get mail about things unrelated to the post. And finally, you need to manually unsubscribe when your interest wanes.

Have you considered using a Google Group or the like for your project? If not, you should. You don’t have to deal with crappy email clients, spam is taken care of, no more monthly mailman reminders or passwords. And and most importantly, people who want to send a message to your project or contribute to an existing thread don’t have any hoops to jump through.

Hotwire 0.444

Hacked a bit Thursday and this weekend and put together Hotwire 0.444. For the impatient, you can skip directly to the Google Group and download. The cool thing about this release is that it has initial undo support. I’ll talk more about that in a minute.

Sometimes, writing applications for the web is quite nice, compared to traditional desktop UI toolkits.  It can be very easy to bang together something that looks awesome, is functional and usable.  In particular, one of my favorite features about the web is javascript:alert(). Wait a second you say, javascript:alert() sucks! Exactly. It’s so bad that no self respecting web developer uses it in the normal app flow. It’s impossible to make it look decent, and it just feels clunky and weird in a normal web page. Therefore, most web applications tend to avoid dialogs, and (hopefully) use better solutions like undo or whatever makes sense for the situation.

I think in general, there are 3 possible reasons you might add a modal dialog that requires a user action or choice to your application.

  1. Need username/password – Ok, but you better remember what I type.
  2. List infos – Things like the Eclipse new-class dialog. This one could be done inline too but it’s mostly fine as a dialog.
  3. It’s probably wrong – everything else.

In particular, I often notice that where a lot of the confirmation type dialogs (“Do you really want to foo?”) are used, it would make more sense to just do what I asked, and if it wasn’t what I really wanted, allow me to undo.

I am going to take a relatively extreme (and topical) example here; the default Fedora root .bashrc which has alias rm='rm -i'.


It asks you this for every file by default

Is there a better way? Yes.


Click to undo!

This took all of maybe 20 minutes to implement for the cd and rm commands; it should be relatively straightforward to add undo support to Hotwire’s builtin mv command, and cp will likely have it once it’s written.

Some other new features for this release:



Terminals in tabs


A help display so you don’t need to read the source to know what commands there are

For more details, see the Google group post.

Boston Zombie Walk 2007

The 2007 Boston Zombie March [link deleted, taken over by porn] was completely awesome. I heard from others last year was maybe 20-30 people; this year I would say there were at least 200 at the peak.


Zombie looking hungry

This guy was a bit more liberal with the stage blood than I was

Now originally I thought, being a computer programmer, I would have a leg up on the competition in the looking-undead department. However, when Brian and Steve mentioned they were thinking of going in their robot costumes as robots protesting zombies, I knew I would be spending most of the night watching them getting ogled. And I did, but I still had a ton of fun taking pictures and being part of the event! Carolyn took some good pictures too I think, I’ll edit this later when I get the link.

Me attempting to devour Brian

One completely amazing thing about this event was just how many people had digital cameras and video cameras. The two robots grabbed attention wherever we went. I had this feeling that everything visible would be tagged and uploaded to Flickr in short order, which will probably be more true as photographers wake up today. But this morning Mike discovered us!
For reference, their signs say Zombies take robot jobs and Robots against Zombies.

Steve having a malfunction while everyone is watching

We walked from Porter square down to Harvard. Watching the confused expressions of passersby was fun (especially when the zombies tried to eat them). I also had to laugh when the Cambridge police stopped traffic around Harvard so that the big crowd of zombies could…slowly one legged limp across the lanes. I can only imagine what people who just happened to be visiting Boston thought.

Some random highlights:


Zombie burying himself (while being consumed by girlfriend?)

A crowd of “protesters” were part of the event

Brian giving a zombie the beatdown

Heading home, this little kid thought he was meeting a real robot

Shopping at Shaw’s was hilarious

And, the full album. I know I’m a crappy photographer!

A Guided Tour of Hotwire 0.333

Hotwire has advanced quite a bit since last I mentioned it. For the most part now, I am using it to develop itself, instead of gnome-terminal. Of course I’ve tried this a few times in the past week, but I wouldrun into some bug that drove me back – until I fixed it. Add a lot of those fixes together though, and it’s starting to actually feel usable.

One feature I added last night that’s kind of a small thing but I am fond of is the last command. What last does is pretty simple – it returns the output of the previous command. This lets you interactively refine pipelines. For example, say you type cat foo.log | grep error. Now, suppose you want to further refine that for strings that match ‘192.168.1.1’. In a shell, you’d likely hit the up arrow, then append to the previous command. But doing so is wasteful (and sometimes unsafe) because it re-executes the entire pipeline; if foo.log is big you have to wait for it to be refiltered (or save it to a file, grep that…ug). Using last in Hotwire feels natural (and I plan to shorten the syntax to just ‘|’).


Hotwire executing /sbin/ifconfig


After grepping for inet6

You may notice from the screenshot that a lot more has changed. Here’s a quick sample of stuff visible there:

  • Hotwire now auto-resolves commands you type by prefixing them with sh or term as appropriate. So for example you can just type ifconfig and Hotwire knows you mean sh /usr/sbin/ifconfig.
  • There are now tabs; try pressing Ctrl-t
  • The display looks a lot nicer! I’m mostly done “porting” to GTK+.

So, cool. But there’s more! Realizing that because right now Hotwire requires the output of commands to all be of the same class (e.g. LinuxProcess, unicode), I redid the entire rendering infrastructure using a tree view. A picture is worth a thousand words here:


Hotwire executing its ps command…on Windows!

So the first thing to notice here is that the output of the ps command is nicely formatted into columns based on its object properties (remember, the Hotwire builtin ps command outputs Process objects, not random bits of text).

The second thing to notice is…wait a minute, that’s Windows! Yes. Hotwire boots on Windows now, and I fully intend to make it a mostly-first class citizen. I am still recovering from the mental scars inflicted from trying to learn the Win32 API enough to enumerate processes, but it’s there. It’s a pretty rare developer in the world that doesn’t ever have to use Windows, and frankly I think Hotwire blows cmd.exe out of the water already for when you need to.

Another thing to notice in the above screenshot is the status message about kill – that’s what you see when you use…right click menus!


Right click on a process to get a Kill option

Now, I want to talk about completion. The TAB completion engine is on its third iteration, and it’s starting to feel about 80% of what bash does. If you use Hotwire for a while you will miss common-prefix completion (you’ll know what I mean), and some other details, but it’s mostly good enough, at least for me.

One thing that is a definite improvement though is that Hotwire offers you previous-token completion. Let’s say you type host example.com. Hotwire not only records this in your history (so if you type ping you can hit the up arrow to reuse the command), but also remembers example.com as a token you used previously. If you start to type it again in any context, Hotwire offers it. For example:


Remembering you typed example.com earlier

This is all part of the Hotwire philosophy of remembering everything you type, and making sure you never type the whole thing again.
Speaking of remembering things, Hotwire now also remembers which commands you used sh for and which you used term. For example, if you type term vi /tmp/foo.txt:

From now on you can just type vi and Hotwire will remember to prefix it with term instead of sh.

Last but not least, I battled setuputils and in the end produced a FC6 RPM and a source zip file: Download page.
I’m playing around with Google Apps for hosting the user pages, so excuse the bareness.

That’s it for now, going to post before LiveJournal eats this!

Investments

Application browsing and installing using the Big Board sidebar for GNOME has made a lot of advances recently. One change that I think turned out to be quite cool is that there is now a kind of “advertisement” section at the bottom; basically, it displays popular applications that you don’t currently have installed.


Browsing the Internet category

When you click on the link, you’re taken to an application page (Thunderbird), with the full description, links to other popular applications…but most importantly – an “Install Now” link. Right now it’s fairly basic; on Fedora it just pops up a terminal and “yum”, but it does work.

The “advert” section turned out to be such a nice way to discover an application and install it that the next plan is to extend the current search box to not only search applications you have installed, but also the advertisement section so you can see uninstalled ones. It feels like the relevance of the section is high in general because the popularity metric is software other people actually use, as measured by open windows, rather than say whether or not the package is just installed.

There’s a demo “Calendar” stock (mostly to flesh out the infrastructure for logging into Google):


Logging in

(Yes, that is the date of the Transformers movie in my Google Calendar)

Aiming for #2

Recently, I lost several weeks worth of data. I’m not talking about code or documents, but something almost equally valuable to me. I lost several weeks of bash shell history. You see, I rely heavily on bash’s Ctrl-R feature to find previous commands. It’s an amazing feature; every time I’m watching another person use bash and actually manually type out something like

../configure

for the 20th time in a row instead of Ctrl-R con RET, I have to resist the urge to lean forward and hit Ctrl-R for them.

Bash was designed a long time ago to run on big high-uptime multiuser servers, so I accept that it isn’t proper Crash only software. The only time bash saves the history of commands you’ve typed is when the shell cleanly exits. It will happily run weeks at a time, and if your computer locks up, you accidentally hit Ctrl-Alt-Backspace, whatever…boom. All gone.

This was not the first time this has happened to me. However, I decided it would be the last. I considered downloading the bash source code. Thinking about it more though, I realized that bash probably had no notion of a mainloop where I could just g_timeout_add(7000, save_history). Then there were other considerations such as trying to do all this in a portable fashion, and the fact that I was somewhat annoyed at the time that my last hacking on GNU software was just seeing the light of day in the Emacs 22 pretests 5 years after writing it.

I’ve always been interested in shells (in the sense of primarily text-driven interfaces). I wrote a simple one for the Mugshot server that turned out to be surprisingly useful relative to how long it took me (a few hours) to write.

Did you know that GNOME Terminal is the #2 Linux application (almost certainly tied with bash if it was counted) according to Mugshot?
Anyways, I’ll stop rambling about the backstory here and get to the point.

Hotwire is my prototype of an interactive hybrid text/graphical shell for developers and sysadmins.

The developer wiki explains a lot more about what it is, so if you want to learn more you should click there first (if you read this far, you probably already did), then keep reading here.

Hotwire is definitely still in the prototype stage; there are bugs and things that could be better. You’re not going to rpm -e gnome-terminal today.
However, what I’ve concluded thus far is that not only is replacing the combination of terminal+shell+/usr/bin/ssh feasible, we can do a lot better.

At this point, you get another story. A few months ago I had Windows on my new laptop, and I decided to try using IE7. It had tabs, which I required. I wondered how usable it would be relative to Firefox. For a little while I used it, was surfing around, making tabs…and it seemed OK, except…there was something wrong with the URL bar. It actually took me a little bit to realize what it was – its completion doesn’t strip of ‘www.’ as a prefix (or something), and its ordering of completions seems to be alphabetical rather than Firefox’s by-recency.

Just like Ctrl-R in bash, I rely on Firefox’s intelligent URL completion in the address bar. I never use bookmarks. IE7 was just not usable for me because of this. I downloaded Firefox. Now of course there are other good reasons to use Firefox, but what really motivated me to click that download right then was the completion.

I like to think Hotwire has some small-scale but big-impact fixes like this. Now for you those fixes may not be the same as me. Personally, I love the fact that history is searched and displayed by default, but for you perhaps it’s the fact that the ‘rm’ command moves items to ~/.Trash instead of deleting them permanently (opening the door to an ‘undo’ command). Maybe for someone else who loves nautilus-open-terminal, it’s having some of the functionality of both in one window.

I could go on, but Hotwire is only just about a week and a half old, and it doesn’t yet have that many amazing features. But again, what really strikes me is how much potential there is. Being written in Python, it’s so easy to hack. If right now it doesn’t have that fix for the terminal/shell you always wanted to do, it’s probably really easy to add. It’s also a framework where we don’t have to care about backwards compatibility with considerations such as the output of the ‘ls’ command, what keybindings do, etc. It’s a canvas, on which we can sketch out and prototype interesting new ideas for a new developer/sysadmin shell.

If you’re interested in hacking, check out the Developer page, clone the source tree, and send patches/feedback to the Google group.

Initial Public Offering

So now seems like a good time to recreate a personal blog. I lost mine when my personal (physical) server died and was too lazy to start one up again.

If LiveJournal is good enough for jwz, it’s good enough for me. (This is what I said originally, but it completely ate the first version of this blog post right after I typed all of it out because I tried to click on a help item then use the browser back button, which I am still angry about while I am trying to retype this, but anyways)

I thought Havoc’s post on the GNOME Online Desktop (and he deserves some sort of medal for the name) was very good. It has started some sub-discussions, one of which is about Gimmie and Big Board direction.

The first thing I want to say to Alex in particular – I have always had a great deal of respect for you and the cool software projects you have created. Gimmie is a great project.

As for the details, I want to avoid all the he-said/she-said stuff and just say that basically, in my opinion it would not have made sense to prototype the Big Board direction starting from Gimmie’s codebase. At least up until now and for the near future.

Gimmie’s scope for the most part has been to improve the panel, and in my opinion does this very well. Does it also replace your panel? Yes, but the Big Board scope is quite different and larger – it is part of a prototype for an online desktop.

For example, the Big Board codebase also includes Havoc’s experimental code to sync GConf with an internet server.

Also in the interest of prototyping, we decided to reuse a large amount of infrastructure that we have developed for the Mugshot server. This has made it a lot easier for components such as the photo slideshow “stock” (the term for Big Board widgets, obviously!) – there is zero configuration involved with it. It goes out and gets your Mugshot contacts, retrieves their flickr/youtube etc. thumbnails, then slideshows them. If we’d wanted to do this in the Gimmie context, we would have had to add infrastructure to the code for “external accounts” (mugshot term for data like flickr username), and also code to talk to the Flickr API, poll YouTube feeds, etc. And that would leave open the question of how you find out the flickr usernames for your contacts.

Another example is Havoc spent a few hours figuring out how to talk to the Google APIs and get a list of your online Google docs displayed in the sidebar. And most of that time as I understand it was battling Google’s crazy everything-is-an-atom-feed API. If we’d wanted to do this starting from Gimmie, we would have had to figure out the harder question of how it iteracts with Gimmie’s code for local documents, what operations made sense, etc., in addition to writing the code to talk to Google.

In code terms, if we had tried to do this as Gimmie patch, a lot of it would have been of the form:

function():
if mugshot_mode():
do_mugshot_thing()
else:
do_gimmie_thing()

which probably isn’t very useful for Gimmie’s current userbase right now.

Longer term, it does make a lot of sense to figure out how to reuse/integrate/merge with/write-plugins-for existing components such as Gimmie/gnome-panel/nautilus/GConf etc. But I hope this post explains why the Big Board is not a “Gimmie clone” anymore than Gimmie is a “panel clone”, and why we’ve been prototyping in a new codebase.

Originally I had written more extensively here but I’m going to post this now before it gets eaten again.