Wednesday, July 27, 2005

JOMA Information Retrieval Project--Experiment with an LSI Search Engine built in Matlab

Saturday, July 23, 2005

Schema lisp

server: 155.69.150.106

from: http://mitpress.mit.edu/sicp/full-text/book/book.html

The advantage of prefix operator:
i, it can accommodate procedures that may take an arbitrary number of arguments.
ii, it extends a straightforward way to allow combinations to be nested.

expressions:

- define

- (cond ( )
( )

( ))

- (if )

-(and ... ), (or ... ), (not )

Scheme is an *applicative-order* language, namely, that all the arguments to Scheme procedures are evaluated when the procedure is applied. In contrast, *normal-order* languages delay evaluation of procedure arguments until the actual argument values are needed. Delaying evaluation of procedure arguments until the last possible moment (e.g., until they are required by a primitive operation) is called *lazy evaluation*. If the body of a procedure is entered before an argument has been evaluated we say that the procedure is *non-strict* in that argument. If the argument is evaluated before the body of the procedure is entered we say that the procedure is *strict* in that argument. In a purely applicative-order language, all procedures are strict in each argument. In a purely normal-order language, all compound procedures are non-strict in each argument, and primitive procedures may be either strict or non-strict.

Lexical scoping dictates that free variables in a procedure are taken to refer to bindings made by enclosing procedure definitions; that is, they are looked up in the environment in which the procedure was defined.

The amount of information needed to keep track of it, grows linearly with n (is proportional to n), just like the number of steps. Such a process is called a *linear recursive process*.

By contrast, the second process does not grow and shrink. At each step, all we need to keep track of, for any n, are the current values of the variables product, counter, and max-count. We call this an *iterative process*. In general, an iterative process is one whose state can be summarized by a fixed number of state variables, together with a fixed rule that describes how the state variables should be updated as the process moves from state to state and an (optional) end test that specifies conditions under which the process should terminate. Such a process is called a *linear iterative process*.

In contrasting iteration and recursion, we must be careful not to confuse the notion of a *recursive process* with the notion of a *recursive procedure*. When we describe a procedure as recursive, we are referring to the syntactic fact that the procedure definition refers (either directly or indirectly) to the procedure itself. But when we describe a process as following a pattern that is, say, linearly recursive, we are speaking about how the process evolves, not about the syntax of how a procedure is written.

Exercise 1.11:
Recursive:
(define (f n)
(if (< n 3) n
(+ (f (- n 1)) (* 2 (f (- n 2))) (* 3 (f (- n 3))))))

Iterator: ?

Exercise 1.12:
(define (pascal r c)
(if (or (= r 1) (= c 1) (= c r)) 1
(+ (pascal (- r 1) c) (pascal (- r 1) (- c 1)))))

Exercise 1.16:
(define (expt b n)
(fast-expt 1 b n))

(define (even? n)
(= (remainder n 2) 0))

(define (fast-expt a b n)
(cond ((= n 0) 1)
((= n 1) (* a b))
((not (even? n)) (fast-expt (* a b) b (- n 1)))
(else (fast-expt (* a (fast-expt 1 b (/ n 2))) b (/ n 2)))))


Exercise 1.17:
(define (even? n)
(= (remainder n 2) 0))

(define (double x) (* x 2))

(define (half x) (/ x 2))

(define (fast-mul a n)
(cond ((= n 0) 0)
((even? n) (fast-mul (double a) (half n)))
(else (+ a (fast-mul a (- n 1))))))

Exercise 1.19:
By calculating that: $T^2_{pq}(a, b) = a(P^2 + 2pq + 2q^2) + b(2pq +q^2), a(2pq + q^2) + b(p^2 + q ^ 2)$, you draw the conclusion that: $p'=p^2 + q^2, q'=2pq + q^2$.

(define (fib n)
(fib-iter 1 0 0 1 n))
(define (fib-iter a b p q count)
(cond ((= count 0) b)
((even? count)
(fib-iter a
b
(+ (* q q) (* p p)) ; compute p'
(+ (* 2 q p) (* q q)) ; compute q'
(/ count 2)))
(else (fib-iter (+ (* b q) (* a q) (* a p))
(+ (* b p) (* a q))
p
q
(- count 1)))))


