More Paul

less lame!

Good Ole 14/14

My buddy Warren and I had a Twitter conversation about learning Zerg in the lower levels of Starcraft 2, and asked what a good beginner build would be for a low-level player trying to get the basics.

Luckily, such a build exists! The “14/14” is a single build you can use in any matchup that leaves you (relatively) safe from cheese and (relatively) set for a decent economy. It’s a very old build that’s been around since the release, and I got to Diamond using only this for my ZvZ’s.

Liquipedia has a decent entry on it, but here’s the basics:

  • 9 Overlord
  • 14 extractor
  • 14 spawning pool
  • 15 overlord - stop droning.
  • @ extractor complete, put 3 drones in.
  • @ spawning pool complete:
    • Queen
    • Metabolic Boost
    • 1 pair zerglings, resume droning.
    • Remove 2 of the drones out of gas, back on minerals.
  • 20 Hatchery @ natural expansion.

Some further notes on this build, and the silly shit you can expect from lower-league players (since they loooooooove their gambits and cheeses):

  • ZvZ: This build is best for ZvZ, since the spawning pool comes barely in time to stop a 7 or 9 pool. You will have to micro your drones, and it’s not a guarantee. If hit by a rush like this, drop a spine as soon as possible, make lings of your own if you have the larva, and maybe get a queen if you can afford it and feel like you might have 25-30 seconds of security.

    If your opponent is hatch-first, you will have speed before him/her, so try to attack early with lots of speedlings. Put 2 drones back on gas, get a baneling nest when you hit 50 gas, make banes as soon as it finishes, and get called a noob for “all-inning”.

  • ZvT: While 15 hatching is preferable, you’ll often get proxy raxed. This is much easier to defend with the 14/14 build, which gives you lings + queen. When your 15 overlord pops, place it where the natural expansion goes to spot, for bunkers, since they’ll occasionally try to build bunkers there (in that case, send 2-3 drones and kill the worker). A building hatchery has almost zero vision.

    Annoying things you’ll see in lower leagues: banshee rushes, stim pushes, and mech turtles. For Terran, you’ll want to put down an evolution chamber and baneling nest soon after your second hatch, and start collecting gas. The evolution chamber lets you upgrade your lings and banes, and lets you build spore crawlers for banshees. When in doubt, just build a shitton of lings and banes.

    For mech turtles (where they sit on two base and don’t leave until they have a million thors and tanks)… these are the most annoying at the lower levels, but where you’ll get your best macro game practice. Take the map, tech up to Hive, get upgrades. You’ll need to abuse mobility and keep them from expanding and later engage with a Zerg deathball of Broodlords, Corruptors, and Infestors.

  • ZvP: Protoss are a pain in the ass. Make sure you take a drone and make an early ring around your base to look for the cannon rush, around 10 or 12 supply. If you see one, don’t panic, build a spine crawler or two as soon as you can, and that prevents them from building any closer to you. Use a queen to pick of the probe if you can. If you get trapped in your base, tech to Lair, build roaches float an overlord to their base, and drop a Nydus Worm. Most cannon rushers who don’t know what to do have nothing at home, and poor macro.

    You’ll also get DT rushed a lot, especially from players who fail their cannon rushes. When in doubt, build an evolution chamber, and make a spore crawler in your base. Also good against mass void rays, which is less popular these days but still around (infestors do well against them, as do hydras). Float an overlord past their base and look for Stargates.


This is a lot of information to take in, and there’s a ton more I can say, but above all: don’t panic, try to relax, and understand that the only way to really learn to play is to play, and stumble a fuckton. Nowadays I can look at a Protoss composition and see how many roaches I have, I can make a reasonable guess as to whether or not I can take them. But that certainly wasn’t always the case: I had to lose many, many armies before I could eyeball it decently. I’ve also been supply blocked tens of thousands of times.

Focus on one thing (supply blocking, larva injects, larva utilization…) and focus on improving that one element, one game at a time. Regardless of what the score screen says, if you were mindful of that element, consider it a win and have a beer.

My favorite motivational quote (God… I can’t believe I can say this) came from a local swim coach in Washington DC named Jim Williams, who said

“If you want to swim fast, you have to swim fast.”

Which I use for anything I want to get good at. If I want to be someone who writes good programs, I have to be someone who writes good programs; I’d better start programming, and stop reading blog posts, or mailing lists, or watching streams. It’s like all the people who want to be great writers, but haven’t, you know… actually written anything yet.

Similarly, if you want to get good at Starcraft, the biggest (and most difficult!) obstacle is just getting the nerve to play, especially when you think you’re terrible and hopeless (which in my case, is more often than I’d like).

Stream Ads

Originally written on December 18, Newtown hit me very hard, then I got wrapped up in holidays. Actual publish date is January 4.

tl;dr I still believe all this but feel people who watch game streams with ad block are acting supremely entitled because there are workarounds, and compared to “theft” of mass media the inconveniences are fewer, and the producers are more cheated.


I got into a Twitter disagreement with a good friend, Jake Eakle, mostly over this tweet of mine:

Considered working in eSports when I decided to change jobs, but goddamn can eSports fans be entitled asscactuses reddit.com/r/starcraft/co…

— Paul Meier (@SrPablo) December 14, 2012

To which he responded:

@srpablo I thought the top comments raised valid points about problems with twitch ads. I have to refresh streams too often to leave AB off.

— Jake Eakle (@jseakle) December 14, 2012

And I:

@jseakle I don’t disagree with the points, or that it’s a teensy bit annoying. But they cry bloody murder over it, and it’s many … (1/3)

— Paul Meier (@SrPablo) December 14, 2012

@jseakle streamers’ livelihood. Many act cheated that this service that of continuous free content isn’t just perfect for a few … (2/3)

— Paul Meier (@SrPablo) December 14, 2012

@jseakle minutes/hr of content, so cheat providers. Dunno, growing up with TV, I find it hard to agree with conclusion/tone. (3/3)

— Paul Meier (@SrPablo) December 14, 2012

And he:

@srpablo It’s a similar issue to content piracy. You can rail against the entitled selfish thieves trying to (cont) tl.gd/kbl9bn

— Jake Eakle (@jseakle) December 14, 2012

(I’m not putting this on twitlonger, because I prefer the data in my own space).

So I promised a rebuttal in a similar long-form vein as the Twitlonger post:

@jseakle Agree almost entirely, have for years, see similarities in morepaul.com/2010/08/making… insufficient in this case, at this scale, imo

— Paul Meier (@SrPablo) December 14, 2012

@jseakle might update blog for longer argument, but short: ads work as model, $5/mo subscription option removes, diffs with general piracy

— Paul Meier (@SrPablo) December 14, 2012

and here it is!

Summary, and a brief aside.

First, I still agree with all this. No use arguing right vs. wrong on these questions, prefer working over non-working, and in the case of mass media assets like pop music, Hollywood movies, and royalties for scripts, the current system is not working.

Note that this doesn’t mean I would pirate or endorse pirating: my opinions in the previous post were concering a proper attitude as a producer trying to make a living, not the morality or a judgement on the person obtaining the assets. I didn’t state my opinion of that person or their actions.

Here’s where the two posts differ: in the tweet that set it all off, I was stating my opinion, at least as in concerns game streams, and more clearly so we don’t miss it: given the state of media, if you’re running an ad blocker during a stream, you’re being entitled (in my opinion, unjustly) to free entertainment and the labor of artists. And, well, I think it’s a dick move, so I don’t do it, and hope you don’t either.

That said, here’s why it’s a more complicated situation for me than the standard case of mass media, where I’m much more forgiving.

This system works for artists, actually.

In the last post, I hinted at the fact that the last system didn’t only provide inferior service for consumers, but cheated artists as well:

A fringe benefit of this is that you no longer have to deal with middlemen taking big cuts, and stealing. Hollywood accounting means that you could still, technically, lose money on the Lord of the Rings Trilogy (Peter Jackson and the estate of JRR Tolkien had to sue to get any royalties from the movies). It’s how TLC could sell 10 million CD’s and still go bankrupt. The bad old days were bad for artists too. So leverage the technology, and work for yourself.

See the Wikipedia page for Hollywood Accounting

In game streaming, these “highway roberry” practices by middlemen are much harder to perform than in traditional entertainment spheres. So when Warner Bros. or Sony Music tell me that I’m stealing from Rihanna, I know they’ve got her and every other one of their artists on a short leash, and I’m actually stealing from Hollywood fatcats who give them fractions of a penny of my $20 CD or DVD purchase.

(note: the not-incorrect theory is, those “fatcats” actually need to be there for the work to get made at all, and deserve their share of the money too. Sure, okay. Certainly the creation of art isn’t enough on it’s own, and there’s a whole industry around packaging, marketing, distribution, and the like. I’ll expose my bias for content creators here: I can’t prove that a system where they get more of the money for their work is “better” since creation is only part of the process, so I’ll just state I have an emotional preference for rewarding content creators, at least more than the current system does).

Given this, I feel a fair bit worse running AdBlock while watching Grubby’s stream because it means mah boi Manuel is losing more money for entertaining me (for FREE mind you… but that’s later) then I would be depriving Kanye were I to downloaded his entire life’s work, proportionally speaking.

(SECOND note: this doesn’t mean Twitch.tv or Owned3D don’t take a cut here. They’re the fatcats. But that cut is substantially less, since a) they are in in direct competition with each other (and tomorrow’s startup) in a low barrier-to-entry market, and therefore can’t collude as effectively (“it’s just how it’s done” can’t be pulled off), and b) they’re calculating artist compensation by automated processes based on precise measurements like ad impressions. Hollywood accounting is possible when you can make a few “big scores”, for which you need a legal team to create a confusing contract based on fungible definitions, and an accounting team to enforce it… Basically, yes, they take money, but they’re playing a game that only works when they create a system where it is much harder to screw you).

[UPDATE (2012-01-17): So as soon as I say this, Owned3D comes to light as being an asshole. So you can still screw artists over. Hopefully the market corrects this, and they either change their behavior or people move to Twitch/YouTube/UStream/LiveStream, or Owned cleans up their act. But if not and this continues, well, this overall point of “better for the artists” becomes less valid.]

So while I don’t do it, I don’t feel that “stealing” from the big labels in traditional media is the same as stealing from the artist, but in game streams, it’s much, much closer; close enough to give me pause. That said, if you’re still so annoyed by the ads…

Put your money where your mouth is and subscribe.

If you click the link to Grubby’s stream above, you’ll notice a Subscribe button for $4.99. This means you watch that stream ad-free for a month, and give the streamer a bigger payout per-user than they get via ad impressions. So if you really wanted to watch ad-free and weren’t afraid of participating in capitalism (where both the producer and consumer benefit from a transaction) why is this option never mentioned in the comments to threads on AdBlock?

A big reason I don’t own a TV or subscribe for cable is because I watch streams regularly enough that I wouldn’t use it. If a basic cable subscription costs $60 (that’s conservative, from what I hear/remember) you can support 12 streamers for that cost and watch 12 streams without ads, ever (cable subscriptions often cost more, especially with HBO, sports packages, &etc.)

I have no data for the premise that few people subscribe, for all I know it’s a very popular feature and tens/hundreds of thousands of users do it. I’m skeptical though, because it virtually never gets mentioned in any threads about AdBlock, and all the people who know AdBlock is costing TeamLiquid 50-60% of their ad revenue never mention or seem to care that all their grievances for watching ads could be remedied with the cost of a fancy drink at Starbucks.

I know not everyone is a software developer like me who can afford the cost of of a cable subscription, but if you still choose to just block the ads, also remember…

It’s a growing industry.

Not to become the “STOP KILLING ESPORTS” kid, but… if you like eSports, why are you engaging in a practice that actively hurts its business prospects? It’s a brand new form of mass entertainment, still on pretty shaky ground, and this bubble could still pop. Just ask Jason Lake or Alex Garfield or Marcus Graham, because they lived and invested in a world of $500,000 Counter-Strike tournaments, only to watch the whole thing pop around them.

