Dirk Hohndel on Open Source Software in China

Dirk Hohndel, Chief Linux and Open Source Technologist at Intel, gave a talk centered on the evolution of open source in China for a lunch meeting of the China Business Network of the NW China Council on December 3.   Mike Rogoway of The Oregonian has coverage on his blog, so I’ll try to complement what he had to say about it.

Dirk emphasized that he was representing his own views; not Intel’s.  They reflect his involvement as a committer to Linux and related open source projects since 1991, his frequent participation in fostering open source in China over the past several years, and a clearly articulated vision of open source as a natural continuation of the way humanity has evolved the state of knowledge over the past 300 years by building on the work of peers and predecessors. 

From this perspective, selling software executables without access to source, which started in the late 1970’s, was an aberration not only from the previous practice of delivering source code with the sale of computers, but also from a longer history of the progress of knowledge.

In China, there was initially a perception that open source software was almost too good to be true by people looking for short term profit.  They could include it for free, bundled with a computer or other device they charged for, or just put a “brand” on a disk and sell it.  According to Dirk, for example, there were many failed attempts to put a brand on the code of the open source OpenOffice.org project and sell it without source as a cheaper flavor of Microsoft Office. 

Within the past 3-4 years, Dirk said, there has been a change in China to true open source participation for the long term by companies, organizations, and individuals, as they have learned that open source creates more value when you do not disconnect from the value chain. Now companies like Red Flag, CS2C, and Sun Wah have become active in open source; and Chinese government ministries and universities have started to become important Linux and open source drivers.

Initial Impressions: iPhone 3G

Rather than a general review, these are initial impressions on some aspects of the new iPhone of particular interest to me and also relative to the competitive market context.

U.S. TV ads during the Olympics have been touting it as twice as fast, which probably is a good, uncomplicated message for that audience, but maybe not quite what was hoped for (EDGE is around 160Kbits/sec and “3G” on UMTS phones you would hope to be running 1-2 Mbits/sec, so 6-12X would be a lot nicer).  Twice as fast basically means you’re still looking for wifi access (see my previous iPhone 3G posting for discussion of Apple’s coup with AT&T wifi at Starbucks), unless you’ve just got to have that email or web page, so most people I know are turning off “3G” (Settings -> General -> Network:  3G -> off) to save power.

The iPhone 3G system software is somewhat more sluggish and the Safari browser more prone to crashing than on the previous iPhone, but neither of these things is a major problem.

