Wednesday, July 31, 2013

Ta mu ke lu si

If you've ever wondered how many syllables Tom Cruise become when transliterated in Chinese, it's 5. Ta mu ke lu si. One of the peculiarities of the Chinese language is that there are no syllables with two consonants in a row. Same goes for Japanese, which is why their speech sounds so machine-gunnish. That means words like schlargleclpctple (a rare dinosaur, even rarer than the other extinct 100% that are extinct) takes 3-4 times longer to pronounce in Chinese. So when we're reading together about Jesus' adventures in India and words come up with two consonants in a row that Yuan Yuan doesn't already know, she'll liberally sprinkle them with vowels. When I stop her and demand patronizingly if there's a vowel after the 's' in swill, and if there's not, why she's pronouncing it 'seewill,' she just bats her eyelashes at me innocently. When I'm well hydrated, I'll ask her how the consonant is pronounced on its own without a vowel before or after it.

Me: how do you pronounce the letter 's'?
Yuan Yuan: ess?
Me: no
Yuan Yuan: suh?
Me: no
Yuan Yuan: see?
Me: no
Yuan Yuan: suh?
Me: no, you've already tried that one!
Yuan Yuan: so?
Me: so it's still wrong!
Yuan Yuan: no, I mean it's pronounced 'so'!
Me: it most definitely is not
Yuan Yuan: then what is it?
Me: keep trying. Don't put any vowels after it, just give me the naked consonant.
Yuan Yuan: ooh, naked...
Me: don't get distracted!
Yuan Yuan: ugh...suh?
Me: no!
Yuan Yuan: I don't like this game.
Me: it's 'sssss'!
Yuan Yuan: suhwill?
Me: no! It's swill!
Yuan Yuan: swill. Got it. "He took a swill of his drink and suhpatuh it back out."
Me: spat!
Yuan Yuan: I know, I was just testing you

Somehow, despite the multitude of rather thick hints, it never occurred to me that Yuan Yuan simply didn't know how the consonants were pronounced on their own. I thought about teaching her, but then I got scared. Is she too old to learn? If I teach her, will her brain restructure itself completely? Is this ignorance what keeps her so childlike and lighthearted? How do I prevent her from figuring them out on her own one day? This must have been what Johnny Cash was talking about when he wrote I Walk The Line.

Tuesday, July 30, 2013

Blogging to procrastinate

I'm being a complete slacker with respect to my sketching. Each day I'm brimming with optimism from the moment I get up to the moment I go to bed, thinking about how I can't wait to sketch, and saying positive affirmations to get myself in the mood, and not thinking about how I currently suck and that it takes at least 5 hours of practice to achieve mastery of a skill and that I still have 3-5 hours to go. So there's no shortage of positivity. The only thing there's a shortage of is actual sketching. I haven't touched a pencil in ~5 days.

Enjoying being terrible at something is a skill I would love to have. But even the great Mario, who can will himself to enjoy red bean paste snacks, is very hit or miss in this respect. He'll be fine with sucking at one thing, as long as he's already addicted to it and doesn't have to do it in front of other people, but then inexplicably refuse to even take a second strike on another.

Over the years I've created this self-image that I can learn to be awesome at anything in 5 minutes, or on the first try, whichever is faster. This self-image, while completely inaccurate, sometimes performs a magic placebo effect and everything clicks. But this self-image has its limits. Sketching, dancing, at one point singing, and a couple of other things seem to be in its Achilles heel, or off its grid, or in its blind spot. I don't know how it works, it's a very hand wavy science.

So the lesson is that I'm good at rationalizations and I'm using it against my sketching. Go. Sketch. Now!

Monday, July 29, 2013

Yuan Yuan the bear

My plank-holding times are steadily improving, but Yuan Yuan, whose body is some kind of mystery of science / voodoo, is gaining on me quickly. When we started out a few weeks ago, I could do 2 minutes and a bit. Today I hit 3 minutes 45 seconds, but then I had to lay there and drool on the floor for a while, until there was enough of a buoyant force for me to get up without popping an absicle. Yuan Yuan started out at a max of 40 seconds or so, and hit 2 minutes today, though she was whooping like a Native American at a scalping for the last 30. In a few weeks she'll catch up and overtake me. She could always do handstands longer than me (1 min 24 seconds), she can hold a bridge for 3 minutes, and she holds the record for jump-roping - 650 in a row. Mario would just shrug and say "that's impossible, I refuse to believe it," when she would beat us both at some new exercise. I often call her bear-related affectionate names, but I'm starting to think she might really be part bear. She sleeps a lot, 15 hours a few days ago, 10-12 regularly, she's super strong but she can barely do 5 push-ups, she can eat twice as much as me easily and being full is no deterrent, she's got a big head and her yawns are closer in shape to a banana (vertically) than an apple, she runs uphill faster than downhill, and she's covered with 3-inch long thick brown fur all over her body. The only thing not in her favor is that she's completely indifferent to meat. Maybe that's the only thing standing between me and a bloody puddle of me-leftovers.

Sunday, July 28, 2013

The feminism / cheeseburger correlation

I think I might be going to hell. I'm getting a C on a 30-day trial and I don't think Jesus would accept a mere confession or 3 "Hail 30 day trials" as penance. Today we made the decision to sacrifice a piece of our no-sugar trial to the devil. In exchange for the ability to eat one sweet a day (you get 10 consecutive minutes to eat it, then you turn into a pumpkin), we've signed up for an extra 30 day trial. Yuan Yuan will do 10 minutes worth of planks / wall sits / handstands, and I will do 5 minutes of wall sits / horse stance. Why do I get away with 5 minutes while she has to do 10? You see, in China we have this wonderful thing called gender inequality. It's a time honored tradition. Back when America was young and still on track, before the great invention (the cheeseburger) vanguarded the Renaissance of our midsections and set our national inertia so high, that at the enormous speed we had amassed, we flew right off the serpentine tracks of the Transtranscendental railroad, before all that apple-bottomed glory, men ruled the world and women sat at home tending to the children and waiting for Jane Austen to come along so there would be some proper motive for learning to read. And God saw that it was good and rewarded us with Amendments to the Constitution and feminists. That's called divine irony, because there's nothing God loves more than to throw everyone completely off balance with the introduction of balance. Meanwhile, China hasn't even gotten to the cheese part of cheeseburger, so their women aren't going to be voting any time soon. What I mean is that it was Yuan Yuan's idea, was it my fault I snatched up the opportunity when the first 5 minutes of my wall-sits came out of her mouth and didn't wait for the next 5?