(Here’s a great interview with Jason Lake, where he mentions “the old guard” of eSports. Included because, again, the scene has gotten this big before, and collapsed hard. You could similarly ask Koreans how MBC Game is doing…)

I think voting with your wallet is mad effective, and when someone creates a good or service that I like, I see no issues with purchasing that good or service if the price is reasonable. And while I was pretty happy before video game streaming was a thing, but I’m much happier with it. So I think you should turn off the AdBlocker if you think the price is reasonable. What was that price again? Oh right, it’s

30 fucking seconds.

Like I said before, this post is less logical than the “works vs. doesn’t” post from before, and more opinion as to “why it’s entitled.” I’ve tried to make a persuasive case as to why this has different feels from the traditional media piracy argument: namely, this hurts the artist more directly, we have an opt-out that still supports artists, and the artists we’re punishing happen to be pushing the frontiers and forgoing more stable livelihoods for something that doesn’t have to exist, entirely for my entertainment. But here’s where it gets the most opinion-ey, and where it motivates me to call most of those people from the thread whiners and asscactuses:

It’s minutes of ads for hours of entertainment, for no money at all.

Nowhere else do you get this value proposition: you can pay out the ass to for a movie to be entertained for two hours (with non-blockable ads at the start) that barely support artists onscreen; you pay for a cable subscription to have the privilege to watch a sitcom episode with 23 minutes of content and 7 minutes of commercials.

Or you can watch a minute or two of ads for every 30-40 minutes of game? Is it really that painful? You’re getting this for free, and it’s available all the time.

I agree it can be annoying as hell sometimes: I scream at my monitor when it doesn’t work (sound on ads never works as it should, pre-roll means you can miss something interesting, repetitive ads, glitches mean the ad never runs but the screen blocker does… oh I could go on), but really, you’ll just stop supporting an industry and its risk-taking content creators whose growth has contributed to some of the best entertainment you’ve had in your 20-odd years because you can’t stand a minute of pre-roll ads?

There’s a word for that: entitlement.

While not specific to Jake’s Twitlonger post (he never mentions TeamLiquid or PPV) it’s especially baffling on a site like TeamLiquid, where it’s mostly banner ads that are getting blocked, and triply baffling when you remember the bloody murder that Starcraft fans cried when MLG went for a pay-per-view model, and started charging for HQ streams in 2011. If ads are blocked, where do they think the money will come from?

Ultimately, I won’t argue over the use cases (pre-roll meaning you can miss something crucial, bad sound, etc.) because I wholly agree with them being aggravating. I just don’t see how you can miss the greater context enough to think it’s worth blocking ads.

Specific responses to weak sauce from the Twitlonger

Just picking at some straggling lines, things that made me “wat” a little:

“Sure, I don’t *have* to be able to do that. But since I can for free, I’m going to.”

If we didn’t have an effective police force, I very well could assault, thieve, and pillage from you because there’d be no governing law to stop me.

And I agree with you! It would be more effective for people to form a police force than to simply tell me to stop.

It doesn’t make me less of a dick, or not entitled, since I’ve still taken people’s shit and they had no say in it. While the stakes are lower, it remains an unpersuasive argument – it’s like people saying if one doesn’t believe in God, why would anybody be good if there’s no Hell and Judgement to fear?

Because we want to be good -_-

“And since I’m going to, it just makes sense for twitch to build their ad model such that I can keep giving them money while I do it.”

Agreed, as per above re: police force. But know if Twitch/Owned and the scene as a whole continues, it’ll be despite your consumption of the product, not because of it, and that just seems twisted to me, especially since we like the work they do.

I’ll bet nobody wants the sound on their ads to work as much as they do, but the fact that they haven’t fixed it yet suggests there might be more to the problem than appears at first blush (software is like that, natch).

Finally, it’s questionable whether “I don’t like your price/model, but I like your good, so I’ll take it by my terms because I can get away with it in this case” is really ethical in the general case.

“This really isn’t a defense of my actions.”

I find it very odd that when I ask why you do this, you provide a not-defense of your actions. But I think it signals something else, which I’ll get to next…

“feel free to think I’m a freeloader and hate me for it.”

Oh, I definitely think you’re being a freeloader.

Here’s the thing: I think you know it, too, as per the “not defense” quote. But like extremely wealthy people who refuse to pay taxes, you’ve created a mental model of the world that makes your choices of convenience also Ethically Sound. But when asked to defend that model, most of what comes out are simplifications, or non-defenses.

IMPORTANT NOTE: I absolutely don’t hate you for it. I have tons of disagreements with my friends over issues with much higher stakes (like the eternal fate of my soul, for instance), but don’t hate them as people as a result.

“I don’t even really disagree.”

Then why do you do what you do?

“I just think that time is better spent working out mutually beneficial solutions.”

Why not both? The people at Twitch/Owned know (and care a lot more than you do, believe me) that they can get much more viewership and revenue from their existing viewership if they come up with a model that isn’t as annoying.


Sorry for the delay, Newtown and holidays hit me hard. Thanks for engaging me ^_^

Shootings

Note: I originally wrote this on December 14, the day of the Newtown shootings, but didn’t publish it because I needed some time to cool off, and let this sit. Here it is, unedited, in all its rage-ey glory, actually published January 4th.

Today, in light of the news, I’ve been feeling pretty much this. Seriously, fuck everything.

But part of what made the whole thing so maddening was the same stupid-shit things people were saying in response to suggestions of gun control in light of this, one of so many mass shootings we get here.