My favorite two innovations are downloadable apps and the multilingual operating environment.  The first thing I downloaded was a WordPress client (no, this post is not being written on the iPhone.  Desktop typing is faster than for an 親指俗人 oyayubi zokujin (“thumb tribesman”) using the phone.  But that brings me to the language part, which actually means the system language, the keyboard, and the region.  For example, switching to Chinese (mainland characters or traditional) puts most everything in Chinese and then you can set the region as China, Singapore, Taiwan, etc.

The keyboard, in the case of Chinese, can be “pinyin” (typing in Roman alphabet, which is contextually converted to Chinese characters) or “handwriting.”  These techniques have been around for a while but work great implemented on the iPhone 3G.

I have to admit I naively thought there was no way that handwriting was going to work with a finger tip dragging across a capacitive-sensitive screen rather with a stylus on a touch sensitive screen (like my previous favorite cell phone, the Chinese Motorola A780 — see way below).  I’m not sure why I thought that, because a common way to clarify to someone which character you mean (in a Chinese language context) is to “write” the character you mean with your finger on the palm of your hand so they can “see” it written. Well, contrary to what I thought, it works great!

Twitter posts in many languages, yes!  Once I started trying some Twitter posts in Japanese and Chinese from the phone, I moved on to German and French, which are almost as cool because predictive interpretation and correction are used there, too.  You type “sein konnen” and it’s changed, like “fail whale, oder warum Twitter Posts trotzdem toll sein können.” Same thing with French diacritics and accents.

In the competitive context (writing as I watch a Verizon ad with an LG iPhone-alike being rolled out and pasted on the side of a building out my office window), adding downloadable webbish apps like WordPress almost, almost, quasi open sources the iPhone, which I think is a key strategic front on which a competitor “could” make their offering(s) bigger and broader (maybe Android phones or Ubuntu on Intel MIDs as they evolve into cell phones will have an opportunity here), and adding lots of languages that work extremely well (esp. Chinese with 600 million cell phone users) both are going to put the iPhone brand just way out there in a way that took the iPod much longer to accomplish.

Wang Jing on Brand New China

Wang Jing (王瑾), professor of Chinese Cultural Studies at MIT, chair of the international advisory board to Creative Commons / China (知识共享/中国大陆), and author of Brand New China: Advertising, Media, and Commercial Culture (Harvard Univ. Press, 2008), discussed “Creative Culture and Creative Commons: Web 2.0 in Mainland China” at Portland State University on June 2.

Wang’s leading insight is that web 2.0, meaning open business models and community-created content, is a natural path of evolution for China. It is a third way, different than being absorbed by “globalization,” in the sense of Western brands colonizing China, and different than a socialism that is either culturally conservative or even de-cultured and thus lacking the energy of innovation.

In this “third way” vision, it is possible to see aspects of several influences. One is an escape from the kind of cultural double-bind associated with Edward Said’s critique of colonialism. Another is an escape from the double-bind of that emerged in the Chinese reformist, pre-revolutionary period, in which some advocated “Western technology but Chinese culture,” perhaps best captured in the Exhortation to Study (1898, 劝学篇) of Zhang Zhidong (張之洞).

Wang is skeptical of bright-eyed Western marketing’s optimism about the so-called rise of the Chinese middle class.

In her analysis, there are, first, limits to growth of the “middle class.” Many web 2.0 digital innovations are being driven not by a middle class consumer culture, but by either the digital elites or the socially marginalized (such as the literally hundreds of millions of largely disenfranchised migrant worker families, or ethnic minorities, neither of whom is readily absorbed by a would-be middle class).

Second, in Wang’s analysis, an important current in Chinese web 2.0 culture is a critique of consumerism that has transformed into an issue of user rights, hence there are already over 1 million contributors to Creative Commons in China. With food and fuel prices rising even more rapidly in China than in the U.S., sustainable lifestyles may shortly be another key component of this critique.

Rebecca Fannin on Chinese Web Entrepreneurs, 2008-4-24

Rebecca Fannin, author of Silicon Dragon: How China is Winning the Tech Race (McGraw Hill Professional, 2008), spoke April 24 for the China Business Network of the Northwest China Council in Portland on the founders of some of the leading high tech entrepreneurs in China. There is a good interview with Fannin about the book in Forbes.

Fannin is a journalist who has covered tech business in Asia since the mid-1990’s, first with Red Herring magazine and later with the Asian Venture Capital Journal and writing for diverse tech business publications. She also has a great network into the investors and drivers of new businesses in China, as well as India and elsewhere in Asia. She has a nose for “the story” on companies in a way that a lot of tech business publications don’t always capture and her talk put a personalized spin on companies like Baidu, Alibaba, and DangDang.

Since recently joining the board of the Northwest China Council, an Oregon 501(c)3 non-profit which puts on a series of China Business Network events, as well as intensive Chinese courses and cultural events, I’ve been working to bring more focus on technology business, as well as looking at ways to leverage web technology for this organization.

UTF8 for Chinese, Japanese web apps

The motivation to use UTF8 character encoding in a web application is to be able to maintain a single development environment regardless of language content. I set out with the goal of creating a cheat sheet I could refer back to for UTF8 in the tools underlying a web application — MySQL database and Apache server configuration, plus PHP, Python, and Ruby programming. There’s also some discussion of Ubuntu Linux and Windows XP, and a side note on WordPress.

For a backgrounder on UTF8, see Joel Spolsky, “The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!).”

Part 1: MySQL

Note: I’m working with MySQL 5.0.45 on Ubuntu GNU/Linux 7.10:

/etc/mysql/my.cnf // Ubuntu and Debian; formerly /etc/my.cnf

[myslqd]
character_set_server=utf8
character_set_filesystem=utf8

You can check the model cnf files in /usr/local/mysql/support-files for other configuration information, but there’s nothing on UTF8. MySQL by default has character_set_server=latin1 and collation_server=latin1_swedish_ci. These can be changed by recompiling using ./configure –with-charset= and –with-collation=. Or mysqld can be started with –character-set-server and –collation-server, or with the corresponding settings in /etc/mysql/my.cnf, as detailed in the previous section. With those cnf settings, restart the MySQL server and now 3/6 responses in MySQL to issuing show variables like ‘char%’ are “utf8” instead of “latin1.” To get 6/6, add –default-character-set=utf8, as in mysql -u root -p –default-character-set=utf8. If you forget to use –default-character-set=utf8, you get mangled display of everything above the lower ASCII range.

MySQL uses “CHARACTER SET utf8” as a modifier to database and table definitions. So a model database definition for UTF8 would be:

create database my_database default character set utf8 default collate utf8_general_ci

and a model table definition for UTF8 would be

create table my_table (
my_id int unsigned not null auto_increment primary key,
my_string varchar(128)
) type=InnoDB CHARACTER SET utf8;

See 10.3.2 “Database Character Set and Collation” http://dev.mysql.com/doc/refman/5.0/en/charset-database.html. If a character set is defined for the database, it is the default for its tables. Note that show create database my_database indicates that it is UTF-8 but describe my_table does not. Also, when using regular expressions with REGEX in queries, first be sure to issue set names “utf8” or the results will be mangled. See 5.11.1 “The Character Set Used for Data and Sorting” (http://dev.mysql.com/doc/refman/5.0/en/character-sets.html).

Important note for using load data to put Chinese or Japanese text into a database: character_set_database affects data imports.

Google vs. iPhone vs. Asia vs. U.S. cellular providers

Kevin Delaney’s Wall Street Journal Online blog entry from May 31, 2007, on “The iPhone Needn’t Fear Google, Yet” points out that Google’s cell phone strategy is not to have a phone product per se, like the iPhone, but rather to evolve a services platform.

With the impending iPhone launch, anyone who’s been using cell phones in Asia the past several years has to wonder, as the Japanese technology business magazine ASCII did in February, what the big deal is. Browser phones without physical keyboards? That’s already been mainstream there for some time. Sliding screen content with your fingernail? Same deal. 2.5G connection speed using EDGE for wireless data? Are we missing something? 3G has been operational for some time in Japan. Why would you want Apple’s phone at three times the price of 2004 model web phones on eBay? Well, because it will have an apple logo on it. Still, probably at the top of the desired improvement list is 3G, according to Ben Charny’s “Apple Changes the iPhone, But Critics Want More Still,” June 18, 2007 WSJ Online.

On the other hand, Apple’s entry is great because it will help loosen the silo death grip of most senior management in U.S. cellular service providers. They know their business model will have to change, but nobody wants to blink first. Managers who aren’t getting paid to put the current business model at risk are actually letting themselves be quoted, according to the Wall Street Journal’s lead story on June 14, 2007, to the effect that they don’t want to blow owning the silo this time like they did with the Internet. Hello? Some large companies can survive forever without realizing what business they’re in. Verizon thinks they’re going to make money as content providers instead of as service providers?

Meanwhile, the Chinese and Indian cellular markets are rapidly becoming 5 times the size of the U.S. market. I kind of think that the market-driven model over there, where the handset, the service provider, and the services platforms act, sell, and interact with the customer quasi-independently and quasi-cooperatively, is what will eventually take hold in the U.S. as well. So in the Asian context, Apple’s handset is nothing new. But in the U.S. market, it’s the break in the dike.

ZTE to start on 3G Pilot in China

It’s been reported in Light Reading that ZTE (中兴通讯) and a consortium of other companies are in the final stages of concluding implementation contracts with China Mobile, the largest cellular provider in China, for year-long pilots of a Chinese 3G cell phone system based on TD-SCDMA. It appears to still be a goal that a TD-SCDMA system will be running in Beijing and a few major cities in China in time for the 2008 Olympics in Beijing. Perhaps both TD-SCDMA and HSDPA will be deployed in China on a scale sufficient to move equipment and handset makers well down the experience curve and gain flexibility in their strategic positioning in the global cellular market. Now that NTT DoCoMo’s 3G in Japan has over 30 million users and 100+ U.S. metro areas have had Cingular’s 3G service available in the U.S. since last fall, it will be interesting to see if the Chinese market finds any new approaches, especially open-source based and driven by user-content, to accelerating development and use of 3G applications.

怎么样使用一个加密的闪存盘

像别人一样,最近我常常需要使用越来越多的网上用户名和密码,还有跟信用卡和银行有关的信息,用户名和密码。假如把这些都放在计算机文件里面,已经超过30K以上的资料。并且,这种资料假如不是电子的的话,不太方便。为什么呢?第一个原因就是,这种信息常常改变,需要编辑。第二个原因,信息不是电子的的话,可能是需要二十张紙,就不能作一个CTRL-F而去查某一个字,因此也许你需要五分钟,才查到莫一个重要的密码。第三个原因,纸上的信息不能加密,千万不要丢了!

