rlucas.net: The Next Generation Rotating Header Image

Don’t Bother with S3FS for Mounting Amazon S3 on Mac OS X (2014)

As of January 2014, it’s not worth bothering with the “s3fs” software for mounting Amazon S3 buckets on your local filesystem.

The idea of s3fs is simple and great: use FUSE (Filesystem in Userspace) to “mount” the S3 bucket the same way you’d mount, say, an NFS drive or a partition of a disk. Manipulate the files, let s3fs sync it in the background. Sure, you lose some reliability, but we’ve had NFS and SMB and all kinds of somewhat-latent-over-an-unreliable-link-but-mostly-with-filesystem-semantics software for decades now, right?

Well, forget it. s3fs as of January 2014, used on Mac OS X and against an existing set of buckets, is so utterly unreliable as to be useless.

First, s3fs cannot “see” existing folders. This is because folders are a bit of hack on S3 and weren’t done in a standardized, documented way when s3fs was first written. However, since then, at least two other ways of creating folders on S3 have gained currency: an older, deprecated way with Firefox plugin S3Fox, and a newer defacto standard way with Amazon’s own management dashboard/browser for S3. Whatever the historical reason, you can’t see the existing folders.

Second, although from mailing list posts, theoretically you can *create* an s3fs folder with the same name as your existing folder, and then its contents will magically become visible, empirically something rather different happens. A mkdir on the s3fs mount leads to the creation of a mangled *regular* file on the S3 dashboard. Now you have two “folders,” each of which is unusable as a folder on the other (S3 dashboard, or s3fs) system. Argh.

Finally, you might say, ok, fine, this will just make me use flat-level, non-folder-nested choices about my S3 architecture. (Leave aside for the moment that the very reason you want to use S3 is probably exactly so that you can have lots and lots and lots and lots (like 10^8+) files in a way that will cripple any reasonable filesystem tools that see them all in one “directory.”) However, even that doesn’t work reliably, as s3fs demonstrated today when it went into “write-only mode” such that I could create files locally that would show up on S3 but that subsequently would disappear from my local filesystem. WTF?!?

The unfortunate answer is: S3 is not a filesystem, and it was created by people who are smarter than you, and who have very craftily calculated that if you are forced to weave in the S3 API and its limitations into your application code, you will have a damn hard time ripping it out of your infrastructure, and so they are going to have you do just that. They do not want it to be used as a filesystem, and so guess what: you are *not* going to use it as a filesystem. Not gonna happen.

Say what you will, but our hometown heroes here in Seattle are no dummies. Embrace, extend, extinguish, baby. Not just for OS companies anymore…

(Yes, I know that s3fs is not an Amazon project. But it appears to be the community’s best attempt to put filesystem semantics around S3, and that attempt has been rejected by AWS’s immune system.)

Never Trust Microsoft Products On Mac OS X, Again

Something in OS X 10.7+ and MS Office 2008 for Mac has made the entire Office suite, apparently, stop respecting symlinks.

I know that Windows took until well into the 21st century to really deal with symlinks even halfway, but come on. It worked before. There are some directories into which I routinely save document files which are literally not reachable by click navigtation any other way but through symlinks.

If you click on the symlink in the “Save” dialog, it will change the name of the file you’re saving to the name of the symlink and generally fail all over itself.

Never Trust Microsoft Products On Mac OS X

In Microsoft Word 2008 for Mac OS X, if you open a “Find” dialog, and if it has focus, it will capture cmd-S (the universal “Save” command) and cause it to toggle the “sounds like” option in advanced find options. It will sort of capture cmd-W (the universal “close Window,” which will close the Find dialog). It will not capture cmd-Q (the universal “Quit”), which will quit the program and close all its windows, assuming your document has been saved.

Which you thought you’d been doing by hitting cmd-S. And then you wonder why your search results were so weird.

Thanks again, Mac BU!

LinkedIn CPC Ads behaving weirdly

This June/July, over at SimpleVerity, we’ve been running some very tiny, super-targeted CPC ad campaigns on LinkedIn to recruit trial users of our system. We’ve noticed the following odd behaviors, and I wanted to ask the Web if anyone else had seen this:

– Lower bids (bottom of the range) outperform higher bids on both CPC and conversion (learn more form on my landing page). Weird, but perhaps explicable; it could be that for our particular appeal, the “lower ranked” ad slots work better.

– Temporary “spike” in CPC, and BIG spike in conversion, right after a change to the campaign configuration. This is strange, because it seems to result not only in a change in how the LinkedIn users react (could be a result of the ad rotation algorithms after a change), but also how they behave once they get to my landing page. No theory for how this works.

– Auto-Optimize among campaigns seems to prematurely start making optimization decisions before reaching anything close to statistical significance. For example, I was running a campaign where the long-term equilibrium average CTR seemed to be about 0.9% (not bad, right?). I had 15 variations running. However, the auto-optimize algorithm started heavily favoring a few ads before all variations had received even 1,000 impressions. That’s just crazy; the ads being disfavored were about 50/50 bets at that point to exceed the average, yet the algorithm was “optimizing” them into oblivion.

My takeaway is that, at least when working with heavily targeted LinkedIn CPC ads, you have to stay very, very close to the “metal” and pay attention to oddities. Don’t assume that paying the highest bid (or even paying more than the bare minimum CPC price) will work better; relentlessly experiment with spend and bid. Also, don’t let auto-optimize kick in until you are comfortable that you are approaching significance on the expected CTR (at the very least, the CTR that you are hoping to “beat”).

TrueCrypt breaks after OS X 10.8 (Mountain Lion) upgrade

1. You run TrueCrypt as before, and once you finally remember your passphrase and type it correctly, you get an error: “the MacFUSE file system is not available (71)”