Here are some pretty basic concepts people need to get into their skulls about gun control and these shootings. First, stop saying the following:

  • “It’s not about guns, it’s about people.” Shut the fuck up already. Nobody promoting a discussion on gun control reform is absolving “people,” whatever that means. We know evil, violent, and unstable people exist in the world (they always have, and they exist even in places without so many mass shootings!). Everybody I’ve spoken who supports more restrictive gun control would be thrilled if we had a more robust, available system for people with violent tendencies, and is more than ready to have that discussion too.

    Nobody at any point suggested otherwise, to use this and related phrases at this point is just a way to deflect a conversation you don’t want or are afraid of having.

    To quote someone else:

    “Guns don’t kill people - people do. By the same token, planes don’t kill people - people flying them into buildings do. And yet, I recall that we immediately and decisively worked to keep deranged people from gaining possession of planes when a handful of those people used them as tools of mass murder; indeed, we made it much more difficult for the overwhelming majority of peaceful, law-abiding citizens to board a plane.”

Also:

  • “Don’t politicize a tragedy.” Again, spare me. By silencing a challenge to the status quo, you are politicizing it. Don’t tell me when a military-grade assault rifle used to gun down 20 kindergardeners, that the “assault rifle” part is off-limits.

yeah, this is reasonable

  • “The solution is more guns/the victims could have protected themselves with guns.” Jesus, NO. In 61 mass killings, none of them were stopped by civilians with guns. Do you really suggest students at Virginia Tech (and by extension, every school in the country) should always bring a gun to every class they attend for the very remote chance someone will barge in and fire? That Gabby Giffords (and by extension, all elected officials or people who attend their events) should keep their hands at her holster at every appearance, and always be vigilant? Kindergardeners? Kindergarden teachers?

    Even if everyone carried concealed weapons and we were all properly trained and the resulting accidents from having everyone carrying so many guns so much of the time was magically miniscule (there were 23,237 accidental firearm injuries in 2000, imagine if every student, teacher and moviegoer had guns instead of the few that currently do), the shooters still have the advantage because they know the attack is coming. They can put on flak armor, they can wear masks.

    For fuck’s sake.

Again, nobody is denying that mental state is a factor, nobody is saying a discussion on gun control should exclude or ignore more comprehensive mental health programs.

Now that that’s been mentioned, let’s look at some facts:

And because we’re not the only country in the world, let’s see how others do it:

  • German police fired 85 bullets total in 2011. That’s all of Germany’s police, for the entire country, for an entire year. Meanwhile, the article reports that we fired 84 at a murder suspect in Harlem, and about 90 at a fleeing unarmed guy in LA.
  • In Japan, to own any firearm (including air rifles), you have to take a day-long class, pass a written test, pass a shooting range class, get a mental test, a drug test, and a background check. In 2008, when the US had around 12,000 firearm-related homicides, Japan had 11 (from the article).
  • Australia’s right-wing prime minister passed exhaustive gun control for semiautomatic and automatic rifles, and shotguns. Firearm homicide went down 60%, firearm suicide down by 65%.

Again, none of these facts can demonstrate a causal link or prove anything, and as mentioned previously, there’s a lot more to this problem then guns (and these examples, too – e.g., Japan has fewer people than we do. Not 1000x fewer, but fewer). That said, not everyone has theses problems at the scale we do (I was pointed to this article of a mass stabbing in China by someone to show other countries have violent people too. As stated previously, that’s not the issue, and never argued against. Nobody died in that attack, guns exacerbate/amplify the lethality the violent people can inflict.)

At the very least, USA: quit acting like even asking the question of whether or not guns have anything to do with this is some kind of irrational, freedom-hating response.

I’ll end with a bit of an anecdote that came to mind after this tweet, with a similar message to this Onion article:

Recall the Twilight Zone story Button, Button. Summarized: a couple is given a box with a button in it from a stranger. If they press the button, they will be given $200,000, no questions asked, though someone they’ve never met will die. After days of excruciating debate, they press the button. A man shows up, gives them $200,000, and takes back the box. On the way out he says “time to give this to the next person… don’t worry, it’s someone you’ve never met.”

Gabby Giffords isn’t an abstraction, a symbol. She’s a person, with a family, with hopes and dreams. The victims in Colorado weren’t abstractions; they were people out to see a movie. The 20 kindergardeners shot today weren’t abstractions.

When you consider the question of whether or not it should be legal to own 10 assault rifles without ever getting background check or psychologically evaluated, I suggest you really ask yourself how you’d feel about such a right if it was your child, brother, sister, or parent. Because for 27 families today, that’s what happened.

(An interactive map on mass shootings in America.)

To go back full circle:

  • You’d have to be deluded (at best, more likely stupid and/or ignorant) to get offended at the notion that discussion of gun control reform may be in the best interest of the citizenry.
  • Let’s also fucking get some decent mental (hell, general) health resources in this country.
  • Fuck everything.

Loving Yourself With EBOOKS

While I’m still ramping up at the new gig, I’ve found a love of code again and recently launched new side project. I may still work on it yet, but chances are I’ll leave it be for a bit while I pursue other interests (hey, it works well as is and I’m not shipping it :-p).

It’s called Ebooker, and if you’d like to have a look at the source, fire me an email, I have it hosted on a private repo on Bitbucket

[Update (2012-01-17): I’ve put the repository on Github!]

“Ebooker”?

Ebooker takes it’s name from @horse_ebooks, one of the most famous Twitter accounts that (legend has it) was a spam bot that forgot to sell its wares, only remembering to try to sound human to avoid spam detection. As a result, you get a sort of abstract poetry:

As a result, it’s a bit customary to include the phrase “ebooks” in Twitter bots, even if they aren’t trying to sell anything as @horse_ebooks was. Some examples are:

Given this, Ebooker takes as input any number of Twitter streams, and will create a bot that will imitate their union. The most obvious (and narcissistic) example is the new @SrPablo_ebooks, based on my Twitter stream:

But it gets more fun when you combine accounts. Ebooker powers @SrLaurelita, a combination of me and my girlfriend’s (@laurelita) tweets:

The nice thing about Ebooker is that it does the tweeting for you: I tell it who I want to mix and match, how often I want it to tweet, and it does the rest.

How does it work?

Ebooker bots, like most Twitter bots, work via a mechanism called Markov chains.
Despite the length and jargon in the Wikipedia entry, it’s really pretty simple and I’ll do my best to explain it to the curious, whatever your background.

