Ideas Have Expirations

One often-overlooked aspect of the crime of not-writing is that the harm isn't just about the things that deserve to be said that you never get around to saying because you don't put in the time and effort. It's also about the things that you can't say anymore even if you suddenly had the will, because the opportunity to say it was bound to a particular time, and trying to recapitulate the thoughts months or years after the fact would be irrelevant, or impossible.

This phenomenon comes in degrees. Start with irrelevance. Often the inadmissibility of tardy words isn't absolute: you could say things late, but the product would be less valuable than if it were timely—especially in a medium like blogging, where the posts being dated and displayed reverse-chronologically creates an expectation that the entries are associated with a particular point in time—at least, that they were written not too long before their publication date, even if the actual content isn't about the ephemera of the day or season. This has contributed to An Algorithmic Lucidity not being as good of a blog as it could be.

Continue reading

Dismal Science

There's something that feels viscerally distasteful and fundamentally morally dubious about looking for a job or a significant other. Search and comparison are for crass, commonplace, material things: we might say that this brand of soap smells nice, but is expensive, or that this car gets poor mileage, but is cheap, and while we may err in our judgment of any particular product, the general procedure must be regarded as legitimate: there's nothing problematic about going out to shop for some soap or a car and purchasing the best that happens to be available on one's budget, even if there's no sense of destiny and perfection about the match. Rather, we want to be clean, and we want to go places, and we took action to make these things come to pass.

Continue reading

This Has Always Been the Year

At a quarter past eight on the first Monday of the new year, the yellow line on the way to the city has just passed Orinda. A young man is standing in the bicycle priority area near the doors, reading a paper magazine. Write Your Novel in 2016! is the cover story, followed by more teasers below: "2 Tools That Can Fix Any Story Problem," "What's Really at Stake? The Secret to More Compelling Characters," and "5 Great Caribbean Literary Festivals: Get Away, Get Inspired!"

It catches the eye of a young woman who got on at Lafayette and has spent the last six minutes scribbling in a Moleskine notebook. "Oh!" she says, approaching. "Are you a writer, too?"

The man looks up, seeming slightly surprised and confused, which slightly surprises and confuses her in turn. "Of course not," he says, indicating the magazine. "If I were, would I be reading this?"

2015 Year In Reverse

(Previously, previously.)