Euclid's Algorithm:
(define (gcd a b)
(if (= b 0)
a
(gcd b (remainder a b))))


Prime test by The Fermat test:
Fermat's Little Theorem: If n is a prime number and a is any positive integer less than n, then a raised to the nth power is congruent to a modulo n.
To implement the Fermat test, we need a procedure that computes the exponential of a number modulo another number:
(define (expmod base exp m)
(cond ((= exp 0) 1)
((even? exp)
(remainder (square (expmod base (/ exp 2) m))
m))
(else
(remainder (* base (expmod base (- exp 1) m))
m))))

(define (fermat-test n)
(define (try-it a)
(= (expmod a n n) a))
(try-it (+ 1 (random (- n 1)))))

(define (fast-prime? n times)
(cond ((= times 0) true)
((fermat-test n) (fast-prime? n (- times 1)))
(else false)))

Exercise 1.27:
(define (fierce-fast-prime? n)
(define (try-it a)
(= (expmod a n n) a))
(define (try-from a)
(cond ((= a n) true)
((try-it a)
(try-from (+ a 1)))
(else false)))
(try-from 2))


A procedure that expresses the concept of summation itself rather than only procedures that compute particular sums:
(define (sum term a next b)
(if (> a b)
0
(+ (term a)
(sum term (next a) next b))))

e.g., for integer addition:

(define (identity x) x)

(define (sum-integers a b)
(sum identity a inc b))

Exercise 1.29:
(define (Sum-Simpson f k a b n)
(define (inc i) (+ i 1))
(define h (/ (- b a) n))
(define (coefficient-i i)
(cond ((= i 0) 1)
((= i n) 1)
((even? i) 2)
(else 4)))
(define (term-i i)
(* (coefficient-i i) (f (+ a (* i h)))))
(* (/ h 3.0) (sum term-i k inc n)))

Exercise 1.30:
(define (sum term a next b)
(define (iter a result)
(if (> a b)
result
(iter (next a) (+ (term a) result))))
(iter a 0))

Exercise 1.31:
(define (product term a next b)
(if (> a b)
1
(* (term a) (product term (next a) next b))))

(define (fac a)
(cond ((even? a) (/ (+ a 2) (+ a 1)))
(else (/ (+ a 1.0) (+ a 2)))))

(define (inc a) (+ a 1))

(define (factorial a b)
(* 4.0 (product fac a inc b)))

;another solution: iterative way
(define (product term a next b)
(define (product-iter a result)
(if (> a b)
result
(product-iter (next a) (* (term a) result))))
(product-iter a 1)
)

Exercise 1.32:
(define (accumulate combiner null-value term a next b)
(if (> a b)
null-value
(combiner (term a) (accumulate combiner null-value term (next a) next b))))

; iterative
(define (accumulate combiner null-value term a next b)
(define (accumulate-iter a result)
(if (> a b)
result
(accumulate-iter (next a) (combiner (term a) result))))
(accumulate-iter a null-value)
)

;test:
(define (A-Sum a b)
(define (Identity x) x)
(define (Inc x) (+ x 1))
(define (Sum x y) (+ x y))
(accumulate Sum 0 Identity a Inc b))

Exercise 1.33:

(define (filter-accumulate combiner accept null-value term a next b)
(cond ((> a b) null-value)
((not (accept a)) (filter-accumulate combiner accept null-value term (next a) next b))
(else (combiner (term a) (filter-accumulate combiner accept null-value term (next a) next b)))))

test:
(define (sum-square-prime a b)
(define (sum x y) (+ x y))
(define (prime? n)
(define (smallest-divisor n)
(find-divisor n 2))
(define (find-divisor n test-divisor)
(cond ((> (square test-divisor) n) n)
((divides? test-divisor n) test-divisor)
(else (find-divisor n (+ test-divisor 1)))))
(define (divides? a b)
(= (remainder b a) 0))
(= n (smallest-divisor n)))
(define (inc x) (+ x 1))
(filter-accumulate sum prime? 0 square a inc b))