The high-level view could be expressed as: Ebooker wants to make text that sounds like you, so it uses only the words you use, and tries to use them in the order that you use them. To do this, we first have to learn about you and your words.

This indicates the program should go through two phases: a consumption phase, where it reads your writing and does some analysis on it, and a generation phase, where it creates new text by using what it learned.

How does the analysis happen? Just counting words in a table, really. Here’s an example of how it works: previously-mentioned Karl Pichotta recently tweeted

Ebooker would look at every word, and make a note of what follows it. For example, in the tweet above, it notes that every time Karl uses the word “school,” the next word is “kids,” and every instance of “whole” is followed by “sandwich” (“Don’t do well in school, kids, or … *whole sandwich falls out …”).

Now for the fun part… what happens for the word “of”? It comes up twice in this tweet, and gets followed by “life” and “beard.” In our little table, we make a note of both “life” and “beard”, and keep track of how many times we’ve seen them. The table might look like:

Word   Suffix, frequencies.
school kids, 1
whole sandwich, 1
of life, 1
beard, 1

Now suppose we’ve done for all of Karl’s writing, ever (Ebooker uses all the tweets Twitter will give us, which is the last ~3200 tweets). The table would be huge, and many common words would have many possibilities. The table might look like:

Word   Suffix, frequencies.
Oxford University, 4
College, 1
Dictionary, 3
whole sandwich, 1
shebang, 4
matter, 2
void, 55
metric, 8
repeat for thousands of entries…
of life, 1
beard, 3
mine, 7
his, 4
that, 9
it, 22

Some things about this table:

  • It only has words in it that Karl has used. If we made up sentences from these words, it would always contain words that have come straight from Karl’s proverbial mouth.
  • By keeping track of the number of times each word follows the previous one, we have an idea of what he likes to talk about by seeing how often he talks about it. Using the table above, we see he did say “whole sandwich” once, but he’s said “whole void” 55 times. Karl loves talking about the void!

From here, generating text is easy. We do so probabilistically: we let the words that show up most often have more weight than those that don’t.

One way to think about is is with darts: Imagine a dartboard with a huge “outside zone” and a tiny bullseye. If you’re terrible at throwing darts such that they land on the dartboard randomly, chances are it’ll hit the outside zone frequently, and rarely hit the bullseye.

In this case, we’ll start with any word in the table (let’s say, “of”) and the words that come after it form a dartboard. “void” will be the huge outside zone because it’s shown up 55 times, and “sandwich” will be the bullseye, which we almost never hit. We ask the computer for a random number, like throwing a dart randomly. Wherever the number lands, we pick that as our next word. With the values above, the odds look like:

Suffix of “of”   Odds
sandwich 1/70
matter 2/70
shebang 4/70
metric 8/70
void 55/70

Once we’ve selected our next word, we look up that word in the table, just as we did for “of”. We do this until we reach a word that isn’t in the table, or (because this was made for Twitter) we run out of characters. When you’re done, Viola!, you’ve created a nonsensical (but not totally random) phrase in someone else’s voice!

(someone did this with Garfield comics, by the way… check out Garkov)

Bots managed by Ebooker

Ebooker is currently whirring away, sending up tweets for the following bots:

If there’s a bot you’d like to see, let me know! I’m happy to get a few more up there!

Onwards!

I might write about this again, since getting the Markov chains was only a day of work (and that’s in a language I’d never seen before). The more technically juicy stuff, from my end anyways, was implementing OAuth 1.0 in Go, as well as a first exposure to goroutines. These might get treated in a future post, but I thought this would be a cute way to describe, to non-technical folk, the kinds of problems programmers solve.

Smoke Weed Every Day

In the tradition of educating the masses on memes and Internet trends, I’ve recently been in love with appropriation of Snoop Dogg. This post isn’t personally an endorsement of marijuana, nor is this disclaimer a recommendation against it.

Mario can’t escape the Dogg:

My favorite one to listen to:

CARELESS WEED:

Everything goes with Guile’s Theme:

On my wall, from a friend:

Testing, and the Lost Art of the Manual

I hate to be GrandPaul, the old curmudgeon who hates things that just ain’t the way they used to be. But I’ve decided to touch webdev for ScrabbleCheat and by jove, I feel those RoR kids have jumped the shark. Forget TDD; that shit is so passe. These kids practice BDD, with Cucumber and RSpec.

Let’s make a few thing clear here: Unit Testing isn’t the end-all, be-all of automated software verification. BDD seems to be a perfectly noble attempt to address many of its shortcomings, or if I may go so far, addressing the “failed promises” of TDD. Some of those promises (and how BDD helps solve them include):

  • Unit testing, on its own, helps you validate your code, but does little to help you understand its purpose. Anybody who wastes enough time on Hacker News or Proggit has read the mandatory article claiming that Unit Tests are your documentation, but it doesn’t take long for this to break down. What about the 92% of TDD practitioners who, at some point, broke down and wrote code before tests just that once (and again and again)? What about all that semantically useless boilerplate (all the Mock libraries, all the fixtures, what have you)? At the very best you have verbose, very technical and implementation-obsessed documentation only your coders can read.

    Sure, by being executable and by having very wide coverage, Unit tests can help the technically-savvy person see, after some scrutiny, just how the application works. But this doesn’t describe what it does. BDD rectifies this by separating the specification of the behavior (what behavior you are testing) with the implementation of how you test it, and achieves this further (in the RoR world, anyways) with a butt-ton of fancy DSLs to make your tests read like English.

  • TDD is a boon to the developer, but the benefits aren’t directly known to the client. RoR folks, moreso in my anecdotal observation than most other types of devs, love to talk about what tools they’re using, usually much more than the projects they’re working on. So while they can circlejerk to each other about how great their methodology is and what gems they’re using, how much better would it be if they could include the person footing the bill, and give them that extra-personal experience?

    I only mention this because everytime Cucumber lists its advantages, it’s always mentioned that you can show your cukes (Feature Definition files) to the clients and they will be able to read and understand it, even as nontechnical people. So that’s a weakness of unit testing, I guess – you can’t show that typing to the clients and it be anything meaningful.

