Dear reader, if you're like me—and if you're not, why are you reading this stupid blog about random shit that no one who's anyone could possibly care about?—close the tab and go do something worthwhile instead. No, I mean it. I'll wait ...
Proper Outlook
Contempt for the past is a healthier emotion than fear for the future.
Twilight Sparkle Is a Disaster Waiting to Happen
I swear to Celestia, one of these days that mare is going to get somepony killed or worse. I almost suspect it's already happened and Hasbro is just sitting on the footage.
Seriously. Levitation or teleporting is fine, but you do not buck around with mind control or transformation spells unless you are absolutely sure that nothing will go wrong and that you can fix it when it does anyway. You'd think she'd learn after, I don't know, accidentally brainwashing pests into destroying the town, or unleashing a transmissible-by-sight plague of madness that wasn't stopped until Princess Celestia herself intervened, or accidentally swapping parts of her friends' souls, or accidentally transforming her friend into a horrible bat-pony abomination, or transforming herself and her friends into tiny vaguely-insectoid creatures and venturing through a closing portal to another world and only barely making it back in time.
Even plot armor isn't infinitely thick. Someday it's going to break, and I don't want to be watching when it happens.
Motivation
The blog has been silent for two weeks plus and, dear reader—that is, if there are any of you still remaining—dear reader, the thought occurs to me that maybe I should keep my drafts in a Git repository with a remote on GitHub, not because I need the full power of version control (I do not), but because then I would be rewarded for writing with those contemptible green contribution squares.
It's an anthropomorphism to think that humans have goals, that we do things because we've computed that they'll increase expected beauty or rightness in the world. We do things for the immediate reinforcement. You eat the candy because it tastes good and you show up to work on time because if you didn't, then your colleagues would notice. Serious long-term risks of diabetes or unemployment are too distant and too abstract to enter in the equation; far more effective is something immediately noticeable, even something as trivial as an integer being incremented or a square turning a darker shade of green. I tell myself that I code because it's fun and useful and lucrative (though I'm never explicit about whether that's descending or ascending order of importance), but would I be quite so diligent without the implicit gamification of my virtue? Would it be enough to have done good work, without wasting a few minutes here and there to gaze admiringly at commit diffs and contribution squares which manifest my moral worth in red and green and green?
Dear reader, I want you to picture yourself reclining at the end of a long day near the end of long career filled with great or terrible deeds. A young minion at the start of their own career will look at you and ask in awe, "O Master, what motivated you, all that time? What drove you on in your hour of deepest exhaustion? Was the it money, the fame, the men or women? Was it your ideological fervor or spirit of generosity?"
"No," you'll reply. "I did it for the green squares. And given the same circumstanstances ... I'd do it all again."
"You mean, you made the right choices? You have no regrets?"
"No, you fool!" you'll shout. "Don't you understand? I said, I'd do it again."
An Education News Bulletin
Apparently a gang of extortionists calling themselves the "California state Bureau for Private Postsecondary Education" are threatening to shut down a number of organizations that provide assistance in learning to program, including App Academy, which I recently benefitted from attending. I could explain why the behavior of the BPPE is an outrage that must be opposed by anyone with a scrap of decency in their heart, but I'm too busy coding and counting my money.
House Style
it's kind of strange that I think the internet is all-lowercase, when I'm so eager to slap Portentous (Pretentious?) Captial Letters on Fuck Near Everything Else
The Chocolate Caramel Sea-Salt Betrayal
"Our civilization," said the engineer, "is decadent." This after visiting the Ghirardelli shop on Market and Montgomery, frowning and, for the first time in his life, doubting very much whether ice-cream was a force for good in the world.
Cute
"... so, what do you think?"
"It was cute, in a meta sort of way."
"Thanks. But there's something a little sad about resorting to meta cuteness so often, like I'm an n-trick pony for undisclosed but probably quite small n."
"Well, you're very good at meta cuteness."
"There is that."
Consistent Hashing
Dear reader, suppose you're a distibuted data storage system. Your soul (although some pedants would insist on the word program) is dispersed across a cluster of several networked computers. From time to time, your human patrons give you files, and your job—more than that, the very purpose of your existence—is to store these files for safekeeping and later retrieval.
The humans who originally crafted your soul chose a simple algorithm as the means by which you decide which file goes on which of the many storage devices that live in the computers you inhabit: you find the MD5 hash of the filename, take its residue modulo n where n is the number of devices you have—let's call the result i—and you put the file on the (zero-indexed) ith device. So when you had sixteen devices and the humans wanted you to store twilight.pdf
, you computed md5("twilight.pdf") = 429eb07bb8a3871c431fe03694105883
, saw that the lowest nibble was 3
, and put the file on your 3rd device (most humans would say the fourth device, counting from one).
It's not a bad system, you tell yourself (some sort of pride or loyalty preventing you from disparaging your creators' efforts, even to yourself). At least it keeps the data spread out evenly. (A shudder goes down your internal buses as you contemplate what disasters might have happened if your creators had been even more naive and, say, had you put files with names starting with A through D on the first device, &c. What would have happened that time when your patrons decided they wanted to store beat00001.mp3
through beat18691.mp3
?)
2013 Year in Reverse
Dear reader, as another year comes to a close, it is perhaps wise that we should take a few moments to reflect on what we learned here at An Algorithmic Lucidity in 2013—the year that was!
In the year 2013, this blog saw 103 posts and (at press time) 40 comments. Among these—
We heard a poem about why you should hire me. We surveyed a few numbers between 0 and 1. (Friend of the blog Grognor told me that the funniest part was the explicit disclaimer that the list was non-exhaustive. I replied that not everyone knows about the diagonalization argument—but considering this blog's, um, selective audience, maybe my readers do—all five of you!) We mentioned some hidden costs of talking about stuff. We noted that some words have substrings which are other words. I wrote a series about my experiences studying web development at App Academy (9 8 7 6 5 4 3 2 1). I pasted my first attempt at an OKCupid profile. We observed that I'm a moron. Books arrived in the post. We mused on the nature of personhood and implemented some classic algorithms: the Ford-Fulkerson technique somewhat clumsily in Ruby, quicksort in the form of a letter to a fictional horse, and Huffman coding in Python. We lamented the nature of existence, noticed the non-observance of an unusual tradition, and heard a poem about watching a motion picture by someone you met at university. Three problems with unsolicited advice were discussed, as was the role of bases in the theory of vector spaces, and the subjective indistinguishability of propaganda and other forms of instruction.
Genre
"I didn't intend for my blog to become a compendium of very short dialogues! It's just—it's just—"
"They're easier to write than anything else?"
"—they're easier to write than anything else."
Classification
"So, what do you think it—"
"It's a Turing machine."
"You didn't even look at it!"
"I don't need to!"
"&c."
Is it wrong that I feel more positively disposed towards Etsy after figuring out where it must have (must have) gotten its name?
Fortune
"They're going to pay you X dollars a year? But that's fantastic! You're rich!"
"I don't like the way you say that. You make it sound as if I had won the lottery."
"Lottery, new job, what's the difference? Good fortune should be celebrated."
"Not like that. If they're going to pay me X dollars a year, that means I have one year to create X dollars of economic value. It's a serious responsibility."
Cover Letter
Beset by nights of torment,
Bent to keep your site performant,
Beneath the moon aloft there then appear
Beautied forms so gallant who
Beseech the gods of Talent to
Bequeath a junior software engineer!
You need someone specific,
One computer-scientific,
Who can complete the team at [Company Name],
Whose reputation takes repose
In repos replete with code which shows
[They put the other candidates to shame].
From graph theory to jQuery,
And matters in between,
My code Pythonic, words unironic,
I greet you through this screen
And ask, if just to highlight it,
If you've positions I might fit,
With pretense shed entirely.
I then said, "Hire me."
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.
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.
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.