found_drama


Honor thy error as a hidden intention.


    Archive for January 2010

    #dream.20100129: sushi

    I’m at… work?  No, not work.  The floors are concrete but this is an Eastern Shore-style crab house.  Concrete floors and rows upon rows of long red picnic tables covered in newspaper.  But I may as well be at work.  I’m surrounded by co-workers, all of us toting our laptops.  We take our seats around the tables.  There is work to be done among the software engineers.  Except that before we can really get started, the project managers descend from out of nowhere, each one carrying huge trays laden with sashimi and rice and other treats.  Everyone dives in.


    #Linkdump for January 26th


    #Linkdump for January 16th


    #Linkdump for January 12th


    #too many titles, or: AppleScript’s greedy tab title setting in the Terminal

    On a regular basis (talking “daily, all day” here), I run n tabs in an open Terminal window where n > 1 (and usually n > 4).  And so each time I open up on these tabs and cd into the directory I need, I’m hitting ⌘⇧i to set a custom title on that tab; and 99% of the time, that custom title is the last node in the pwd output.  So what I was thinking was to set up a little shell script, backed by an AppleScript to:

    1. cd into a specified directory;
    2. get the title I want via pwd | cut -d'/' -f51;
    3. and pass that as an argument to AppleScript (via osascript in the shell script) to have it set as the title of the tab.

    The shell script2 piece ought to be easy enough:

    alias mycd="cd /path/to/directory/of/interest;
        osascript ~/Library/Scripts/set-terminal-tab-title.scpt
        `pwd | cut -d'/' -f5`;"

    And the AppleScript ought to look something like:

    on run argv
      tell application "Terminal"
        set terms to every window in application "Terminal"
        repeat with term in terms
          if term is frontmost then
            set tTabs to every tab in term
            repeat with tTab in tTabs
              if tTab is selected then
                set cTitle to item 1 of argv
                set custom title of tTab to cTitle
              end if
            end repeat
          end if
        end repeat
      end tell
    end run

    …and this almost works3.  Almost but not quite.

    First:  let’s gripe about how verbose AppleScript is.  Loop through every window to find the frontmost?  And then loop through every tab to find the selected tab?  Apparently this is what I need to do.  Now, accepting that and moving on…

    The first thing that breaks down in practice is the pwd code cribbed from Stack Overflow.  Throwing that into the command line gives me what I want.  And executing that within backticks to generate the output to the osascript’s argument works.  But it doesn’t work when wrapped up in the alias4.  What’s frustrating though is if I pass a string literal there, the AppleScript accepts that.

    Rock and roll, right?  Wrong.

    Doing this for the first tab (let’s call it “interest”) seems just fine.  Start the second tab (let’s call it “interest2″) and do it there and both tabs are now named the same thing (“interest2″).  Do a third tab (“interest3″) and now they’re all “interest3″.  Well this is a drag!

    Quit Terminal and start over…  What?  The new window is named “interest3″?  How can this be?  It would appear that setting the custom title on the selected tab is actually reaching into the application’s preferences and setting a custom title there and applying it app-wide and then permanently saving it as a preference.  So it seems I have two problems.

    1. How do I get the standard output actually passed as the argument to the osascript?
    2. How do I get it to only set the title on the tab?

    Any takers?  Thoughts?  Suggestions?



    1. Tip o’ the hat to this thread on Stack Overflow. []
    2. Yes, I know that setting an alias in .profile is not technically a shell script. []
    3. And on that note, I’d really rather skip passing arguments into the AppleScript at all and have it take care of the pwd trickery, but that’s a separate bit of frustration… []
    4. It occurs to me that I should try this as a “real” shell script? []

    #a week with Chrome

    I broke down and decided to try out Google’s Chrome browser after having heard so many positive reviews of it.  It’s backed by WebKit—just like Safari, my current favorite—and so if nothing else, I know it has a tried and true and powerful engine going behind the scenes.  That said, I’ve tried out more than a few browsers over the years and almost always wind up “switching back” after a day or two (or at most: a week or two).  With that in mind, I was more than expecting to go “Meh, back to Safari…” by the end of the week.

    But at the end of that week, I’m beginning to think that Chrome might stick around for quite some time as my day-to-day browsing1 browser2.

    First, what I like:

    1. The tabs. The tabbed browsing experience in Chrome is nearly perfect and without a doubt the best I’ve seen so far.  The tabs in Chrome are “on top”, which Apple tried to do in the Safari 4 beta and failed to execute properly.  What Apple did wrong in the Safari 4 beta was to try to have the tabs merge into and replace the title bar; this is wrong.  From a UI/visual hierarchy perspective, the tabs definitely belong “above” the browser controls and the address bar, etc.—but they are themselves a part of the window and as such you need adequate clearance.  Under Safari 4 beta, the tabs went all the way up to the window edge; Chrome nails it by providing a just-about-right-sized buffer between the tab’s top edge and the window’s top edge—from what I can tell, it’s about ½-⅔ the size of the title bar’s normal height.  So there’s no ambiguity with respect to what you’re going for:  you’re either going for the tab (to rearrange it or do the also well-executed tear-off behavior) or else you’re going for the title bar to move the window around.  To crib a phrase, in the platform’s UI grammar, this is correct3.
    2. The animations. You may call it superfluous if you wish, but this kind of spit-and-polish work can be important in setting one application apart from its peers.  Most of the animations are with the tabs, so I’ll list off a few that I instantly noticed and instantly loved:  the way a tab pops up when you create a new one; the way a tab sinks when you close it; the tear-off animation; the tab rearrangement animations; how the loading circle in the tab goes anti-clockwise and much slower until it gets a server response (and then starts to load).  These are not key features, but they sure make things feel more complete.
    3. Fast. It feels like a very fast browser.  Maybe I’m distracted by the animations, but it seems a little snappier to render pages and to respond to in-browser events.  I’ve read that it’s faster than any other browser; but I’ve also read that Safari has the slightest edge on it.  But then again, I’ve also read that Chrome knows how to use more than one CPU core at a time.
    4. Unobtrusive UI elements. When I first noticed that Chrome didn’t have a status bar across the bottom of the browser window, I went looking for it.  I want this thing to be turned on.  But after using it for a few minutes, I noticed that it didn’t need a status bar because it just displayed status messages on an as needed basis in a little messaging space that was only as big as it needed to be.  (Win!)  And then when I downloaded a file and instead of popping up a “downloads window” it just put a “downloads bar” across the bottom…  Well, I must say I was impressed with that, too.  Unobtrusive, and only as needed.
    5. Additive tabs. If you (like me) tend to open big batches of tabs all at once from a bookmark group in the bookmark bar, you’ll appreciate that Chrome just appends these to the open tabs.  Instead of replacing the ones you have open.  (Safari, I’m looking you direction.)

    What I do not like:

    1. The icon. Chrome’s icon blows.  It looks like a Pokémon egg.  Or a half-baked Simon-from-the-future.  If asked to rate the browser icons, it would go something like this:  Shiira, Firefox, Safari, Opera … a whole bunch of other guys … Chrome, and finally Internet Explorer.
    2. I miss my “open in tabs” command. Allow me to rephrase:  I’m annoyed that I need to right-click my bookmark group and click “Open All Bookmarks”.

      Safari just has this at the bottom of the bookmark group.  And I use it a hundred times a day4.
    3. Text fields do not (always) play by the rules. Folks on the Mac that “switched” from Windows machines will probably understand this one right away.  You get used to hitting “home” and “end” to go to the beginning and end of lines (respectively) and then you switch and have to learn that you now press up and down to do the same thing.  And then you get used to it.  And then you start using Chrome and this isn’t the case.  Or at least isn’t always the case.  In the browser’s address bar, up and down are bound explicitly to the history/search results/bookmarks suggestions list that appears.  And within the browser window itself, a text field may play nicely with this convention.  And sometimes it won’t.  And I haven’t figured out the pattern yet.  If there is one.  Which just makes this worse/more frustrating/more annoying.  Perhaps I’m just being hyper-vigilant to it and Safari et al. are the same way.  But I’m not so sure.  [UPDATE 1/12/10: I think this is just a matter of waiting for Chrome to catch up with me and my browsing history and habits.  It does in fact seem to prompt-and-fill-in the same way as Safari.]
    4. Double-clicking the tab bar doesn’t start a new tab. This is a behavior in Safari that I use all the time.  It drives me nuts that this minimizes the Chrome window.  I hate being forced to use the little “+” icon.  [ADDED 1/12/10]

    What I’m undecided about:

    1. The auto-completion in the address bar. Perhaps I’m just too used to how Safari auto-completes, but Chrome’s does not sit right with me.  I mentioned this immediately above w/r/t/ how the up and down keys are bound to the suggestion box; but I’m also expecting the address bar to instantly try to auto-complete my typing.  When I type “ama” I’m expecting it to instantly suggest Amazon.com.  Chrome does not always seem to do that.  Again:  it’s inconsistent.  Maybe it will learn as I go?
    2. The way you close tabs. To quote the venerable and inscrutable Gruber, “It’s a grammar thing — in the Mac UI grammar, close buttons go on the left.”  But that said, Gruber writes that in response to a thoughtful missive of Chrome’s tab closing behavior by Basil Safwat at The Invisible.  The nutshell version of Safwat’s argument is that putting the tab closure icon on the right allows users to quickly close them with mouse-clicks with minimal mouse movements regardless of if they are closing from left to right or right to left.  I won’t go much further with that because you should really just read the article.  But that said, tabs in a browser are pretty wily and protean beasts by their nature, and while Safwat has some great points about tab praxis, the pedantic part of me wants desperately to reject the closure-on-the-right more/less out-of-hand because it’s a pretty fundamental violation of (there’s that phrase again!) the UI’s grammar.  Could it be that we need a corollary for the “closure on the left” rule?  Does praxis override all else in this case?  Or is there a way to accomplish this same fluidity without violating the placement assumptions?


    1. As opposed to “development” browser. []
    2. Though Camino spent (almost?) a year or so as my day-to-day browser before it got displaced by Safari again.  So, who knows, eh? []
    3. Of course, they put the close button “the wrong side” w/r/t/ this platform’s UI grammar; but we’ll get to that in a bit. []
    4. All right, I am exaggerating.  It’s more like fifty times a day. []

    #2010 Goals

    An annual tradition here at F_D1, let’s kick-off the year with a full disclosure of goals.  Rather than set vague “resolutions” and lame half-promises to yourself, why not think of the new year as an opportunity for a little personal growth?  A couple of little benchmarks to set your aggressive little sights on throughout the year?  Here are mine:

    1. Write ≥3 hours each week. Something of a re-hash of last year’s writing goal.  I can do this.  I need to do this.  If I’m going to have goal #2 (vide infra) mean anything at all, it’s going to be through diligence, perseverance, and practice-practice-practive…
    2. Submit at least 2 short stories for publication. If I’ve had a writing goal every year, and if I’ve wanted to be a published author since I was five years old, then why did I go all of last year without sending out a single thing?  I had a flurry of submissions in 2008 but then went all “radio silence” last year.  I’ve got some good stuff, I just need to get it out in front of people.  (While we’re at it:  the first one went out last night.)
    3. Revise at least one of my novels-in-progress. In case you haven’t been paying attention, I have several novels in progress and “completed” drafts of at least three2.  All of them are worthy stories that, with the right amount of polish, are publishable.  The goal here is to turn goal #2 (vide supra) into “submit at least one novel for publication” next year3.
    4. Read ≥36 books. This is totally a repeat of one of my 2009 goals.  I set the bar at 36 last year and came in at 25.  Why go for 36 again?  Because I read 49 books in 2008.  No reason not to.  And to up the ante a little bit, two sub-goals:  (1) I plan to finally finish Godel, Escher, Bach; and (2) I intend to read these twelve:
      1. Foucault’s Pendulum (carry-over from last year)
      2. Where Late The Sweet Birds Sang: A Novel
      3. The Blind Assassin
      4. The Moon Is a Harsh Mistress
      5. The Pragmatic Programmer
      6. The Tao Of Physics, and then for contrast
      7. Feynman’s Six Easy Pieces
      8. Illegal Beings: Human Clones and the Law
      9. The Eleventh Draft: Craft and the Writing Life from the Iowa Writers’ Workshop
      10. Sex, Drugs, and Cocoa Puffs: A Low Culture Manifesto
      11. Blood Meridian, and the other McCarthy that has been recommended to me ten million times
      12. All the Pretty Horses
    5. Exercise:  get my money’s worth at Bolton Valley. It’s my eighth winter in Vermont and I finally got around to getting a season pass4.  This year I got a pass to Bolton Valley.  I worked it out that I need to go at least five times to get my money’s worth.
    6. Exercise:  walk or run ≥1 mile ≥2 times/week. I got myself a treadmill for my birthday a couple years ago.  I don’t think I used it at all in ‘095.  And since I moved and can’t walk to work anymore, I’m thinking that I should try to get in one or two runs a week6.  Perhaps I’ll even join the “barefoot runners” cult.
    7. Exercise:  climb at least once each week. Third year running.  Much more than this probably isn’t terribly realistic.  Not for me.  Not until The Boy is a little older.
    8. Restrict my “personal expenses” to $70/week. To be honest, this will actually be the fourth year that I’ve done this but the first year I’ll own up to it.  What constitutes “personal expenses”?  That’s money I spend directly on me:  coffee, lunch, my portion of the dinner bill, drinks, etc.  It’s a fun challenge.  And very revealing.

    I almost feel like I ought to come up with two more to make it a nice round, metric ten.  And maybe I’ll add some later on in the year.  But these are as good a place as any to start.

    Here’s to a happy and successful 2010!



    1. Well, since 2007. []
    2. The three I have in mind are this thing (which I’ve been working on since roughly 2001), and my 2006 and 2009 NaNoWriMos. []
    3. That said:  I’ll give myself a little wiggle room on this goal if it means that I get yet another first draft written.  (But what good are three first drafts and a second-or-is-it-third draft?) []
    4. And seven of eight of those winters I even worked for a company that offers discounts on season passes as a benefit.  (Still work there.) []
    5. Although…  Well, at least Amy did. []
    6. I know the goal says “≥2 times/week” but… that’s what makes it a goal? []

    #Linkdump for January 2nd


    #search term haiku: December 2009

    Gecko v. WebKit
    greatest cookbooks of all time
    zombiephobia

    “Search Term Haiku” is a series wherein I examine this site’s log files and construct one or more haiku poems from search terms and phrases that led visitors to the site. Where possible, I attempt to keep the search phrases intact. However, as these are haiku poems, I do need to follow the rules.




    Creative Commons License This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

    Bad Behavior has blocked 1627 access attempts in the last 7 days.