I bring all this up because, well, I’m trying to get on this train and I’m finding it a bit of a pain in the ass. There are two major reasons for it, one the current Ruby ecosystem in particular, and the other simply being skeptical of the whole approach in the first place.

BDD in Ruby, today

Despite my seething cynicism, I’m working through it and giving it a try. Hell, the only reason I joined Twitter was because, four years ago, I was getting angry at its very existence, feeling that “Web 2.0” had brought us to such a shallow, useless service. Then I realized I was sounding like my (awesome, wonderful) Luddite father, so I signed up immediately. 2500 tweets later, I love it. So maybe (and I still believe this) I’ll come around and preach this the way the Ruby kids do these days.

But where to start learning? I looked at RoR years ago, back when we were all still using Test::Unit, I understand MVC, but wanted to do things right this time. So I read about RSpec and Cucumber, go to their respective websites, and try to write my first cukes and specs. The first thing you notice is that they both use DSLs. I know me plenty of Ruby, but when all your examples look like

Feature: An online spittoon which allows users to spit at the monitor for fun and profit

Scenario: Spittoon graphics
Given that my website is operational
And that the user is full of saliva
Then that user may spit upon the screen
But not upon the keyboard
And a bucket will appear to receive the spit

Scenario: Proper spittoon sounds
Given that the user has spit upon the screen
When the user spits on it
Then it should make a great "ding!" sound

It’s not obvious where the code comes in. Or what the rules are for writing these files. Similarly, RSpec shows you tons of files like

describe Spittoon do

    subject { :spittoon }        

    it "should take spit in the monitor" do
       visit("./")
       subject.should receive_spit 
    end
end

All of this is well and cute, so you ask yourself, “where is the DSL reference so I can write my own?”

No really, where is it? Because I still haven’t found it. I’m looking all through the interwebz, but neither Cucumber nor RSpec have a definitive listing of their DSLs. There are a few half-baked tutorials, some Wikis on the Github pages, and while they all describe these technologies on a very shallow level, they barely answer my questions. When you run rspec from the command-line, where is it looking? Same with cucumber? How should all the components fit into the Rails app? Where is a full specification of the DSL? What capabilities of the browser does Capybara emulate? And where’s its DSL reference?

To contrast, there’s no shortage of press pages and splash pages telling me how this will add business value, how easy they are to use, how they all play well together, how they’ll turn you into a rockstar ninja coder that makes makes clients happy. I’d believe them, but if I want to read how you’ll redirect me to a dozen scattered wiki links and shallow blog posts with toy examples.

Funnily enough, the best source of information is to dive into source: the kind of thing these tools are supposed to prevent.

Well, that’s not quite true. Because for $25 you can buy The RSpec Book. Or the Cucumber book, for another $25. Note that many a Rails book carries a list price of $40-$50. Yes friends, you can have a decent serial, instructive reading experience that doesn’t involve navigating disjointed wiki tabs if you pay up. All the refrains about how Java was as good for the publishing industry as it was for the software industry come back. PragProg is a house built on their Ruby + Rails books. Never mind that the reviews for the books state that they are mostly out of date (all the examples use Webrat, not Capybara) or also only contain only trivial, toy examples. You can’t really blame them, it’s part of the limitation of the dead tree business. But you know what can solve this? A good, freely available manual.

I can learn a mainstream language from 1995 (Ruby), I can leverage existing programming experience from several other languages and projects, but when Rails apps use a component list reminiscent of The Startup Guys (“So I’m using Cucumber and RSpec with Rails with a dash of Factory Girl to practice BDD, with Launchy and Capybara since I think TDD and Webrat are dead.”) there a real need to ensure that, if you rely on DSLs, the barriers to entry are low and the ability to learn is high.

To compare to another learning experience I’m having, I’ve picked up emacs. I’ve been a Vim user for the past 3 years, but felt like I wanted to taste the forbidden fruit and so have started doing all my text editing in Emacs (this post was written in Emacs). I was off the ground, blown away by some of the capabilities in less than a day. I was using SLIME to run excercises in PAIP in less than a day, filled a few TODO lists in org-mode, and found a redundant import using Erlang-mode. And d’you wanna know how I did it?

I downloaded SLIME… and the manual. I downloaded org-mode… and the manual. I downloaded Emacs… and the manual. When I need to know something, it’s in there. But now, I’m feeling less friction learning one of the most bloated and feature-packed pieces of software in history than I am trying to get a basic site up in Rails, using the community’s idioms and best practices.

At RailsConf 2009, Robert Martin gave a great talk titled “What killed Smalltalk could kill Ruby, too”, and he highlights properties of the Smalltalk culture before it died: a bunch of very talented, smug programmers who were sure they would inherit the world because their tools were so much better than the competition. You can ask the Lisp guys how that worked for them, too. But at the end of the day, Rubyists: try not to make too much of a mess, since for every person like me who comes along to join the party, 10 won’t stick around past this frustration as I have. Do the dirty work and write a damn manual, preferably downloadable as a PDF.

On BDD, generally

All that being said, I can’t help but be skeptical about the advantages of BDD in the first place. A lot of it is well said in this blog post, but I feel like BDD doesn’t offer a whole lot of advantages over TDD, and the criticisms of TDD seek a more powerful answer.

