An Algorithmic Lucidity

a blog

Thinking About Writing

"I've been thinking about writing a novel."

"I don't understand."

"I said, I've been thinking about writing a novel. What's there not to understand?"

"The phrase thinking about writing. Is that even grammatical? And if so, what could it possibly mean?"

"What? It's perfectly gram—oh, I get it. Fine. No hedging: I am going to write a novel!"

"Sorry, I still don't get it. I know what it means to have written something, or to be at a keyboard writing something. But to be going to write something, in the unobservable future? Even if the concept is coherent—and I'm not sure it is—how could you possibly know?"

Highball

"Now remember: when you're negotiating salary and they press you for a number, do not reveal your BATNA. Give them an unrealistically high estimate and make them negotiate down. Now practice on me."

"Ahem. Well, sir or madam, given my demonstrated expertise and the value I could create for this company, I think a fair starting salary would be ... sixty thousand."

"No, no, no! I said—"

"Per day."

"Uh ... that's a little too—"

"In Bitcoin."

Numbers Between 0 and 1 (Non-exhaustive List)

π/4, the Euler–Mascheroni constant, Chaitin's construction, the fraction of my internal narrative which consists of various rephrasings of I've been a contemptible fool; but, that's decision-theoretically irrelevant

Computing the Powerset

Suppose we want to find the powerset of a given set, that is, the set of all its subsets. How might we go about it? Well, the powerset of the empty set is the set containing the empty set.

$$\mathcal{P}(\emptyset)=\{\emptyset\}$$

And the powerset of the union of a set S with a set containing one element e, is just the union of the powerset of S with the set whose elements are like the members of the powerset of S except that they also contain e.

$$\mathcal{P}(S\cup\{e\})=\mathcal{P}(S)\cup\{t\cup\{e\}\}_{t\in\mathcal{P}(S)}$$

So in Clojure we might say

