The Chinese Web Market

April 30th, 2013, 9:19 am PDT by Greg

Since I have been in China, I have been thinking a lot about the web in China (and of course, living with a Chinese Internet connection). I know my share of web entrepreneurs, so one of the things that has been sitting in the back of my head is the question “how can foreign web companies expand into the Chinese market?” I know some excellent people thinking about doing just that.

After a few months, my honest advice to any web company thinking about China is: Don’t. It’s not worth the risk.

The unavoidable danger is being blocked by the firewall and completely losing any investment in China. The other is being cloned by a Chinese developer: shanzhai or copy-to-China. I propose to convince you here that these aren’t two independent risks, but are highly correlated.

Let’s look at the history of some prominent shanzhai sites and their foreign inspiration:

The pattern is clear here: a foreign company does something innovative, a Chinese company clones them and grows to be a viable competitor in the Chinese market. The foreign site becomes immoral and is blocked.

In each of these cases, the Chinese market moved quickly to the shanzhai site. I hear a little grumbling about the degraded Google service, and see the occasional Chinese kid on Facebook, but mostly the users moved smoothly to the Chinese-owned clone.

The reasons given for Internet censorship in China are generally prohibition of illegal material and promotion of national unity. There seems to be a clear side benefit: to neutralize foreign competitors when they become inconvenient to a local company.

I don’t think there is any quid pro quo there. I don’t think the Baidu founders went to the government and asked if they wouldn’t mind eliminating his competition, but the outcome seems identical to if they did.

So my advice on China is that there is too much danger of your entire investment being lost to the throw of an administrative switch on the firewall. Too much danger of a local clone. Too much danger of them both happening simultaneously.

Edit 03-2014: There has been some quid pro quo, at least on the scale of posts.

Network Sanitization

April 23rd, 2013, 11:48 pm PDT by Greg

I have been spending a fair amount of time working in coffee shops in Hangzhou. The culture seems to be that buying a coffee also buys me several hours sitting in a table doing whatever I damned well please. It’s a nice change of scenery from my apartment. They usually have wi-fi, but it would be pragmatic to assume that whatever traffic goes over that connection is beamed directly to a billboard outside. I generally feel the same way about hotel internet, free airport wi-fi, and other dodgy connections: I just don’t trust that they have any interest in protecting my privacy.

I really want to encrypt all of my traffic over those links. I always encrypted my mail client connections anyway, and SSH is inherently encrypted. That really leaves my browser as the weak link in my average-day networking.

After considering some options, I ended up with just about the simplest solution, although it does take touch of technical know-how to get going. The basic idea is that SSH can provide an encrypted SOCKS server. Using it basically involves setting my browser to use the SOCKS tunnel for everything, and starting up the SOCKS tunnel with a command like this:

ssh -C -D 1080 userid@someserver.example.com

It’s also possible to do this on Windows with PuTTY and on a Mac from the Terminal.

In theory, this can speed up a slow connection a little. It removes the TCP handshake from their network, and the compression (-C) might help for the right kind of traffic.

Of course, you need a server to SSH to. If I’m working, I use a computer in the department at SFU. I figure that’s kosher. Another option is Amazon: a Amazon Web Services free tier should stay free if you use a micro instance and keep the bandwidth under control. As I recall, I just used their most generic looking Ubuntu image and changed just about nothing.

You privacy is, of course, only as good as your endpoint. Sooner or later, your unencrypted web traffic has to get out there into the big-bad internet. It’s not that I particularly trust Amazon, but I don’t trust any other provider much more.

I have also experimented with sshuttle. It pushes your entire network interface over the SSH connection. That’s technically better, but the SOCKS tunnel usually passes the “good enough” bar for me.

Edit: …and Proxy Selector to flip the SOCKS proxy on when I need it.

The coffee shop

April 18th, 2013, 12:24 am PDT by Greg

Just came to a nearby coffee shop to do some work. I hadn’t noticed this one until recently: it actually has a food menu, which should be explored.

I ordered a hot chocolate. A few minutes later, I got a probably-Carnation hot chocolate. A little weak, but whatever.

When I was half done, the guy comes over with a new drink, says “too sweet” and took my old one away.

I am now drinking brown hot water. Because China.

People ask what I miss from home. I miss having some idea of what is happening around me… ever.

Cultural Sharing

