Thursday, October 26, 2006

最近用来消遣看的一些东西

最近突然在考虑人生问题,马上就郁闷了。也难怪,欲望和不甘总是会让人不满,无法改变的过去,人性的弱点一直在折磨本体,而太过美妙的憧憬会导致更大的现实反差。因此心灰意懒,实验也被搁置了,不过那个实验也不知如何进行下去(借口吧)。其实自己早就想过,这一生也就做个自了汉,从佛的分类来说,就是个罗汉级的人物,只度的了自己就可以了。

要排解郁闷,比较好的办法是睡觉,可惜这样会带来更大的负罪感,已经好几次由于睡觉误事而自责。没办法,尸位素餐吧,又没地方玩,只能玩电脑了。

看naruto动画,漫画,剧场版,下ost来听。漫画要赞的,延续着紧张的剧情。动画到后面感觉像敷衍了,鸣人没成长啊,弄来弄去就那几样东西。

看网络小说,这个是被疯子和大猪头影响的。没有像他们一样博览群书,我只是stick to some books. 紫川,阿里布达,随波逐流之一代军师。以前通宵看 国之利刃,我是特种兵,真是印象深刻,热血贲张。总之,看网络小说消磨时间真的很快很快,特别是我这种一根筋的家伙,副作用也是很大。紫川好久没更新了,不会TJ了吧,散伙饭上喝醉了不省人事,被同学抬回寝室的路上突然有了些意识,意识到自己在说的竟然是“紫川”,“远东”,“魔族”,“光明王”,马上住口,然后继续不省人事。第二天还被同学笑,真怀念。

anyway, 目前拿的出手的兴趣爱好还真没有,什么都会一点但没有一样是很深入的,头疼啊。

Monday, October 16, 2006

latex笔记

插入pdf图形, 用pdflatex编译,file里不能出现.eps图像,无法识别

\usepackage[pdftex]{graphicx}

\setlength\fboxsep{3pt} %定义边框和图像之间的距离
\setlength\fboxrule{4pt} %定义边框厚度

\begin{figure}
\fbox{\scalebox{.5}{\includegraphics*[bb=0 0 400 300]{file-name.pdf}}}
\caption{This is figure.}
\label{fig:fig1}
\end{figure}

Saturday, October 14, 2006

Emacs快捷键笔记

A good website for programming under Emacs:
http://www.cs.bu.edu/teaching/tool/emacs/programming/


推荐: 《GNU Emacs》 -Schoonover & Bowie & Arnold

M-%      Interactive Find and Replace

Ispell:

M-$      Check word's spelling
M-x spell-buffer    Check buffer's spelling
M-x spell-region    Check region's spelling


LISP

Modes:
M-x emacs-lisp-mode    Emacs-Lisp mode
C-x C-e      Evaluate preceding expression
C-M-x      Evaluate expression(contain the cursor or after)
M-x eval-region    Evaluate code in region
M-x eval-current-buffer   Evaluate all code in buffer

M-x lisp-interaction-mode    Emacs-interaction-lisp mode
C-j      Evaluate expression preceding the cursor

Moving Among Defuns:
C-M-a    Move to start of current or previous defun
C-M-e    Move to end of current or next defun
C-M-f    Move forward over the current or next sexp
C-M-b    Move backward over sexp
C-M-n    Move forward over list
C-M-p    Move backward over list
C-M-u    Move up a list
C-M-d    Move down a list

Marking Text:
C-M-h    Put region around defun
C-M-@    Puts a mark after the next sexp

Indentation & Comment:
C-j      Finish line and indent next
C-M-\    Indent all lines in region
C-M-q    Indent list contents
C-u TAB    Shift list to correct alignment
M-;      Append a comment to current line
C-u - C-x    Delete comment on current line
C-M-j    Finish current comment line and start a new comment

Tuesday, October 10, 2006

Beyond: 不朽的经典

Beyond 谁伴我闯荡

