Posts

audacious写入id3tag乱码问题

Image
我的audacious和audacious-plugins的版本及USE flag如下: [I] media-sound/audacious Installed: 1.2.1(chardet -gnome nls) [I] media-plugins/audacious-plugins Installed: 1.2.2-r1(aac alsa arts chardet -esd flac -jack -lirc -modplug mp3 -musepack nls -oss -pulseaudio -sid -sndfile timidity vorbis wma) 值得注意的一点是,我都加上了chardet USE flag,这样在UTF-8环境下就不必为本来encoding为GB码的mp3文件里的id3tag转码了。 只需要稍微设置一下: Preference->Playlit->Metadata: auto character encoding detector for: Chinese fallback character encoding: gbk 还有一点是,如果主窗口显示不出汉字。看看你是否选择了这个选项: Preference->Appearance->Fonts->Use bitmap fonts if available 请不要选中这一项试试。如果使用微软雅黑,同时选中这个选项,主窗口的歌曲名如果是汉字就会乱码。而不选则不乱码。 这两个地方设置过后,audacious已经几近完美了。不过还有一个问题,就是修改id3tag保存后,再打开该文件会发现id3tag乱码。 经过我的分析,原因大概是这样: 1. id3v2.4.0标准里定义了tag可以有4种encoding,可以在tag里标明,占用一个字节,其中UTF8的值为3。 2. 如果指定encoding为utf8,taglib在写入时会遵循标准的约定,在tag里用一个字节表示encoding,就是3。 TextIdentificationFrame::renderFields() 3. 但是在读取tag的时候,我发现似乎taglib根本没有考虑这里还有个字节表示encoding。而是把3看作字符串的一部分。 StringList::toString()仅仅是把list

Install Gentoo by coping LiveCD to harddisk

http://groups-beta.google.com/group/gentoo-china/browse_thread/thread/b059f759094c82d4/e1384ded3366dce7?hl=en http://groups-beta.google.com/group/gentoo-china/browse_thread/thread/f1e44fda204bffde/781b86d88c804514?hl=en

The prison in Prison Break

Conditional breakpoint in gdb

First you have to setup a break point. (gdb) b 'server::Checks::chkCleardigits(ost::Script::Line*, ost::ScriptImage*)' don't forget the leading ' before server, so that gdb can complete the whole function prototype for you. Check breakpoint info (gdb) info b Num Type Disp Enb Address What 1 breakpoint keep y 0x080565f4 in server::Checks::chkCleardigits(ost::Script::Line*, ost::ScriptImage*) at checks.cpp:624 breakpoint already hit 1 time Run the program, and then you find that there are so many calls to this function. However, you are only interested in one particular call. And most importantly, you know a condition which is unique to this call, line->argc>1 Set condition: (gdb) condition 1 line->argc>1 (gdb) info b Num Type Disp Enb Address What 1 breakpoint keep y 0x080565f4 in server::Checks::chkCleardigits(ost::Script::Line*, ost::ScriptImage*)

select.span

I was asked to analyze the usage of this "select.span" command. However, I've no idea wtf the so-called span is. What's worse, it seems that nobody else here could explain to me what it is. I am a totally newbie in this area(I mean IVR), and I think it is known to everyone. However, I did find some clue. I found normally those span should be initialized in the driver. Take capi20's driver as an example, BayonneSpan object is newed in Driver::startDriver(). But unfortunately, the synway's bayonne driver is not complete at this moment. The driver is in bayonne-nonfree package. In my opinion, the biggest problem now is this incomplete synway bayonne driver. If it is finished, many problems will not exist any longer. PS: This "select" thing is discovered by me, when I analyzing "connect". In startDialing() which is called by scrConnect(), there is a call to getPointer() with a single parameter in the form "select.%s". Then I found th

PS3 is coming

According to e-zone, a Hong Kong magazine, PS3 60GB version will be sold at HK$ 3780 in Hong Kong starting from Nov 17. This price is equal to 56,810 Yen according to the exchange rate on Nov 1, while the expected price of Japan version is 60,000 Yen. This price is also lower than that of US version. The 20GB version will be available in December in Hong Kong. The price will be HK$ 3180. The price is lower than I expected. However, I won't act before Winning Eleven PS3 version is out. :)

我的emacs

Image
This is my /usr/bin/emacs #!/bin/sh emacs.emacs-23.0.0 --enable-font-backend -fn "Consolas-12" "$@"

今天又搞了搞字体

Image
最终的选择是下面这些。近期应该不会再有大变化了 简体中文:微软雅黑 繁体中文:微软正黑 英文:Verdana 搞的过程几经周折,这里记录一下: 1. Vista里的英文字体 Vista里带了好几个新英文字体,都是C字辈的。包括几个serif, san serif和一个monospace。这几个字体是很好看,不过有一个通病,就是指定同等大小的情况下,比中文字体(比如雅黑)要小,比原来的Verdana那几个也要小。我的显示器是1680x1050的,字体小了看着很费力。(下次说什么也不买大个儿的笔记本了。)我尝试了一个方法,是把小于18 pixelsize的Candara的大小均强制改为18 pixelsize。不过感觉还是不太爽,感觉笔画比较细,看着费力,而且强制拉大的显得不太协调,粗体显的太粗。 <match target="font" > <test compare="eq" name="family" > <string>Candara</string> </test> <test compare="less_eq" name="pixelsize" > <double>18</double> </test> <edit name="pixelsize" > <double>18</double> </edit> </match> 2. Emacs字体设置和Vista新日文字体 今天发觉emacs里有些中文字显示不出来了。后来发现emacs是找meiryo,也就是Vista里的新日文字体来显示的。日文字体里的汉字自然是不全的。按理说Emacs应该从~/.fonts.conf的字体列表里找,看来现在还不是。不知道怎么设置,只好删掉meiryo不用,反正不懂日文。 3. Firefox的字体设置 个人觉得总体上说有3种选择: 一是让网页选择字体 二是不让网页选择但只指定seri