Getting sidetracked aside, this might end up being harder than not eating sweets at all. I've already stifled most of my urges, and though I can't eat 99% of the edibles in any store on the planet, I've accepted my fate and hung my head and set up a little tent in the eggs and produce aisle of life. Finding myself in this new permissive world, I'm bound to be completely miserable, where before I was only hopeless. Now when I go to the store I have to wander around the mountains of sticky treasures and pick one thing to sate my mutinous appetite. It's Sophie's choice all over again.

Saturday, July 27, 2013

Vysotsky can only show you the door, it's up to you to hit someone in the ear with it

Haven't written a song in a while, and I was listening to Vysotsky today and felt a bit inspired. The song turned out pretty cynical and didn't really go in the originally intended direction, but I think it turned out decent anyway. I've borrowed (heavily) from his song "Мой друг уехал в Магадан" (My friend left to Magadan), but I don't feel too guilty about it because apparently a lot of Vysotsky's song melodies borrowed heavily from the "standard" folk melodies. So it's not like I'm stealing from the rich, I'm stealing from poor, it's ok.

Here's a decent translation of the Vysotsky song My Friend left to Magadan:

(translated by Margaret & Stas Porokhnya)

My friend has moved to Magadan
Play him a fanfare, play him a fanfare.
He went himself, his own free man;
He wasn't sent there, he wasn't sent there.

It wasn't that his luck turned bad
Or done to make somebody mad;
It wasn't part of some big act:
He simply packed

If someone asked him: "What's it for??
Why just abandon your life at random?
That place has killers by the score
That's where they crammed "em, that's where they crammed' em!"

He'd shrug - "Whatever people say
There's more in Moscow anyway"
Then pack up everything he can
For Magadan

I wouldn't say my race is run:
I'd jump the night train like in the old days
But I won't go to Magadan
Leaving my old ways, starting a new phase

I'll sing, my guitar on my knee,
Of all the things he's going to see
Of all that's left unseen, undone,
Of Magadan

My friend had nothing left to lose
It's his decision, it's his decision
He won't be beaten by the screws
He's not in prison, he's not in prison

But God made me another plan...
Or should I go to Magadan?
And like my friend just go to ground
And make no sound


If you don't speak Russian, Vysotsky can be hard to appreciate because he's not translated, nor is he easily translatable, so you'll have to take my word for it that he is an absolute genius lyricist and performer. He wrote 800+ songs/poems before he drank himself to death at age 42, and they range from hilarious, to mysterious, to romantic, to cynical anti-establishment provocations. He has tons of songs about the criminal element, songs from the point of view of inanimate objects and animals, songs about love, science, war, love, betrayal, sports, the mentally ill, you name it. Most of his songs he performs with just his slightly out of tune guitar, but some have been pretty well orchestrated and might be easiest for the non-Russian-speaking crowd to appreciate. You can try these:

Дом Хрустальный (Crystal House)
Белое Безмолвие (White Silence)
Баллада о вольных стрелках (Ballad of the free archers - a song he wrote for a Russian movie about Robin Hood)
Песня о вещей Кассандре (Song about the clairvoyant Kassandra - not for the faint of heart)

Every once in a while I try to translate one of his songs for the benefit of Mario or Yuan Yuan and I'm always disappointed with what comes out. It's mostly lost on Yuan Yuan, but Mario seems to appreciate it, either out of the goodness of his heart, or maybe because he was enamored with Russian previously and subconsciously adds colors to my grey translations.

The song I wrote today is tentatively titled Compromise

Am Dm
you started out pure, of intention
Dm6 E7
you were never gonna be like them
Am Dm
your life, (your own), your invention
G C B
you'd be damned if you'd be someone else

Am Dm Am
but then a splash of milk fell in your coffee
Dm Am
you said alright, but just tonight
Dm E7
and then one day you pushed away the cream
Am
and your coffee's white

you said, you wouldn't age a day
you'd never let yourself get fat
you'd stay sharp as a tack
you'd be the blackest black of cats

but you were young, you didn't know
and now your hair's seen its first snow
you've learned another word for lies
it's compromise

it's not that you, lost your ideals
you just lost your baby teeth
they thought they had it all figured out
before they ever had any meat

you shouldn't be so hard on yourself
that optimism comes off the shelf
you're still a wonderful guy
some day drop by

If you think the last chord sounds dissonant, it is a bit. It's a Am6, with the 6 not in the key of the song. Vysotsky loves to throw in at the end of his songs, just in case you thought you had his song figured out. And when Vysotsky says drink yourself to death, I jump off the bridge without a second thought.

Friday, July 26, 2013

Vovochka strikes again

Looks like some of these 30 day trials I'm on have to get restarted. Several of them died horrible deaths. The ones still going to strong are the vegetarian trial and the blogging every day.

The others, may they never rest in peace but get revived until they are completed are:
1. Pushups / planks. Sadly around a week ago, when I got sick, my arm also started hurting and not at all in that nice way like when you're getting scratched or a pretty girl is lightly biting you while you're trying to work and you give her dirty looks but don't punish her just yet because maybe if you don't, she'll keep going. But then of course you have to punish her so that she wants to keep doing it. Anyway, where was I? My arm hurt, and it wasn't from the sin of Onan, although if God were to pick one arm to go to Hell for that sin, it would be the same arm. Which reminds me, I read a great joke today about the apotheosis of Russian childhood mischief - Vovochka.

In case you don't know, Vovochka is a cornerstone of Russian joke culture. He is an irreverent reprobate, whether he happens to be age 5 or 30 in the joke, and he thrives on tearing down teachers, parents, and other grown-ups that stereotypically demand respect. Vovochka is also extremely sexual, which renders all innocent classroom questions dangerous territory:

"What does your daddy do?"
"How many watermelons could you carry and how?"
"Any questions?"

(Note: If you can't think of a filthy answer to all of those questions, you've probably never heard a Vovochka joke, or graduated from elementary school.)

The teachers typically know this and only call on Vovochka when completely exasperated with the other children's demented answers. Then Vovochka of course makes them regret it for the millionth time.

In this joke, probably one of the cleanest Vovochka jokes, Vovochka is inexplicably attending Catholic school:

Teacher: Remember, those children who get A's and B's are going to Heaven, and those who gets C's D's and F's are going straight to hell! Yes Vovochka, you have a question?
Vovochka: does anyone leave this school alive?

Here's one more:

Vovochka brings home an F in math.
Dad: why??
Vovochka: she asked me, how much is 2x3? I said 6!
Dad: but that's right!
Vovochka: then she asked me, how much is 3x2?
Dad: what the f*** is the difference?
Vovochka: exactly! I mean, that's exactly what I said!

Classic. Next time I'll tell you my favorite Vovochka joke of all time. Sadly I have to translate all of these from Russian into English by way of Chinese, so they lose some of their juice. Just don't tell Vovochka I said that.

So the pushups / planks trial is getting restarted officially tomorrow. I've been warming up for it during the last two days and the looks like my arm is back to full health.

2. The no eating sweets trial. This trial was actually going really well. Then I got sick. Usually when I get sick, I try to up my vitamin C dosage, even if just as a placebo. So I drank this just-add-water vitamin C orange mix for a few days. No worries, the craving is mostly gone, so this trial got restarted 3 days ago.

3. Reading with Yuan Yuan in English for 30 minutes every day. This one just didn't work out, Yuan Yuan went to Korea, and then when she came back she went on a tour around Beijing for a few days, coming home and crashing immediately every day. But we'll try to get it going again...though she's off to Korea in a couple days again.

4. Stretching. Restarting? Fine, I had to beg myself to restart it, but I agreed. Restarting this one today.

Thursday, July 25, 2013

Protect your invariants

Ah, programming...

"You must program defensively, with the assumption that clients of your class will do their best to destroy its invariants."
--Effective Java (Joshua Bloch)

That is the world I live in. This is what they teach little SkyNet children in school today, so that when they grow up they'll feel benevolent towards the human race.

This book (Effective Java) and all books on writing better code have more violence in them than a season of 24. Other programmers, malicious and/or incompetent, are always conspiring to violate your classes, objects, invariants and other violable violabilities. Every other paragraph you get admonished to trust NO ONE, to code defensively, lest the converging hordes mutate your code's internals and then exploit those mutations to gain access to the Zion mainframe. Writing safe code is an extreme sport. Here are some other gems:

"Second attack on the internals of a Period instance."

"This would give the attacker free reign over all instances."

"Classes containing methods or constructors whose invocation indicates a transfer of control cannot defend themselves against malicious clients. Such classes are acceptable only when there is mutual trust between the class and its client or when damage to the class’s invariants would harm no one but the client."

The last sounds like something a lawyer might have me sign after I pretended to read it very carefully for 3 microseconds.

My new roommies and I are getting along famously. Monday to Thursday they're quiet and friendly, not asking me any coding questions, not zooming around like trapeze artists and shaking the walls with heavy Tomcat tomes and leaving bloody streaks of mosquito and human soup all over the apartment, not making soup out of spoiled vegetables. The last I see of them every week is Thursday night. The next I see them is Monday night. For 3 days and 3 nights a week, I am roommate-free. Mario, you have a lot to learn. About programming of course, the roommate stuff's irrelevant.

Wednesday, July 24, 2013

Stay right where you are


Looks like Yuan Yuan's going to Korea again. She just got back two days ago from a luxury cruise tour there, where her responsibilities included holding onto her clients' passports and doing whatever the hell she wanted. Poor girl can't catch a break. This time she's flying, and it's a sight-seeing tour rather than a shopping tour (the 20 min sight-seeing / 2 hours shopping per site ratio is flipped). I don't see why people book tours at all, when they can just go by themselves or better yet, not at all. Which brings me to my second point. People should just stay where they are. What is the point of seeing places? The places would have to be pretty amazing to offset the annoyance of getting there, coming back, and dealing with housing and overeating issues (going somewhere else makes people think they should eat twice as much as usual). Until teleportation is invented, I'm going to sit tight and hang out in my room, which is already as amazing as a place can get.

I started A Mote in God's Eye today, while running errands. I feel like I'm being forced to get to know the characters before the interesting stuff starts happening. I don't like it. It better start cruising soon.

I finished The Ocean at the End of the Lane by Neil Gaiman the other day. It was good, I felt completely immersed in the story. The characters were a tad stereotypical, but the world he created was quite magical. He used one of those cool literary devices that I like a lot in Strugatsky Brothers fiction, which they call "Refusal to Explain," where they don't even try to explain some of the bizarre things that happen. It's a bit of a wild card technique, but when used right it gives the reader this incredible itch that forces him/her to keep reading in hope of getting more clues to the mystery. All in all, quite an itchy book.

Tuesday, July 23, 2013

Tongue leprosy

I'm proud to say I haven't coded any new functionality in the last week. I've been exclusively redesigning and tinkering with old code. The code is looking a lot better, I think, but there are still design problems I don't feel equipped to solve. I have this one case where I can't figure out an elegant way out of a circular definition. I have a sort of abstract factory class Synchronizer which has two subclasses, ResourceSynchronizer and CollectionSynchronizer. As they are separate AMD modules, the subclasses need to import Syncrhonizer in their "define" statements. But then there's no way for Synchronizer to have a getSynchronizer() method that will return an instance of one of the two subclasses. In order to have such a method, it would need to either import the two subclasses in its define statement, completing the circle, or return a Promise to return a subclass, which would make getSynchronizer() undesirably asynchronous.

Another problem I've run into is when I try to separate out a logical chunk from a bloated module and it turns into a seesaw and goes out of control. I'll be happily migrating things and then realize that I've gradually moved everything into the new module. Then I start to wonder if the separation was a good idea in the first place or if the code is just experiencing separation anxiety. On the other hand, the seesawing also doubles as a sifting process; as I move the code back and forth, it seems like it gets cleaner. Maybe if I do it enough, the code will disappear and everything will still work.

I think something's wrong with my tongue. There's a spot on the left side, roughly a centimeter in diameter, that's behaving like it's been severely burned, producing a numb tingly feeling when under the slightest pressure, and hurting when I bite it as hard as I can. I've studied it in a mirror and I think there might be a tiny alien trying to claw its way out. It looks cracked like parched land, and generally unwholesome. Maybe I'm allergic to something. Maybe it's not my tongue at all and it's actually someone foot with athlete's foot.

