If You Had to Choose

"I just want a guy who's kind, and smart, and handsome, and truly understands the depths of my very soul," she said. "Is that too much to ask?"

"Yes. Pick two," said her older and wiser friend, who had studied the question. "And not the truly-understands-the-depths-of-your-very-soul one."

Missing Refutations

It looks like the opposing all-human team is winning the exhibition game of me and my it's-not-chess engine (as White) versus everyone in the office who (unlike me) actually knows something about chess (as Black). I mean, naïvely, my team is up a bishop right now, but our king is pretty exposed, and the principal variation that generated one of our recent moves (16. Bxb4 Bf5 17. Kd1 Qxd4+ 18. Kc1 Ng3 19. Qxc7 Nxh1) looks dreadful.

Real chess aficionados (chessters? chessies?) will laugh at me, but it actually took me a while to understand why Ng3 was in that principal variation (I might even have invoked the engine again to help). The position after Ng3 looks like

    a b c d e f g h
 8 ♜       ♜   ♚   
 7 ♟ ♟ ♟     ♟ ♟ ♟ 
 6                 
 5           ♝     
 4   ♗   ♛         
 3 ♙           ♞   
 2   ♙ ♕     ♙ ♙ ♙ 
 1 ♖ ♘ ♔     ♗   ♖ 

and—forgive me—I didn't understand why that wasn't refuted by fxg3 or hxg3; in my novice's utter blindness, I somehow failed to see the discovered attack on the white queen, the necessity of evading which allows the black knight to capture the white rook, and preparation for which was clearly the purpose of 16. ..Bf5 (insofar as we—anthropomorphically?—attribute purpose to a sequence of moves discovered by a minimax search algorithm which doesn't represent concepts like discovered attack anywhere).

Continue reading

Mirage

(just some quick notes, hopefully in the spirit of delightfully quirky symmetry-breaking)

In her little 2010 book The Mirage of a Space Between Nature and Nurture, Evelyn Fox Keller examines some of the eternal conceptual confusions surrounding the perennially popular nature/nurture question. Like, it's both, and everyone knows it's both, so why can't the discourse move on to more interesting and well-specified questions? That the oppositional form of the question isn't well-specified can be easily seen just from simple thought experiments. One such from the book: if one person has PKU, a high-phenylalanine diet, and a low IQ, and another person doesn't have PKU, eats a low-phenylalanine diet, and has a normal IQ, we can't attribute the IQ difference to either diet or genetics alone; the question dissolves once you understand the causal mechanism. Keller argues that the very idea of distinguishing heredity and environment as distinct, separable, exclusive alternatives whose relative contributions can be compared is a historically recent one that we can probably blame on Francis Galton.

The "Bay Area" was ostensibly hosting the big game this year. They blocked off a big swath around the Embarcadero this last week to put on Super Bowl City, "a free-to-the-public fan village [...] with activities, concerts, and more." I really don't see how much sense this makes, given that the actual game was 45 miles away in Santa Clara, just as I don't think we (can I still say we if I only work in the city?) really have a football team anymore; I like to imagine someone just forgot to rename them the Santa Clara 49ers. Even you don't think Santa Clara is big enough to be a real city—and it's bigger than Green Bay—then why not San Jose, which is a lot closer? I think I would forgive it if the marketers had at least taken advantage of the golden (sic) opportunity to flaunt the single-"digit" Roman numeral L (so graceful! so succinct!), but for some dumb reason they went Arabic this year and called it Super Bowl 50. Anyway, on a whim, I toured through Super Bowl City after work on Friday. It was as boring as it was packed, and it was packed. I wasn't sure if my whimsy was worth waiting in the throng of people to get in the obvious entrance on Market Street (the metal-detection security theater really took its toll on throughput), but I happened to hear a docent shouting that there was a less-crowded entrance if you went around and took a left each on Beale and Mission, so I did that. There were attractions, I guess?—if you could call them that. There were rooms with corporate exhibits, and an enormous line to try some be-the-quarterback VR game, and loud recorded music, and a stage with live music, and an empty stage where TV broadcasts would presumably be filmed later. There was a big statue of a football made out of cut-up beer cans near one of the stands where they were selling beer for $8, which sounded really expensive to me, although admittedly I don't have much of a sense for how much beer normally costs. In summary, I didn't see the appeal of the "fan village," although I do understand what it feels like to be enthusiastic about the game itself—I really do, even if I haven't been paying much attention in recent years.

Continue reading

"I Have the Honor to Be Your Obedient Servant"

A friend of the blog recently told me that I'm meaner in meatspace (what some prefer to call by the bizarre misnomer "real life") than you would guess from my online persona. I'm not proud to have prompted this observation, but I didn't deny it, either. And yet—insofar as one has any reflectively-endorsed non-nice social impulses (to create incentives for good behavior, or perhaps from an ungentle although-sadistic-would-be-far-too-strong-of-a-word æsthetic that appreciates a world in which people don't always get everything they want), it does seem like the correct strategy: in meatspace, you can react to verbal and nonverbal cues in real time and try to smooth things over if you go too far, whereas in the blogosphere, it's possible to die in a harrowing thermonuclear flamewar and not even know until you check your messages the next day. We must use diplomacy where we cannot wield our weapons so precisely.