最好的解决办法呢。我觉得就是加密的闪存盘,我特别喜欢的是一个开放源代码加密程序,叫做Truecrypt,应用于Linux和Windows的造作系统两个都可以。在下我试试描写Truecrypt最方便的用法。总的来说,就是加密闪存盘的一个所谓”volume”,然后把你的文件放在这个volume上,这样子你可以拿这个闪存盘,随便用于你办公室的电脑或者家里的电脑或者移动的电脑。这样子,每次开始用这个闪存盘跟另外一个有Truecrypt加密系统电脑,Truecrypt加密系统先让你轮入闪存盘上被加密的volume的密码,然后你每次把文件放在闪存盘上或者用你的Text Editor或者Word processor编辑闪存盘上的文件,Truecrypt加密系统就会自动的加密或者解决,不需要再次轮入密码。

安装(GNU/Linux Ubuntu 6.10):
>truecrypt -V // 假如Truecrypt不在或者不是4.2a以上,作sudo apt-get install truecrypt
// 连接你想用的闪存盘于你的有Linux造作系统的电脑的USB端口而
>ls -latr /dev // 试试看最后被打的pluggable device (plugdev)叫什么名子(例如“sdb1”)。 也可以用dmesg
>sudo fdisk /dev/sdb // 创造1个给Truecrypt加密系统用的partition
>sudo truecrypt -c /dev/sdb1 // 在这个partition上创造Truecrypt要用的volume
// 我选的encryption是“Twofish”而hash是“Whirlpool”

每次用于一个有Truecrypt系统的电脑:
// 连接闪存盘于USB端口
>ls -latr /dev // 试试看最后被打的pluggable device (plugdev)叫什么名子(不一定是“sdb1”)
>sudo mkdir /mnt/sdb1 // 如果没有/mnt/sdb1
>sudo truecrypt -u /dev/sdb1 /mnt/sdb1
// 用Truecrypt系统来mount这个device
// Truecrypt系统只要问你Linux系统的密码和Truecypt volume的密码

// 现在你可以随便继续用这个volume上的文件,比如:

>ls /mnt/sdb1/myfile.txt // or edit, etc.

// 工作做完的时候:
>sudo truecrypt -d /dev/sdb1 // 以Truecrypt系统卸载加密的文件系统
// 在电脑的桌面上的一个“cdrom“图标上的右键菜单中你就要选“eject”。 现在可以断开你的闪存盘。

其他:
>sudo truecrypt -vl // Truecrypt系统的volume的属性看得出来.

就这样。最基本的用法非常简单。除了这些以外,应该作一个被安全地存储备份。

How to Use an Encrypted Flash Drive

Like everybody else, recently I’m finding I need to use more and more web IDs and passwords, as well as user names and passwords for credit card and banking information. If you look at this in terms of a computer file, it amounts to more than 30K of information. Furthermore, if this kind of material weren’t in electronic form, it would be pretty inconvenient. Why? One reason is that this is information that is frequently changing and needing to be edited. The second reason is that, if this information were not electronic, it might take up 20 paper pages, in which case you can’t just hit ctrl-F to go find something, so it might take you five minutes to locate a particular password. The third reason is that there’s no practical way to encrypt information you’re going to keep on paper, so you’d better hope you don’t lose it!

What’s the best solution to this? I think it is an encrypted flash drive. I particularly like an open source encryption program called Truecrypt, which can be used both on Linux and on Windows operating systems. In the following, I try to describe the most practical ways of using Truecrypt. In short, it’s to encrypt a “”olume” on a flash drive and then put files onto this volume. Then you can just take the flash drive and plug it into your office computer or your home computer or your mobile computer. This way, each time you start to use the flash drive with a different computer that has the Truecrypt encryption program, the Truecrypt encryption system will first require you to enter a password for the Truecrypt-encrypted volume, and then automatically encrypt or decrypt files, as you put them onto the volume, or open them from there, in a text editor or word processor, without requiring entering a password again.

Installation (GNU/Linux Ubuntu 6.10):
>truecrypt -V // If Truecrypt is not installed, or is not version 4.2a or greater, do: sudo apt-get install truecrypt
// Connect the flash drive you’re planning to use to the USB port of your Linux OS computer
>ls -latr /dev // check to find the name of the pluggable device (plugdev) hit most recently (like “sdb1”). You can also do this with dmesg.
>sudo fdisk /dev/sdb // Create a partition intended for Truecrypt use.
>sudo truecrypt -c /dev/sdb1 // On this partition, create a volume intended for Truecrypt use
// I chose “Twofish” for the encryption and “Whirlpool” for the hash.