2. You look around and you still have /usr/local/lib/*fuse*.so etc., in addition to /Library/Filesystems/fusefs.fs

3. Your MacFuse control panel in System Preferences still exists (but the “uninstall” button doesn’t seem to work!). Also, the script which that button runs, /Library/Filesystems/fusefs.fs/Support/uninstall-macfuse-core.sh — that doesn’t work either (run with sudo).

4. You’ve tried installing “fuse4x” and “fuse4x-kext” from MacPorts, but still nothing.

What I did:

1. Remove MacFUSE manually, completely, using the list of installed files at http://code.google.com/p/macfuse/wiki/FAQ

MacFUSE file system bundle (/Library/Filesystems/fusefs.fs)
MacFUSE Objective-C framework (/Library/Frameworks/MacFUSE.framework)
MacFUSE C-based libraries (/usr/local/lib/*fuse*.dylib) and headers (/usr/local/include/fuse*)
MacFUSE preference pane (/Library/PreferencePanes/MacFUSE.prefPane)
MacFUSE project templates for Xcode (/Library/Application Support/Developer/Shared/Xcode/Project Templates/MacFUSE)
2. Remove /Applications/TrueCrypt.app

3. port uninstall fuse4x and fuse4x-kext

4. Reboot. (Might not be necessary but can’t hurt here.)

5. port install fuse4x fuse4x-kext

6. Reinstall truecrypt (you might need to option-right-click to bypass the security check). Note that installing truecrypt, I believe, re-links the TC binary against the fuse libraries that you just re-installed using MacPorts, so you end up with a different TC binary than before.

7. Run TrueCrypt.app again and hope that it all worked…


Don’t try to do date math in MySQL

MySQL (5.5) has incredibly broken date math semantics.

Subtracting two “datetime” types gives you a number which is manifestly not the number of seconds between those datetimes. (It’s also not ~ 10^n times that number for any n.)

So naive subtraction is broken. What about “timediff?” Well, you can use that function to compare two datetimes, and what it returns you is in the form “HH:MM:SS.” Nice. Seems to be some kind of useful interval type, right? If you decide you just want to do some averages on this result, you can then use the “time_to_sec” function, and now you’re computing some nice figures like the average time to click on an email.

…which, in keeping with the MySQL philosophy, sort of works until it (almost) silently stops working. What I mean is that the first time your date math gives you a figure like “883:15:19,” the “time_to_sec” function will start quietly giving warnings. If you turn on warnings (which really REALLY need to be on by default, here, MySQL folks), you will learn something like:

Warning (Code 1292): Truncated incorrect time value: ‘883:15:39′

Oh, great. There’s some number of hours one can put into a time value which is subsequently converted into seconds. What that number is, who knows. (Apparently not the author of the “timediff” function, because that’s what gave me that incorrect time value.)

Just give up and convert everything to an epoch timestamp. After all, who needs milliseconds anyhow? Other solutions include: use Postgres.

Quick Django Foreign-key Gotcha

When your Django app poops out with:

'RelatedManager' object is not callable

The problem might be that you’re trying to call up related fields via a foreign key field type’s auto-generated reverse-lookup attribute — but mistakenly trying to call it as a method instead of as an attribute that holds a query set. In code terms, you put:

tracks = cd.track_set()

What you meant to do was:

tracks = cd.track_set.all()

China 2008 Reflections

Observations on China
August 2008
Randall Lucas

This blog post, adapted from a letter to friends and colleagues, summarizes my observations from a recent trip to Beijing, Shanghai, and some smaller cities in between, during three weeks in August, 2008 (coinciding with, but not focused on, the Summer Olympics).

While no short trip or short document could hope to capture much of this vast country and ancient civilization, I certainly felt I learned quite a lot.  My target audience is the Western thinker who has not (recently) visited China; old hands at Sinology are asked to indulge me some basic explanations in parts.

Originally composed at Seattle, Wash., 25 August 2008.

I am dividing my observations into the following broad categories:

– Labor
– Sharp Edges
– Maintenance
– Content
– Health
– Sex
– Law and Government
– Intellectual Property
– Video
– Service
– Salesmanship
– Cargo Cult

– Labor

Every Western observation of China must begin with the sheer quantity of humanity.  In fact, this great number is not apparent in the way one might find most obvious (on the streets of the cities).  Nowhere in Beijing were the streets anywhere near as crowded as, say, a New York shopping street in December.  However, this may be because of the government’s Olympic preprations, which, rumor holds, caused all of the construction workers, laid-off and gypsie cabbies, and “aunties” (older cleaning maids) to be sent out of town for the duration.

Rather, the way the relative scarcity or abundance of people is made visible is through the labor market.  And the shocking discovery is that /labor is essentially free in China./  The cost of hiring a full-time employee is less than what we would consider, in the West, the mere “overhead” of keeping an employee (taxes, insurance, etc.).  Consider the following examples:

A tourist-targeted tailor’s shop offers to add French cuffs to a shirt or working buttonholes to a suit coat for no extra cost.  It’s as though the labor involved in sewing is just a loss leader to get the fabric sold.

Each floor of a hotel, each car of a train, and damn near each table at a restaurant has a fuwuyuan, or attendant, serving just that floor or car or table.  This is in addition to the normal complement of staff that you would expect (bellmen, clerks, conductors, waiters, etc.).

Foot massage is a ubiquitous creature comfort, and is 40-100 RMB ($6-15 US) for an hour (likely including tea and other consumables) even in the large cities.

Gas costs over 6 RMB a liter, almost $3.40 a gallon, and yet the taxi fare in Beijing is less than 50c per mile.  The cabs are either old shitboxes or, surprisingly, many newer Jettas and Hyundais.  When you consider that gas and capital costs are nearly the same as for a U.S. cab, the cost of labor almost disappears in the numbers.

Instead of coinboxes, buses have a ticket-seller on board to make change and shepherd passengers.

A result of having such a huge number of people is how you relate to them.  My take on the “sea of humanity” effect is that it leads to a binary view of others.  You are either Somebody (a friend, a colleague, a customer), or Nobody At All.  If you are Somebody (and you can become Somebody through just the briefest exchange or introduction), you will be extended every courtesy.  If you are Nobody At All, then expect to be ignored, cut in front of (in line), dismissed with an indecipherable grunt, and almost literally spat upon.  It seems rude, but it’s a fairly effective way to run a civilization of a billion and a half souls.

Finally, it is worth noting that even with all these people, on the ground, China still operates at human scale.  For example, we bumped into a (Chinese) girl at one tourist site two days after we’d briefly spoken at another, and recognized each other.  There are not so many people that these sorts of things can’t happen.

– Sharp Edges

Things in China have sharp edges.  Don’t want to fall off the edge of that stone stairway (sans handrail)?  Well, don’t walk next to the edge.  Don’t want to break an axle driving down a main urban street?  Well, don’t drive over that open manhole.

2- and 3-star hotel rooms may or may not have a smoke detector, but will definitely have burn marks all over every tabletop and counter surface from where forgotten cigarettes burned themselves out, thankfully without incident.

I still haven’t figured out what it is the taxi drivers all say when you start to reach for the nonexistent or nonfunctional seat belts in back, but it’s on the order of “give it up.”  (Tip: the front passenger “suicide seat” might be a better deal, as its belt more often works.)  Beltless cabs comprise 80-90% of the total.

Seatbelts: a fantasia

Traffic itself is a royal flying three-ring clusterfuck with crossed palms.  No, it’s nowhere near as interesting as videos you may have seen of bike and motorbike armadas playing chicken with trucks in faraway Asian cities.  There do exist controlled intersections, although I’ve seen every category of vehicle, from rusty trike to posh bus, blast full speed through red lights.  And the number of truly outrageous specimens, donkey-drawn carts or rickshaws piled high with crates of live chickens, etc., is minimal.  But shenanigans like steadily pushing through a left turn  against four lanes of oncoming traffic, straddling lanes on the major ring roads, or just plain driving into oncoming traffic for a brief while, are all to be expected from cabbies if not everyone.  I recommend dosing your anxiolytic of choice before your first day of cab rides.

Amazingly, I saw only one wrecked car the whole time, although I was close enough to hear and smell the rubber of some squealing near-misses.

Lots of folks wear flip-flops everywhere, despite the ubiquitous presence of shit (by which I mean not junk, but actual turds of unknown provenance).  Nails and such are fairly common, although broken glass gets swept up quickly by ubiquitous attendants (see “Labor” above).

If you eat enough, and interesting enough, food, you will eventually be served things that you might choke on (bones, shells, inedible bits, etc.).

The glib, and not a little racist, take on all of this is that with so many people, individuals’ lives and safety count for less.  Whether or not this is true, I don’t think it has explanatory power.

My theory is that this state of affairs is the result of limited civil remedies against businesses and the sovereign.  If you effectively can’t be sued or voted from office, then why fix, clean up, or make safe your restaurant, shop, or city?

Safety first!

– Maintenance

Maintenance of capital assets is simply not a natural follow-on to their acquisition in the way we think of as a best practice in the West.

Of course, things are created and built in China very competently and often on a grandiose scale — think of the Bird’s Nest stadium or the Water Cube for the 2008 Olympics.  But I believe that within five years, these gems, if still standing, will have fallen into a shameful disrepair (beyond the norm for disused trophies of expos and games long past, like that weird World’s Fair thingy in Knoxville).  This is because nothing, it seems, gets maintained in China.

My first ten nights were spent in a posh apartment in a high-rise built in the last several years by a Hong Kong developer (your hint of this is when the internal signage is all in traditional characters).  Covered garage under a fountain and lawn; legions of starched-shirt, polite security guards; marble, steel, flat-screen TVs and all that.  We towered above the neighboring tenements.  But despite all of this, there were subtle hints that something was amiss.  A sheet-metal sign near the private tennis courts was bent at the corner into a menacing protrusion.  Some of the flagstones were broken, others wobbly.  The elevators were intermittently functional.

The residents of this high-rise were expats (one gal working for the U.S.  Army was dropping $4000 of your tax dollars monthly on a two-bedroom) or Chinese upper-class folks: surgeons, bankers, and the children of the wealthy.  So, while this building was hardly the very most upscale in Beijing, it was no slouch even by U.S. (cost) standards.  Yet the maintenance of the facility lagged well below what Americans might expect from, say, a well-run Holiday Inn franchise.

Paradoxically, it felt as though we were in a place where capital (initial building cost) was “cheap” while operating expense (mainly labor) was “expensive.”  Of course (see “Labor” above), labor opex is nearly free, while capital (though the issue is complex and nonmonotonic) is constrained.  This makes me think that the problem is probably a mix of management culture and accounting practice.

Other examples of maintenance issues are visible at hotels which have been open more than a few years.  As the Lonely Planet “China” guide opined, many hotels are “manifestly” one star lower than their ostensible rating after having been open a while.

Grand Hotel, Petite Slippers

Finally, I want to make a couple of observations about maintenance of historical sites.  Specifically, on Tai Shan, the holiest mountain of Daoism, there are numerous shrines and temples up and down the slope.  They are often in ill-repair from an infrastructure-maintenance point of view, but this is not because they are in any way being historically preserved for “authenticity.”  Many of them bear plaques indicating their age, but a curious pattern emerges.  The typical plaque says something like:

“The Temple of the Holy She-Wolf has been here since antiquity, but has been rebuilt many times since 1650.”

Is that the same temple that was there in 1650?  Or the same as was there in antiquity?  The writer of the plaque seems to imply that it is the same, merely rebuilt.  Or perhaps it doesn’t matter that it is no longer the same; perhaps there is an Eastern philosophical outlook at play that suggests we overlook the artificiality of the new vs. old distinction.

But if that sounds hokey to you, it does to me, as well.  I think a more likely suggestion is that since some parts of China are so very old, and since history gets measured there in dynasties instead of decades, the “oldness” of a 1970-rebuilt temple vs. an 1890-rebuilt temple vs. a 1770 rebuilt temple vs.  a 1650 rebuilt one is all about the same — on the order of “not that old.”  I also suggest that a sense of permanence accompanies this idea of longevity, so that any urgency is removed from the need to keep things just so.  Combine that with a lackadaisical approach to routine maintenance, and it starts to make sense to just rebuild the Temple of the Holy She-Wolf every several decades after it’s crumbled past some unusable point.

– Content

China is dying for content.  To a first approximation, all content in China sucks.

Television is horrendous.  CCTV (state television) controls several channels, and apart from heavily censored news (with Mao’s portrait over the Forbidden City behind the anchors) and Olympic sports, the content was:

Kung-Fu Movies
Soap Operas
Bland Music Shows

But mostly, Kung-Fu.  I know it sounds like a bad joke, but it’s not.  At any given time you can turn on the TV in Beijing and find at least two channels with some guy in a ponytail kicking some guy in pajamas.  And we’re not talking Jackie Chan or Bruce Lee, export quality stuff — this is mainland Chinese knockoff, crappy effects, no athleticism, martial arts mush.

I managed to flip through the 20 or so channels available about once a day.  The only imported Western content I saw was an overdubbed episode of “Growing Pains,” the 1980s sitcom.

(In non-broadcast media [e.g. DVD or VCD] you can get dubiously licit copies of Hong Kong movies, which are usually still pretty high on the Kung-Fu and the violence but have something approaching plot, cinematography, and acting to bolster it.  And, of course, pirated Western movies are around on DVD, although the Olympic cleanup effort swept most of this into back alley shops.)

In print media, I am told you can get a copy of the NY Times or the Wall Street Journal in a five-star hotel.  However, I never once saw one.  Not in a hotel, not in a newsstand, and not even in the largest foreign-language bookstore on Beijing’s main shopping drag.

China wants content.  Adores content.  Needs content.  And by “content,” I mean both the longer-form stuff — albums, movies, TV shows, songs — that we typically think of, but also the short-form, non-media content that is embedded in products and the built environment, like brands and design.

Look at kids walking down the street.  They want content on their shirt so badly that they wear nonsensical, misspelled knockoffs of Western logos, slogans, and graphics.  Half the kids in the Internet cafes (wang-bas) are watching video-on-demand.

But there are two totalitarian forces standing in the way of the Chinese getting content: the Chinese government, and Rightsholders.

The Chinese government does not want a populace aroused (in either sense; see “Sex” below) by uncontrolled foreign content.  Make no mistake: this is naked fear on the part of the government.  But, they control the outlets and the press, so in a move of simple genius, they just don’t allow any uncensored content.

Rightsholders, those rent-seekers who find themselves quasi-legally entitled, in the West at least, to a monopoly on the use of certain information, are just as scared.  Their fear is just as blind and just as destructive; for more, see “Intellectual Property” below.

Maybe China has spurious DMCA abuse, too?

– Health

China is a ticking time bomb of public health.  Bird flu or SARS are red herrings.  The dominating effects over the next 20 years will be chronic lifestyle issues.

Smoking in China is where it was in the West at midcentury, acceptable (and actually done) literally everywhere I went except for inside airplanes and train cars.  Restaurants, taxis, Internet wang-bas, you name it.  This would not be such a shocker, I admit, if the entire First World hadn’t made a jihad against tobacco its major accomplishment over the last ten years (with even iconically fumigaed French restaurants and Irish bars banning smoking).  But it seems very unlikely that this trend will catch on in China (although trends are propagated in odd ways; see “Law and Government” below).

Deep fried everything is more ubiquitous, in some cuisines, than in a Deep Southern lunch counter.  In those cuisines that don’t subscribe to the fry-everything model, another lurking danger is the taste for pure animal fat.  The costlier a piece of pork is, the more likely it is that it’s got a half-inch thick fat-cap slow cooked and carmelized on top of it.  (The first three such morsels you eat will overwhelm you with goodness, melting like a cross between fine smoked slab bacon and cotton-candy in your mouth.  But then you realize that there remain twenty more bites on your plate, and the thought of eating a half-pound of suet sobers you up quickly.)

American bobos and self-anointed gourmands who get high on “authenticity” (see also “Intellectual Property” below) will be glad to hear that yes, your local “Jade Garden Pagoda” (or whatever) take-out place is doing it all wrong, and that all that soy and oyster sauce, must not be Truly How It Is Done.  But foodies, hippies, and cardiologists alike would be aghast at how much salt, sugar, MSG, and God Knows What Else does “authentically” make it into the food.  Drenched in sugary sauces, salted to the extreme, and systematically selected for fattiness describes just about everything besides staples and vegetables.

People (except those who eat only staples and vegetables) are getting fat in China, and it’s going to get worse.  The standard Beijing or Shanghai adult male summer uniform of short-sleeve shirt tucked into navy blue polyester pants with some kind of plastic loafers, is not complete without a modest (by American standards) but growing paunch and a phlegm-hacking cough.

Booze flows freely everywhere, and beer is the beverage of choice to accompany meals.  (Good damn luck getting a nice glass of red wine outside of a truly upscale restaurant!)

In Beijing and Shanghai at least, the bicycle is no longer ubiquitous.  I saw more bicycles (parked) than electric bikes, but the majority of vehicles actually being ridden around were powered (electrical or tiny motors).

Bikes and mopeds: you tell me how folks are getting around

There exist gyms and health clubs, but in nothing like a proportional amount to the population.

– Sex

Maybe the health and wellness industry is stunted because one of its key drivers is completely squelched.  Chinese aren’t yet whipped into a neurotic frenzy over body image and attractiveness, because there is essentially no sex in the media in China.

By no sex, I mean at any level.  TV and movie content may be romantic but is largely chaste.  The only “bikini” level body exposure in any medium I saw was during Olympic beach volleyball broadcasts.  And rap music video-style booty shaking, Cosmo-style cleavage-showing magazine covers, or outright porno?  Forget it.  It’s just not there.

That’s not to say that there’s no sex industry in China.  It’s just run in a complete mirror image of the way an American might expect: prostitution is ubiquitous and rampant, but harmless looking is completely impossible.  (Gentle reader, trust that I had only your curiosity in mind during my research; suffice to say my conscience remains clean, yea though my mind be incorrigibly dirty.)

There exist “sex shops” in the major cities, but, curiously, they sell only “appliances” and not pornography.

My Shanghai (a more Westernized and racier city by far) hotel ostensibly had adult video-on-demand on the TVs in the room.

Now those are some enticing titles

Massage parlors are commonplace and, with obvious hookerific exceptions, completely legitimate (or rather, I should say it is possible to get a completely legitimate foot rub there).  45 minutes into the hour long foot massage, though, the inquiries begin: do you have a taitai or a nupengyou (a wife or a girlfriend)?  Locals confirm that it is nearly always possible to negotiate extra services, even at these “legitimate” establishments.

Also fairly blatant is the pimp’s street come-on, common on tourist streets after dark: “Hello hello my friend, you like lady?”

Despite the fact that you’re never a kilometer from a negotiably naughty massage joint, there are no nudie or strip clubs at all.  A Beijing Hooter’s franchise is as close as you can get.

I find it hard to believe that market demand is what shapes this skewed-to-extremes adult entertainment industry; after all, one would expect that increasing social opporobrium on the scale from Hooter’s to hookers would suppress incidence.  The opposite is true of market offerings in China.  Which is almost certainly the result of government policy.

– Law and Government

The law and the government (very nearly one and the same) in China use a bizarre mix of laissez-faire and complete thuggery to distort the hell out of various markets at the whim of the relevant officials.

Most of you have probably heard about the dramatic measures the government took to clean the air in time for the Olympics: unilateral shutdown of nearby factories, car rationing by license number, and even cloud-seeding to induce cleansing rains.  Did you also know that the leftmost lane on every expressway around Beijing was repainted with Olympic rings, for the exclusive use of credentialed Olympic vehicles?  Or that every single taxi driver in Beijing was spruced up with a collared shirt and tie, at risk of a 200 RMB fine, for the games’ duration?

These measures sound slightly wacky, and, at least to you collectivist Seattle eco-hippie readers unconcerned with factories’ positive contributions or cabbies’ sartorial discretion, mostly harmless.  (The anti-spitting propaganda campaign, for example, was definitely a plus.)

But an example of something more troubling is the clean-up approach to the crime on Beijing’s premier bar street, the Sanlitun district.  Like any nightlife area, it had an underground economy, and as is common everywhere, foreign (in this case, North African) gangs had mastered the distribution chain for the relevant goods.  The rumor we heard in hushed tones from Sanlitun regulars, as they pointed out the absence of nearly all black folks from the district, was that two weeks before the Olympics, the police simply gave the bum’s rush to any blacks they found in Sanlitun.  The cops logic was brutal but effective, in the Chinese style: some North Africans are known to be dealing in Sanlitun, so let’s drive anyone who looks vaugely like that out of the district.  Problem solved, sort of, and quite messily, in that way that the Chinese government solves problems.

Another “solution” is ubiquitous surveillance.  Tourists enjoying the Summer Palace (which, by the way, puts Versailles to shame both in grandeur and in tastelessness) will see staring back at them, among the odd-numbered gargoyles atop the pagoda roofs, closed-circuit TV cameras in steel housings.  (In a weird echo of Orwell’s telescreen, the name of the Chinese state TV broadcasting monopoly mirrors back the name of the surveillance cameras: CCTV.)

Cops are everywhere in China, though they kind of look like rejects from the third string of the little league minor team — skinny kids in ill-fitting green uniforms — or else slightly more swaggering versions of the universal Chinese adult male (avec paunch, emphysematic hack, and navy blue polyester).  Nobody seems to have a gun, except for the occasional hardcore ninja team that sweeps through transit hubs with machine guns and full armor.

The operation of the cops on the ground is a sort of mirror of the operation of the government at large.  In Qingdao, on the boardwalk to the little pagoda in the harbor (see your nearest Tsingtao beer bottle label for an illustration), hawkers selling seashells, carved bone combs, and similar items do a brisk business selling to the (Chinese) tourist throng.

Qingdao vendors (crouched/seated on the dock) before the cops.

As I walked back toward the shore from the end of the pier, though, I noticed the vendors getting all a-twitter and standing up from their crouches.  A cop car was slowly rolling down the pier.  As the car got about 10 meters away from each vendor (camouflaged by the crowds), each vendor rolled up his seashells and tossed them into the sea, some jumping to follow their package into the water.  Once the cops had made their way down to the end, they stopped, turned around, and headed back — and just exactly opposite the way they disappeared, the frogman vendors and their goods reappeared back in their original places, a bit damp but back to business.  There was no secret as to exactly what each party was doing, but as long as the cops didn’t see the vendors actually in flagrante delicto, everything was kosher.

Where'd they go? (Hint: into the drink)

(Alas, I was too scaredy-cat to photograph the cops themselves.)  The Qingdao seashell sellers exemplify the approach of small entrepreneurs to the law — scrupulous compliance (or at least invisibility) when the eye of the authorities is turned, and business as usual when it looks away.

The government does not always rely on the formula of muscle plus surveillance, however.  Ingenious little incentives are sometimes used, too.

In restaurants (here as everywhere), there is a strong incentive not to ring up cash-paying customers properly, in order to skim tax-free into either employees’, managers’, or owners’ pockets.  This problem is compounded by the fact that everyone pays cash and restaurants rarely use computerized tills.  In order to get restaurants properly to account for charges, though, the tax authorities turn to the customers for help.  Asking for a fa piao (receipt) with a government inventory control number on it (and a carbon copy to the revenuer) gives you, the diner, the chance to win 10 RMB by scratching off a lottery ticket-like box.  (As far as we could tell, this is the only “gambling” permitted north of Macau!)  Your waiter will grumble and pretend not to understand you, but if you repeat “fa piao” enough, he’ll eventually bring you the ticket, fulfilling the tax authority’s purpose.

– Intellectual “Property”

Here in the West we have an authority that has very successfully corrupted our lawmakers into granting it “taxation” rights over the public: the Walt Disney Corporation.  Although our Constitution specifically and unambiguously requires that copyrights be for “limited Times,” Disney and its friends among the copyright holders (the Rightsholders) have managed to turn it into an effectively perpetual rent.  This is, of course, so remarkably lucrative that it inspires phenomenal amounts of both fear and greed.

When the Rightsholders think of any place, medium, or system in which they lack the ability to strangle free speech with their ill-gotten legal cudgel, their immediate conclusion is: “If we let our increasingly digitized content into [place], our rights will be violated and our content will be instantly uploaded with bitwise fidelity into a giant cloud of sharing!  Therefore, blockade and stonewall, and protect our precious rents!”

Think of the RIAA and MPAA reacting to VCRs, Napster, just about every home computer peripheral that can write data, Internet music distribution, etc.  and you can see this pattern repeated over and over.

I am fairly certain that the Rightsholders have this view toward China, as well.  (For much of Hollywood’s sex-drenched pulp, the blockade is unnecessary, as the government would censor it anyhow; see “Sex” above.) This is not due merely to fear that the content might be redistributed back to their home markets digitally, but it is also due to greed at the prospect of eventually selling billions of copies of “Steamboat Willie” or “Eagles Greatest Hits Volume 2″ to a pacified middle kingdom.

The more nuanced or subtle (but still conservative business-friendly) view of Intellectual “Property” in the West is that the culture of respect for IP is important to enable R&D and content-producing businesses.  This view makes respect for IP part of a climate that permits innovation and entrepreneurship, and ultimately, economic growth.

This binary view of a country’s attitude toward IP — respected or not respected, rights consistently enforced or not enforced — is completely inadequate, however, to understand how IP is viewed and treated in China.

For starters, I hold that IP in the form of branding is hugely respected in China — in the sense of a recognition that branding holds great power and that it is valuable.  Look at the rising Chinese-native athletic wear brand, Li Ning.  The logo is a clear rip-off of the Nike “swoosh.”  The English-language slogan, “anything is possible,” comes straight from Adidas’ Olympic promotional phrase, “impossible is nothing.”

Does that "swoosh" motif look familiar?

Tidy little syllogisms: if "Impossible is Nothing," then ... ?

The power of a brand is clearly respected in China — why else would they want so badly to rip one (or two) off?  It is only the ownership and exclusivity that is not respected.  The thirst for content is there (see “Content” above), but the willingness to play by the Rightsholders’ rules isn’t.

None of this means, however, that IP has no value.  Quite the opposite.  The value might be different (including “less”) or it might merely be unlocked or monetized differently.  But people are willing to pay for branded goods and content in China.

Two brand- and IP-heavy companies from the West have very clearly figured out the Chinese IP code, in my opinion.  The two are very different, though what they’ve learned is largely the same, so I split them apart here.

Microsoft has the perfect approach to China.  They know full well that the high-priced software they sell in the West isn’t economical for the vast majority of consumers or even businesses.  So, they let sharing (“piracy”) flourish.  As a result, Microsoft is the de facto standard for operating systems, despite the government’s nationalist efforts at an Open Source “Red Flag” GNU/Linux distribution.  As businesses mature and interoperate with the West, their default choice of Microsoft as a platform, originally free (pirated), will result in later paid installs and flourishing of the proprietary Microsoft ecosystem.

Audi, too, has cracked the code, to some extent.  The black Audi A6 is the rough equivalent of the Lincoln town car or the Mercedes S500 sedan in North America and Europe, respectively — the “executive” car or choice.  These Audis, however, are by and large not the newest A6s, with the styling one sees in a posh parking lot in the US, nor are they large-engine (4.2L or larger) powerhouses.  And perhaps most tellingly, they are almost never Quattro (all-time 4-wheel drive) — the sine qua non of Audi’s branding work in the West (see e.g. “nur fuer Audi” mountain roads).  Audi has thrown away the key elements of its Western branding — newest styling, large engine displacement and/or turbo, and Quattro all-wheel drive — in favor of pushing (probably through a shrewd licensing deal) lots of black A6s into the Chinese market.  And the result is very favorable; they are the de facto standard in Beijing (especially for the Olympics) and Shanghai for chaufferred luxury sedans.

– Video

My observations on Video are almost an add-on to “Intellectual Property” (above), and certainly share some common themes.  Video entertainment and communications are treated much differently in China than in the West, and I think the key difference is in “quality of service.”

In China, video is available.  Notice, I don’t say “available to those with 6.0 Mbps download speed” or “available on certain models” or “available for a fee.”  I say “available.”  And what that means is that, by hook or by crook, video is going to find its way down your uplink.

Asia is home to the Video CD (VCD) format(s), the (crappy) VHS-equivalent digital video smorgasbord.  China specifically enjoys a plurality of standards that will squeeze down onto whatever pipe or medium is available.  Hotel VOD (Video on Demand) often appears to be VCD or worse.  Broadcast and cable TV ranges from the shiniest high-bitrate product (main CCTV) to seriously degraded, distorted and discolored signal from local stations.

In any wang-ba of size, you will see numerous folks plugged in and watching video streaming over the Web.  It’s never YouTube, and it’s often washed-out colors with bad quality, but it’s ubiquitous.  Somehow (and my vocabulary was insufficient to the task fo figuring out what codecs and methods these were), the Chinese have figured out how to make video a ubiquitous part of their digital experience without handwringing over HD-DVD, bickering over Blue-Ray, or dicking around with DRM.

This parallels the Intellectual Property observations to some extent: worse is better, and getting your stuff out there is the key thing to do.  How you do it, and how well you do it, takes a back seat to just getting ‘er done (more or less).

– Service

This eminently practical attitude of just “getting ‘er done (more or less)” has a dark side, however.  Doing the bare minimum to get something done is, without a doubt, the default method by which work in China gets accomplished.  The notion of “customer service,” or the phrase “above and beyond,” are unknown here.

Ask a ticket agent for a ticket to Qingdao.  “Mei you.”  (“Don’t have.”) Don’t give up — you asked (implicitly) for a standard fare.  What about a sleeper car?  “Mei you.”  What about hard-class (bench)?  “Mei you.”  What about first-class sleeper?  “San bai yuan.”  (“That’ll be 300 bucks, please.”) Ok, thanks, I’ll take that ticket, and fuck you very much for checking the other classes for me.

Unfortunately, that sort of automaton-like response to your requests is very common, especially where the job is more rote, the customers more numerous, or the employee closer to being in the government’s service.  This is different, admittedly, only in degree and not in kind, from what you can expect from such employees here in the States, but it is very pronounced in China.

Restaurants, from the slightly-above-average on down (except fast food) will not give you napkins, unless you ask, and those napkins are about the same consistency of high-end toilet paper.

Cab drivers are practically speaking incapable (though more likely, unwilling) of reading, or even orienting themselves on, the most basic of maps (even those marked in Chinese characters).  They show remarkable creativity in finding places to drive, but very little initiative in figuring out where you want to go.

This general “I-don’t-give-a-shit” attitude (see “Labor” above) is pervasive but probably explainable with some fairly straightforward analysis.  Tipping is unheard of in China, except for those with some Western experience who will try to hustle newly-arrived laowais into leaving them the change from a big bill.  Quality Control is simply not something that service industries bother with yet.  So without either a bottoms-up or tops-down incentive for improving service, why should anyone care?

– Salesmanship

A little bit more curious is the lack of salesmanship talent in China.  Here, incentives should be rather obvious — commission for sales.  Indeed, the motivation is quite apparent among hawkers at tourist-facing retail outlets.  But everything here gets sold as a commodity — bargained on price — and the notion of selling value to the customer is unknown.

I realize that it’s a bit much to hope a retail clerk to understand “unique selling proposition” or “differentiation” in translation.  But the concepts themselves, I am convinced, are not understood by sellers.  Conversations with Western-educated businesspeople confirmed that even up the value chain, and for larger and larger deals, the same holds true.

My personal theory is that, in China’s dealings with the West for the last 30 years, the price (labor cost) advantage has been so decisive that the competitive pressures that would otherwise lead to differentiation have been absent.  In a sense, the “free money” that the labor cost arbitrage has left on the table has made Chinese business lazy and uncreative about creating value (rather than just capturing the labor cost delta).  As a result, skills at differentiating product, selling value, and articulating a selling proposition are still in development.

It should be noted, however, that the concept (or at least the empty word) of “quality” is certainly known and much bandied-about.  However, it’s recited in almost a caricature of how you might imagine a Chinese merchant — “very good quality!” excitedly repeated about every object, no matter its obvious shabbiness.

– Cargo Cult

The vendors know that saying something is “quality” is supposed to make somebody buy, or pay a higher price for, an item.  But they seem to have no concept about what it is that underlies this notion of “quality.”  In effect, they seem to be cargo-culting the notion of quality.

An aside on the idea of a Cargo Cult: briefly, after World War II there remained certain isolated islands that were once used as airstrips but were thereafter abandoned by the militaries.  The native inhabitants were found many years later to have created religions and ceremonies mimicking the use of runways, radios, control towers, and ground crews, in hopes of eliciting the “magic” cargo from the skies (and doubtless the high-calorie treats and other Western goods the GI’s doled out).  These (possibly apocryphal) natives were said to have created “Cargo Cults,” and the name sticks to this day, especially in the tech industry, as meaning any rote repetition of an action in search of its characteristic response without any understanding of the underlying mechanism of the original process.

Although it may seem to smack of Western arrogance, I can’t shake the feeling that a lot of what goes on in China, and especially a lot of what I have written about above, ends up being reducible to the notion of cargo-culting.  Yes, having a clean sheet over the back seat of a taxi is, standing alone, probably a sign of higher quality.  But it’s of lower quality when that sheet blocks the seat belts from working.  Yes, it’s generally good to have lots of “volunteers” to guide foreigners when you host the Olympics.  But putting a tent up and putting polo shirts on the same four old men who would otherwise be squatting on the same street corner, without any training or maps or information or value-add, completely misses the point of having volunteers.

A less culturally-charged way of saying this might be that the Chinese “go through the motions” for a lot of things.  But the things I noticed are ones imported from the West, which makes them seem cargo-cult-like.

– Conclusion

Much of the above comes across as critical, which reflects the frustration I felt as my third week in-country approached and I sketched out these notes.  I acknowledge that this emotional content would be a weakness of an objective account; however, this is meant to be a thoughtful but subjective and opinionated piece.

I left China without either a great apprehension of the rising hegemon, nor with any sense that our Western advantages will hold past the horizon we today can see.  But my perpsective /was/ changed and honed.  The measures that one might naively use to measure’s China’s great catch-up — % GDP growth, number of universities per capita, degrees awarded, power plants constructed, durable goods orders — these are all meaningful in their own fashions, but are red herrings when it comes to commensurability with the West.  Things like civil institutions, the culture of business, salesmanship, and service, IP regimes, and cultural mores will ultimately mean more than these easily quantifiable (and easily falsifiable) figures.

The experience also has helped highlight for me those cultural and institutional parts of American culture that might otherwise be taken for granted.  We must not discount the role of things like R&D, value-based pricing, the emphasis on industrial standards, and individual initiative within large organizations, for the effect they have on our collective wealth and national effectiveness.

All that said, gentle reader, I have only scratched the surface and can’t wait to get back to learn and experience more of the country that is destined to be our greatest trading partner, our greatest military rival, and our greatest source of learning during the next century.  This is my account; now, please correct, challenge, and contradict me at will.

The other Lighter Capital

Today, the team at Lighter Capital (formerly RevenueLoan) kicked off a promotion, where we commit to investing $500k in a company that applies online by 31 August 2011 (that’s 21 days and counting).

We did lots of the usual things, plus some unusual things, to get the word out — press releases, blogger outreach, videos, tweets, etc. We’re pleased to trumpet our “Lighter” name, as indicating both a lighter-weight process and a lighter attitude than the traditional banks.

But in our research we discovered: we’re not the only “lighter capital” out there.

In fact, the industrial city of Wenzhou, south of Shanghai on China’s eastern coast, claims the title of “lighter capital of the world.” To wit:

In Wenzhou, there are more than 500 lighter manufacturers that produce 5,000 kinds totaling 500 million lighters each year. Among that, 80 percent are exported abroad. Lighters from Wenzhou make up 70 percent of the world’s market for lighters with metal shells, and 80 percent of the European market.

From the China Daily, http://www.china.org.cn/english/2002/Apr/31597.htm

So, to our “lighter” brethren across the big pond — 你好, 我们爱你的名字!

Fukushima-type reactors in the USA

I was moving a bookshelf around my house this weekend when I found a copy of “Nuclear Power Reactors in the World,” an April 2000 publication by the IAEA.  (Don’t ask why I have this kind of crap lying around …) It struck me that people would want to know what reactors are “like” the Fukushima Daiichi reactors in Japan which have been causing all sorts of problems lately. Well, here goes:

View BWR 1970s reactors in the USA in a full screen map

The March 2011 earthquake / tsunami / reactor emergency brought to the public eye the dangers of “active safety” in engineered systems.  Elements of reactor design and operation which may have seemed appropriate in the 1960s (when these reactors were designed) now seem like “what were they thinking??” anachronisms to concerned laypersons.

Specifically, I’m talking about the need for electrical pumps to be in continuous operation to prevent reactor core overheating; use of water (hydrolysible into 2H2 and O2, explosive and reactive gasses) as coolant; use of cladding and fuel alloys that are subject to fire risk and enhanced toxicity (zirconium and MOX); and storage of spent fuel rods in top-floor containment pools subject to sloshing and evaporation and requiring electrical pumping. Keep in mind that all of the bad shit at Fukushima started happening after the earthquake and tsunami had passed, during a period where the active safety systems relatively slowly stopped working.

(Lots of folks don’t realize it, but you can build stable, passively safe, high tech systems, to a degree. Simple airplanes are built to fly themselves. If you’re up in the air piloting a Cessna in level flight at, say, 5000 feet, you could probably take a 10 minute nap and live to tell about it. Yes, there’s gravity involved, but the aerodynamics involved let the plane stay up there either flying (engine on) gliding (engine off) for quite a while with no requirement for constant input and management. Contrast this with something like the Joint Strike Fighter, where the plane is intentionally aerodynamically unstable and, without the constant inputs of a high-speed computer, would fall out of the air like a brick. We want reactors that are boring and Cessna-like, not delicate JSF divas that literally melt down without enough attention.)

(Non-geek version: the Fukushima-type reactors are like delicate plates spinning on top of poles.  You can’t just leave them be without expecting to break a lot of shit.  And they don’t tend to revert to safe or stable states when they break.)

The above map names the US-based reactors with BWR type (boiling water; arguably the most dangerous type still in service), manufacture by GE (GE, Toshiba, and Hitachi were the suppliers at Fukushima), and construction dates that include the 1970s (1969 in the case of Nine Mile Point).  This does not mean that you should freak out if you live near these plants.  But it does mean that, in the broadest sense, these types of reactors are subject to the same types of risks as the Fukushima reactors.  (Keeping in mind that even Fukushima was fine for 30+ years until a 9.0 earthquake.)

If you want to do something positive about nuclear power in general, don’t freak out or ask for all nukes to be banned. Instead, the nuke-minded citizen should:

  • …push for greater research on safer alternatives like pebble bed reactors.
  • …push your Congressional representatives to get off their asses and open up a real, centralized, better-than-inaction interim solution for the nation’s nuclear waste. (This gets rid of fuel rods sitting in ponds at the very place where they can do the most incremental harm when things go wrong…)
  • …pay, pay, pay. [Good] nuclear power will not be cheap. But it can be vastly improved from the Fukushima state of affairs. However, it will take enormous amounts of money for research, and the political will to eschew interim half-assed solutions (like putting cheap BWRs into service well into the 1970s, when other approaches were already either viable or in progress).