Monday, July 22, 2013

You call this a language?

English can be obnoxiously ambiguous at times. My parents and my sister went to the beach yesterday. When I wondered why Mahlet (my sister's best friend) hadn't gone with them and why I haven't heard much about Mahlet recently at all, and how Mahlet was doing cause I miss her, my dad said:

"I think she just loves us more now"

As long as you don't think about that sentence, it makes perfect sense. But once you start, you realize that it could mean pretty much anything in the world. It could mean that my sister loves my parents more now than she did before, or that she finally loves them more than she loves Mahlet, or that she loves them more than Mahlet loves them, or even that Mahlet loves my parents more now, so she graciously lets them have alone time with my sister. There's 46 other interpretations that I won't go into.

After I recovered from that soft gooey bitch-slap of ambiguity, I wondered for the millionth time how Chinese people do it. How do they ever understand who the hell they're talking about? In spoken Chinese, the pronouns "he," "she" and "it" sound identical. Not because I'm a foreigner and my ears are too big to hear the difference, but because they're all one and the same phoneme. Same goes for the plurals, "they" has three written forms - masculine they, feminine they, and undead they, but they all sound the same. This last one is only shocking until you realize that English only has one "they" to begin with, but it can help you appreciate the magnitude of the disaster that is the case of singular pronouns. Instead of he, she and it, you just have the singular form of they. And the same goes for possessive pronouns.

What this means, is that if a Chinese person is telling you a story about a heterosexual couple and their dog, you're hearing:

They says they doesn't want to get married, but they insists that they does, they just doesn't want to get married to they because they is so poor, and of course they has an opinion on it too, barking every now and then to punctuate the conversation. So I don't know what they is going to do. Maybe they will divorce they and marry that other girl.

Ha! You should be so lucky, getting that freebie at the end. Usually it's like listening to some kind of demented software interview brainteaser.

Sunday, July 21, 2013

How to make a sandwich in Javascript

Michelle, if you're reading this, start getting ready for our open mic duet. Don't even worry about the set list, I'll take full responsibility for picking the songs I like. Here's some that you might want to learn how to sing:

by Wings:
Let me roll it
Band on the run

by Blue Oyster Cult:
Burning for you
Take me away
Astronomy

by Led Zeppelin:
That's the way
D'yer M'ker
Houses of the Holy

by Dusty Springfield:
Son of a preacher man

by Save Ferris:
Come on Eileen (their cover rocks, you play the power chords, I'll practice the crazy ska rhythm)

by Squeeze:
Tempted

by Bogushevskaya:
Cafe Ekipazh

Let me know which ones you don't absolutely love so I can convince you otherwise. Everyone else go listen to these and imagine how well they'd sound if they sounded slightly worse. Pretty fantastic? Agree.

One and a half more days of freedom and then my favorite girl will be back to torture me. I need to think about what kind of things I can do now that I can't when she's around. Other than tell vicious lies on this blog with impunity, or sleep with other women. I guess I should get all my bad singing, bad drawing, and bad dancing out of the way so she doesn't have to do too much criticizing right after a hard week's rocking in Korea.

And now, a cool trick from today's JavaScript camp. I've used this before, but never in the general form:

function partial(fn) {
var args = [].slice.call(arguments, 1);
return function() {
return fn.apply(null, args.concat(arguments));
};
}

What this allows you to do is precreate functions when you know some arguments ahead of time. So for example, if you have a sandwich function:

function sandwich(bottom, top, middle) {
return {
bottom: bottom,
middle: middle,
top:top
}
}

...and you know a "good" sandwich always has a pancake on the bottom and a pop-tart on top, you can make yourself a shortcut function easily:

var goodSandwich = partial(sandwich, 'pancake', 'pop-tart');

This essentially hardcodes the (bottom, top) set of parameters and gives you back a function that expects only one parameter - 'middle'. So now you can use the goodSandwich function to make sandwiches with different contents but the same shell:

// equivalent to sandwich('pancake', 'pop-tart', 'turkey')
var goodTurkeySandwich = goodSandwich('turkey');

// equivalent to sandwich('pancake', 'pop-tart', 'Mark')
var goodMarkSandwich = goodSandwich('Mark');

// equivalent to sandwich('pancake', 'pop-tart', 'cheeseburger')
var goodCheeseburgerSandwich = goodSandwich('cheeseburger');

// equivalent to sandwich('pancake', 'pop-tart', sandwich('pancake', 'pop-tart', 'cheeseburger'))
var doubleDecker = goodSandwich(goodSandwich('cheeseburger'));

Mm, a cheeseburger wrapped in two pancakes and two pop-tarts. That'll get you bulimic in no time.

Saturday, July 20, 2013

Getting shaved by visitors

Yesterday's cold kept me delightfully bed-ridden all day. I lay there most of the day, sometimes draped over a chair like a wet towel, sometimes prostrate on the bed like a dead hooker, but always impossibly listless. I ended up reading all day, and I feel a little bit sorry for the book I demolished - Prodigy by Marie Lu - I would have probably enjoyed it more if I'd read it in a non-zombified state. Still, it was enjoyable if not quite enjoyed. It was as expected, not quite as interesting as Legend (the first book in the series). This is pretty typical of dystopian trilogies; the first book is about starting a revolution, earth-shattering realizations, the death of ignorance, and the next N sequels are about war and hypocrisy and all kinds of nonsense dealt with better in books that deal solely with war and hypocrisy. Prodigy did better in that respect than Hunger Games, Divergent, and the Matrix sequels, but it still suffered from the same side-effects.

I learned a new object oriented programming pattern today that provides a cool way to follow the open / closed principle.

In case you don't know, the open / closed principle says that you should design things to be extensible but not modifiable. Meaning you don't want people modifying your diaper design, but you do want people building plugins for it. The original design, once complete, should only modified if something is broken. And this seems to apply on many levels, from objects to systems. Now onto the pattern, called The Visitor.

The Visitor pattern basically has you build in an uber-simple but multi-purpose socket, that you can later build things to plug into. The socket doesn't need to know beforehand exactly what will be plugging into it, a vibrator or the Omega 13 device, it's the job of the Visitor implementor to build plugs for those devices. The result is that once you have the socket set up, you're virtually unlimited in what you can plug into it, without ever modifying the diaper.

Neat, though it seems a bit hacky to me. It appears mostly to be used when you want to take a function that might apply to many different objects, and encapsulate all the variants into an object. This object, which is called a Visitor but should really be called a DirtyDirtySlut, then plugs into those objects and provides a single service, albeit adapted per their needs. So you might have a ShaveVisitor object, that defines 10 different variants of the function visit(): bear.visit(), chicken.visit(), patrickRothfuss.visit(), etc, and when the bear or the chicken decide they need a shave, they call in the ShaveVisitor to visit (shave) them. And of course everyone who shaves, lives in perpetual fear because they have no way of knowing who the ShaveVisitor shaved before them, and because there are rumors going around that there's a new Butthole object which likes to get shaved all the freakin' time. And who wants to be the next one shaved after that?

Friday, July 19, 2013

Sick again

I caught another cold yesterday night. I've had colds on and off for the last month. It's hard to tell if it's one long cold or if I've wandered into some kind of buffet and can't find the exit.

I went down to the pharmacy a few minutes ago and slammed right into the barrier between Chinese and Western medicine. In America, they usually ask you about the symptoms you're experiencing and then pronounce a diagnosis - you have a cold. No shit. Sometimes it's cancer. Then it's "oh shit." But things aren't so simple here. In Chinese medicine, there are several different types of colds, depending on the season and how you acquired them.

Me: I have a cold, can I have some cold medicine?
Pharmacist (a nice elderly lady): What kind of cold?
Me: Excuse me?
Pharmacist: is it from running the air conditioner, or were you in a cold place, or did you catch fire? (上火 - Catching fire - the most common ailment Chinese people complain about, symptoms ranging from diarrhea to constipation to scratchy throats to pimples and many more. In general, it means something is inflamed, and you need to fight that fire with something intrinsically cool, like cucumbers and water. Foreigners are generally mystified by the concept.)
Me: I...have no freaking clue
Pharmacist: shame on you, you don't even know your own body!
Me: could someone have sent the cold to me in an email?
Pharmacist: don't be a smart ass, you need at least realtime audio to catch a cold over the network. Here are three types of cold medicine, pick one yourself.

I ended up picking the "wind-heat cold" (风热感冒) medicine. The other prominent choice was "wind-cold cold" (风寒感冒) medicine. We'll see what happens. Or maybe we won't. Chinese medicine is very much a slow cure, you never know whether it helped or you managed to recover on your own.

One of the things Mario was always better at than me is urination. Not only could his stream cut metal (you could hear it from the local KFC), while my stream couldn't cut the line at the KFC, but he could empty out 0.75L at a time. I averaged 0.25L with a rare max around 0.4L. How do I know this? Occasionally the bathroom is taken, and there's a bladder emergency among the leftover roomizens. If the bathroom is occupied by a girl, everyone knows that there's imminent danger of permanent bladder damage, so they usually grab a bottle and pee in it. Then everyone else grabs a bottle and pees in theirs. Don't worry, we do this privately, we don't compare equipment or anything.

Anyway, I've never managed to fill a 0.4L bottle in one go, and no amount of practice or holding it in seemed to help. But this morning, that looked like any old morning, with no hint of the epic feats about to transpire, I woke up to a bladder emergency. The bathroom was taken by one of my new roommies, the one with breasts. I found an empty bottle, 0.45L, and filled it up with pee to spare. This is momentous day, make no mistake about it.

Thursday, July 18, 2013

Programming your octopus's celibacy

The last few days, I've been reading up on good programming practices, design patterns, object oriented thinking, and how to draw arms, legs and breasts. When later I went back to look at my code, I was somewhat horrified. First of all, there were no breasts in sight. Second, some of the modules were getting a little too friendly with each other. So I've spent most of today trying to rewrite some of the more inappropriately intertwined modules, if they can even be called modules any more. Is an octopus having sex with another octopus still an octopus? It's definitely still half of two octopi, but visualizing separating one out might just give you that aneurysm you've been saving for something more special. Not to mention you might distract the lovers and wind up as part of the brainteaser. The only sane thing to do is to kill them both and start over, using chunks of their dead bodies as raw material.

Turns out, when you've been building stuff for months, it's hard to rewrite it all in the span of a couple of hours. It's kind of like a second pregnancy is at best twice as short as the first; after that you get into all sorts of relativistic paradoxes like Einstein himself showing up to cram that baby back up your vagina, after which one of the twins turns out five years older than the other. I took special relativity in college, I know what I'm talking about.

Hmm, I don't know if it was something I said or wrote or thought, but as soon as I stopped typing a second ago, I knocked a cup of warm water right into my crotch. It didn't feel half bad for the first 5 seconds, but now it feels...wet. And clingy. I may have to take off my pants and put them on backwards.

Wednesday, July 17, 2013

All by myself

Yuan Yuan's off on a cruise to Korea (as a tour guide), so I'm left to fend for myself. This is a survival test. Without anyone to tell me when to eat, why to put on clothes and who I can't safely ignore, I feel very dangerous. What if Yuan Yuan's mom comes to visit and no one's there to tell me to open the door? What if zombies attack and I find I have latent zombie-wasting skills and then when Yuan Yuan gets back from Korea I mistake her for a zombie and waste her? What if I accidentally watch an episode of Chuck by myself? If that happens, I may have to go off the grid. These are the questions that plague me.

Meanwhile, Yuan Yuan's 15 stories above sea level, thinking about whether she should get the steak or the lobster. As the opportunities for a free pass on a luxury ocean liner are scare, she's generously forgiven herself in advance for the inevitable breaking of two 30-day trial oaths - no sweets and no meats. She also has no qualms about rubbing it in the faces of the more faithful.

I bought myself yet another sketch pad today, as well as pencils and an eraser, so I'm all set to continue my quest of drawing lopsided things. In the fantasy literature I've been reading lately, the characters are endowed with prodigious art and/or music skills, and sometimes I feel like I might not have what it takes to be a fantasy hero. It's a highly depressing thought. So I'm smoothing out the rough edges - learning to draw, sing, squaredance, whatever it takes.

While zooming around Bejing yesterday, I finished the latest novel (reading, not writing, I only write novels in November). Legend by Marie Lu. It was good. This "good" is especially good since the novel is in the YA dystopian / action hero genre, where it seems every other novel lives these days, since Hunger Games' success. Legend is way better than Hunger Games. It may have some plot holes, which I wouldn't know about as I suspend all disbelief when reading anything with good language, but at least the premise isn't completely retarded.

I'm also done with Daughter of Smoke and Bone. It was pretty good overall, but the overly girly dialogue and ubiquitous mid-conversation thoughts in italics bothered me. I also didn't really dig the whole seraphim / chimaera "forever war," it was a bit silly. If you're going with something that silly, you might as well take it all the way to This Book is Full of Spiders: Seriously Dude, Don't Touch It. Patrick Rothfuss, you can stop wishing you wrote it and finish The Doors of Stone already.

Tuesday, July 16, 2013

Inequality on the Chinese subway

I was traveling around Beijing all day today, on secret errands which I can't disclose due to patient <--> National Security Agency confidentiality agreements (signed implicitly via tapped phones and hacked email accounts). I've been on the subway a billion times, but today was the first time I noticed that the directions you get at the screen doors before entering the train are vastly different in Chinese and in English.

Here's what Chinese people get:
Ladies and Gentlemen, the train is arriving. Please remember to keep elbows away from gonads as you board the train, avoid spitting on each other, and most importantly, don't forget that it is our culture's great tradition to respectfully give your seat to elders, children, cripples and pregnant women (if it's a boy). Ride safely and politely, for God's sake!

And here's what foreigners get:
Ladies and Gentlemen, the train is arriving. Please stand firm and hold the handrail.

Now comes the pop quiz. Which way did you interpret this scenario? Is it that Chinese people need all those reminders to help keep them in line and not tear each other to pieces like wild animals? Or is it that foreigners are utterly hopeless, so wasting reminders on them isn't worth the cost of the electricity? Or did the writers guild go on strike in the middle of penning the 2nd announcement? Or did they flip a coin? Either way, shame on you, why don't you go think something nice about people for a change.

Monday, July 15, 2013

Take off your shirt. Now take off your rib cage.

I went to get a physical examination today. There's only one place in all of Beijing where foreigners can get a physical that carries any legal weight, so I got up at 6:30AM and triathaloned it there - walked to the subway, subway'd to the bus, bus'd to the middle of nowhere and walked some more. It was good weather to be healthy in, a relentless shower that occasionally scaled up to fairly convincing rain. The puddles were what made it fun, and I had extra time to enjoy them because I had no idea where I was going between the legs of the triathalon. Yes, it was very wet there. No, it wasn't very erotic. Yes, I just can't help myself.

Whenever I need to find a bus in China, I'm at a loss. And by a bus in China, I mean a bus anywhere. And by a bus I mean anything outside of our apartment. I'm hopelessly dependent on knowing where everything is beforehand, and since Yuan Yuan already knows where everything is, I don't even need to depend on that. If I'm looking for something and it's not on my computer, I call Yuan Yuan and ask her.

"Honey, where'd you put the tomatoes? In the fridge? Great. Which shelf? Okay, they're the red ones right?"

But this time Yuan Yuan was too busy to go with me, and the bus stop, sensing her absence, grew particularly nefarious. I got off the subway, picked one of the three available directions at random, mostly by virtue of it having a news-stand where I could ask for directions, and splashed merrily along. What I took to be a news-stand turned out to be a hot-dog stand, which I should have suspected was part of the bus stop's evil plot to waylay me. It must have known I was on a 30 day trial of being vegetarian and was testing me. If I even so much as licked a hot-dog (you get a free lick before you buy it), I would never find someone to take my physical in a million years. Unless I took a cab, then maybe in 15 minutes.

I asked the hot-dog vendor where the Beijing International Hygeine/Health Protection center was. He pointed at a hot dog. I repeated my question. He wasn't very happy about it. He assumed an irritated expression and wagged his thumb in a direction over his shoulder, roughly the direction from where I had come, but also only ~15 degrees off from another direction, over a bridge, which I was later to discover led straight to Hell. I pointed in the direction I had come from, and said "hmm?" He didn't confirm or deny and just repeated his pointing. I decided he was obviously lying and went across the bridge. 10 minutes later I came back and went in the direction he'd pointed out. I'd always had a weakness for reverse psychology, but how did the bus stop know that?

The physical examination itself was uneventful. I will therefore describe it in mind-numbing detail.

I was one of the first to arrive, and there was virtually no wait. I went from room to room getting signatures on my health sheet. I felt like I was carrying around a petition. "Will you vouch for my state of health please? I already have 5 signatures, I just need 2 more."

There were 7 components:
1. Blood test - barely felt it, the nurse was a pro. She was also a cutie pie. As she pricked my arm, she asked if I smelled a horrible stench. I was a bit perplexed, wondering if I'd accidentally crapped my pants, and whether she was now going to say she was obliged to give me a sponge bath. I raised an eyebrow quizzically. She explained that they were eating some Durian (fruit) earlier, and asked if I hated the smell. I admitted to hating it, but not to having smelled it. I complimented her on her needlework. She single-mindedly pursued the Durian offense and asked me if I'd dare try it. I said I'd do it for my country. She let me go in one piece.
2. Blood pressure & heart rate test - 115/68 I think, maybe not. The heart rate was 53, which the software the nurse was using labeled as "A bit too slow." I asked her if my heartrate was indeed too slow. She said yes, a bit. It was a dialogue for the ages.
3. Ultrasound (it's a boy)
4. X-Ray. I tried to go to the X-Ray room 3 times and each time some other doctor would rush over and intercept me and examine me. Then when the X-Ray was the only one left, a nurse's aid came up to me and took me outside to a bus. I climbed in, stood in front of a portrait of Mickey Mouse, with the words "Look here" inscribed on his forehead, got handed a big heavy triangular lead-filled groin protector and smiled for the judges while they irradiated my chest.
5. Electric conductivity test. The doctor clipped what looked like declawed jumper cables to my hands and feet, then stuck some leads to my chest. I asked her belatedly if she was going to shock the capitalism out of me. She said no. I can't remember what happened next.
6. Eyes and ears.
7. Food/Height test. This was the final test and held the biggest surprise. The doctor has the 2nd floor all to himself, and a spooky sign "Surgery -->" pointed right to his door, where he sat, beckoning me to come in quick before I missed my chance for a free amputation. He sat me down in a chair, scrutinized the palms of my hands for the briefest of moments, then probed all around and behind my jawline (presumably looking for hidden food caches, as the examination requires an empty stomach), then had me stand on what looked like a weighing device but with no display or little brass weights or demarcations of any kind. I asked if I needed to take off my flip-flops, he said no, and then pronounced me tall.

Guys, it took 27 years, but I've finally reached 1.8 meters. I'd like to thank my flip-flops, for giving me that extra boost, my doctor, for not giving a damn about accuracy, my parents, for believing in me, I couldn't have done it without you, and Yuan Yuan, who is always saying life would be perfect if she were just a little bit taller. Your dream has finally come true! To me.

Sunday, July 14, 2013

Yesterday's Post

The Matrix was still magical, for the 63rd time. The perfect dialogue, the salad of spiritual references, the gorgeous special effects, the ineffable ineffableness, none of that has aged much. But the speed has slowed. I'm beginning to feel a generation gap. 10 years ago the Matrix was a rollercoaster ride, a non-stop thrill that throbbed with suspense. In 10 years, The Matrix will be Bladerunner, a languid film-noir. The newer sleeker models are higher velocity if not higher impact. They don't dole out meaningful dialogue in consumable chunks, they slam you with it like a slam poet and leave you to figure out the details for yourself on the 3rd viewing. In this sense, The Social Network moved faster than The Matrix. I didn't understand a word they said in their crossfire dialogues and yet I walked away with the feeling that they were saying something interesting. Poor Matrix.

I was reading up today on how networks work. Some of it was review for stuff covered in my Computer Systems Engineering (6.033) class at MIT, but concepts learned in my formal education are often obscured by so much fog that it'd be easier to try to see the Beijing sky. Some seemed completely new, in other words the fog in front of it has solidified into intrabrain Jello and is refracting the hell out of my searches.

My favorite thing about networks is the hilarious pessimism that defines the whole field. For example, TCP vs UDP (the two major communication protocols on the internet):

TCP: "There is absolute guarantee that the data transferred remains intact and arrives in the same order in which it was sent."

Sounds good so far...

UDP: "There is no guarantee that the messages or packets sent would reach at all."

That's the spirit I love. I understand that this is true by definition, that such a protocol is very necessary, but the wording is always so tragic. They build you up...

TCP: "Sir Sean Connery will deliver your packet himself if necessary. Tom Cruise will not rest till your packet is safely at its destination."

And then they murder you...

UDP: "We take your message and throw it in the shredder. Sometimes we miss and if your destination happened to be the floor, congratulations!"

Too much fun.

One of the things that frustrated me about my education at MIT was that very little of the main curriculum was focused on practical applications. There were "hardcore" classes that delved into operating systems and compilers and other witchcraft, where you could probably get some solid experience, but the required courses in the CS branch hardly stressed practical skill acquisition. In other words, we didn't code much.

What we did, was perform largely a depth-first search into important but (in my opinion) secondary concepts. Intro to Algorithms, for instance, was probably my favorite CS class, but at the same time probably one of the most useless. At a real job, unless you're a researcher, how often do you need to come up with low-level algorithmic solutions? About as often as you need to build a lightbulb as an auto-mechanic. It was about as useful to me as the Special Relativity class I took for fun. I'd much rather have gotten a firmer grasp on the next levels up in the software abstraction onion - object oriented programming, application design, common development patterns, as well as gotten some crash courses into the most commonly used technologies (especially in web application programming) - CSS, Javascript, Servlets, programming for mobiles. When I did an internship at Microsoft the summer after junior year, I had to learn all the practical skills needed for my project on the spot. My MIT education hardly helped me at all. When 5 years later I did some more serious hacking for two start-ups, I had to learn everything as I went. My MIT education played with itself somewhere in a far corner of my mind while I was getting my hands very very dirty.

I remember during the tour at MIT, when I was still a senior in high school, the guide was telling us how MIT teaches people "how to think." It sounds oh so romantic, but it's hadly true. It's more like you go to MIT to train to be a blacksmith and when you go to your first smithy after getting out, you find yourself constantly hitting your thumbs with the hammer you've never wielded before. But you sure know a lot about iron.

Anyway, MIT was fun, I don't resent it at all. I could have pushed myself harder and searched out the opportunities for practical application. It just wasn't force fed to me, like I think it should have been.

Saturday, July 13, 2013

Coffee and Astronomy

I'm not a very loyal addict. My half-pound of coffee arrived today and my brain is steeping in a comfortable brown bath. I'm not even thinking about chocolate anymore. I am most certainly not thinking about warm gooey chocolate brownies fresh from the oven, of dipping Hershey's kisses in gnutella and then in fondue while surreptitiously scouting out the premises to finagle a moment of privacy in which to take the fondue head on, literally, or ripping off all my clothes and jumping into Willy Wonka's chocolate pool and seeing if my lungs can extract oxygen from liquid chocolate. If they can extract it from liquid oxygen, I don't see the problem. Coffee is fantastic.

The Daughter of Smoke and Bone is getting a little more exciting, though I can't shake the quasi-guilty feeling of reading something that may or not be quasi-pulpish. The only thing I can say for sure about it is that I'm still reading it. But I may reread The Name of the Wind when I'm done. Meanwhile in Lamb, Jesus is making friends with the abominable snowman. Biff has just proposed the theory of evolution to him and Jesus rejected it even faster than he did Biff's theory of universal stickiness (gravity). Good fun.

As soon as this entry is done, we're going to watch The Matrix. It's been a couple years since I saw it last, so pile on the shaming. My dad may disown me if he reads this and believes it. Mom will have to raise me all on her own, and the four of us (my sister will also be present) will have dinner together occasionally and talk to each other through her.

Dad (to Mom): honey, will you tell my former son to pass the salt?
Mom rolls her eyes
Me: It was only one time! For two years! How long are you going to punish me for this!?
Dad (to Mom): what are we watching after we finish this glorious dinner?
Mom: ...The Matrix?
Dad: and who's not invited?
Sister crosses fingers, hoping it's her

Speaking of epic, for those of you who are always complaining about hearing Stairway to Heaven in every corner of the room, listen to Astronomy by Blue Oyster Cult. It was my go-to track for short distance running, the two times I subjected the local gym's treadmill to that kind of unholy contrast between awesomeness and mediocrity.

Friday, July 12, 2013

Good Reading

I've been reading a lot lately and watching very little. I usually start several books at once and let them compete for my interest. Sometimes I end up dropping all of them but usually one grabs my attention and I'll abandon the others to their fate. If they deserve to be read, they'll remind themselves to me I figure.

The latest winner was The Guernsey Literary and Potato Peel Pie Society, a charming novel (?) written entirely in letters, and thus constantly juggling ~10 voices. Though I really liked the book, I'm a very lazy reader, and when towards the middle I realized that this character Susan Scott, who showed up less frequently than the rest, was a blindspot in my mental cast lineup, I bulldozed through Susan's latest letter without skipping a beat. Someone else may have flipped through to the beginning of the book and sniffed out this woman's role (I'm reasonably sure she's a woman), but I'm not bothered by such minor inconveniences as not knowing who a character is. I read purely for the pleasure of the process, which is why I can reread all the books I've already read and enjoy them the same the 2nd time around. In fact, when I was younger, this was exactly what I did. I had two books that I loved, which was the only fact I remembered after reading them each time, and I would read them over and over while my parents tried to inveigle me into reading something new. "Didn't we say you'd like Three Musketeers? Trust us, you're going to LOOOVE ...(I forgot)." Yea, and you were right, Three Musketeers rocked so hard that who would ever need another book?

Anyway, dear Susan, these days, I'm more adventurous and I constantly read books I've never read before. I think. It's hard to tell sometimes, every book's a bit of a deja vu once you start either enjoying it or stop caring a fig for it.

The current book I'm munching on is Daughter of Smoke and Bone. So far it hasn't blown me away. It reads a bit like the supernatural (vampire, werewolf, zombie, turducken) adolescent melodrama crap my sister binges on (no offense sis, and good to see you here!), but it's also got a bit of a spunky Hellboy touch to it, which was decent fun...but I draw the line at decent. The main reason I'm still reading it is that it comes with Patrick Rothfuss's effusive recommendation, the Patrick Rothfuss who has us all biting our wrists (we already gnawed fingernails, fingers and hands off) waiting for the last installment in the Kingkiller Chronicle. I'm way more excited about it than you were about the 7th Harry Potter book. Trust me on this one Susan, go to the nearest bookstore right now (don't fret, there's one right on your Kindle), and get yourself a copy of The Name of the Wind, the first book in the soon to be trilogy.

Now I must really bid you farewell Susan, I've got some mean potatoes to peel.

Thursday, July 11, 2013

30 day trialarama

I'm experiencing extreme withdrawal. If any of you have ever been addicted to heroin, tips would be much appreciated right now. Today is the first day of six 30-day trials, the most important being a rerun, a classic, a killer, a challenge about which epic love songs have been written - no sugar. I don't know why I do this to myself, I would not approve if I were me. So far I've managed to slip into daydreams about candy roughly every 10 minutes. If I could just do a reality check every time I craved a piece of chocolate, I'd have already had 50 lucid dreams today.

The other trials are:
2. 300 pushups / planks mix & match, where a 2 minute plank is equivalent to 50 pushups. In 30 days, my lower back will have bigger pecs than my chest and I won't be able to do planks anymore because my abs will touch the ground. Children will use me as a rocking horse.
3. Read with Yuan Yuan in English for 30 minutes. Currently we're halfway through Lamb (The Gospel According to Biff, Christ's Childhood Pal), hopefully we'll finish that this month. I'm accepting suggestions for the next book. Candidates need to be either extremely funny, or at a middle school reading level.
4. Being vegetarian. Piece of cake as chocolate is the only meat I care about.
5. Stretching - 2 mins each of 5 different stretches. I hear that being flexible can extend your lifespan and it makes sense; corpses are the least flexible people I've ever met.
6. Blogging every day. This one started yesterday. I've failed the previous two times I attempted this one, but will never admit it.

No sugar is undoubtedly the hardest; I've yet to invent a doable 30-day trial that's harder. Even the trial of doing 25 pushups every time I wanted to sit down, and the trial of no sitting down at all for 30 days (except to poop), pale in comparison. I've been to the fridge more times than I've done pushups and there's never anything new there. I've forgotten all about Mario. Unless it's secretly him that my subconscious is looking for in the fridge.

Wednesday, July 10, 2013

Mario is history

Mario left yesterday, back to the land next to the land of the burrito. For the last three months we've been singing the refrain "if Mario leaves..." then "if Mario leaves in July..." and finally to "if Mario leaves at 1:30AM on July 9th..." (Note to self: good outline for a song). It started because Jia Yan and Yuan Yuan are hopelessly romantic at heart, having their brains filled from an early age with Chinese soap opera sludge. It still leaks out their mouths though we've stoppered their eyes and ears. If life were a soap opera, there would be a final "if" at the airport, a plaintive "if you leave me now..." and Mario's heart of anti-(social)matter would finally signal to him in furious Morse code that he has to stay. For the orphans, of course. Alas, the orphans will have to fend for themselves this time. Mario would appreciate the irony, he loves Charles Dickens.

When the game started, Mario would roll his eyes as he hadn't the shred of a Parmesan cheese crumb of a doubt that he would leave on schedule. But eventually he joined the party. "I haven't decided if I'm going to live with Ben or by myself when I go back. If I go back, I mean. And if Ben doesn't move here..." We all laughed at each episode of "If Mario leaves" and I'm sure Jia Yan's heart broke a little each time but she did a great job of hiding it. I only once saw her puffy eyed and that was on the last day, when the mystery was about to be solved and the "will Mario leave?" question was about to be casually duh'd out of existence. Apparently it was a four player game because it doesn't seem as fun anymore.

Today our new roommates arrived, fresh from the roommate factory. They're a Chinese couple, and half of them are pregnant. The first thing the pregnant half did upon arrival was jump on our electronic scale and complain about not being fat enough. I'm in love with her already.

They seem...nice. Like elves. After the weigh-in, they offered to take me out to dinner, which I politely refused, then they walked around outside until they hit their quota of toxic air and went promptly to sleep at 10:30. I have a feeling they might get up at 6 and make me breakfast, then leave some on the table and quietly slink off to work so I won't be shy about eating the leftovers in front of them. Then they'll come home and quarter me for eating their food. Cause they're evil elves. We'll see.

Here's a slice of Mario before you go:

Mario: what do you think would be easier, if space was limited or time? ...Probably space.
Mark: unless you're stuck inside an egg
Mario: yea, good point. Even if the egg is light years across. Uhh...I feel so claustrophobic