Archives / Search ›

Odds and ends

WWDC was fun, if exhausting; everything went wonderfuly smoothly (ignoring the traffic on 101 driving into SF on Friday night) until my flight home, when we were delayed four hours while United maintenance drove two bolts from SFO to SJC. Joy.

For some reason I didn’t get too much out of the WWDC sessions; perhaps I picked the wrong ones to attend. The small amount of time I spent in the labs made me wish I had hung out there more. I got to meet lots of people, both among my friends and the Mac developer crowd, and have some interesting conversations—although, as usual, even with thousands of people surrounding me from time to time I felt completely isolated.

I haven’t finished organizing photos and videos yet, mainly because I’ve been so busy since I returned, Lightroom really likes a faster machine than my iBook, and my iBook died over the weekend in any case. The photos I took at the large and enjoyable #macdev dinner are here, however.

There’s now a date and Web page with the papers for the OOPSLA 2006 Dynamic Languages Symposium in Portland in October, at which I’ll be presenting the work I did on a hardware transactional memory-enabled PyPy. Half the papers are Python-related, which is rather cool.

Finally, a couple of zsh tips. The great thing about a shell with as many features as zsh is that you never stop learning about new features and ways to use them. The annoying thing is that you seem to forget things just as quickly. Until this morning as I came across a mention in the zsh book (which I highly recommend), I’d used this idiom to get all the directories under the current one:

% print ./**(/)
./bin ./eio ./inputs ./outputs ./results ./src

But this excludes the current directory, which I often want (and usually forget) to include. Instead, you can do the following:

% print ./**/  
./ ./bin/ ./eio/ ./inputs/ ./outputs/ ./results/ ./src/

which, in addition to being shorter, has more DWIMitude.

This one is probably a bit better known, but I also discovered yesterday I can get a directory history list by typing ~- followed by the tab key. Reverse the sort order with ~+. Either way, it beats typing popd repeatedly to find the directory you want.

3 comments on “Odds and ends”

  1. 30 August 2006 | 3:13 PM

    I love zsh, but it just takes too long to load. When I spawn a new terminal window zsh takes a good second to load, and it sometimes takes longer. As I said, I love zsh, but I’m back to bash for now.

  2. 30 August 2006 | 3:18 PM

    The answer is more or less “buy a new machine,” I think. On the dual G4/500 I’m borrowing, opening a new terminal window/zsh takes about 1.5 seconds; I can’t imagine that won’t be at least 4 times as fast on a new machine.

    But yes, zsh is a bit slow to start.

  3. 30 August 2006 | 8:12 PM

    This one is probably a bit better known, but I also discovered yesterday I can get a directory history list by typing ~- followed by the tab key. Reverse the sort order with ~+. Either way, it beats typing popd repeatedly to find the directory you want.

    The way I’ve always done it when I wanted some non-immediately-previous directory from the directory stack was to type “dirs” and copy and paste.

    I’m glad to now know about the completion method, though. You should also know that rather than tabbing through the list, you can simply type the number shown:

    cd ~- %~(0)
    0 — /Users/boredzo/Documents
    1 — /Users/boredzo/Domain of the Bored
    cd ~-1 %~(0)
    ___
    %~/Domain of the Bored(0)

    (Yes, I do indeed use the RPS1 right-aligned prompt.)

    As for timings, .zshrc and .zshenv play a huge part. On my 450 MHz Cube running 10.4.7 and zsh 4.2.3:

    time zsh -c exit %~(0)
    zsh -c exit 1.44s user 0.99s system 74% cpu 3.247 total
    ___
    time zsh -f -c exit %~(0)
    zsh -f -c exit 0.01s user 0.02s system 76% cpu 0.030 total

    -f, as you might guess, suppresses the sourcing of .zshenv and .zshrc.

Leave a reply