;; relative prime's product
(define (product-relative-prime n)
(define (product x y) (* x y))
(define (inc x) (+ x 1))
(define (identity x) x)
(define (gcd a b)
(if (= b 0)
a
(gcd b (remainder a b))))
(define (relative-prime? i)
(if (and (= (gcd i n) 1) (< i n))
true
false))
(filter-accumulate product relative-prime? 1 identity 1 inc n))

Lambda function:
(lambda () )

The general form of a let expression is

(let (( )
( )

( ))
)

which can be thought of as saying

let have the value and
have the value and

have the value
in

The way this happens is that the let expression is interpreted as an alternate syntax for

((lambda ( ...)
)


)

Therefore no new mechanism is required in the interpreter in order to provide local variables. A let expression is simply syntactic sugar for the underlying lambda application.

Friday, July 22, 2005

open in KDE and Gnome

In gnome, the open file command according to the file's affilix is:
"gnome_open"
In KDE, the command is "kfmclient exec"

Tuesday, July 19, 2005

数学工具

MAPLE - Mathematica - MATLAB - MathCad - Maxima - SPSS - SAS

Maxima, from: http://maxima.sourceforge.net/
Maxima is a free computer algebra system, written in Lisp and released under the GNU General Public License. Maxima is a descendant of DOE Macsyma, which had its origins in the late 1960s at MIT. Macsyma was the first of a new breed of computer algebra systems, leading the way for programs such as Maple and Mathematica. This particular variant of Macsyma was maintained by William Schelter from 1982 until he passed away in 2001. Maxima itself is reasonably feature complete at this stage, with abilities such as symbolic integration, 3D plotting, and an ODE (Ordinary Differential Equations) solver, but there is a lot of work yet to be done in terms of bug fixing, cleanup, and documentation.

Introduction to GnuPlot

from: http://learn.tsinghua.edu.cn/homepage/2001315450/gnuplot-doc/TOC.html

1, Variables and Functions

In 2D plots, the variable to use is x, in 3D plots, use x and y. Multiplication is denoted by *, and division by /. Exponents are denoted by**, and all multiplication must be explicit. That is, 3x would generate and error, you would want to use 3*x.

  • The standard trig functions, sin, cos, and tan Note, to use the constant pi can be referenced by just using pi.
  • The inverse trig functions , asin, acos, and atan.
  • The hyperbolic trig functions, sinh, cosh, and tanh.
  • The exp and log function. exp raises e to the power of its argument. For example, 4e2x would be 4*exp(2*x) in Gnuplot. log returns the natural log (base e) of it's argument. This corresponds to ln in normal math notation.
  • For information on other functions, type help functions in Gnuplot.
2, 2-D plot:
  • plot
To change the scale, use one of the following forms of plot:
  • plot [x1:x2] [y1:y2]
  • plot [x1:x2] (To just set the x range)
  • plot [] [y1:y2] (To just set the y range).
To set the default x range back to [-10,10], type the following:
  • set xrange [-10:10]
Also, if you set the range for the y values, they will stay the same for future plots as well. You can set GnuPlot back to autoscaling the y axis by typing the following:
  • set autoscale y
3, 3-D plot:
  • splot
  • splot [x1:x2] [y1:y2] [z1:z2]
  • splot [x1:x2] (To just set the x range)
  • splot [] [y1:y2] (To just set the y range).
  • splot [] [] [z1:z2] (To just set the y range).
hide the grid points on the drawing graph.
  • set hidden3d
  • replot
Increasing Precision of 3D plots
  • set isosamples x_rate, y_rate
Adding contour line
  • set contour base - Draw the contour lines along the base of the diagram
  • set contour surface - Draws the lines along the 3D surface
  • set contour both - Draws lines on both surface and base
  • set nocontour - Turns off contour lines
