An Algorithmic Lucidity

a blog

Friday Night Lies

"I am a practical man," I said calmly and confidently to no one in particular while sitting down to an easy-mode round of the new tower defense game where the bad ponies are the good ponies and the good ponies are the bad ponies, "I have created no less than X times 276 divided by 365 dollars of economic value this year, and I don't believe in karma, sin, or willpower depletion."

On Schedule

gonna get ready for my d8

my d9

it feels like you should be able to spell date with a numeral, but

no, wait

I think the first one actually works

Pumpkin Spice!

It's September in the first year of my life (that I feel comfortable admitting to), and I feel great—the mounting success or arguably-not-yet-failure of my professional, intellectual, and—other goals is complemented splendidly by a muted but nonetheless genuine appreciation of the subset of nature's cyclic harmonies that I'm capable of perceiving: the air is getting slightly less warm, the sun is setting slightly earlier, and the hacks by which the retailers separate us from our money have changed completely.

In particular, the American coffee hegemon has started offering its "pumpkin spice" medicinals again, and my esteemed colleague Alexander Corwin has been blogging about drinking them despite/because hating them, so as a loyal client of the hegemon (measured by spending habits; the market gods only accept sacrifices of time and money, and don't care what you say or believe), of course I have to accompany him to the hegemon's outpost on fourth street that I go to frequently (typically bringing the personal cup I got at BABSCon, and the barista H. insists on giving me a brohoof every time), but the day before was no good, because Alexander apparently needed his sweetener/caffeine medicinal while I was busy pairing with our CEO on our new lead pipeline and bought his traditional Diet Coke instead.

So this morning, shortly after I arrive in the office, plans are quickly formed for me and Alexander and our esteemed colleague Tim to go to the outpost.

Sep 10 09:18:04 <acorwin>     zackmdavis: PSL?
Sep 10 09:18:39 <zackmdavis>  acorwin, I don't know what that is an initialism for
Sep 10 09:18:43 <zackmdavis>  oh
Sep 10 09:18:46 <acorwin>     zackmdavis: pump--
Sep 10 09:18:49 <zackmdavis>  Pumpkin Spice!

We stroll down Brannan street, chatting about the sorts of things San Francisco software engineers talk about when they're not talking about their work, like the code we've been writing not-for-work. Alexander has been making a dice game for the iPhone but has run into trouble that he doesn't know how to debug; I suggest going to an iOS meetup group and enthusiastically mention that I went to an exciting Clojure meetup the previous night (where Zach Tellman, who has more GitHub stars than me by like two and a half orders of magnitude, gave me some tips on how to improve my 3D 2048 clone).

H. is manning the left register today. When I get to the front of the line, we perform the obligatory fist-bump and I order a grande (the BABScon cup holds sixteen ounces) iced-coffee with pumpkin spice syrup, and a birthday cake pop. H. makes a faux-teasing remark about my wanting the pink one. (I think this, and the matter of my cup and the bumping of fists, is part of an interesting psycho-sociological phenomenon that I've been meaning to blog about sometime.) Alexander orders a Pumpkin Spice Frappuccino and something to eat at the right register, and I think Tim gets a pumpkin spice latte.

We wait and continue to chat. Alexander receives what I think is a blueberry scone but later learn was actually a blueberry yogurt muffin with honey. His Frappuccino arrives (with whipped cream, despite/because of how he doesn't like whipped cream); he tries it and I think says something about it being mercifully less terrible than the standard pumpkin spice drinks on account of being cold. I express regret that I neglected to bring writing materials to record what he said verbatim to quote on my blog. Tim's latte arrives. I'm surprised that my own medicinal is taking so long, and I'm just about to ask when we see it being poured.

During our walk back to the office for another glorious day of building the future of cloud storage (perhaps not as glamorous as cloud computing, but the glory isn't about the glamor), I confess that I had considered offering to pay for my esteemed colleagues' drinks with my ridiculous golden loyalty/payment anti-credit card (you loan money to the American coffee hegemon at zero interest in exchange for a free medicinal every twelfth visit starting with the thirtieth) but didn't do so because it would be socially awkward, and Alexander points out that now it's awkward of me to have mentioned it and he had to pay for his pumpkin spice monstrosity. Next time, I say. Tim points out that gingerbread season isn't far away.

And on this tenth day of the first September of my life (I will cough loudly and unconvincingly if you insist otherwise), I think things are going to be okay (for a while (for me)).

Worth

"I still feel bad about being the worst person at my job."

"You don't mean worst person. People all have an equal intrinsic moral worth that has nothing to do with their economic role in society. You mean something more like, 'perhaps less skilled than some others at some job tasks'."

"No, that's pretty much what I meant by worst person."

Debugging Techniques I

#def my_problematic_function(x):
def my_problematic_function(x, call_count=[]):
    call_count.append(1)
    print("ZMD DEBUG call #{}".format(len(call_count)))
    import traceback; traceback.print_stack()
    result = do_stuff(x)
    etc()

Growl

Dear reader, imagine you have an idea for a work of prose that you want to have finished by Election Day for reasons which will become clear later, and you're not sure how long it should end up being, but you think maybe around twelve thousand words. When considering what you can do to ensure that this feat will actually be accomplished, it occurs to you that you could start writing now. Or

Or you could design a script to make desktop notifications about how much more writing you have to do! (Maybe you could even put it in a cronjob so that it would nag you to write automatically!)

Well, I already made it for you (unless your Linux distribution doesn't use notify-send or you're on a Mac or something).

#!/usr/bin/env python3

import argparse
import subprocess
from datetime import datetime

arg_parser = argparse.ArgumentParser()
arg_parser.add_argument("filename", help="path to file of draft")
arg_parser.add_argument("goal", type=int, help="goal wordcount")
arg_parser.add_argument("deadline", help="deadline in YYYY-MM-DD format")
args = arg_parser.parse_args()

today = datetime.today()
filename = args.filename
goal = args.goal
deadline = datetime.strptime(args.deadline, "%Y-%m-%d")

def nag_message():
    progress = int(subprocess.check_output(["wc", filename, "-w"]).split()[0])
    to_go = goal - progress
    days_remaining = (deadline - today).days
    to_go_per_day = to_go / days_remaining
    proportion = progress / goal
    return "\n".join(
        "{}: {:.2f}".format(k.replace("_", " "), v) for k, v in locals().items()
    )

subprocess.check_output(["notify-send", "writing progress", nag_message()])

My Wordcount Notification

You're welcome. Now get back to work.

Convention

$ lein new 3lg2048
Project names must be valid Clojure symbols.
$ lein new Thirty-Three
Project names containing uppercase letters are not recommended 
and will be rejected by repositories like Clojars and Central. 
If you're truly unable to use a lowercase name, please set the 
LEIN_BREAK_CONVENTION environment variable and try again.
$ LEIN_BREAK_CONVENTION=1
$ lein new Thirty-Three
Project names containing uppercase letters are not recommended 
and will be rejected by repositories like Clojars and Central. 
If you're truly unable to use a lowercase name, please set the 
LEIN_BREAK_CONVENTION environment variable and try again.
$ export LEIN_BREAK_CONVENTION="fuck you"
$ lein new Thirty-Three

Don't Get Your Loyalty Trapped

Opportunity
Comes in the mail
Opportunity
Comes in the mornings and
Opportunity
Shows everyone
The futility of company loyalty
Get it out, get it out, get it out, get it out

Honest dealings doesn't mean you show your feelings
[...]

You said
"He was the phoniest"
I said
"You are erroneous"
You said (hey!)
"He never called you back
Check that you're out for the check (ye-eah)
Don't get your loyalty trapped
Don't get your loyalty trapped"

A Thanksgiving in June

Sitting on the green couch, eating cheese ravioli and sipping an allegedly peach-tea-flavored energy drink, admiring my brand-new wireless router and fresh installation of Xubuntu 14.04, I make a deliberate decision to drop to my knees in a song of praise which says, "God bless America!"—and if some not-yet-forgotten ghost or subroutine of intellectual integrity has me quickly disclaim that God is but a metaphor and America a metonym for concepts much less familar and perhaps slightly sinister, I don't think it makes the prayer any less heartfelt.

Where I Stand

(firmly on one side of the fine and yet distinctly perceptible line between "I've got mine; fuck you" and "I've got mine, and I hope that you get yours, but I'm far too ignorant of the relevant sciences to say which interventions would make this more or less likely")

Lexicographic

"Here's a draft of the new sign-up form."

"... I like it. Only one question: I'm just curious, but why did you put the Female radio button first?"

"Alphabetical order."

Standard Advice

"So? What do you think I should do?"

"Hm. I think you should start with all computable universes weighted by simplicity, disregard the ones inconsistent with your experiences, and maximize expected utility over the rest."

"That's your answer to everything!"

The Emissary Who Will Bring Disunity

It's like everyone thinks they belong
Like everyone thinks they agree
Like everyone thinks they can strike up a cause
With one half of humanity
But I think I can show that they're wrong
Their consensuses all disagree
I'm as spry as can be
I'm the emissary
Who will bring disunity
I will bring disunity

Lower Decks

Another way you can tell that you're the worst person at your job is when you play the "If This Were a Starfleet Operation, What Rank and Division Would Everyone Have?" game and you're not tempted to make anyone else an ensign.

Behind Schedule

gotta wr8

gotta wr9

it feels like you should be able to spell write with a numeral

but I guess

you can't

A Short Story

"Seriously, what kind of asshole writes the phrase conditional on the hypothesis that when the word if would do?"

"Well ..." I said.

Sub Specie Aeternitatis

Contrary to popular belief, it is not the case that all's well that ends well. But it will seem like it, at the end.