Author Archives: ads

Comments on the work of the Old Hanzi Group towards an encoding of OBI script.

This document is a response to an invitation by Suzuki Toshiya and Deborah Anderson to comment on work by the Old Hanzi Group towards an encoding of early Chinese scripts. The comments are based on a review of documents archived on the IRG website:(http://appsrv.cse.cuhk.edu.hk/~irg/), and of the data deposited at ftp://ftp.iso10646hk.net/IRG/OldHanzi/.

Contents:

0. Introduction

1. General remarks

2. Other projects

3. Feasibility of OBI standardization and encoding

4. Why Old Hanzi shoud be encoded separately from CJK

5. Documentation

6. Intended user group, and purpose of encoding

First draft of new paper: “The particle yān 焉, and the phonological reduction of prepositional phrases in Old Chinese.”

First draft is online for circulation and comment. (PDF)

This paper reaffirms Kennedy’s proposal that the particle yān 焉 is, historically, the result of a phonological reduction of a high-frequency PP involving the preposition yú 於 and a 3pp. It further shows that this was part of a more general process which affected high-frequency PPs combining several different prepositions (the discussion will be confined to yú 於, yú 于) and several different 3pps (including zhī 之, shì 是 and hé 何). The MC readings for yān 焉 derive from the PP yúshì 於是. The graph yān 焉 arose from a héwén (合文) writing for the PP yúshì 於是.

The central phonological claim, is that yān < b/qan 焉 derives from the sequence of yú < b/qa 於 and shì < b/deʔ 是, and has attracted some flak from some early readers of the article. I have suggested that the syllable that might be expected, *a/b/qad, which would be prohibited by phonotactic constraints (no voiced stop codas), might have been repaired to the legal b/qan.

Ubuntu 11.10 => HP LaserJet 1200 stopped working

After upgrading to Ubuntu 11.10, my HP LaserJet 1200 refuses to print properly any more. I sometimes get single pages of multi-page documents. I sometimes get “PCL XL error” pages. But usually nothing gets printed at all.

Trying the latest version of HPLIP. The Ubuntu repositories have version 3.11.7. The HP website has version 3.11.12

  1. removed old version of hplip with Synaptic.
  2. downloaded installer from hp.
  3. followed all instructions without incident.

Initially I was back in the same mess as before. However, by repeatedly playing around with deleting the printer connection (System Settings > Printing), adding a new printer connection (System Settings > Printing), and plugging in and out the printer from the USB, and switching it on and off to clear the flashing green light, I managed to get it to work. The problem seems to be that the when the printer gets plugged into the USB, it is recognised automatically, but somehow the connection is incorrectly configured. Now prints just fine from LibreOffice Writer and Evince pdf viewer.

Unfortunately, I’m not sure whether it was the newer hplip version, or the delete/add new printer connection that fixed it.

Install working version of FontForge on Ubuntu 11.10

The version of FontForge currently available from the Ubuntu repositories is unusable with Ubuntu 11.10. The bug and the solution is described here. It seems that FontForge has been fixed to work with 11.10, but that the Ubuntu repositories have not been updated. Version 20110225 works; the older version 20100429 in the repository doesn’t.

Aleksandr’s solution works:

  1. Uninstall the old FontForge package (using Synpatic or whatever).
  2. Install git and python-dev if they are not already installed.
  3. Download and compile FontForge from source:
    Open a terminal screen, and enter the following lines:
    git clone git://fontforge.git.sourceforge.net/gitroot/fontforge/fontforge.
    That downloads the source code for the latest version.
    cd fontforge
    That moves you into the directory where the FontForge files have just landed.
    ./configure
    sudo make install
    That compiles FontForge. The executable was at ~/fontforge/fontforge/fontforge. Change the permissions to run it without sudo.

Ubuntu 11.10 misery

You persuade yourself, and anyone who will listen, that migrating to Ubuntu Linux was a smart move – it’s free, you have control, it doesn’t try and sell you things or manipulate you, it has a short boot-time, you learn more, it isn’t targeted by viruses and malware, it doesn’t use grasping and possessive infantilisms like “My Computer” and “My Music”, it’s fun, you aren’t tortured by shut-down screens that say “Do not unplug or power off your machine – installing updates” that stay there for indefinitely long periods when you need to leave the office with your laptop in five minutes’ time, etc. etc.

Then you upgrade to Ubuntu 11.10…

You can forgive the slightly kindergarten feel of the “Dash”. You reinstall the stuff that gives you back the control you miss from earlier versions. You acknowledge that it actually looks and feels pretty good, and works pretty well.

Then you realise that it cannot, will not, declines to, refuses to, print to your HP LaserJet 1200, which worked just fine with the previous version. You can’t print anything at all! Then you install FontForge, which worked on previous versions, and find that it pulls a segmentation fault whenever you do anything drastic like press the Shift key.

I’m going to start here and here. If they are not both fixed in 24 hrs, I am officially no longer a fan.

Qt + MySQL + Windows 7

Getting Qt and MySQL running together and interacting properly on Windows 7 has been a real headache – much more challenging than on Ubuntu Linux the last time I tried. Without the MySQL drivers for Qt installed, you get the error QSqlDatabase: QMYSQL driver not loaded if you attempt to use a MySQL database. Had I not found the tutorial by ieatbinary I would certainly have been defeated. One way of tackling the problem, it seems, is to get Qt and MySQL up and running independently of one another first, and then to build the MySQL plugin for Qt. Doing that avoids the need to compile all of Qt, including the MySQL driver, from source. Instead one can use the much more friendly installer. There were a few twists, though, which I will summarize here.

Step 1 – Install Qt SDK

Download the installer from http://qt.nokia.com/downloads/. Run it. Note ieatbinary’s (Step 1) point about installing source files, to ensure that you have the source files needed to compile the MySQL plugin.

Step 2 – Install MySQL

Note first that, according to ieatbinary, only 32-bit MySQL can be used to for the Qt plugin. ieatbinary’s tutorial (Step 2) tells us that we need to install the MySQL Client C API Library. I was installing MySQL as part of WampServer and did not find any way of including all of that library during installation. The only file that seemed to be required yet missing was libmysql.lib. This can be retrieved from the ZIP archive downloadable from http://dev.mysql.com/downloads/mysql/. Two different 32-bit archives for Windows were available and only the larger of the two (I used mysql-5.5.19-win32.zip) contained the missing file. Extract the file and copy it to the lib directory of the existing MySQL installation (for me: C:\wamp\bin\mysql\mysql5.5.16\lib).

Step 3 – compile MySQL drivers for Qt

From here on, ieatbinary’s tutorial can be followed exactly. Note that I got a warning (not an error) about unescaped backslashes during the compilation (his Step 4). Didn’t seem to matter.

Writing and Literacy in Early China

Li Feng and David Branner’s book on writing in early China is now out. I have a chapter which addresses the question of scribal training at the Shang site of Anyang 安陽.
Adam Daniel Smith, “The Evidence for Scribal Training at Anyang,” in Writing and Literacy in Early China, ed. Li Feng and David Branner (University of Washington Press, 2011), 173-205. A pre-print of my chapter is available here.


Import database in SQL format using PHPMyAdmin

The contents of a database (tables, indexes, data, etc.) can be exported from MySQL as a text file containing the SQL statements that recreate the database structure and populate it with the data. The following are the steps required to restore a MySQL database from such an SQL text file using PHPMyAdmin.

  1. Suppose we have an SQL file called db.sql. (PHPMyAdmin can also handle compressed or archived file formats like db.sql.zip – no need to unpack them first.)
  2. Using the web browser, navigate to http://localhost/phpmyadmin to start PHPMyAdmin.
  3. Be aware that importing an SQL file can overwrite existing tables or databases. Make sure that you know what the SQL file is supposed to do and that it won’t interfere unexpectedly with existing databases.
  4. Click the Import tab. Use the “Browse your computer” input box to select the SQL file to import.
  5. Note the size of the file, and the PHP “Max” file size next to “Browse your computer”. The default “Max” size on my installation was a puny 2,048KiB. If the SQL file that you want to import is too big, you could first try compressing it (to a zip file, say). If it is still too big, you need to edit the PHP configuration file php.ini. You could do this by hand with a text editor. Mine is at C:\wamp\bin\php\php5.3.8\. Alternatively you could go via the WampServer icon in the Notification Area… … (PHP > php.ini), which amounts to the same thing. Find the line that begins upload_max_filesize and modify the value that follows it. I have just changed mine from 2M (2 megabytes) to 100M. Save the modified php.ini file. Restart PHP/Apache.
  6. Choose the appropriate character encoding – my data files should always be in utf-8. Uncheck the “partial import” box unless you have a good reason not to. Make sure that “Format” is set to SQL.
  7. Click “Go”.

Install Apache, PHP, MySQL & PHPMyAdmin on Windows 7

Installing Apache, PHP, MySQL and PHPMyAdmin on Windows 7 (64 bit).

Apache (more properly Apache HTTP Server) is a web server.

PHP is a programming language that can be used within a web document and which is processed before the document is served up by the web server (Apache here).

MySQL is a database server.

PHPMyAdmin is a graphical interface for administering MySQL databases using a web browser. It is written in PHP, and so the interaction with the MySQL database server takes place via web documents served up by Apache.

The easiest way is simply to install them all bundled together as WampServer. The version I am using includes:

  • Apache 2.2.21
  • Php 5.3.8
  • Mysql 5.5.16
  • PhpMyadmin 3.4.5
  • …and various other utilities.

  1. Download the executable from the WampServer downloads page. I have selected the 64-bit version. I believe that only MySQL has a distinct 64-bit version. Because I want to enable MySQL support for Qt SDK, I need to use 32-bit MySQL.
  2. Run the executable (double-click on the file icon).
  3. Accept all defaults, and permit all requests. Accept all offers of taskbar and desktop links. This worked fine for me, installing the WampServer files in c:\wamp\.
  4. See that the installation is working correctly by opening the web browser and navigating to http://localhost/index.php.
  5. Run PHPMyAdmin by navigating to http://localhost/phpmyadmin/.
  6. PHPMyAdmin may display a warning inviting you to set a password for the root user. If you set a password via PHPMyAdmin (“Privileges” tab), you will need to modify the PHPMyAdmin configuration file. Mine is at c:\wamp\apps\phpmyadmin3.4.5\config.inc.php. Search for the line $cfg['Servers'][$i]['password'] = ''; and modify it to $cfg['Servers'][$i]['password'] = '******';, replacing the asterisks with your root password.
  7. Each time you reboot the machine, restart WampServer manually using Start > All Programs > WampServer > start WampServer.