Changing view of graph
  • set view horizontal_angle,vertical_angle
  • set view horizontal_angle,vertical_angle,zoom
  • set view ,,zoom
4, Parametric Equations
  • set parametric
To go back to standard Cartesian mode, type:
  • set noparametric
To switch to graphing with polar coordinates, type:
  • set polar
To switch back to Cartesian coordinates, type:
  • set nopolar
Plotting Data
# Example1.dat
# number of subint. - width of subinterval, computed value, abs. error
0 1 5 0.00673794699908559

plot "example1.dat"

  • set logscale
  • set data style linespoints
  • replot
Change the plot's columns:
  • set nologscale
  • plot "example1.dat" using 1:3

3-D data plots:
  • set parametric
  • set data style lines
  • splot "try2.dat"
Outputs:
ps file:
  • set output "filename.ps" where filename.ps is the name of the output file.
  • set terminal postscript
  • replot
eps file:
  • set output "filename.eps"
  • set terminal postscript eps
Load from a file:
  • load 'work.gnu'
Line styles:
You can also add the with keywork to plot and splot commands. For example,
  • plot sin(x) with boxes
  • plot "turkey.dat" with impulses
The following line styles are available for 2D function and data plots: `lines`, `points`, `linespoints`, `impulses`, `dots`, `steps`, `errorbars`, `boxes`, and `boxerrorbars`

Define new variables and Functions:
  • constant_name = expression
  • function-name(parameters) = expression
Add time and title:
  • set time
  • set title "Farm Data Plot"
  • set nokey



linux工具

我现在用的工具:
Shell: bash, 使用vi的输入方式
编辑器: VIM
程序开发: gcc, icc, make, ld, clisp, j2sdk, Perl, Python, Tcl/Tk ...
写文档: AMS-LaTeX, CJK
演示文稿: ConTeXt
绘图: GNUplot, MetaPost
图像处理: Gimp
自动管理: make
数值计算: octave, scilab
代数计算: Maxima
加密: GNUpg
打包压缩: tar, gzip, bzip2...
服务器程序(偶尔开): apache, proftpd
自动下载工具: wget
虚拟终端: rxvt
窗口管理: fvwm2
中文输入: SCIM
电子邮件: Mutt+fetchmail+exim
读电子书: xpdf, gv, djvu工具包及netscape插件
看网页; Mozilla-xft, Phoenix, Lynx
登陆UNIX机器: OpenSSH, telnet
登陆Windows机器: rdesktop
同步: rsync
即时通信: Gaim+libqq-ft
多媒体:Mplayer
对付Office文档:StarSuite

Saturday, July 16, 2005

钱是不是万恶之源

钱是万恶之源:

一,钱是万恶之源,是说钱诱惑了人走向了罪恶的道路。人性本善,这早在战国时期孔子,荀子等就阐述了这个道理。世上有邪恶的人性,是由于人在后天 受到了各种各样的诱惑,一步步走向邪恶的深渊。这些诱惑千变万化,但同钱有着千丝万缕的联系,钱是最根本最直接的诱惑,所以说钱是万恶之源。当然有些人不 因为钱的诱惑而走向恶的道路,这只是说明他们对于金钱有较强的抵抗力,并不代表钱不是万恶的根源。这和病毒造成人生病是一个道理,有些人没有得病,并不代 表病毒就是不疾病的原因。

二,钱发展成为一般等价物,来同一般的商品进行等价交换。这些商品是满足人们的基本需求的必要品。没有最基本的需要的满足,这样的贫困是罪恶的催化剂。而 人手上的钱财永远是有限的,金钱的需要是无穷无尽。目前主要的矛盾是无限量的金钱需要同有限的钱财的矛盾。这一矛盾使人对金钱无限渴望,滋生了各种罪恶。

三,钱逐渐超越了一般等价物的基本形式,大量存在的权钱交易,色情交易,使钱在社会中的作用进一步提升。钱的作用无限扩大,使人们逐渐对钱顶膜崇拜,封为 上帝。这样的狂热和金钱至上,造成了很多罪恶的根源。人们为了获得这些特权,不惜以身示法,挺而走险,最终走上恶的诱惑道理,无法回头。