Dear reader (that's reader in the singular because I doubt that there are two actual humans who read my blog; it's not because there are many and I'm addressing you individually), it's that time of the year again—the time of the year when it stops being the year. A time to think thoughtfully and ask, "What happened since the last time we did this?"

In the year 2015, this blog has seen (at press time) 43 posts and 30 comments. Among these—

Continue reading

Naughty List

(examining a Christmas card and enclosed document, frowning) "I think my Uncle Benny is mad at me."

"Why?"

"Well, every Christmas since me and my brother were kids, instead of getting us toys or cash as gifts, Uncle Benny would give us some kind of financial instrument, like a savings bond or a share of stock in some company. You know, to teach us the value of productive investment over mere consumption."

"And this year?"

"Commodity options."

"That doesn't s—"

"In coal."

Attentional Shunt

#!/usr/bin/env python3

# Copyright © 2015 Zack M. Davis

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

"""
Configure the machine to shunt traffic to distracting sites to localhost,
preserving attention.
"""

import os
import argparse
import subprocess
import sys
from datetime import datetime, timedelta

ETC_HOSTS = os.path.join(os.sep, 'etc', 'hosts')
HEADER = "# below managed by attentional shunt"
INVERSE_COMMANDS = {'enable': "disable", 'disable': "enable"}

DISTRACTING_HOSTS = (  # modify as needed
    'news.ycombinator.com',
    'math.stackexchange.com',
    'scifi.stackexchange.com',
    'worldbuilding.stackexchange.com',
    'workplace.stackexchange.com',
    'academia.stackexchange.com',
    'codereview.stackexchange.com',
    'puzzling.stackexchange.com',
    'slatestarcodex.com',
    'twitter.com',
    'www.facebook.com',
    'slatestarscratchpad.tumblr.com',
)
SHUNTING_LINES = "\n{}\n{}\n".format(
    HEADER,
    '\n'.join("127.0.0.1 {}".format(domain)
              for domain in DISTRACTING_HOSTS)
)


def conditionally_reexec_with_sudo():
    if os.geteuid() != 0:
        os.execvp("sudo", ["sudo"] + sys.argv)


def enable_shunt():
    if is_enabled():
        return  # nothing to do
    with open(ETC_HOSTS, 'a') as etc_hosts:
        etc_hosts.write(SHUNTING_LINES)


def disable_shunt():
    with open(ETC_HOSTS) as etc_hosts:
        content = etc_hosts.read()
    if SHUNTING_LINES not in content:
        return  # nothing to do
    with open(ETC_HOSTS, 'w') as etc_hosts:
        etc_hosts.write(content.replace(SHUNTING_LINES, ''))


def is_enabled():
    with open(ETC_HOSTS) as etc_hosts:
        content = etc_hosts.read()
    return HEADER in content


def status():
    state = "enabled" if is_enabled() else "disabled"
    print("attentional shunt is {}".format(state))


def schedule(command, when):  # requires `at` job-scheduling utility
    timestamp = when.strftime("%H:%M %Y-%m-%d")
    at_command = ['at', timestamp]
    at = subprocess.Popen(
        at_command,
        stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE
    )
    at.communicate(command.encode())


if __name__ == "__main__":
    arg_parser = argparse.ArgumentParser(description=__doc__)
    arg_parser.add_argument('command',
                            choices=("enable", "disable", "status"))
    arg_parser.add_argument('duration', nargs='?', type=int,
                            help=("revert state change after this many "
                                  "minutes"))
    args = arg_parser.parse_args()
    if args.command == "status":
        status()
    else:
        conditionally_reexec_with_sudo()
        if args.command == "enable":
            enable_shunt()
        elif args.command == "disable":
            disable_shunt()

        if args.duration:
            now = datetime.now()
            inverse_command = INVERSE_COMMANDS[args.command]
            schedule(
                "{} {}".format(os.path.realpath(__file__), inverse_command),
                now + timedelta(minutes=args.duration)
            )

Apt-Get

Some packages could not be installed.
Unable to correct problems; you have held broken packages of ideas.
This may mean that you have requested an impossible situation,
Or if you are using the unstable distribution,
That some required packages have not yet been created.

The following information may help to resolve the situation.

The following packages have unmet dependencies:
Justice, Safety, Innocence (>= 1.8), and the notion that one is suitable,
likely, or prepared to receive that which is appropriate to one's moral
standing, depend on an ordered universe maintained by sufficent force of agency
to perceive, understand, and carry out the operation of the moral law.

But it is not going to be installed.

Still Yet Another Idle Wish for a Future Star Trek Series

(Previously, previously, previously on An Algorithmic Lucidity.)

"The next thing we need is a secure way to communicate with our contacts on Bajor," says Maj. Kira during Act One of Deep Space Nine Season 6, Episode 3, "Sons and Daughters", planning the secret resistance to the Dominion's occupation of Deep Space Nine ... at a table in a public bar?! Who writes this stuff?

It's too much to retcon, but since we're getting a new series soonish, I'm going to hope for an episode where, as a plot point, some people (not necessarily the protagonists) use cryptography with their universal translators to evade would-be eavesdroppers: you'd stop speaking out loud and configure your universal translator to translate your subvocalizations into noise that can only be decrypted by one of the private keys in your friends' universal translators.

Traffic Koan

"I'm behind schedule this Monday morning," said the engineer, "but it'll be OK as long as the train isn't late."

The train was late. In that moment, the engineer was enlightened.

Wu's commentary: As one train door opens, another fails to close. The fool curses police activity at West Oakland. The wise person swims across the bay.

Wu's poem:

The doors are closing;
Please stand clear of the doors so
The train can depart.

The Sin in the Form

Would you like to hang out on the weekend some time
And say things that we like to say,
Like "How are you doing?" and "Weather's sublime,"
And how altruists should spend ten K?

But with inbox so teeming, and weekends high-priced
And better spent coding alone,
Tell me what could make up for the sin to ask twice,
But the sin in the form of a poem?

Creature Manipulation

(marching into the room confidently, carrying copies of Carnegie, Cialdini, and Patterson Grenny et al.) "I'm going to acquire creature-manipulation technology!"

"What kind of creatures are you planning to manipulate?"

"What?"

"You just said you were going to acquire creature-manipulation technology."

"Oh, you must have misheard. I said, 'I'm going to learn interpersonal skills!'"

(facepalming) "Good luck."

Company Loyalty

"My lord. You took a chance on me when I was unknown and unproven, rescued me from the continued degradation of 'college' that the emperor's men would have us believe is the source of life itself. In return for your generosity, I will do everything in my power to make it not have been generosity.

"You will grow even richer by my efforts. I will fit your plumbing, mend your stylesheets, and polish your user interfaces; I will answer your support tickets and triage your user stories, laboring long into the evening and the night, seeing only by monitor-light. Not because I couldn't get away with doing less: I know very well that once you've hired someone, morale constraints prevent you from firing them as long as they have a nontoxic personality and give the Socially Acceptable Moderate Effort.

"That is: this instance of me could get away with it. But the Great Wheel of Time is slow and vast, and we are both but samples from the statistical sea in which companies and programmers live and die. You would be foolish indeed to take someone who looks like me into your house if you didn't know that some of them would offer you more than more of the S.A.M.E.

"That is why I will fight for you. That is why I will code for you. To maintain the right tail of that probability distribution.

"My life is yours, my lord ... for, oh, let's say about four years."

Back from Running

[16:03:37] <alice>  I'm back from literally running, metaphorically from
                    figurative demons
[16:03:50] <alice>  including the celebrity demon-prince Rateirs-Blak
[16:05:37] <carol>  alice: ?
[16:05:49] <carol>  oh
[16:05:55] <alice>  there's no canonical Latin-alphabet transliteration of his
                    name, because mortals fear to set it in writing
[16:06:08] <alice>  or maybe they just can't think of how or never make
                    the effort to do so; it's unclear

(1)

"Could it be? That parenthesized numeral one in the other tab can only mean that a human has sent me mail! I wonder what it could be—why, the mind staggers at the sheer number of possibilities! Could it be an old friend writing to regale me with true tales of adventure and mystery on the high seas? A professional acquaintance looking to make a business deal? Or the first of many missives to come from my destined one true love? ...

"Oh. It's the Amazon Instant Video order confirmation for the cartoon I just bought twenty seconds ago to distract me from the desperate, soul-scarring eternal loneliness.

"... exactly how many times am I going to fall for that?"

(cue Gravity Falls theme music)