Quotations IV

MISTY: You know, I usually burn incense when I meditate, but the smell of a burning city can be just as relaxing.
JENNY: People are in danger! Why don't you do something?!
MISTY: They stiffed me.
JENNY: What?
MISTY: Your town. Tremorton. They wouldn't cough up the cash for services rendered.
JENNY: I have no idea what you're talking about.
MISTY: I'm a hero for hire. I save people for money. You knew that.
JENNY: And if they don't pay up, you just let them get pummeled?
MISTY: Pretty much. I have to eat, don't I?
(JENNY flies away, disgusted)
MISTY: I'm not living with my mom, like some people!

My Life as a Teenage Robot, "Mist Opportunities"

A second way of interpreting the effort level eMIN is to consider that the principal and the agent do not have completely conflicting objectives. It is possible that the agent gets some utility from his work, but only up to a certain effort level. We assume that the level that the agent is willing to spontaneously offer is eMIN. The agency problem turns up in this case since the principal would like the agent to offer an effort greater than his spontaneous level.

—Inés Macho-Stadler and J. Davis Pérez-Castrillo, An Introduction to the Economics of Information

Continue reading

Two-Point Compersion

"I don't get it."

"Yeah, I guess the rules are kind of complicated, but—"

"No, I mean, I think understood the literal content of your explanation, but I don't understand how the behavior you describe could arise from the rules as stated. What stops teams from just cooperating with each other?"

"Cooperating? What do you mean?"

"You say advancing the ball to the other side of the field is a touchdown worth six points?"

"Yes, plus a point-after kick or two-point conversion attempt."

"So why don't the teams just take turns scoring touchdowns?"

"What? Why would they do that?"

"To score points. You said that was the objective of the game."

"Oh, ah—I didn't realize I needed to explain this part—the goal is to get more points than the other team. The team with more points is called the winner of the game, and the other team loses."

"So it's a zero-sum game?"

"Well—yes."

"But that's barbaric!"

"That's ... not usually the reason people call football barbaric."

"Lower animals fight over fixed resources, the power to create opportunities lying far beyond their abilities and even their concept-space. But you, living at the dawn of your world's intelligence, you have the rare opportunity to build new worlds—and share the proceeds between you. And you waste your energy on this contrived imitation of a payoff matrix that it is your birthright to supersede! It is revolting."

The Seat Thief's Rationale

What is even the motivation for stealing a bicycle seat? How much can you hock it for?

I think I would forgive it if some poor soul had stood here after glancing around furtively to confirm that the train cops were absent, and computed: "Taking this seat will ruin the evening commute of some rich person, and likely the eight commutes after that, but he (probably he) can take it, whereas I need to sell this seat to get the money to buy the drugs to sell the drugs to get the money to buy the bread to feed my starving family—clearly a Kaldor–Hicks improvement, and after my drug-dealing startup takes off, I'll be sure to spend the occasional Monday evening replacing missing seats at a train station bike rack not unlike this one."

TODO I

    let path = Path::new("/proc/meminfo");
    let proc_meminfo = match File::open(path) {
        Ok(f) => f,
        Err(e) => {
            println!("Error: {:?}", e);
            // TODO: be kinder to our friends still under Cupertino's rule
            moral_panic!("couldn't read /proc/meminfo?! It is possible \
                          that you are struggling with an inferior nonfree \
                          operating system forced on you by your masters in \
                          Cupertino or Redmond");
        }
    };

Missing Words VII

We need a word or phrase to refer to intentionally (and usually only slightly) misquoting something for the sake of a perceived æsthetic improvement in the context in which the quoter wants to use the material. Okay, we do have the word paraphrase, which is close ("To paraphrase the great fooer Bar Quux ..."), but I don't think that's quite it—the Wiktionary definition mentions "often to clarify meaning" and I'm definitely talking more about petty differences in word choice than actually clarifying meaning.

There's this wonderful quote by Eugene Gendlin that I often remember as "People can stand what is true, because they are already doing so," but it turns out that Gendlin's actual phrasing was "for they are already enduring it." If I want to use my slightly different choice of words because I think it flows better in the context in which I'm repeating it, I think that can be legitimate. (Although needless to say, in formal settings, you definitely only want quotation marks around the words someone actually said.)

Or if my hypothetical pop punk band (which would hypothetically be called either "Bullet Candy" or "Zack M. Davis and the Duty-Bound Empiricists") were to cover Taylor Swift's "The Story of Us", I would sing part of this one line in the chorus as "the twist of fate by which it all broke down" rather than the original "the twist of fate when [emphasis mine] it all broke down," not to suggest Swift was wrong to sing when, but rather because that kind of use of the phrase by which is exactly the sort of rhetorical flourish that my hypothetical band would hypothetically be known for.

Voicemail Greeting

(circa 2005)

You've reached the voicemail box of Zack M. Davis
I say that in case this is a wrong number
And you want to know what his name is
But he cannot talk to you right now
No he's got other things to do right now
So he cannot talk to you, leaving you alone
But you can leave a message after the tone

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)
            )