orginal version:

钱是犯罪分子追求的欲望源泉。马克思曾经说过,“罪犯分子可以为了百分之百的利益而挺而走险,可以为了百分之三百的利益冒着生 命的危险从事犯罪”。有理智的犯罪分子,甘于冒法律的惩罚于不顾,是受到了同法律的惩罚相比,更有利可途的利益驱动,而归根到底,这些利益驱动是金钱的诱 惑。所以我们说钱是万恶之源。
二,没有金钱的诱惑,是控制犯罪的有效途径。人并不是生来就成为犯罪分子。当他们贫不了生,看不到正常的生活和奋斗 能给它们带来什么希望,同时又看到有些人拥有很多的奢侈享受,财富集聚,权利福利,心理和生理上不能承受,就会造成犯罪的诱因。任何有理智的犯罪,都会相 应的找到对应的诱因,也就是犯罪的动机。控制了金钱的诱惑,使诱因不再具备,自然控制了犯罪。所以老子有一句话是“使民不见所欲”,讲的就是这个意思。

钱不是万恶之源:
一, 钱可以有效的控制和解救犯罪。有钱可以曾强教育,灌输礼仪、文明和法律意识,曾强公民的个人素质,提高他们的生存能力,进而控制住犯罪的起因。犯罪外部原 因是无法适应社会,受到主流社会的排斥和压抑。通过教育和个人努力,重新掌握生存的机能,自然免除了外部的犯罪压力。试想,每个公民成员的素质都很高,社 会能不文明进步吗?我们提倡教育不就是为了这些原因马?内部原因的免除:是因为个人修养的提高减少了非理性的动作,因为礼仪的培养使人不会因为一时冲动作 出傻事。同时,对于远大目标的追求可以让人的承受能力更强,不因小节或是一时之委屈而走向犯罪道路。 春秋时期的韩信能够忍胯下之辱,而不去同地痞流氓冲突,就是这个原因。所以钱通过教育的方式可以控制犯罪。
二,充足的钱可以系统话的避免犯罪。装 备齐全,组织有效,干练的警察、侦探队伍可以有效的同犯罪份子加以严惩,达到杀鸡敬猴的效果,犯罪份子闻风丧胆,感到没有不透风的墙,而且出事后会复出的 代价太高,就自然就不回报着侥幸心理去犯罪。所谓魔高一尺,道高一丈,就是这个道理。加以严格治理,钱能控制犯罪,怎么能说是万恶之源呢?

Friday, July 15, 2005

辩论

精读《四书》。考虑到辩论赛作为华语推广活动,对传统文化,特别是儒家思想
是比较重视的,所以在这方面我们理应多做些准备。我们除布置队员熟读《四书》外,还要
求他们熟读《孙子兵法》、《道德经》等重要著作。

在训练时,我们要求每个队员在场上都应达到把这两种思维方式辩证地结合起来的境界
。我们安排了一些训练,如要队员在20分钟时间内快速翻阅一本书,然后用简炼的语言概
括出这本书的主要内容,要紧扣书的主题来说,不允许说废话;我们也要求队员快速读完一
篇文章,立即对这篇文章的主题思想进行批驳,驳斥要有力,不允许停留在枝节问题上。这
些训练都在一定程度上提高了队员们的收敛式思维能力,他们善于迅速地把握并扣住主要问
题进行辩论。另外,我们也安排了一些锻炼队员进行发散式思维的训练。我们会出一些古怪
的题目让队员们的想象力自由驰骋,如“克拉利佩奥的鼻子生得短一些,世界历史会发生什
么样的变化?”“如果希特勒赢得了第二次世界大战,目前国际政治格局会发生怎样的变化
?”“如果你见到外星人,你想告诉他什么?”“如果一个人在一小时后将会死去,你认为
他将想什么?”“如果南极洲的冰山溶化了,地球将发生怎样的变化?”等等。这些稀奇古
怪而又妙趣横生的问题,促使队员们展开想象的翅膀,到处翱翔,从而丰富了自己的联想和
跳跃式思维的能力。这些训练的结果是,队员们在场上常能很好地把这两种思维方式结合起
来,并熟练地进行运用。

