Computers
Adding ‘addremove’ to Git
I’m a happy git user, but mercurial has a nifty command with no git equivalent: hg addremove. This command removes deleted files from the repository and also adds new files in the current directory. For me, at least, it’s a useful command that I’d like to have. Of course, git is nothing if not flexible, so let’s add this command! I’m using a suggestion for a script that I found here. Add the following lines to your $HOME/.gitconfig:
[alias] addremove = !git add . && git ls-files --deleted | xargs --no-run-if-empty git rm
Tada—git addremove puts new files in the staging area and also removes deleted files. Now you don’t have to pay attention to your hipster friends who try to tell you how great mercurial is.
Bad UI Design Killed My Computer
OK, perhaps it didn’t kill it, but I thought it was somewhat entertaining. The story is this: last week I read this Jeff Atwood blog post on Coding Horror, where he describes a concept from UI design that he refers to as the “opposite of Fitts’ Law”. Jeff also includes a humorous illustration from a UI design book that illustrates the idea by showing a row of identical switches in the cockpit of a fighter jet: windshield washer, FM radio, ejector seat, and cabin lights.
Today I experienced a real example of the problems that can arise from this design flaw, similar to the issues Jeff points out with Gmail. I live in a moderately sketchy house, and there is a switch which controls the power to several walls worth of electrical outlets. The arrangement of controls is about as good as the fighter jet. Here’s a picture of the switch panel:
› Continue reading
Using notify-send to Slack Off Efficiently
I’ve been working on a big project in MPI and the execution times on my code are annoyingly long (on the order of minutes). I like to keep my work in a separate workspace from my browser to minimize distractions, but then when I set my code running and head over to visit reddit or something I often don’t notice when my code finishes. Today it occurred to me that this would be a good use for libnotify. There is a command-line utility called notify-send (you should have it if you have a recent version of Ubuntu; not sure about other distros) which gives a simple interface to libnotify, so I whipped up a tiny script to call it:
#!/bin/bash EVAL_STRING="notify-send -u normal -t 5000 -i info \"Task completed\" \"$@\"" eval $@; eval $EVAL_STRING
I put it in a folder which is in my path, and now I just do
$ notify ./takes_forever
and I know as soon as it’s done. OK, back to work.
Gmail: Please Bold the Hidden Labels Button when there are Unread Messages
I love Gmail. It does everything I could possibly want an email client (web or desktop) to do. All of my non-junk email accounts are Gmail or are forwarded to Gmail accounts. That said, occasionally something occurs to me that would make my Gmail experience a little bit better. Sometimes these crop up as Labs features, which I think is great, and is part of why I enjoy using Gmail so much.
› Continue reading
First Thoughts on Scala
Over the past week or so I’ve been looking into the Scala programming language. If you aren’t familiar with it, Scala is one of a group of new-ish languages including Groovy, Clojure, and Nice (as well as new implementations of preexisting languages like Jython, JRuby, and Rhino) that run on the JVM (either interpreted or compiled to Java bytecode). Over perhaps the past decade the JVM has been increasingly seen as an attractive target platform for language development for several reasons:
- Implementation in Java instead of C
- Features like garbage collection, portability, and a huge standard library come for free
- Languages benefit from advances and optimizations in the JVM
(This is part of a trend pointed out as Prediction #4 in a list of 10 predictions about software Steve Yegge made about 5 years ago.) In fact, targeting a virtual machine has almost become the only way to implement new, fancy languages with reasonable performance, portability, and implementation time.
Dark and Disquieting Portents
Have you noticed an increase in the margin on the left side of the Google search results page recently? My coworker started noticing it yesterday, but I thought it was just him. Then I noticed it when I got home, and saw it mentioned on Twitter as well. The weird thing is the platforms where it shows up. My friend first started noticing it with Firefox 3.5 on Windows. I noticed it at home with Firefox 3.0 on Ubuntu, and on this Windows machine I see the effect with Chrome, but not Firefox 3.5 or IE 7:
Ctrl-C is Back
My (indirect) host, fsckvps.com, was pretty messed up by hackers using a HyperVM exploit. Fortunately, the server I use seemed to be OK, but the DNS servers were down and due to one thing and another I wasn’t able to set up alternate nameservers until just now. I’m using free service from afraid.org. It seems kind of slow, but it’s definitely better than nothing. Anyone know of any alternatives? Is it possible to roll my own?
There is a slight improvement; http://www.ctrl-c.us/ now redirects to http://ctrl-c.us/ :-)
OK, it’s now way past my bedtime. I’m getting up in just a few hours to go on another epic hike. Pictures to follow.
Keyboard Remapping in Windows XP
When I found that I had to use Windows for work, the first thing I did was to install gvim and my usual host of plugins. The next thing was to remap caps lock and escape. I switch these when I’m using Linux because I don’t really ever use caps lock, but I use escape all the time (especially in vim). In Linux it’s a simple .Xmodmap entry:
