Sunday, July 27, 2008

最近10年计算机专业图书中的50强

美国著名图书频道Book Pool集结最权威的62位作者评选出了最近10年计算机专业图书中的50强。

光这62位作者阵营就非常强大,我们熟悉的就有:
  • Francesco Balena《Microsoft.NET框架程序设计——Visual Basic.NET语言描述》作者)
  • Bert Bates《Head First Design Patterns》作者)
  • Joshua Bloch《Effective Java》作者)
  • Kalen Delaney《Microsoft SQL Server 2000技术内幕》作者)
  • Stephen C. Dewhurst《C++ Gotchas》作者)
  • Bill Evjen《Visual Basic.NET宝典》作者)
  • Dino Esposito《构建Web解决方案——应用ASP.NET和ADO.NET、Microsoft .NET XML程序设计》作者)
  • Andy HuntPragmatic Programmer系列图书作者)
  • Gary McGraw《Exploiting Software: How to Break Code》作者)
  • Steve McConnell《Code Complete》作者)
  • Christian Nagel《Enterprise Services with the .NET Framework》作者)
  • Arnold Robbins《Linux程序设计》作者)
  • Tim O'Reilly(O'Reilly媒体集团创始人)
  • Chris Sells《Windows Forms程序设计、.NET本质论》作者)
  • Stephen Walther《设计模式——可复用面向对象软件的基础》作者)
  • John Vlissides《ASP.NET揭秘》作者)
由此可见这次评选的权威性,还是让我们来看看这50本书的分布吧:

软件工程类

按照现代计算机技术的发展,《人月神话》应该称得骨灰级图书了,计算机图书能够流行30年,Frederick Brooks确实让人刮目相看。这种现象往往出现在软件工程类和算法类的图书上,这些理论和技术往往经久不衰。比如:
  • 《设计模式:可复用面向对象软件的基础》1994年出版(多位大师创作)
  • 《人件》1987年出版(Tom DeMarcoTimothy Lister
Martin FowlerKent Beck是软件工程领域最有名的技术作家,剩下的4本上榜图书全部是他们所写:
  • 《企业应用架构模式》Martin Fowler
  • 《重构——改善既有代码的设计》Martin Fowler
  • 《解析极限编程》Kent Beck
  • 《UML精粹:标准对象建模语言简明教程》Martin Fowler
看看这个领域还漏掉哪些经典:
Robert C. Martin《敏捷软件开发:原则、模式与实践》或者是其他?

C/C++类

C语言的设计者Brian W. Kernighan《C程序设计语言》确实经典,超过C++之父Bjarne Stroustrup《C++程序设计语言》进入名单榜中。

此外,Scott Meyers《Effective C++》众望所归,他的《More Effective C++》《Effective STL》也同样精彩。

Stan Lippman《C++ Primer》不在榜单,有点可惜。

Java类

不 知道什么原因,Java类图书的排名比较靠后,《Head First Java》是一本不错的教材,不过国内好像还未引进,《Java 2核心技术 卷I:基础知识》已经出第7版了,可见受欢迎的程度。Sun的Joshua Bloch《Effective Java》采用Scott Meyers的风格,使本书成为真正的Effective Java Book。

不过《Java编程思想》《J2EE核心模式》《Contributing to Eclipse》《Expert One-on-One J2EE Development without EJB》落榜有点意外。

Windows/.NET类

Charles Petzold《Windows程序设计》是尽人皆知的Win32 API编程经典,也称为“Petzold Book”。由Anders Hejlsberg来写《C#编程语言详解 》,谁说不是经典?不过《ADO.NET实用指南》上榜有点出乎我的意料,为什么不是Jeffrey Richter《Microsoft .NET框架程序设计》

Linux/Unix类

这类只有一本《UNIX环境高级编程》,漏掉了《UNIX 编程艺术》是否可惜?

Web开发类

有3本书上榜,Perl之父Larry Wall《Perl语言编程》是经典的教程,《网站重构》上榜在情理之中,Jeffrey Zeldman一直走在Web标准制定的最前沿。

ASP.NET Page Framework负责人Nikhil Kothari《ASP.NET服务器控件与组件开发》讲解ASP.NET模式非常清晰,不过,如果是ASP.NET入门的话,我倒是推荐另外一本——《ASP.NET揭秘》

还有没有漏掉什么啦?《JavaScript权威指南》是不是也很好?

网络通讯类

这类图书上榜比较多,TCP/IP如此的重要,《TCP/IP详解 卷I:协议》《TCP/IP路由技术(第一卷)》同时上榜。其他的还有《Internet路由结构》《计算机网络(第四版)》《DNS与BIND》

数据库类

数据库类评选结果不太好评点,《Transact-SQL权威指南》是一本标准的T-SQL教材,进一步实践,还是建议看邹建最新出版的中文版《SQL Server 2000 开发与管理应用实例》

其 他上榜的都没有中文版:《A First Look at SQL Server 2005 for Developers》(FirstLook系列过时太快,基本上没有引进)、《Expert Oracle, Signature Edition (One-on-One)》(2005年的新书,作者Thomas Kyte是Oracle的VP)、《Joe Celko's SQL for Smarties : Advanced SQL Programming》(作者Joe Celko是ANSI SQL标准委员会成员)。

安全类

网络社会没有比安全更重要的了,这类图书上榜就有5本,分别是: 《编写安全的代码》《黑客大曝光》《信息安全工程》《网络信息安全的真相》《应用密码学》。 后2本都是国际公认密码和信息安全专家Bruce Schneier的大作。

算法和代码类

提到算法,没有人不想到Donald E. Knuth《计算机程序设计艺术》,据说Bill Gates曾放言,做对该书所有习题就能到微软来报到上班,可见此书探讨算法的深度。相比Donald的巨著,《算法导论》更适合做为算法教材。

《代码大全》上榜在预料之中,这本书曾经有过中文版,不过现在已经绝版了,有点可惜。

综合类

不 好归类的都叫综合类吧,《程序员修炼之道》书名翻译不太恰当,《Pragmatic Programmer》代表注重实效的程序员,程序员如何注重实效?全书就围绕这个话题在谈。不过,因为这本书出版时间较早(1999年),我更愿意看《Joel说软件》,这种Blog的写作风格更加通俗易懂。

《编程珠玑》《程序设计实践》是2本讲解编程技巧的图书,如果说软件是工艺的话,你对这门手艺掌握的如何了?

Merrill R. Chapman作为老资格的程序员、销售主管,在《IT大败局》中以事件亲历的方式来剖析Ashton-Tate等公司的失败案例的时候显得特别具有说服力。前车之鉴、后车之师,何必自己花钱买教训呢?

综合类还有很多好书,比如,Gerald M.Weinberg《你的灯亮着吗?》David Kushner《DOOM启世录》都值得一读。国内的读者还不应该放过李维《Borland传奇》蔡学镛《爪哇夜未眠》

其他一些上榜图书没有中文版,不太好点评,分别是:
  • 《Microsoft SharePoint: Building Office 2003 Solutions》
  • 《Group Policy, Profiles, and IntelliMirror for Windows 2003, Windows XP, and Windows 2000》
  • 《Don't Make Me Think》
  • 《The Design of Everyday Things》
  • 《The Code Book: The Science of Secrecy from Ancient Egypt to Quantum Cryptography》
  • 《Mac OS X: The Missing Manual, Panther Edition》
  • 《The Elements of Style, 4th Edition》
  • 《Godel, Escher, Bach: An Eternal Golden Braid》

Thursday, July 24, 2008

Enable Math Rendering in MediaWiki

1. Install OCaml.
2. Install texlive-latex
3. Download and install AMS-latex:
ftp://ftp.ams.org/pub/tex/amslatex.zip
ftp://ftp.ams.org/pub/tex/amsrefs/amsrefs-tds.zip
3. Install texvc (/wiki/math/README)
4. edit LocalSettings.php:
$wgMathPath = "../images/math";
$wgMathDirectory = "{$IP}/images/math";
$wgTmpDirectory = "{$IP}/images/tmp";
$wgUseTeX = true;


Thursday, July 17, 2008

Oracle 10g Installation

Groups:
  • oinstall, gid=2000
  • dba, gid=3000
  • oper, gid=4000
User:
  • oracle, password=orapass, g=oinstall, G=dba,oper, uid=2001
Directories:
  • Oracle Base Directory=/u00/app/oracle
  • Database File Directory = /u01/oradata
  • Recovery File Directory = /u02/oradata
  • Inventory Directory=/home/oracle/oraInventory
Evironment Variables:
  • ORACLE_BASE=/u00/app/oracle
  • ORACLE_SID=vrlab
  • Installation Name=OraDb10g_home1, Installation Path=/u00/app/oracle
Database:
  • Global Database Name=cad
  • System Identifier(SID)=cad
  • Server Parameter Filename=/u00/app/oracle/dbs/spfilecad.ora
  • Dababase Accounts=SYS, SYSTEM, DBSNMP, SYSMAN/orapass
  • iSQL*Plus URL=http://<host_name>:5560/isqlplus
  • iSQL*Plus DBA URL=http://<host_name>:5560/isqlplus/dba
  • Database Control URL=http://<hostname>:1158/em

Monday, July 14, 2008

Install WordPress & MediaWiki

1. Create the group and user for mysql users:
# groupadd -g 1000 mysql
# useradd -G mysql -d /home/mysql -m -u 1001 mysql
# passwd mysql
New Password: mypass
Reenter New Password: mypass
2.
# gzip -d mysql-5.0.51a-linux-i686-icc-glibc23.tar.gz
# tar -xvf mysql-5.0.51a-linux-i686-icc-glibc23.tar
# mv mysql-5.0.51a-linux-i686-icc-glibc23 mysql
# mv mysql /usr/local
3.
# cd /usr/local/mysql
# chown -R mysql .
# chgrp -R mysql .
# scripts/mysql_install_db --user=mysql
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h opensuse password 'new-password'

Alternatively you can run:
./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl

Please report any problems with the ./bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
# chown -R root .
# chown -R mysql data
4. Start the MySQL server.
# bin/mysqld_safe --user=mysql &
5. Accounts with the username root are created. These are superuser accounts that can do anything. The initial root account passwords are empty, so anyone can connect to the MySQL server as root — without a password — and be granted all privileges.
On Unix, both root accounts are for connections from the local host. Connections must be made from the local host by specifying a hostname of localhost for one of the accounts, or the actual hostname or IP number for the other.
Two anonymous-user accounts are created, each with an empty username. The anonymous accounts have no password, so anyone can use them to connect to the MySQL server.
On Unix, both anonymous accounts are for connections from the local host. Connections must be made from the local host by specifying a hostname of localhost for one of the accounts, or the actual hostname or IP number for the other. These accounts have all privileges for the test database and for other databases with names that start with test_.

1) remove the anonymous accounts:
# mysql -u root
mysql> drop user '';
Query OK, 0 rows affected (0.00 sec)
mysql> drop user ''@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> drop user ''@'opensuse';
Query OK, 0 rows affected (0.00 sec)
2) assign passwords to the root accounts:
# mysql -u root
mysql> set password for 'root'@'localhost' = password( 'mypass' );
Query OK, 0 rows affected (0.00 sec)
mysql> set password for 'root'@'opensuse' = password( 'mypass' );
Query OK, 0 rows affected (0.00 sec)
mysql> set password for 'root'@'127.0.0.1' = password( 'mypass' );
Query OK, 0 rows affected (0.00 sec)
3) allow root account connecting from any host:
# mysql -u root -p
Enter password: mypass
mysql> create user 'root'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> set password for 'root'@'%' = password( 'mypass' );
Query OK, 0 rows affected (0.00 sec)
4) grant privileges to root@%
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY PASSWORD '*CDC006E5FCB22B379747AF6E75DF97FB503F11B3' WITH GRANT OPTION
6. Use mysqladmin to verify that the server is running.
# bin/mysqladmin version - p
Enter password: mypass
bin/mysqladmin Ver 8.41 Distrib 5.0.51a, for redhat-linux-gnu on i686
Copyright (C) 2000-2006 MySQL AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version 5.0.51a
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /tmp/mysql.sock
Uptime: 3 hours 18 min 27 sec

Threads: 2 Questions: 300 Slow queries: 0 Opens: 24 Flush tables: 1 Open tables: 17 Queries per second avg: 0.025
# bin/mysqladmin variables -p
+---------------------------------+----------------------------------------+
| Variable_name | Value |
+---------------------------------+----------------------------------------+
| auto_increment_increment | 1 |
| auto_increment_offset | 1 |
| automatic_sp_privileges | ON |
| back_log | 50 |
| basedir | /usr/local/mysql/ |
| binlog_cache_size | 32768 |
| bulk_insert_buffer_size | 8388608 |
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/local/mysql/share/mysql/charsets/ |
......
| tmp_table_size | 33554432 |
| tmpdir | /tmp/ |
| transaction_alloc_block_size | 8192 |
| transaction_prealloc_size | 4096 |
| tx_isolation | REPEATABLE-READ |
| updatable_views_with_limit | YES |
| version | 5.0.51a |
| version_comment | MySQL Community Server (GPL) |
| version_compile_machine | i686 |
| version_compile_os | redhat-linux-gnu |
| wait_timeout | 28800 |
+---------------------------------+----------------------------------------+
7. Verify that you can shut down the server:
# bin/mysqladmin -u root shutdown -p
Enter password: mypass
8. Verify that you can start the server again. Do this by using mysqld_safe or by invoking mysqld directly. For example:
# bin/mysqld_safe --user=mysql --log &
[1] 27927
opensuse:/usr/local/mysql # nohup: ignoring input and redirecting stderr to stdout
Starting mysqld daemon with databases from /usr/local/mysql/data
9. Run some simple tests to verify that you can retrieve information from the server. The output should be similar to what is shown here:
# bin/mysqlshow -p
# bin/mysqlshow mysql -p
# bin/mysql -e "select * from user" mysql -p
10.
# gzip -d httpd-2.2.9.tar.gz
# tar -xvf httpd-2.2.9.tar
# cd httpd-2.2.9
# ./configure --enable-so
# make
# make install
Now you have httpd-2.2.9 available under /usr/local/apache2, configured with loadable module support and the standard MPM prefork. To test the installation use your normal procedure for starting the Apache server, e.g.:
# /usr/local/apache2/bin/apachectl start
and stop the server to go on with the configuration for PHP:
# /usr/local/apache2/bin/apachectl stop.
11.
# gzip -d php-5.2.6.tar.gz
# tar -xvf php-5.2.6.tar
# cd php-5.2.6
Now, configure your PHP. This is where you customize your PHP with various options, like which extensions will be enabled. Do a ./configure --help for a list of available options. In our example we'll do a simple configure with Apache 2 and MySQL support. Your path to apxs may differ, in fact, the binary may even be named apxs2 on your system.
# ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql
# make
# make install
If you decide to change your configure options after installation, you only need to repeat the last three steps. You only need to restart apache for the new module to take effect. A recompile of
Apache is not needed.
Note that unless told otherwise, 'make install' will also install PEAR, various PHP tools such as phpize, install the PHP CLI, and more.

12. Setup your php.ini
# cp php.ini-dist /usr/local/lib/php.ini
You may edit your .ini file to set PHP options. If you prefer having php.ini in another location, use --with-config-file-path=/some/path in step 11.
If you instead choose php.ini-recommended, be certain to read the list of changes within, as they affect how PHP behaves.
13. Edit your httpd.conf to load the PHP module. The path on the right hand side of the LoadModule statement must point to the path of the PHP module on your system. The make install from above may have already added this for you, but be sure to check.
For PHP 4:
LoadModule php4_module modules/libphp4.so
For PHP 5:
LoadModule php5_module modules/libphp5.so
14. Tell Apache to parse certain extensions as PHP. For example, let's have Apache parse .php files as PHP. Instead of only using the Apache AddType directive, we want to avoid potentially dangerous uploads and created files such as exploit.php.jpg from being executed as PHP. Using this example, you could have any extension(s) parse as PHP by simply adding them. We'll add .phtml to demonstrate.
SetHandler application/x-httpd-php
Or, if we wanted to allow .php, .php2, .php3, .php4, .php5, .php6, and .phtml files to be executed as PHP, but nothing else, we'd use this:

SetHandler application/x-httpd-php
And to allow .phps files to be executed as PHP source files, add this:
SetHandler application/x-httpd-php-source
15.
DirectoryIndex index.php index.html
16. Use your normal procedure for starting the Apache server, e.g.:
# /usr/local/apache2/bin/apachectl start
- OR -
# service httpd restart
17.
1) Download and unzip the WordPress package, if you haven't already.
2) Create a database for WordPress on your web server, as well as a MySQL user who has all privileges for accessing and modifying it.

mysql> create database wordpress character set gbk collate gbk_chinese_ci;
Query OK, 1 row affected (0.02 sec)

mysql> create user 'wordpress'@'%';
Query OK, 0 rows affected (0.00 sec)

mysql> set password for 'wordpress'@'%' = password( 'wordpress' );
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on wordpress.* to 'wordpress'@'%';
Query OK, 0 rows affected (0.04 sec)

3) Rename the wp-config-sample.php file to wp-config.php.
4) Open wp-config.php in your favorite text editor and fill in your database details.
5) Place the WordPress files in the desired location on your web server:

* If you want to integrate WordPress into the root of your domain (e.g. http://example.com/), move or upload all contents of the unzipped WordPress directory (but excluding the directory itself) into the root directory of your web server.
* If you want to have your WordPress installation in its own subdirectory on your web site (e.g. http://example.com/blog/), rename the directory wordpress to the name you'd like the subdirectory to have and move or upload it to your web server. For example if you want the WordPress installation in a subdirectory called "blog", you should rename the directory called "wordpress" to "blog" and upload it to the root directory of your web server.

Hint: If your FTP transfer is too slow read how to avoid FTPing at : Step 1: Download and Extract.

6) Run the WordPress installation script by accessing wp-admin/install.php in your favorite web browser.

* If you installed WordPress in the root directory, you should visit: http://example.com/wp-admin/install.php
* If you installed WordPress in its own subdirectory called blog, for example, you should visit: http://example.com/blog/wp-admin/install.php

18. Change the password for admin: <default>

19. Install MediaWiki:

1) Install ImageMagick:
# gzip -d ImageMagick-6.4.2-3.tar.gz
# tar -xvf ImageMagick-6.4.2-3.tar
# cd ImageMagick-6.4.2
# ./configure
# make
# make install
2) Prepare the Directories:
# chmod 777 config
3) Use your web browser to browse to the main wiki page. Click on the link to begin the configuration script.
* PHP 5.2.6 installed
* Found database drivers for: MySQL
* PHP server API is apache2handler; ok, using pretty URLs (index.php/Page_Title)
* Have XML / Latin1-UTF-8 conversion support.
* Warning: A value for session.save_path has not been set in PHP.ini. If the default value causes problems with saving session data, set it to a valid path which is read/write/execute for the user your web server is running under.
* PHP's memory_limit is 128M.
* Couldn't find Turck MMCache, eAccelerator, APC or XCache; cannot use these for object caching.
* Found GNU diff3: /usr/bin/diff3.
* Found ImageMagick: /usr/bin/convert; image thumbnailing will be enabled if you enable uploads.
* Installation directory: /usr/local/apache2/htdocs
* Script URI path:
* Installing MediaWiki with php file extensions
* Environment checked. You can install MediaWiki.
*** Admin Username: WikiSysop
*** Password: mediawiki

*** Database Name: wikidb
*** DB Username: wikiuser
*** DB Password: mediawiki

Wednesday, June 18, 2008

远程重启Windows XP

shutdown -r -t 0

Firefox 3.0

Firefox 3.0正式发布了,24小时内被疯狂下载了800多万次,创了新的世界纪录。
我也下载下来试用了一下,也许是因为用了主题的缘故,感觉跟以前无异,希望BUG少些,和IE的兼容性也好些。
速度似乎挺快。
Firefox 3

Monday, June 16, 2008

Zeitgeist, the Movie

http://www.zeitgeistmovie.com/main.htm