微软雅黑

用了几天微软雅黑 现在在看Simsun,发觉非常不习惯 很淡很淡 即使是通过开启antialias使用了内嵌位图,也是一样的感觉 恐怕我是回不去了 刚刚了解到一个有关emacs 23的字体问题 其实仅仅用了这样的命令来启动是不够的 emacs --enable-font-backend -fn "Dejavu Sans Mono-12" 这样的话,非英文字体emacs还有可能用X核心字体 需要在~/.Xdefaults里加上这样一句才能保证emacs 23使用xft作为字体后端,仅仅启用字体后端是不够的。 Emacs.FontBackend: xft 这样一来,~/.emacs里就不需要任何配置字体的信息了 不过又发现一个问题,似乎emacs 23对~/.fonts.conf里的字体顺序反应迟钝? gtk+2程序的反应是即时的,只需要关掉并重新启动程序 qt程序可以用qtconfig来改字体替换表 emacs 23却没辙了,想不起来还可以改什么?即使~/.fonts.conf里Simsun排在前面,也还是只能用Microsoft Yahei。 参考: http://www.nabble.com/Xresource-of-enable-font-backend--t2349798.html http://zhllg.spaces.live.com/blog/cns!956A48A2D7ED7265!1475.entry

HOWTO Compile Kernel

HOWTO Compile Kernel From Gentoo Linux Wiki Jump to: navigation , search 目录 [ 隐藏 ] 1 安装内核源代码 2 配置 2.1 配置命令介绍 2.1.1 make menuconfig 2.1.2 make oldconfig 2.2 第一次配置 2.3 升级时配置 3 编译和安装 [ 编辑 ] 安装内核源代码 代码: 安装内核源代码 $ USE=symlink emerge gentoo-sources 使用symlink的目的是建立符号连接/usr/src/linux,以指向安装好的内核源代码目录。 [ 编辑 ] 配置 配置内核对于新手来说是一个噩梦。不过事实上,配置过程要远比一般人想象的容易。只是有些技巧了解的人不多。 [ 编辑 ] 配置命令介绍 [ 编辑 ] make menuconfig 配置内核的命令很多,不过make menuconfig应该是最通用的。它的运行几乎不限环境,远程登录也可以用它配置,所以我们重点介绍。 用法: 方向键选择菜单项/按钮 回车进入子菜单 按高亮字母直接选择相应菜单项 Y键包含,N键排除,M键配置成模块 退出,?键查看当前菜单项帮助信息,/键搜索 图例:[*] 包含 [ ] 排除 模块 < > 可配置成模块 [ 编辑 ] make oldconfig 利用已有的.config来生成新的.config。如果遇到新内核新增的选项,会挨个提示你是否启用。建议选择默认,即直接按回车。同时记录下有疑问的选项,以便下面再make menuconfig手工配置。 [ 编辑 ] 第一次配置 代码: 第一次配置 $ cd /usr/src/linux $ make defconfig $ make menuconfig make defconfig的作用生成一个缺省的配置文件。这个配置文件里各内核组件基本完整,只需修改硬件和文件系统即可。这步不是交互式的。 make menuconfig这一步就是要修改硬件和文件配置。需要关注的主要有这么几个部分,分别是 IDE驱动(默认是CONFIG_BLK_DEV

Psychic mode plugin of gaim 2.0.0dev

Psychic mode plugin is a very interesting plugin. It could cause conversation windows to appear as other users begin to message you, before they press "enter". The notification message is very funny: You feel a disturbance in the force... Updates: MSN protocol could use this plugin too, although it is not mentioned in the plugin's description.

[转载] QT 3.3.6 及以后版本的字体替换设置

http://wiki.chrischou.org/freeware:qtfont3.3.6 摘要: QT 3.3.6 及以后版本的字体替换规则发生了微小的变化,为此使用QT的应用程序(包括KDE)可能无法使用fontconfig的替换规则。QT 3.3.6 及以后的版本,除非指定sans-serif、serif、monospace其中的一个作为QT程序的默认字体,否则这些程序的中文将无法保证使用 fonts.conf 中指定的支持中文编码的字体来渲染中文字符(QT会使用第一个查找到的具有中文编码的字体来渲染中文字符)。而这些在 QT 3.3.5 及以前的版本是可行的。 PS: 在我这里一定要把SimSun写为“宋体”才可以。 不过还是有一个问题是,粗体出不来。 搞什么啊???!!!

zhcon 0.2.6 will be in portage soon

UTF-8 support is added in this version. To enable it, you have to use "zhcon --utf8" to start zhcon. zhcon's homepage is here: zhcon.sf.net This version is already in gentoo-china overlay. "layman -a gentoo-china" to check it out. Or you could see it here: http://www.gentoo.org/proj/en/overlays/layman-global.txt flameeyes said too much overlays will bring us down . I agree, to some extent. But that requires the maintainers response in a timely fashion . Otherwise, users can only resort to overlays. Fortunately, I am now become the proxy maintainer of zhcon. That situation won't happen to zhcon again as long as I remain as zhcon's proxy maintainer. EDIT: now it is in portage, so I have deleted it from gentoo-china overlay.