曲:黄家驹 | 词:刘卓辉

前面是那方 谁伴我闯荡
沿路没有指引 若我走上又是窄巷

寻梦像扑火 谁共我疯狂
长夜渐觉冰冻 但我只有尽量去躲

几多天真的理想 几多找到是颓丧
沉默去迎失望 几多心中创伤

只有淡忘 从前话说又如何
其实你与昨日的我 活到今天变化甚多

只有顽强 明日路纵会更彷徨
疲倦惯了再没感觉 别再可惜计较什幺 喔~~


谁愿夜探访 留在我身旁
陪伴渡过黑暗 为我驱散寂寞痛楚

寻觅没结果 谁伴我闯荡
期望暴雨飘去 便会冲破命运困锁

几多天真的理想 几多找到是颓丧
沉默去迎失望 几多心中创伤

只有淡忘 从前话说又如何
其实你与昨日的我 活到今天变化甚多

只有顽强 明日路纵会更彷徨
疲倦惯了再没感觉 别再可惜计较什幺

始终上路过

MP3 download:
黄家驹-谁伴我闯荡.mp3

CRANBERRIES - WANTED

WANTED Lyrics
Artist(Band):Cranberries

Sitting in an armchair
with my head between my hands
I wouldn't have to be like this
if you'd only understand
Too many misunderstandings
causing such delay
And if it doesn't work like this
Well, I'll try another way

Oh, if this is the way you wanted it
oh, I didn't understand
Oh, if this is the way you wanted it
oh, I didn't understand

You know that all I wanted
was to be there by your side
And if you didn't want it
Well, you should have denied
You knew that you were someone special
right form the start
But if you treat me badly
We'd be better off apart

Oh, if this is the way you wanted it
oh, I didn't understand
Oh, if this is the way you wanted it
oh, I didn't understand
Understand

The MP3 file download:

TheCranberries-08-Wanted.mp3

到了思考方向的阶段

如果不能做自己喜欢做的事情,那就去喜欢自己做的事情吧。


在sunlover的blog上看到这句,感触颇多。在我不知道喜欢什么方向的时候选了光学,在知道了喜欢什么后已经无法改变,出国申请由于背景限制,选择了光学。但这不是我真正喜欢的,每次去图书馆,看到书架上那一排排CS的大部头,总有一种冲动要都抱在怀里,UNIX,TCP/IP,AI,ARCHITECTURE,COMPILER,SCRIPT,LISP,KERNEL.... 目前生活是无奈的,希望在下一个十字路口,能够turn。也有可能那时就没有turn的决心了,who knows.

大二被computer的magic所打动,狂啃data structure,thinking in C++,OS Concept, 狂攒经典大部头英文书,翘掉专业课跟大猪头玩系统,redhat,debian,ubuntu,BSD,windows 2000-2003中英文都装一遍,晚睡早起去听CS的课,听coco骂MS rubbish,bs ISO-OSI模型,赞美java和ipv4,一节课要说很多句土人,“哎你这个土人~”,听coco分析linux代码,听他讲笑话,关注CS版上他的趣事,从操作系统课堂追到计算机网络追到操作系统实验,曾想着如果不出国肯定去考他的研究生,肯定能考上。。。。 真是单纯快乐的时光,定了很多目标,憧憬着学会了以后就可以做更多的事情了,虽然很多都没学好。

最后,最后,为了生活,逃离浙大。很羡慕sunlover,能做着喜欢做的事,我就先喜欢自己做的事情,再伺机改变吧。事在人为,毕竟有些东西还是要放在首位的。

Saturday, October 07, 2006

Emacs配置文件(更新中)

.emacs (更新中)