Each time you use it with a computer that has Truecrypt:
// Connect the flash drive to a USB port
>ls -latr /dev // Check to find the name of the pluggable device (plugdev) hit most recently (like “sdb1”).
>sudo mkdir /mnt/sdb1 // If there is no /mnt/sdb1
>sudo truecrypt -u /dev/sdb1 /mnt/sdb1 // Use the Truecrypt system to mount the device
// The Truecrypt system will ask for the Linux system password and the Truecrypt volume password

// Now continue doing whatever you need to with the volume’s file system, such as:
>ls /mnt/sdb1/myfile.txt // or edit, etc.

When finished:
>sudo truecrypt -d /dev/sdb1 // Dismount the volume’s file system through the Truecrypt system.
// Right click on the “cdrom” icon on the computer desktop and select “eject” from the menu list. Now you can disconnect the flash drive.

Other:
>sudo truecrypt -vl // To access properties of the volume in the Truecrypt system.

That’s it. It’s really very simple. Aside from these few things, the only other thing you ought to do is to make a secured backup.

邓丽君,王菲,和宋代诗人

两三个礼拜前有两个朋友到我家来, 原来是因为想研究十九世纪的书法作品 (我有一个觉得可能是鸦片战争时代有名的民族英雄裕谦在二十一岁的时候的书法).

然后谈到中国现代音乐,用MP3的技术从网上拿下来一些非常有名的女歌手。 想不到这两个女歌手随然有名,我随然非常喜欢中国琵琶, 二胡, 古筝,唱哥, 昆剧等那些种的音乐, 还没听过现代最有名的女歌手的歌曲, 给我介绍王菲邓丽君的音乐。

按照中文的维基百科,”《但願人長久》原是為蘇軾的名詞《水調歌頭·明月幾時有》譜的曲,這首歌也成為王菲本人的經典曲目之一。”

Deng Lijun, Faye Wong, and Song Dynasty Poets

A few weeks ago a couple of Chinese friends came over, originally with the idea that we would do some research on a 19th-century calligraphy (which I think absurdly thought was written when he was 21 years old by Yu Qian, later a national hero in the First Opium War).Later, we got to talking about Chinese pop music and downloaded some mp3 files off the web by very famous Chinese singers, which I had somehow managed to remain clueless about, even though I really like Chinese pipa, erhu, guzheng, kunqu opera, etc., and thus I was introduced to the music of Faye Wong and Teresa Teng [Deng Lijun].

According to the Chinese version of Wikipedia, one of Faye Wong’s most famous songs, “May you live long,” is based on a lyric “When the moon shines brightly” by the Song dynasty poet Su Shi.

A780 GNU/Linux cell phone

Motorola A780

Motorola has the first more generally successful GNU/Linux-based cell phone in China and Europe, and reportedly sold 2 million Linux-based phones, including the A780 and the newer A1200, in China in Q3 2006. Using MontaVista embedded Linux 2.4 and Trolltech’s Qtopia, the quad-band GSM A780 started shipping in August 2005. It’s reviewed on linuxdevices.com and OSNews.com.

I recently picked one up second-hand on eBay from Hong Kong by way of LA. Once you download the Opera Mini browser to improve web performance, the 150 kbps EDGE (rarely falling back to 50 kbps GPRS) Cingular connection for data, such as email and web browsing, is nothing to write home about, but certainly ok for limited use, like looking up entries on Wikipedia while waiting for lunch in a restaurant. Fortunately, gigabit web phones are coming. Meanwhile, people are poking at the GNU/Linux side of the A780.

Using information assembled by Dino Kern at www.troodon.org/A780, I set up a telnet connection into the phone that works over Bluetooth or USB. It’s pretty cool to make the connection and issue dmesg and ls -latr to see what’s up on the phone, but it’s not really a true open source environment, yet.

Motorola probably could profit hugely from market leadership with open source phones (Japanese companies NEC, Panasonic, and NTT Docomo are also active in this space, as are Chinese companies Zhongxing tongxun [ZTE] and Datang) but I don’t think you can say that Motorola’s strategy is “open source” today. They’ve been building needed technology and talking around the periphery of open source for several years now, without making the management decision to “go native,” as noted in June by Eugenia Loli-Queru, editor of OSNews.com. The official Motorola strategy appears to be defensive — the party line is that application developers should write Java applications on Motorola’s J2ME platform. Kinda booring!

Meanwhile, Harald Welte and others are working to create a flashable, open-source Linux 2.6 environment for the A780 and its successors through the OpenEZX project. The MotorolaFans.com, Opie, and OpenEmbedded sites also have related information. It will be interesting to see what happens with Linux on (and around) cell phones.