(require 'clojure.set)

(defn include-element [collection element]
  (map (fn [set] (clojure.set/union set #{element}))
       collection))

(defn powerset [set]
  (if (empty? set)
    #{#{}}
    (let [subproblem (powerset (rest set))]
      (clojure.set/union subproblem
                         (include-element subproblem
                                          (first set))))))

An Unauthorized Use of Ms. Gunnison's Secret Time Machine

Gunni told her not to touch it;
Common sense would say as much in
Plainer words, for these devices
Warrant care if not a license,
Just to view the glowing screen
Of the forbidden time machine.

It's meant for research that's historical,
Not for making oneself an oracle,
Not for giving Voltaire a tease,
Or climbing up Pangaean trees.

But Laura had a burden
In this timeline's normal version,
So she made her own incursion
To years the burden had occurred in.
No one knows just what she did,
Or how the timeline handled it,
Or how things were supposed to go
If Laura had not changed the flow.

And as we gathered in her mansion,
And I checked my gift poem's scansion,
I had to wonder why she will not tell
Why her investments have gone so well,
Or why all her enemies have come down with
Fatal but late-to-manifest genetic diseases,
Like Huntington's chorea.
I dismissed my concerns and raised my drink
To sing: Happy birthday—or so we think.

Conversational Overhead

A woman of wisdom once told me to heed Paul Graham's advice to notice the things you can't say and then don't say them, which stance I'm updating slightly towards, because even when you're only making a perfectly reasonable point along the lines of Policy debates should not appear one-sided; I don't think that your Argument A actually supports Policy X (although I agree that X could be desireable for reasons independent of A) and everyone is charitable and no one bites, there's still a huge amount of emotional overhead incurred just by being in the conversation at all, because even when and you and your interlocutors are honest, you almost never have common knowledge of that honesty, so your interlocutors aren't necessarily sure that you're not just disagreeing with A out of secret enmity towards X, and you're not sure that they're sure that you're not, all of which drama is a drain on mental energy that could otherwise have been allocated to entirely grown-up concerns like JavaScript and money.

Quotations III

I am convinced, from many experiments, I could not study, to any degree of perfection, either mathematics, arithmetic, or algebra, without being a Deist, if not an Atheist.

—John Wesley

Selfishness and altruism are positively correlated within individuals, for the obvious reason.

@InstanceOfClass

There is only one book: the world book. And all books are volumes of this one book. And all pages are pages of this world book. [...] You’re already skimming. You're already skipping over. You’re already not reading all the pages of the book.

—Khatzumoto, "All Reading Is Skimming"

The moral is that it is probably better not to sin at all, but if some kind of sin you must be pursuing,

—"Portrait of the Artist as a Prematurely Old Man" by Odgen Nash

Science may not fucking love you back.

Rachel Haywire

And that after this is accomplished, and the brave new world begins

—"The Gods of the Copybook Headings" by Rudyard Kipling

App Academy Diary, Week Nine

Sunday 17 November 2013— This was the last week of App Academy's regular course content; the next cohort starts Monday and my cohort will begin the three-week "post-course" mostly focused on interview practice, applying for jobs, &c. I got Superscription into a non-embarassing state: I made the feed-fetching happen as a scheduled task, added guest users, introduced the ability to mark entries as having been read, made an attractive click-and-drag category selector, &c. I still want to—at the very least—implement infinite-scroll pagination (fetching all the unread entries from the start can be very slow if there are a lot of them) and rewrite the category selector's terrible, terrible code. On Friday a lot of my class went to the San Francisco Startup Job Fair at noon, and we also had our demo day at the office at three. I think I made an okay showing? But thanks for reading.

You Can't Spell X Without Y

Why is it considered rude to reschedule an event after you've already sent out the invitations? Why do people stubbornly rejecting a compromise tend to do so in a polite and kindly manner? Why did you name your car Rainbow Dash? Speculative answers to these and other questions might be found in the following list of observations.

You can't spell alliteratively without literati.
You can't spell announcement without cement.
You can't spell apprenticeship without entice.
You can't spell chemotherapy without mother.
You can't spell eponymous without pony.
You can't spell compassion without compass.
You can't spell literate without iterate.
You can't spell disappointingly without tingly.
You can't spell disapproving without roving.
You can't spell disconcerting without sconce.
You can't spell discontinuance without nuance.
You can't spell ill-naturedness without redness.
You can't spell illustrative without strati.
You can't spell intransigently without gently.
You can't spell resolute without solute.
You can't spell oversuspicious without versus.
You can't spell precedent without recede.
You can't spell vindictive without indict.

World's Best

"We need some sort of slogan to go on our advertisements. Any ideas?"

"How about 'World's Best Widgets'?"

"Ha—no."

"Too cliché?"

"Not ambitious enough."

"Not ambitious enough?! How so?"

"Think about it! What use is it to have the best widget in today's world, if someone might just invent a better widget tomorrow? And who would be content to have the best widget in our universe, past, present, and future, when still better widgets might have existed if things had gone differently? No! I want all our potential customers to know that we make the best widgets in all possible worlds!"

Cascading Stable Strategies

"What do you think of my website's new look? I designed it with ESS."

"It's hideous! And you mean CSS."

"No, ESS. I used genetic algorithms to 'breed' new designs until the pool of candidates settled down into equilibrium."

"Ah."

App Academy Diary, Week Eight

Tuesday 5 Novembmer 2013— Yesterday was our last pair-programming project; I worked with Ben Watts on a little chat server in Node using WebSockets. I felt like perhaps there was something regrettable about shoving so much functionality into a big callback, but maybe that's just the nature of JavaScript, and not really regrettable at all? On Sunday I started my RSS-aggregator capstone project, now called Superscription.

entity-relationship diagram for the Superscription domain model: User, Category, and Subscription models connecting to UserSubscription and Entry

Thursday 7 Novembmer 2013— I guess Superscription is going okay. Here's how it works. You can sign up and sign in and stuff. (I used Devise for this rather than rolling my own.) There are forms for adding a category or a subscription URL. When you add a URL, stuff happens which depends on stuff. More specifically, if you enter a URL which the system has never seen before, then a new Subscription model (which accepts_nested_attributes_for an associated UserSubscription join model) is created, and it requests the feed from the URL you supplied and tries to parse the XML using Nokogiri. If that doesn't work, it suggests that maybe you got the URL wrong, but if it does work, then it makes a bunch of Entry objects for all the stories in the feed, saves everything, and redirects you to your subscription index page. But if the system has already seen your URL before (presumably from another user with similar reading tastes), then it doesn't wastefully fetch all that data again: it just makes a new UserSubscription that points to you and your Category and the Subscription that it already has. It's efficient! Then when you click the "Read!" button (which is non-hideously positioned thanks to nearly an hour of fighting the CSS), all your news is organized by category under Bootstrap tabs. And on the subscription index page, when you click the little trash can next to a subscription, then it does the cool jQuery fade-out thing and sends an Ajax request telling the server to destroy that UserSubscription.

early Superscription screenshot showing a logged-in user's RSS feed reader with a "Google barge mystery unfurled" story open

Sunday 10 Novembmer 2013— You know, I don't think I'm happy with Superscription's current state. As currently written, it's fetching feeds inside of the request-response cycle, which is just awful on a technical level even if I seem to have gotten away with it so far. I'll want to do some serious rework this week (next week?—I suppose these entries have been following the Monday-indexed convention) so that the fetch happens as a background job (even though that will cost money to host on Heroku, which only offers one free web dyno). And it could do with a lot more JavaScripty features on the frontend, and I need to read the Bootstrap documentation more carefully.

I made some improvements to Wires today. I got logout working, introduced redirection after logging in or out, and added a favicon! Yet I still don't have associations working, due to unforeseen scoping issues.

App Academy Diary, Week Seven

Monday 28 October 2013— The governor of Delaware was supposed to visit us today, but he totally stood us up!—supposedly because of a late airplane or something, if you even believe that. Today's assessment (on elementary JavaScript, binding of this, and the module pattern) was really straightforward, but I found the day's project (in collaboration with Irene Ngyuen) on client-side MVC quite challenging at times; I fear that we were only the second-best IreneZach team today. I'm sleeping over at the office again tonight, which seems like a good thing to do twice a week maybe?—when I stay, I can fit in some quality solo hacking time until sleep or distraction takes me, whereas I am not inclined to do so after a train and bike ride home. Case in point: I got a crude form of authentication working in Wires today! So many feels!

Wednesday 30 October 2013— Our focus this week is Backbone.js, a library for doing client-side stuff. I hadn't been sure what to do for my capstone project, but now (perhaps inspired by remembering how I really ought to use feeds instead of manually navigating to my favorite blogs for all the world as if it were 2003) I'm thinking of making an RSS reader and calling it Event Listener. In the evening, I made a small improvement to the Wires template engine, and I started working on an improvement to how objects inherit from the ORM base class, but it's getting late and I'm not done debugging and I wasn't planning on sleeping over tonight, so rather than pushing egregiously broken code to GitHub, I backed up my work as an online paste of a diff obtained by redirecting git stash show -p.

browser screenshot of a Backbone.js "Paste Project" app, showing a logged-in user's list of saved pastes

Thursday 31 October 2013 (or, very early Friday)— Speaking of online pastes, today I worked with Vincent Park on another make-a-Backbone-app exercise inspired by GitHub's Gist. It simply cannot be doubted that practice, as always, makes perfect. In the evening I bought a new clipboard at the Target inside the Metreon (as my old clipboard had been broken for some time, and the way in which the broken-off piece makes a great coaster had been small consolation indeed), and I hung out and made a few small improvements to Wires. I received a reminder of the importance of catching only specific exceptions—an except: block in my code was silently catching a type error that was the source of a bug, when really all I wanted was an except KeyError:—it was an easy fix this time, but in a larger project one might not be so lucky! Wires's current "template language" (if you can call it that; I'm just replacing identifiers inside "<%=" and "%>" delimiters with substitutions from a supplied dictionary) doesn't support conditionals the way EJS or ERB do, but it would be awfully nice to at least, say, render logged in as this-and-such depending on whether the user is logged in, but I have a cheap workaround in mind.

Levels

Specific is terrific,
But meta is betta.

App Academy Diary, Week Six

Tuesday 22 October 2013— I slept at the office last night for want of transportation, and ended up making some solid initial progress on a little Python web framework inspired by last week's class exercise, which I am also calling Wires. (Working on it in spare moments today alerted me to a disturbing deficit in my mental model of Python imports; you wouldn't expect organizing code into different directories to be difficult.) Yesterday I worked with Ryan Newton and today with Daphne Johnson on some JavaScript exercises.

Thursday 24 October 2013 (well, 0106 Friday)— Yesterday ("yesterday") I worked with Tommy Nast on a crude Asteroids clone using HTML canvas, and today ("today") I worked with Irene Zhou on a towers of Hanoi UI and started a Snake game using jQuery and DOM manipulation. I'm sleeping over at the office tonight, having spent the evening working on Wires.

Missing Words IV

You hear people accusing their enemies of being morally or intellectually bankrupt, and they mean it in the sense of "destitute of, or wholly lacking (something)", rather than the sense of financial insolvency. But I actually would like to see the insolvency metaphor: people should speak of declaring intellectual bankruptcy to mean "I was wrong before; I won't try to defend my previous claims because I can't" (in analogy to "I won't try to pay my debts, because I can't").

App Academy Diary, Week Five

"Getting Down to Business" song page in "Starlight Music" app, showing lyrics from Jem and the Holograms and two user notes

Monday 14 October 2013— I'll confess that I didn't have a productive weekend at all. No excuses; I just got distracted. You could argue (I won't, but you can) that it's perfectly healthy and fine to take some well-earned relaxation on one's days off, but even relaxation is something that can be done better or worse: hours of the latest ephemeral internet amusements are probably much less rejuvenating than hours of ... I don't know, some sort of activity that doesn't involve sitting in front of a monitor?—I presume such things still exist even if I can't remember them anymore.

Still no deal in the BART contract talks; I took an evening train and slept at the office last night because we didn't know whether there would be trains in the morning. As it turns out, there were, but there likely won't be tomorrow. A moment of amusement is provided by imagining what kind of vicious and histrionic things a frustrated commuter might say if they were angry ("Curse the unions! Curse anyone who won't curse the unions! Curse anyone who won't put a light in their window and sit up all night cursing the unions! Let management fire them and hire scabs! Let hackers insert their names into the public sex-offender registry!" &c.), but in truth, I ain't even mad. (This is in accordance with policy; even if we were to suppose that I somehow knew how the labor dispute should ("should") be resolved, it would still be a waste of cognition to think about it unless we were also to suppose that people care what I think—and that's ridiculous.)

Today we did solo work on an application to keep track of musical artists and their associated albums and tracks, in the process gaining some more practice with authentication and learning about ActionMailer.

Tomorrow there's an assessment scheduled, and I really ought to have taken the time on the weekend to go through the posted practice-assessment, because I looked at it this evening, and somehow getting the specs to pass is much more difficult than I would have imagined. I may have a slight attitude problem: I tend to hold the entire idea of "studying for a test" in contempt (for surely we should study exactly the things that are worth knowing, tests merely being a instrumentally useful device for measuring what we have retained), but this is probably an error of modeling myself as having more agency than I actually have. All principles and rhetoric aside, we can predict that if I had studied for the test last week, then I wouldn't have forgotten the HAVING clause, but I didn't, so I did.

And that's terrible.

Friend Cricle webpage for a Friend Circle called "People I Tolerate" containing two friends

Tuesday 15 October 2013— I got all the specs to pass on the assessment with time to spare. Today's designated project was Friend Circle (!), a Google+ish thing where users can put other users in circles and share posts with them. I was scheduled to pair with Jeff Rosen, but apparently he was ill, and so I worked alone after lunch. The instructions described a somewhat ambitious project; I only got as far as letting users create circles and will have to catch up later. Associations are actually really powerful! Still no BART settlement ... and no strike, either; I decided to come home tonight, the allure of a shower and bed and privacy outweighing the travel uncertainty. Tomorrow we're going to make a very simple clone of some of the functionality of Rails itself (following up on our earlier very simple clone of some of the functionality of ActiveRecord). I guess I'll call it ... Ruby on Wires?

Thursday 17 October 2013— Writing Ruby on Wires yesterday (albeit building off the supplied skeleton) was really fun; I hooked it up to SedentaryRecord and started a blog engine ("blog engine"—well, okay, so you fill out a form and it adds your content to a page) that actually works, without Rails! Today I worked with Ben Hass again on a Reddit-like thing with RSpec tests (and FactoryGirl and Faker to construct test objects). Near the end, under Ben's leadership, we used JavaScript and jQuery to get comment forms to appear on the page in response to a user clicking "Reply", but didn't have time to actually get the comment submission to work. The trains are really going away tomorrow; perhaps I'll be able to join an ad hoc carpool at the station?

Sunday 20 October 2013— On Friday I got to the city in one the buses chartered by BART management. A television reporter asked me what I thought of the strike. I said that I didn't have anything interesting to say. She asked if I supported the strike. No, I said, then added that I think it's a waste of cognition to have opinions about things you don't have any control over.

I doubt that they used that clip.

Friday's focus was integration testing; I paired with the other Zach (Westlake). Things mostly went pretty well, but there was a frustrating period near the end of the day when we were reduced to fighting our own test framework.

Serenity

"I shall seek the serenity to accept the things I cannot change, the courage to change the things I can, and the wisdom to know the difference."

"I shall seek? What's wrong with the original God grant me?"

"What God sees fit to grant me is one of the things I can't change."