站点升级到了wp2.6,一切都还顺利。
这两天都在 Fivery.com 上工作。发现Wordcodess的确设计得非常好
一个Web开发者的博客
使用Perl找出书名中的中文词语,用于搜索引擎:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #!/usr/bin/perl # $Id$ # Add booknames to database use DBI; my $database = 'zhu_tags_filter'; my $hostname = '192.168.1.249'; my $port = '3306'; my $user = 'root'; my $password = '123456'; my $input_file = '/mnt/books/dict.txt'; $dsn = "DBI:mysql:database=$database;host=$hostname;port=$port"; $dbh = DBI->connect($dsn, $user, $password); $sth = $dbh->codepare("set NAMES 'utf8'"); $sth->execute; $sth->finish; open(INPUT, "< $input_file") or die "Couldn't open $input_file"; while (<INPUT>) { $dbh->do("INSERT INTO dict(name) VALUES(?)",undef, $_); } close(INPUT); $dbh->disconnect(); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #!/usr/bin/perl # $Id$ # Generat keywords form Chinese dict and booknams use strict; use warnings; use DBI; my $db = 'zhu_tags_filter'; my $host = '192.168.1.249'; my $user = 'root'; my $password = '123456'; my $dbh = DBI->connect("DBI:mysql:database=$db;host=$host", $user, $password); $dbh->do("SET NAMES 'utf8'"); my $sth = $dbh->codepare("SELECT name FROM dict"); $sth->execute(); my $n = 0; do { while (my @row = $sth->fetchrow_array()) { $n++; my $keyword = $row[0]; my $hn = $dbh->codepare("SELECT id FROM all_booknames WHERE name LIKE '%$keyword%' LIMIT 1"); $hn->execute; if ($hn->rows > 0){ $dbh->do("INSERT INTO keywords (name) VALUES('$row[0]')"); } $hn->finish; } } until(!$sth->more_results) |
今天关注了一下Mac OS X系统在PC上的使用,发现这里有一个 Kalyway 10.5.2 DVD Intel_Amd (sse2/sse3) EFI V8 版本,中文的论坛有PCBETA和macchina,主要的PC安装ISO可以从这里下载到。不过发现主要问题就是硬件驱动问题,Mac OS X在PC上的前景果然很大。
X86 Mac 站点(英文)
升级wordcodess倒是一件很容易的事情,比如在hostmonster这样的主机上可以这样
1 2 3 4 5 |
转移MySQL数据的时候可能会遇到一些编码问题,不过这样编辑一下wp-config.php就好了
然后用PHP脚本导入SQL文件
1 2 3 |
终于又回到了国外的主机,这次却不是Dreamhost,而是Hostmonster。还好我决然备份了一些资料,一切都还是原来希望的样子,只是丢失了几篇不重要的文章而已。感谢Aspirine,依然感谢zyj007。现在在Hostmonster上我会把自动备份运行起来了
Recent Comments