2006-07-31

Zope export outside zope/使用wget来导出zope文件

以前每次导出zope的某个文件夹都要进入到ZMI的web interface里,一直希望能有脚本在命令行下完成。今天在网上找到一个脚本,可以实现在命令行下导出的功能。

使用wget来导出:
wget -O 3urts96.zexp http://username:password@urts96.uni-trier.de:8080/Projects/2urts96/manage_exportObject?download%3Aint=1&submit=Export'

Code:

2006-07-29

subversion+Outlook

Outlook是我常用的程序了,经常用里面的notes记录一些小东西。虽然网上有google notebook,也有 textsnipptes 这样的工具可用,但有时还是不如使用本地的方便。由于我经常在不同的机器上用outlook,于是把pst文件放在了网络硬盘上。可是同一时间只允许一个程序读取这个pst文件,当在outlook里关闭这个文件后,必须让outlook完全退出才能完全解锁这个文件,这样其他机器上的outlook程序才能读取它。

今天突然想,能不能把这个文件提交到subversion里,在各个本地check out一个副本,修改完后再提交到版本库,不知道这样能不能解决我的问题。

2006-07-28

frames的不同编码

当同一个页面的多个Frames使用不同的编码时,IE 6.0 的处理要好于Firefox 1.5。IE 6.0对于不同的Frame使用不同的编码,而Firefox 1.5对于多个Frames使用同一种编码,如果多个Frames的编码不一致,这样的页面在Firefox下显示就有问题了。

2006-07-27

update ilias 3 to ilias 3.6.5

Bitte beim nächsten Update nicht vergessen, im Homeverzechnis des Ilias 3 Webverzeichnis immer eine Link machen:
ln -s /studipserv/ilias3data/data data

Da sind die Daten der verschiendene ilias 3 clients.

2006-07-26

解决SVN 1.32 windows版本命令行显示乱码

我在windows XP下使用SVN 1.32时发现svn在本地化信息时一些字母没有正确显示,如得到提示:
Geben Sie 'svn help' f?\195?\188r weitere Hilfe ein.
其实本应该是Geben Sie 'svn help' für weitere Hilfe ein.

解决办法是设置环境变量 APR_ICONV_PATH,让它指向svn目录下的iconv目录,如在我的机器上是 D:\Programme\svn-win32-1.3.2\iconv 。

2006-07-25

convert MyISAM to InnoDB

MySQL的文档说InnoDB类型的表在处理数据比较大时,效率要比MyISAM类型好。urts52上有个字典数据库的数据为6.4个GB,不算小了。于是想把这个数据库的所有表从MyISAM 类型转换成 InnoDB类型,常见的办法是。
1. Dump the database with mysqldump
2. Change TYPE=ISAM to TYPE=INNODB
3. Add entries to /etc/my.cnf and restart MySQL
4. Load the database with mysql

不过如果MySQL server已经支持InnoDB了,可以用更简单的办法,如转换单个表的类型:

alter table mytable type=InnoDB;如果要转换一个数据库所有表,可以用:

for t in $(mysql --batch --column-names=false -e "show tables" mydbname);
do
mysql -e "alter table $t type=InnoDB" mydbname;
done


如果要转换一个数据库带有某个特定前缀的表或忽略某些表,可以搭配grep来使用:

for t in $(mysql --batch --column-names=false -e "show tables" mydbname |grep "include_this");
do
mysql -e "alter table $t type=InnoDB" mydbname;
done
for t in $(mysql --batch --column-names=false -e "show tables" mydbname | grep -v "exclude_this");
do
mysql -e "alter table $t type=InnoDB" mydbname;
done


或者直接输入多个表的名称: for t in table_1 table_2 table_n;
do
mysql -e "alter table $t type=InnoDB" mydbname;
done

2006-07-19

用junction创建windows 2000/XP下的symbol links

Windows 2000 and higher supports directory symbolic links, where a directory serves as a symbolic link to another directory on the computer. For example, if the directory D:\SYMLINK specified C:\WINNT\SYSTEM32 as its target, then an application accessing
D:\SYMLINK\DRIVERS would in reality be accessing C:\WINNT\SYSTEM32\DRIVERS. Directory symbolic links are known as NTFS junctions in Windows. Unfortunately, Windows comes with no tools for creating junctions - you have to purchase the Win2K Resource Kit, which comes with the linkd program for creating junctions. I therefore decided to write my own junction-creating tool: Junction. Junction not only allows you to create NTFS junctions, it allows you to see if files or directories are actually reparse points. Reparse points are the mechanism on which NTFS junctions are based, and they are used by Windows' Remote Storage Service (RSS), as well as volume mount points.

mysqldump: Error 2013

今天写了个小的脚本,把MySQL的数据从urts52复制到urts96时,运行时得到一些错误:
copying DWBdatabase4cd
mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `TEXT_H` at row: 23854
copy database DWBdatabase4cd finished!
now copying DWVdatabase2
mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `lemma` at row: 9251

出现这个问题的原因很有可能是max_allowed_packet变量的值设置太小了。
这儿有一个关于这个问题的讨论,和参看MySQL手册中相关的部分

2006-07-18

MySQL区分用户名大小写