I listed two criticisms at the top of the post. Tackling them in reverse order:

  • As my smarmy description made clear, nontechnical clients shouldn’t touch (or have a need to see) the executable bits of your testing unless they really want to. If I want to hand my clients a list of requirements to confirm that I understand them, I’ll write them a proper document thank you very much, not send them a bunch of braindead-sounding cukes, since I don’t think it’ll be of any consolation to them that I’m “running” that document. Write cukes for yourself it if helps you, but don’t put them in the client’s face since, frankly, I doubt they care. If they seem to care, they probably want something better suited for their needs.

  • The second, more compelling point, on specification vs. implementation. Here there is fertile ground to improve upon unit tests, but I think it would be by abandoning the developer writing an implementation in the first place. Many languages now have tools like Haskell’s QuickCheck or Erlang’s PropEr where you declare the properties of the function you test, and the language can generate hundreds of random test inputs, usually finding a lot more corner cases than you expected. We automate building our software, we use fuzzers to find corner cases we didn’t expect in security, why not automate the drudgery of coming up with unit tests?

    Bryan O’Sullivan (of Real World Haskell fame) had a zinger of a comment in an article describing BDD:

    Oh wow. I never knew that Rubyists had a Cobol fetish. I think I liked my brain better when it didn’t contain that knowledge.

    It just feels like so much typing for not much power. “Natural”-sounding executable text doesn’t strike me as a critical gain on the weaknesses of TDD.

Despite all my grousing, I’ll stick through it. Watch me write a blog post in a few months swearing by it, like my Twitter conversion. Just wanted to get this off my chest.

Pretentious Titles and Pedantry, Part Paul

Here’s a long overdue post: what the hell is up with the title to your earlier post, mainly the term observational indistinguishability? I admit to mentally fapping a bit; I’ll try my best to explain the term here since it right well blew my mind when I learned it.

Observational Indistinguishability, as it sounds, is the principle of two or more entities being indistinguishable from each other (you can’t tell which one is which) by any amount of observation. It’s really just a more formal way of saying a group things are equal in any way that matters. The magic of this is that the extra formality (that OI it is not the same thing as equality) is absolutely critical. I’ll show why, using two examples in CS.

The first is pseudorandomness. This is a word everybody says colloquially, probably unaware that it means something very precise, and solves a major theoretical hurdle of cryptography.

That hurdle is this: most crypto constructs need random data in many places, but how do you reliably, consistently get a truly random stream of data? The short answer is that you can’t: every method of gathering the random data will contain patterns that ‘leak’ from whatever method you used. An example of this is pulling numbers out of your head: you may think they’re random, but if you do it for long enough, you’ll start falling into human behavioral patterns that a smart-enough person can predict your next number with better odds than they would if it were actually random. Even if they couldn’t immediately, there’s no proof that they would never be able to if they’re given a long enough time. And saying its ‘mostly random’ without qualification isn’t good enough: In the Game of Cryptography, you win or you die!

So cryptographers got smart: they just lowered the bar to something that’s just as good, in practical terms. Rather than demand actual random data, they created pseudorandom functions which, while provably not actually random, can also be proved to show that any polynomial-time function (computer-speak for “any computer program on all the world’s computers for several lifetimes”) could never tell the difference*.

And with that, a bunch of slacking cryptographers eagerly lost their excuse to sit on their asses, and went on to build secure cryptosystems and hash functions on top of a mathematically precise “random enough data.” Remember: even though we know it’s not random, it really doesn’t matter because we couldn’t tell the difference even if we tried.

The second example is more meaningful though, because it’s a bit more general: it comes from my Programming Languages seminar, where we frequently reasoned about the semantic meaning of programs using operational semantics. You’d frequently get a program written one of a few ways and ask yourself questions like “what does it do,” or “how can we add X feature to the language and preserve all the previous properties?”

To do this, you’d have to understand what a program is doing in relation to another program written with the same rules. Here’s an example: are two functions equal, in terms of their semantic content? Do they do the exact same thing, from an inputs/outputs point of view? This isn’t a trick question, answer the best you can and you’re probably right:

function example_one() {
    var x = 4;
    return x + 1;
}

function example_two() {
     return 4 + 1;
}

The answer is yes, they are equal in terms of meaning, but here’s the real problem: what does ‘equal’ mean? Any attempt we had a class reverted to intuition (“come now, we all know what it means”) or synonyms (“when they are the same. And they are the same when they are… equal…”).

Observational Indistinguishability lets us come up with a suitable definition without having to resort to defining equality. In this case they are observationally indistinguishable when for all programming contexts in the language, they will both evaluate successfully or they will both fail to evaluate. In other words, for a set of evaluation rules M, two programs are ‘unequal’ if you could write a program using M such that one of your functions will run to completion, but the other will “crash” and fail to evaluate. If you can’t produce such a program, they are “equal.”

Lets try now with two unequal functions:

function example_one() {
    return 4;
}

function example_two() {
     return 3;
}

Now these are clearly not equal, but let’s show this without the notion of equality. We’ll construct a program works when under one function, but not the other. Simple enough**:

function test() {
    return 1 / (4 - example());
}

If you’re using example_one(), the program crashes (evaluation is impossible), while example_two() hums along smoothly. Since were created a context where one example evaluated and one didn’t, we know that these provide semantically different behavior. A few things to note about this:

  • It makes no constraints on syntax, or even the specifics of evaluation rules: so long as a set of rules exists, this definition works for any program written with those rules.
  • It puts the focus of equality on the meat and bones of the language: the evaluation rules and its primitive operations. example_one() and example_two() would actually appear equal if the language, for example, didn’t support division, and instead only supported addition and subtraction between numbers. To you, as a language engineer, this makes you wonder what the point of including numbers or addition in your language is at all when the difference between 3 and 4 can’t crash any program you can construct in it.

So to come back full circle, I just thought original story was cute because a very studied, full-of-ideas dramaturge got played so hard by a process that was the result not of equality of scripts, but observational indistinguishability, which makes me wonder how important dramaturges are to the process to begin with.

* = A little disclaimer: they didn’t prove that no polynomial time function could ever stop it, just that if anybody could come up with a way to do it, they’d first have to solve a Famous Unsolved Problem We’re Pretty Sure Doesn’t Have An Answer, like discrete logarithm.

My friend made a joke on cryptography proofs: “We haven’t proved they can’t be broken, just that nobody has done it yet. By this logic, I’m immortal!

**= IIRC, Javascript implementations represent all their numbers as floats, meaning 4 - example_one() might actually not be 0, but some very very small number, and the program won’t crash. Ignore, please.