注:除非特别注明,否则请按自己兴趣选读,包括选择有兴趣的章节阅读。
辩词实录类(剖析):
国辩系列:《狮城舌战》(必读)、《唇枪舌剑》、《世纪之辩(99国辩)》(必读)、《创世纪舌战》(注:97'《梦断狮城》不推荐)

全国名校辩论邀请赛系列:《英才雄风》、《智慧之光》、《纵横天下》(注:反面教材)、《千禧之擂》、2000年以后的不推荐,自行阅读。

全辩:《舌战攻略(2000)》、《蓝带杯辩词实录》(录音)、《大辩论(2002)》(结合对比赛的剖析)。

其他:《舌卷京城》、《03年海峡两岸大学生辩论赛》(录像)、《正方与反方:辩论者手册》。


基础理论类:(全类必读)
《马哲》、《人生哲学教程》、《形式逻辑》(或《逻辑学》)、《自然辩证法》、《西方哲学简史》(推荐罗素的,想偏学术史可看梯利的,对政治哲学史方面感兴趣可读文德尔班的)、《中国哲学简史》(冯友兰)、近现代西方哲学(自行选择合自己口味的版本)。

社科类:
西方经济学(教材类任选,推荐萨缪尔森《经济学》16版或曼昆《经济学》)、《国际经济学》(教材类任选,推荐厦大龚敏老师的《国际经济学》。注意:只须看有关比较优势的部分,一般是最开头的几章)、管理学(教材类任选,推荐斯蒂芬•罗宾斯或哈罗德·孔茨的)、社会学(教材类任选)、《第五项修炼》(建议大三时再读)、《认识辩论》(游梓翔)。

文史类:
《唐诗三百首》、《宋词三百首》、《古文观止》、《四书五经》(略读)、《资治通鉴》(略读)、《史记》(略读)、《中国通史》(略读)、《世界通史》(略读)。

杂志类:
《读者》、《青年文摘》、《演讲与口才》、《科幻世界》。

推荐网站:
华语辩论网(www.bianlun.net)、华语辩论网(www.chinaisok.com)

说明:
这份书单不是一定要读的,而是如果辩手自己想读一些书来提高自己的辩论水平时,我们觉得在时间精力有限的情况下读哪些书比较合适。毕竟认为必读的只有9本,还有一些都是正常上课就能学到的。新手可以根据自己的兴趣在自己想读的那一方面的书中看看我们认为哪些更应该读一读的。如果说全读,我们队里没有一个做到的。我自己对“史”方面就几乎没读过什么。
其实这些只是因为考虑到刚进队的新辩手,从中学的教育模式下走过来,往往不知道如何利用有限的时间和精力选择书来读。所以我们提点建议而己。事实上书单上的书我们队里没有一个人读全了(包括老队员)。书单的作用是帮助新手渡过从茫然无知到可以自主选择合适的书来读的过程。读到一半以上的时候往往就可以自己去选择合适自己,而又可以提高辩论水平的书了。那个时候这份书单就可以扔掉了。

Saturday, July 02, 2005

GNOME Clipboard Daemon

GNOME Clipboard Daemon is a program that keeps the content of your X clipboard in memory, so the clipboard won' get lost even after you close the application you copied from. It's a daemon - it has no GUI. You start it and it'll run in the background and Just Work(tm).
from: http://members.chello.nl/~h.lai/gnome-clipboard-daemon/index.html

installation for ubuntu:
wget -c http://frankandjacq.com/ubuntuguide/gnome-clipboard-daemon-1.0.bin.tar.bz2
sudo tar jxvf gnome-clipboard-daemon-1.0.bin.tar.bz2 -C /usr/bin/
sudo chown root:root /usr/bin/gnome-clipboard-daemon
sudo chmod 755 /usr/bin/gnome-clipboard-daemon
sudo gnome-clipboard-daemon &

Friday, July 01, 2005

ubuntu chinese installation

  • 系统升级(如果出现需要输入[Y/n] 或 [y/N] 一律输入 y 并 回车):

$sudo apt-get update
$sudo apt-get dist-upgrade

  • 设置本地local环境:

$sudo dpkg-reconfigure locales

确保 zh_CN.UTF-8 被选择,同时也默认local为 zh_CN.UTF-8

  • 安装中文语言支持:

$sudo apt-get install language-pack-zh language-pack-zh-base language-support-zh

  • 安装中文字体(如果出现需要输入[Y/n] 或 [y/N] 一律输入 y 并 回车):

$sudo apt-get install ttf-arphic-newsung

  • 安装输入法,你可以在SCIM和fcitx输入法中任选一种安装

* SCIM:

$sudo apt-get -y install scim scim-chinese scim-config-socket scim-frontend-socket scim-gtk2-immodule scim-server-socket scim-tables-zh
$sudo sh -c " echo 'export XMODIFIERS=@im=SCIM ; export GTK_IM_MODULE="scim" ; scim -d ' > /etc/X11/Xsession.d/95xinput "
$sudo chmod +755 /etc/X11/Xsession.d/95xinput

* fcitx:

$sudo apt-get install fcitx
$sudo sh -c " echo 'export XMODIFIERS=@im=fcitx ; export GTK_IM_MODULE="fcitx" ; fcitx ' > /etc/X11/Xsession.d/95xinput "
$sudo chmod +755 /etc/X11/Xsession.d/95xinput

  • 设置LC_ALL和其它属性:

$sudo gedit /etc/environment

在编辑器里,将内容修改如下:

LANGUAGE="zh_CN:zh:en_US:en"
LC_ALL=zh_CN.UTF-8
LANG=zh_CN.UTF-8
GST_ID3_TAG_ENCODING=GBK

保存,关闭编辑器

好了,注销一下电脑。(系统 -> 注销 -> 注销) 这时候,输入法 (按 Ctrl + 空格 键激活输入法) 都应该可以使用了,并且整个界面都是中文的了。

  • 安装JAVA环境(如果出现需要输入[Y/n] 或 [y/N] 一律输入 y 并 回车):

$sudo apt-get install sun-j2re1.5

  • 安装更好的多媒体播放驱动(如果出现需要输入[Y/n] 或 [y/N] 一律输入 y 并 回车):

$sudo apt-get install beep-media-player totem-xine w32codecs gstreamer0.8-plugins

  • 安装英汉辞典(如果出现需要输入[Y/n] 或 [y/N] 一律输入 y 并 回车):

$sudo apt-get install stardict stardict-common stardict-cdict-gb stardict-cedict-gb stardict-hanzim stardict-langdao-ce-gb stardict-langdao-ec-gb stardict-oxford-gb stardict-xdict-ce-gb stardict-xdict-ec-gb

  • 高级设置:

升级你的内核,让系统更快. 如果你的电脑是Inter芯片,则用如下命令:

$sudo apt-get install linux-686

如果是AMD芯片,则使用:

$sudo apt-get install linux-k7

  • 支持gtk1.0 (e.g.: xmms)等程序显示中文:

$sudo ln -s /etc/gtk/gtkrc.zh_CN /etc/gtk/gtkrc.zh_CN.utf-8

emacs cvs install on Ubuntu

install the gtk 2.0 dev first:
sudo apt-get install libgtk2.0-dev

# Need CVS from repositories
sudo apt-get install cvs
# Enable ssh and download sources from CVS anonymously
cd /tmp
CVS_RSH=ssh
export CVS_RSH
cvs -z3 -d:ext:anoncvs@savannah.gnu.org:/cvsroot/emacs co emacs

emacs compile:
./configure --prefix=/usr/local --with-x11 --with-x-toolkit=gtk --with-xpm --with-jpeg --with-tiff --with-gif --with-png --x-libraries=/usr/X11R6/lib/ --x-includes=/usr/X11R6/include/

make bootstrap
sudo make install