(set-language-environment 'utf-8)
(prefer-coding-system 'utf-8)



;;使用文泉驿中文字体,同时设定字体大小。
(create-fontset-from-fontset-spec
"-adobe-courier-medium-r-*-*-14-*-*-*-*-*-fontset-ifree,
chinese-gb2312:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
chinese-big5-1:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
chinese-big5-2:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
chinese-sisheng:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
chinese-cns11643-3:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
chinese-cns11643-4:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
chinese-cns11643-5:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
chinese-cns11643-6:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
chinese-cns11643-7:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
japanese-jisx0208-1978:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
japanese-jisx0208:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
japanese-jisx0212:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
japanese-jisx0213-1:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
japanese-jisx0213-2:-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-160-75-75-p-80-iso10646-1,
"
)

(set-default-font "fontset-ifree")

(add-to-list 'after-make-frame-functions
(lambda (new-frame) (select-frame new-frame)
(set-default-font "fontset-ifree")))

;; 指针颜色设置为白色,seems not working, add it at the bottom
(set-cursor-color "white")
;; 鼠标颜色设置为白色
(set-mouse-color "white")
;; 设置背景颜色和字体颜色
(set-foreground-color "#FDFF00")
(set-background-color "#343434") ;;增强对比度
;; 设置另外一些颜色:语法高亮显示的背景和主题,区域选择的背景和主题,二次选择的背景和选择
(set-face-foreground 'highlight "white")
(set-face-background 'highlight "blue")
(set-face-foreground 'region "cyan")
(set-face-background 'region "blue")
(set-face-foreground 'secondary-selection "skyblue")
(set-face-background 'secondary-selection "darkblue")
;;设置日历的一些颜色
(setq calendar-load-hook
'(lambda ()
(set-face-foreground 'diary-face "skyblue")
(set-face-background 'holiday-face "slate blue")
(set-face-foreground 'holiday-face "white")))

;;hilights grammer
(global-font-lock-mode t)

;;不要滚动栏
(scroll-bar-mode nil)

;;时间显示设置
;;启用时间显示设置,在minibuffer上面的那个杠上(忘了叫什么来着)
(display-time-mode 1)
;;时间使用24小时制
(setq display-time-24hr-format t)
;;时间显示包括日期和具体时间
(setq display-time-day-and-date t)

;;所有的问题用y/n方式,不用yes/no方式。有点懒,只想输入一个字母
(fset 'yes-or-no-p 'y-or-n-p)

;;鼠标自动避开指针,如当你输入的时候,指针到了鼠标的位置,鼠标有点挡住视线了
(mouse-avoidance-mode 'animate)
;;允许自动打开图片,如wiki里面
(auto-image-file-mode)
;;可以操作压缩文档
(auto-compression-mode 1)
;;在minibuffer上面可以显示列号
(column-number-mode t)
;;显示默认的文档的宽度,看起来比较舒服?
(setq default-fill-column 60)
;;指针不要闪,我得眼睛花了
(blink-cursor-mode -1)
(transient-mark-mode 1)
;;当指针到一个括号时,自动显示所匹配的另一个括号
(show-paren-mode 1)
;;是用滚轴鼠标
(mouse-wheel-mode t)
;;去掉烦人的警告铃声
(setq visible-bell t)
;;滚动页面时比较舒服
(setq scroll-step 1
scroll-margin 3
scroll-conservatively 10000)

;;允许emacs和外部其他程序的粘贴
(setq x-select-enable-clipboard t)

(set-cursor-color "white")

(require 'ange-ftp) ;;自动导入文件目录

(setq tex-dvi-view-command "yap") ;;设定dvi打开程序,还可windvi,xdvi



;;关闭启动画面
(setq inhibit-startup-message t)

;;所有备份文件转移到~/myBackup/Emacs目录下,保持最新的五个版本和最原始的两个不版本
(setq backup-directory-alist (quote (("." . "~/myBackup/Emacs"))))
(setq version-control t)
(setq kept-old-versions 2)
(setq kept-new-versions 5)
(setq delete-old-versions t)
(setq backup-by-copying t)

;;不产生备份文件
;(setq make-backup-files nil)

;;开启图片浏览
(auto-image-file-mode t)

;在标题栏显示目前在什么位置
(setq frame-title-format "yang@%b")

Friday, October 06, 2006

Debian下编译安装MPlayer

本来想装编译包,但是找了几个deb source后apt-get update时都出错,说GPG error, public key unauthenticated(like this),google和很久没找到解决方法,就试着源码编译了。

参考以下文章:


How To Install On Debian with Several Codecs

RTSP/RTP streaming support for MPlayer



I'm using source of

deb http://debian.uchicago.edu/debian/ testing main contrib non-free


贴一下第一篇文章吧

How To Install On Debian with Several Codecs

mplayer project home page

These step by step instructions have been updated and tested on September 3, 2006

I have tested this how-to on Etch (Testing).

This howto only includes codecs for win32, Quicktime, RealPlayer, and Live.com (streaming for protocols such as reaplayer)

Not up for doing all of this? There are unofficial debian packages provided by marillat: read more

Otherwise...

Files to download

Source:

MPlayer v1.0pre8 source - 7.8M - You may download directly from the Mplayer HQ Download or from: (mirror1 )
(unless you have a src file of your own you wish to use)

Codecs:

essential-YYYYMMDD.tar.bz2 - Grab the latest version "essential codecs package" from Mplayer HQ Download

live555-latest.tar.gz - about 400 K (live555.com download)

User Conf:

mplayer-user-conf.tar - 690 k (mirror1 | mirror2)

Since I don't know where you are downloading these to, you will just need to move them to the proper place when I ask you to unpack them.

Uninstalling Old Version

If you have an older version of mplayer on your system remove all traces of it (if you used a deb do dpkg -P mplayer then go through your system and make sure EVERYTHING for mplayer is gone, some things will not be removed with dpkg -P). This step is VERY important.

Things from apt

as root:

apt-get install libogg0 libogg-dev libvorbis0a libvorbis-dev vorbis-tools libpng12-0 libpng10-dev liblogfile-rotate-perl libconfhelper-perl debhelper fakeroot g++ libgtk1.2 libgtk1.2-dev svgalibg1 svgalibg1-dev libsdl1.2-dev libaa1 libaa1-dev x11proto-gl-dev

NOTE: Make sure your gcc and g++ versions match!

Installing the Codecs

as root:

rm -r /usr/lib/win32

(If it exists. These are the w32 codecs, don't worry, we will replace these later, you can pack them up and move them if you are really concerned about losing them)

tar -jxvf essential-YYYYMMDD.tar.bz2

mv essential-YYYYMMDD/ /usr/lib/win32

Live.com Codecs (for streaming realplayer)

cd /usr/local/lib/

rm -r live/

(If it exists. These are the old live.com codecs, don't worry, we will replace these later, you can pack them up and move them if you are really concerned about losing them)

tar -xvvzf live555-latest.tar.gz

cd live/

./genMakefiles linux

make

(Here MOVE THE WHOLE LIVE DIRECTORY TO /USR/LOCAL/LIB THEN COMPILE!)

Setting up the ~/.mplayer directory

(you can skip this if you have your own configs and settings, and/or don't want to use gmplayer)

become your user

cd

tar -xvvf mplayer-user-conf.tar

this will create the ~/.mplayer directory including a skin (neutron), arial size 18 font, and config file

in line 27 of the ~/.mplayer/gui.conf file, change: font_name = "/home/lyz/.mplayer/font/font.desc" to reflect your username (I havent found a way around this step, ~ doesn't work).

Creating the .deb and installing mplayer

as root:

cd /usr/src/mplayer/

tar -jxvvf MPlayerVersion.tar.bz2 (where 'Version' is your version, ie -1.0pre7)

cd MPlayerVersion

DEB_BUILD_OPTIONS="--disable-runtime-cpudetection --disable-rtc --enable-live --with-livelibdir=/usr/local/lib/live" fakeroot debian/rules binary

Make sure there aren't spaces between -- and any-of-the-options

when it's finished compiling, it will create an mplayerVersion.deb file in /usr/src/mplayer

cd /usr/src/mplayer/

dpkg -i mplayerVersion.deb

when it asks about video output choose which is right for you, if unsure just use xv

The End

launch mplayer by typing mplayer moviefile (where moviefile is the name of the file you wish to use to test mplayer)

You're done! Congrats!

Some Notes:

This also includes gmplayer. gmplayer allows you to use "skins" for mplayer, I don't usually use skins because I don't need the gui control, and the skins tend to take away from speed and quailty of movie decoding.

If you're having problems using xv as a video output, try gl or gl2; mplayer -vo help will give you a listing of your options.

Sometimes you will want to watch realplayer files that are .rm; remember that a .rm can be viewed as a simple text file with the stream location of the actual .ra is in that file. mplayer will not play the .rm but it will play the .ra stream. (Apparently there is a patch out so that mplayer will play .rm but I have never used it).

FAQ

Something broke, can you help?

I might be able to, as I said, I have tested this, and if something broke it might be a conflict in versions (stable vs testing vs unstable vs mixed system) or a simple user error. It is quite possibly due to not completely uninstalling previous versions of mplayer, this is a very important step! If all else fails, you can always uninstall the deb, and reinstall what you had before.

I'm not on debian but I want to install mplayer, any pointers?

Not really, I could point you to some sites I have found for other distros, but I have never tried them, so I can't guarantee they will work.

Why don't you include more codecs?

Are there many more? I have included the ones I primarily use, so these are the only codecs I have installed and tested.

Why do you make a .deb? How do I compile it without making a .deb?

I make a .deb because it's debian's package management tool. If you just want to compile it and not bother with the deb, the "DEB_BUILD_OPTIONS" are what would normally be passed when you compile the package by hand.

What about DVD support?

I don't have a DVD-ROM, so I have no way of testing DVD support, sorry.

Links

MPlayerHQ - Main MPlayer site

Live555.com - Home of the live.com codecs

linux.coconia.net "Installing Mplayer" - Not Debian specific, but includes some codecs that I haven't bothered with


Special thanks to Mark and Magni who host two of the mirrors!

Thanks to Grifter for teaching me how to install this.

Thanks so much to everyone else who has emailed me to point out mistakes and offered compatibility notes, I appreciate it greatly and encourage others to do the same.

Comments? Questions? Pointers? Email me at Lyz@PrincessLeia.com


"My pessimism extends to the point of even suspecting the sincerity of other pessimists." - Jean Rostand

all quotes

Tuesday, October 03, 2006

Debian & xfce4 tips

在自己的office里的破机子上装了debian, 本来想装ubuntu的,但刻的盘坏了,就拿出一年前刻的debian 3.1盘装上了,呵呵,还是大猪头的盘牢靠阿。装了xfce4,太爽了,很简洁,而且配置不是很难,看来是个很configurable的桌面系统,爽了,要多用快捷键,那个鼠标是二键滚轮鼠标,尽量不动吧。这几天explore一下,这个帖子的题目也改成debian & xfce4 tips了。 New world begins.

有一些tips要记一下:
1。ssh默认安装后要改sshd_config

PasswordAuthentication Yes


否则连接的时候会连不上,输入用户名就自动关了。错误是no authentication method availabe

2。装xfce4,用bin装时最好先执行一下
apt-get build-dep libxfce4mcs

这样会解决编译时 checking for X ... no的问题。 好像是libxt没装好,anyway,试试xfce4,office机子太烂了,gnome比较吃力。

3. 用graphical installer解决xfce4mcs问题后在编译volume manager的时候有可能也会出问题,这时可能缺lib, 执行
apt-get install libasound2-dev


4. ape player under linux

ape player for linux


安装步骤:

#tar zxvf ape.tgz
#cd ape
#./install.sh

#cplay

(待续)