thursday, october 20

                         the data is   a program the program is a machine
         is a program the program is   a machine                   the data
   machine                       the   data is a program the program is a
   machine                  the data   is a program the program is a
       data is a program the program   is a machine                     the
       is a program the program is a   machine                     the data
                       the data is a   program the program is a machine
           the data is a program the   program is a machine
   is a machine                        the data is a program the program
               the data is a program   the program is a machine

(courtesy ptx(1))

wednesday, october 19

the data is a program
the program is a machine

monday, october 17

(nobody wants another meditation on mortality
some days it's just hard to write any other thing

nobody wants to rake the leaves, most of the
time, but they keep falling)

i was carefully arranging textfiles
and stacks of paper the other day
and i got to wondering
what am i doing this for?
what posterity etc. is waiting this
particular, deliberate tedium?

i got to thinking just now about
my great-grandfather keeping a journal
of his travels northwest of kansas,
some several lifetimes before i was born

in an age when i suppose half the
dying shape of the older continent
before what his people made of it
was yet within living memory

his journal's in my closet, in a box,
inside a plastic bag
i've thought now of transcribing it
for something like half my life

it wouldn't come to many words, or
i suppose convey much new information, but
i may yet put on cotton gloves and carefully
photograph those brittle pages

(there is probaby no true reckoning with the past, if we
are honest; no logic that can operate over the
accumulated data and balance the losses half-traced therein)

Sunday, October 16

finding an obscure vim plugin bug

I filed this against vim-fugitive a bit over a month ago and just remembered it: Autocommands do not fire for files named index:

I have an autocommand to do some stuff. I noticed that it fails on files named index, I think because fugitive.vim has its own autocommand for index{,.lock} that triggers BufReadIndex(), which in turn does something to prevent further processing of the event. I’m kind of hazy on how.

Tracking this down to its source was tricky, and I feel like I should document a couple of the small things I learned in the process.

For background, this is from the Vim help for :autocommand:

:au[tocmd] [group] {event} {pat} [nested] {cmd}
        Add {cmd} to the list of commands that Vim will
        execute automatically on {event} for a file matching
        {pat} |autocmd-patterns|.
        Vim always adds the {cmd} after existing autocommands,
        so that the autocommands execute in the order in which
        they were given.  See |autocmd-nested| for [nested].

The {event} is something like BufNewFile, which triggers when a buffer is opened with a new file. There are a bunch of these. I was trying to get something like the following autocommand to fire:

" this calls a function to treat blog entries as markdown
au BufReadPost,BufNewFile */p1k3/*[0123456789]* call BPB_PikeHighlight()

…and I couldn’t understand why the pattern */p1k3/*[0123456789]* wasn’t matching on a path like /home/brennen/p1k3/archives/2016/10/16/index, even though it worked for other files in that tree.

At first I thought something was wrong with the pattern, so I rewrote the function called by the command to this:

au BufReadPost,BufNewFile * call BPB_FiletypeOverrides()

" set custom filetypes for some things
function! BPB_FiletypeOverrides()
  " make sure NERDTree windows don't get messed up
  if bufname("%") =~ "NERD_tree"

  echom 'testing for p1k3 match'

  " using expand('%:p') instead of bufname("%") for full path, per:
  " the initial slash in the regex seems to be necessary to make \v work
  if expand('%:p') =~ "\\vp1k3\/archives.*([0-9]|[a-z])+$"
    echom 'p1k3 match - setting filetype to markdown'
    set filetype=markdown

That didn’t get any results, but since the echom debug messages didn’t trigger at all, it finally dawned on me that the autocommand wasn’t firing regardless of pattern. Then I got to thinking about how index is a special filename for things besides my blog. Git, for example.

In order to confirm my new suspicions, I wanted to see if some plugin was registering an autocommand that might be overriding mine. You can use :autocmd to list the existing ones. It gives many pages of output like this:

--- Auto-Commands ---
fugitive_status  BufDelete
    term://*  call fugitive#reload_status()
fugitive_commit  BufDelete
              execute s:sub(s:FinishCommit(), '^echoerr (.*)', 'echohl ErrorMsg|echo \1|echohl NONE')
filetypedetect  BufEnter
    *.xpm     if getline(1) =~ "XPM2" |   setf xpm2 | else |   setf xpm | endif
    *.xpm2    setf xpm2

Since this was stupidly long and hard to jump around in, I went looking for a way to capture the output of a command. This actually turns out to be pretty easy:

:redir @a
:redir END

This puts the output of :autocmd into the register a, which can then be pasted into a buffer by typing "ap.

Sure enough, buried in there is this:

fugitive_files  BufReadCmd
              if fugitive#is_git_dir(expand('<amatch>:p:h')) |   exe s:BufReadIndex() | elseif filereadable(expand('<amatch>')) |   read <amatch> |   1delete | endif

I stopped there and filed a bug report, since it’s a trivial bug and it had already cost me more time than the thing I was trying to fix is likely to save me in a lifetime, but maybe one of these days I’ll get around to figuring out what is actually happening and write a patch.

As a final meta-level thought on this: I’ve invested an embarrassing amount of time in configuring my text editor over the years, but it’s only recently that I’ve hit the point where most of my deliberate changes to this setup land me firmly in the Turing tar-pit.

Perhaps not coincidentally, this is right about where I realize that shifting my preferences to another editor would be a matter not just of relearning interface elements, but of porting a small but growing body of somewhat tricky code. Every change increases the incentive to make future changes to the existing environment instead of paying the cost of switching environments.

Path dependence explains a lot of things in life.

It also remains true that Vim is an astonishing achievement, both powerful and feature rich in ways that most systems rarely attain. One might wish for an underlying syntactic and conceptual simplicity, for a language composable and manipulable without an entire vocabulary of dirty hacks — but one isn’t exactly surprised by reality.

Addendum: It turns out this is not the first time I have learned the :redir trick.

Friday, October 14

It’s the middle of the night, and I should be sleeping. Because I had a run in with a plate of Oskar Blues chicken enchiladas and one to four pilsners (who’s counting, really?), I am not.

In between festivals, weddings, and conferences, I’ve been thinking about a project.

Back in 2013, I started writing userland: a book about the command line for humans. It’s not really finished,1 but I got it to a readable state in the fall of 2014, right about when the main project in my life was coming apart at the seams.2

After I left SparkFun, userland set a tone for the next couple years in my working life. Or at least after that, I started to get paid for technical writing, and wound up with a full-time job writing sysadmin docs.

It wasn’t the way I’d imagined being a writer when I was young, but I could still say with a straight face that I was a professional. And with it, I learned that I could in fact stare down a blank editor window and make functional text happen, even on topics that held little personal interest. (More people read my disposable, obsolete-at-publication tutorial on hosting an ill-advised mobile app framework in a single week than will ever read any of my poems.)

And then somewhere in there I burned out pretty hard. In fact, although I can handle the mechanics of writing, I am terrible at life as a content monkey. Unable to farm clicks with the necessary ruthlessness and keep any peace of mind.

It’s not that “content marketing” is automatically a degrading way to sell things. In fact it might be one of the more honest propositions in the business, at least when what you mean by it is “documentation on how to use useful things”. It’s just that the idea of “content” as a kind of generic liquid substance remains grotesque and distorting, and despite the baseline assumptions of marketing culture, it continues to matter what you sell.

When I quit writing for DigitalOcean, I started thinking about writing for my own reasons, and about how I could take that seriously as a practical task. Since then I’ve been hovering around a set of ideas that seem to have accumulated, pecking at them here and there, working up to that moment when the engine might turn over again:

  • Forget the contempt I held for highschool / college platitudes about notes: Notes are essential to so much code, systems, prose.
  • I’ve been taking notes since some time in the late 90s. They’re just scattered, unindexed, unsorted.
  • What if I had random access into my life’s entire catalog of meta-memory?
  • Why don’t I keep a database?
  • In an age of ever-more-thoroughgoing surveillance, why can’t I ask basic questions about my own life and experiences in a rigorous way? Why does the panopticon’s model of my existence seem more developed than my own?
  • Why does so much of my history on the command-line go unrecorded, un-annotated, un-repeatable past the narrow time horizons of my working memory?
  • Why don’t I publish photos any more?
  • Some of the tools I use are pretty good. Others would be pretty good if I was tough-minded and serious about developing the underlying ideas.
  • If I spend so much time customizing my computer environment, why aren’t my tools better?

I know that I want to write something like a book, but these aren’t exactly the topics I want to write it about. It’s more that I intend to use them as a way to discover the book I do want to write, or the thing that isn’t quite a book but will satisfy the same basic impulse.

1 Being a sketchy outline of the book it ought to be, and having emerged from a moment when a kind of optimism about computing seemed to me, somehow, appropriate and sustainable.

2 It had a little help.


Elizabeth Wurtzel on Depression and David Foster Wallace -- New York Magazine

David Foster Wallace - The Problem with Irony - YouTube

Double Solitude - The New Yorker

Marvel's Guardians of the Galaxy Vol. 2 - Official Sneak Peek - YouTube — yessss

Exploring CLI Best Practices | Hacker News

Why the ‘Psychoticism’ Error Took Years to Fix -- Science of Us

WordPress Without Shame

How the Web Became Unreadable

Finalists in the 2016 Comedy Wildlife Photography Awards

How Uber Scales Their Real-time Market Platform - High Scalability - — This shit is fascinating.