以前一直没有注意MySQL中用户名大小写的问题,因为用户名一般都是小写的。今天Ansgar给我设置了一个MySQL账户,用户名为Dingjun。这样我用小写的用户名登陆
jiad4701@urts96:~> mysql -u dingjun -p
Enter password:
ERROR 1045 (28000): Access denied for user 'dingjun'@'localhost' (using password: YES)

就得到错误提示。使用区分大小写的用户名就没有问题:
jiad4701@urts96:~> mysql -u Dingjun -p
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 264184 to server version: 4.1.13
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

2006-07-14

认识Apache Forrest

最近一直在弄Apache Cocoon,今天抽空看了一下Apache Forrest。这也是一个web publish framework,其中包括了Apache的很多项目,当然也包括cocoon。Forrest支持静态和动态发布网页,对于制作项目文档和基于XML/XSLT的网页开发是个很好的工具。Forrest目前还处于发展的初期阶段,发布的最新版本为0.7,开发版本为0.8。Forrest提供一些项目快速开发支持,如用forrest seed命令创建一个项目文档的基本结构,这一点马上让我想到了ruby on rails,不过ruby on rails好像是不支持静态发布网页的。

2006-07-13

在vim中连接行

以前使用vi总不知道如何把当前行的下一行移上来,常常是通过做剪切和粘贴的工作来完成,其实用一个命令就可以完成。今天在网上看到怎么做了:
J:  将下一行连接到当前行的末尾
nJ:连接后面n行

2006-07-12

学习Xinclude

以前经常看IBM developerworks的文章,今天在网上想学习一下Xinclude,才发现MSDN也有不少好文章,如这篇将 XML 文档与 XInclude 合并在一起


这儿是实现Xinclude的一个列表(截至2003年6月),Cocoon榜上有名

2006-07-09

FOP and Embedding Fonts under Cocoon

在cocoon 2.1.9自带的文档里提到FOP and Embedding Fonts under Cocoon,但是里面的内容显然已经过时了,不是针对cocoon 2.1.9版本,如果按照文档的做法无法为cocoon的FDP serializer添加其他的字体。下面是我为cocoon 2.1.9的pdf serializer添加Arial Unicode MS字体支持的过程。

让FOP生成支持多语言的pdf文件

在使用fop 0.20.5生成pdf文件,当fo文件里出现不在base-14里的字符时,这些字符在生成的pdf文件里就变成了#符号,看了一下FOP的FAQ,发现原来是FOP里默认的字体不支持Unicode的原因。在windows上有个字体Arial Unicode MS是支持Unicode,于是执行下面的命令为这个字体生成metric file。

2006-07-07

xsl和xslt文件扩展名的问题

以前为StudIP生成pdf文件接触过xsl,但是一直搞不太清楚为什么会有xsl和xslt两个不同的文件类型。在XML Spy中创建文件时也可以选择是创建xsl文件还是xslt文件。

如果选择创建xsl文件,则程序生成的文件头为:

2006-07-06

用firefox访问非常规port的网页

今天为装zuccaro,随便选择了一个端口6000,用IE和Opera访问都没有问题,但是没想到用firefox访问时却得到提示:
This address is restricted      

This address uses a network port which is normally used for purposes other than Web browsing. Firefox has canceled the request for your protection.

后来在google上找到了解决办法:
The only way to fix this problem is to add a new variable to Firefox's configuration.
You do this by:

1. Entering about:config in the URL bar.
2. Right click the list that is displayed and choose New->String
3. Enter network.security.ports.banned.override as the name of the new string and click ok.
4. Enter the ports you want allowed, seperated by commas (like: "101,800,5000"). Click OK.

2006-07-05

安装 zuccaro

学校的Kunstgeschichte系和一个位于意大利罗马的图书馆有个项目,搞一个关于意大利艺术史的网上数据库。他们使用Zope/Plone,并且自己开发了一些Plone的Products。他们现在用的zope Server在一台windows xp上跑,打算移到Linux下。今天下午试着把他们的数据挪到urts96上去。

察看文件编码的小工具

前几天被文件编码和字符集搞的有点头疼,发现有一个小工具Enca可以检测文件的编码和作编码的转换。

这个工具现在的版本只支持一定的语言,包括中文,但是不支持德语。

2006-07-02

MySQL 4.1中涉及字符编码的变量

有多个有关character set 和 collation的变量会影响MySQL客户端与MySQL服务器的交互操作,对于在数据库中使用非英语的语言时,这些变量如果没有正确设置,就会导致出现乱码。

MySQL服务器端的character set 和 collation是由变量character_set_server 和 collation_server分别来决定的,创建数据库时默认的character set 和 collation则是由变量character_set_database and collation_database来指定的。

2006-07-01

Autoenrollment with event id 15

最近学校的网络好像不太稳定,前几天不知道什么原因甚至瘫痪了一晚上。我的日志里也有一些
Event Type: Error
Event Source: AutoEnrollment
Event Category: None
Event ID: 15
Date: date
Time: time
User: N/A
Computer: computer name
Description: Automatic certificate enrollment for local system failed to contact the active directory (0x8007054b). The specified domain either does not exist or could not be contacted. Enrollment will not be performed.