April 15th, 2013, 7:45 am PDT by Greg

Something astonishing just happened.

I was shopping at my usual grocery store and was grabbing some apples. Another guy around the apple stand clearly needed a plastic bag: he was trying to move in the direction of the roll of bags, but was blocked by a cart and general Chinese grocery store detritus.

Without thinking, I grabbed a bag and handed it to him. That was not a very Chinese thing to do. Even noticing that there was someone else in the store with me seems to be unusual. He thanked me and we went on our way.

A minute later, I went to the produce-weighing station. Another guy who I believe saw the plastic bag interaction motioned for me to go ahead of him.

If you haven’t been to China, that might not seem weird. Let me explain. The expected thing to happen in that situation would be for him to step in front of me, go first, and never acknowledge my existence. Another socially acceptable thing would be to wedge his shoulder in front of me if I wasn’t standing close enough to the counter, and put his stuff on the scale a millisecond before mine.

I literally don’t think I have had a “you go first” wave in all the time I have been here. I can only assume that it was a result of my bag-getting courtesy.

I may have started something here, like in Warm Bodies.

Shanghai

April 5th, 2013, 9:55 am PDT by Greg

I decided to go to Shanghai this weekend, for various half-reasons, but mostly because I wanted to see more of it. We previously spent about two days here on a tour. That’s not enough time to experience a city of 23 million.

Random tourist crap I did aside, I’m glad I came. It has really put my China experiences into perspective. Basically, Shanghai is a global city in a way that Hangzhou really isn’t.

Sure, Wikipedia has a very in-depth definition of “global city” but here’s my functional definition. A global city is one in which the ethnicity of the food people are eating is not well correlated with their ethnicity.

As an example, take Starbucks. There are a couple of Starbucks (Starbuckses? Starbucki?) in Hangzhou, but in them I get a vibe of “let’s try the coffee drinks westerners have”. In Shanghai, it feels like people got there by saying “let’s have Starbucks”. Starbucks is part of the culture here.

In the same way, dim sum, sushi, Thai and Indian are part of Vancouver. To my mind, Beijing is less of a “global city” than Vancouver. Manila more than Montreal (I daresay).

So I think what I’m really getting here is something I didn’t know I was missing: time in a global city. I can have a burger if I want because I fit in exactly as well as the Shanghaiese group at the next table. Same at the xiaolongbao place, or an Indian place. Damn… I should find an Indian place.

It also puts Hangzhou into better perspective for me. Despite having a population of 6 million, it really is a small town. That’s not a bad thing, just a thing that’s true. The outside world is still a bit of a novelty, because the world hasn’t all come to visit yet. Some of the difficulties I have had living there boil down to that, and I think I have a better understanding of the place with that in mind.

April Fools

April 1st, 2013, 12:18 am PDT by Greg

Having too much time on my hands here, and realizing that I teach both courses on April 1 this year, I decided I needed to do something about that.

I’m giving my lectures here differently than I always have at home. Here, I’m doing my notes as HTML, in decent point form, as I always have given lectures. I’m posting the notes for the class and basically using them as lecture slides. I just bump the font size up three or four notches, and scroll through them as I talk.

It’s working pretty well: they have something they can review later if they don’t catch the English of it all. It’s causing exactly the problem that kept me from this experiment at home: without having to write, I can say too much in one lecture. It’s very easy to cover material at an unreasonable pace.

I decided that for April Fools, I wanted to have the characters on screen move around, just subtly enough that they initially wouldn’t be sure if they really saw anything or not. After a little Javascripting, I had something I’m pretty happy with. You can see what I ended up with on a demo page. If you’re into Javascript code, I have posted that as well.

What you see in the demo is a character being animated every two seconds. I left it at every five seconds during lecture, so it was more subtle. They had plenty of time to look at it, after all.

I think it worked out pretty well in the discrete math course. I could see the occasional student do a double take. A couple of times, one fired near a part of the screen I was pointing at, and I had to ignore it. I let it run for the first half of the lecture and them told them what was going on: it seemed to be appreciated. There seemed to be a mix of “yeah I saw it” and “I thought I was going crazy at first”, which is about what I wanted.

Now to see how the web development course takes it…

Edit: The web course was probably more split. I think some of them noticed right away, but some never did. It’s also possible they’re just more expressive than the 8am group.