On Failure (Personal)

To contrast to the other part of this double-post, let’s talk about something a little more familiar to the folk at home: failing at life. This is prescient to me because of this:

Degree from Brown University

That is my degree from Brown University, a combined BS in Computer Science/BA in Music. But didn’t I graduate last year?

Well, technically no. Despite passing higher-level neuroscience and graduate-level programming languages, I failed high school calculus, which was a prerequisite to studying computer science at Brown. Not a requirement, mind you: a prerequisite. Meaning that in theory, I needed to complete it before being allowed to study computer science.

(the resolution, if you don’t know, is that I took the course over the summer, and passed. Because of this, I didn’t graduate in the class of 2010, but technically in the class of 2011 as a “non-enrolled student.”)

What surprised me most, and (what I think) is the most valuable lesson I got from Brown, is that failing hard is one of the best things that can happen to you. Only when you’re kicked in the teeth and actually pushed to your limit do you know what it means to truly confront your demons, your weaknesses, and test your actual mettle.

Put another way: are you proud of the fact that you took a shower this morning? Do you look back fondly on the last time you tied your shoes? No, because those presented no challenge; completing those tasks presented no new knowledge of the world, and no new knowledge of yourself. If you think back to anything you’re proud of, it’s almost always been a challenge.

The fact that hard things are what make you proud isn’t really anything new (nor was it before I failed). The key realization for me was understanding that failing presents a much more heightened sense of accomplishment. To wit, I was incredibly proud of my high school production of Arcadia; but no matter how hard or challenging that was, I’ll always be more proud of the fact that I’m programming professionally, if only because I was already good at acting/directing, and had never been bad at it. Leaving your comfort zone and being truly uncomfortable is a growth experience too many bright people won’t experience.

They have a saying in software testing: a successful test case is one that finds a bug in the program. This means that when you test software, you remove all formalities of being a kind or understanding person and put on a different hat, thinking to yourself “what’s the meanest, cruelest thing I can do to this software? How can I BREAK THE SHIT OUT OF THIS.”

It’s a good thing to do this in life as well. Don’t be stupid, but for the good of you, take a risk every once in a while. You’ll never be more proud.

On Failure (Computing)

While I’d also like to speak of personal failures today, I’ve been thinking a lot more about system failure.

Alan Perlis famously wrote that you shouldn’t bother to learn a programming language unless it changes the way you think about programming, and Erlang delivers in spades. Almost a year in* to ScrabbleCheat, only now do I feel like I’m understanding the value (and love) of Erlang. Namely, what it means to write dependable software.

Another blog post said it best: “Erlang is about building reliable systems.” Singling it out to concurrency, or distributed systems, or hot-code loading, or simply for it’s functional nature is missing the point.

It’s not immediately obvious: the most used and referred-to book for newcomers trying Erlang is Joe Armstrong’s Programming Erlang. This was my first book learning Erlang, and while it has a great tone and expresses many of the introductory concepts clearly, it sadly seems a bit out of date, and has it’s priorities in the wrong order. If you only read the first 200-300 pages, you come out not knowing exactly how big a deal the OTP is.

As an example, an entire chapter on using Makefiles to build your code is probably unnecessary: any developer worth their salt knows enough about Makefiles to compose shell commands, and that’s essentially all he demonstrates.

I don’t mean to be too hard on it, but here are some tips/resources for those interested in exploring Erlang:

  • Learn You Some Erlang is an excellent, excellent introduction. It starts slowly with the language, but always gives you context of how Erlang fits with other programming models, simple but direct writing, common pitfalls, and even “Don’t drink the Kool-Aid” sections where he brings Erlang away from the hype and back down to Earth. And while the language sections are fine enough, the OTP chapters near the end have you understanding exactly why gen_server and gen_event are the way they are.

  • Erlang and the OTP in Action is another good choice, though un-free. They walk you through generating an Erlang release by hand with the default tools, which is good to do at least once or twice. They also have an excellent focus on the OTP, though with more emphasis on it’s practical use in production applications rather than the important ideas behind it. If you feel like you want to buy and work through something to understand Erlang, I would recommend this.

  • Rebar as a build tool. It’s lean, it usually does just what you want it to, and the source code is embarassingly clear and easy to read if it doesn’t. The mailing list is friendly, and it’s easily extensible. Much better than raw Makefiles.

  • Get to learn the tools: Appmon, Dialyzer, Common Test, and others. It’ll boost your productivity, and give you a sense of confidence you won’t get often.

You’ll never really love the language until you design a proper application with OTP. While every book/tutorial wants you to write a chat server, I rather enjoy optimization problems, like ScrabbleCheat.

Back to failure: after programming in Erlang, I feel naked in other languages without supervisors and trap_exits. Lack of proper Actors means distribution (and therefore fault-tolerance) is a chore, never mind the concurrency benefit. Erlang has been a dream to play with, and I would recommend you do a hobby project or two in it ^_^

*= Madly Brilliant and I joke about the fact that I’ve been working on this for so long. Really, it’s been about a year since the initial commit, where I implemented trie using gb_trees, way before I had even heard of a GADDAG. While I like to say “a year in” to make it sound like a major commitment, I’ve sadly only gotten to work on this very rarely. Were I someone who hadn’t just moved into a city and started my first job while maintaining an overseas-then-cohabitating relationship, I would call this 2-3 months of real work.

Homebrew Comfort Music

Often when coding and confronted by a problem you don’t know how to solve, it’s nice to have music that’s fun/good/comfortable enough to tune the world out, but not one that will overtake you. Here’s a bunch of YouTube links that I bounce between.

My awesome cousin Maddy pointed me to this video:

I’m not familiar with stop-motion used in music, but the tune is excellent (especially after playing hundreds of hours of Smash in the Zelda Palace level). This guy makes excellent videos:

My favorite Zelda song on Guatemala’s national instrument!

Previously, previously, previously, previously, previously, previously, previously, previously, previously, previously.

I’m just old enough to a remember a time before having Internet. What a dark time that was.