Skip to main content

Posts

调整gnome音量调节的幅度 | Adjust the value of volume step in gnome

我的笔记本的音量调节是滚轮式的,拨一下会产生很多按键事件,因此音量增大或者减小很多,非常不爽。今天网上搜了一下,只需要改一个gconf键值: /apps/gnome_settings_daemon/volume_step 原来是6,改成2比较适合我。 There's a volume wheel on my notebook, one touch would make a number of keypress event, therefore the volume will be enlarged or reduced too much, which is very annoying. After spending some time on searching, I found the corresponding gconf key: /apps/gnome_settings_daemon/volume_step The default value was 6, changing it to 2 is good for me.

让 pstree 的 圆圈节点 Tcircle 保持一样大小 | Make all Tcircle nodes in pstree a fixed size

最近要用latex画树,决定学习pstricks,pstree还是蛮好用的,但是用Tcircle画节点时发现一个问题,每个圆圈的大小是与内容有关的,比如字母a和f的圆圈就不一样大,很难看。 在pstrick的文档里看了半天也没弄出个所以然,然后又搜了半天,才发现可以用makebox,原来这么简单,但是我对latex还是不熟练。 解法为: \Tcircle{\makebox[\somefixedsize][c]{content}} I need to draw some trees in latex, so I learned some pstricks, I found pstree is rather easy to use, but there's somethings with the Tcircle, the size of the circles is related to its content, for example for circles for 'a' and 'f' are not of the same size, which makes the tree very ugly. I didn't found anything useful in the pstrick's document, after rather some time searching on the web, I realized that I can take advantage of makebox, that's a easy but great idea, however I was still not familiar enough with latex... The solution is: \Tcircle{\makebox[\somefixedsize][c]{content}}

不能启用触摸板的临时办法 | A workaround of enabling touchpad

症状是 touchpad 可以识别,按笔记本上的启用/禁止触摸板键,屏幕上也有正确提示,但是触摸板就是不能工作。 一个可能的原因就是在windows里面禁用了,重启进ubuntu以后就出这个问题。 另外发现在禁用的情况下,按住笔记本上那个键(我这里是Fn+F7)就可以用,松开就不行。 在网上搜到的gconf的键值,观察了一下,只有按住的时候是enabled,否则是disabled了。 临时解决方案是: gconftool-2 -t bool -s /desktop/gnome/peripherals/touchpad/touchpad_enabled "True" 运行以后笔记本上的启用/禁止键也能正常工作了。 这个估计是Xorg或者GNOME的bug。 The symptom is that although my touchpad is recognized, and when I press the enable/disable key on my keyboard, there's right notification on the screen, but my touchpad just is not working. One possible reason is that I've disabled it in Windows, then I restarted my machine and entered Ubuntu. Another thing I found is that only when holding the enable/disable key can I use the touchpad. I found the corresponding key in gconf, and indeed I observed that the key is enabled only when the enable/disable key is being held. A workaround is to run the following command. gconftool-2 -t bool -s /desktop/gnome/peripherals/touchpad/touchpad_enabled ...

Windows Server 2008 R2中配置游戏手柄 | Configuring gamepads in Windows Server 2008 R2

Windows Server 2008 R2 中似乎并没有游戏控制器的相关配置,以至我新买的手柄一直不能正确配置。 在 http://www.win2008r2workstation.com/win2008r2/game-controllers 中提供了一个游戏控制器的控制面板文件,包含了32位和64位的版本。按提示安装后就可以在控制面板里找到了,与之前Windows游戏控制器的配置无异。 Seems that the configuration dialog of gamepads is missing in Windows Server 2008 R2, which made my new gamepad not working all the time. Several necessary files for gamepad configurations are provided in http://www.win2008r2workstation.com/win2008r2/game-controllers including 32bit and 64bit versions. Just follow the instructions to install it, and then it can be found in the Control Panel, which is exactly the same as the gamepad configuration in previous versions of Windows.

在Google Reader中显示标记Like的条目 | Display liked items in Google Reader

转自:http://lifehacker.com/5317004/display-just-the-items-you-liked-in-google-reader 访问如下链接即可: http://www.google.com/reader/view/user/-/state/com.google/like From: http://lifehacker.com/5317004/display-just-the-items-you-liked-in-google-reader Just visit the following URL: http://www.google.com/reader/view/user/-/state/com.google/like

指定excel输出csv文件的分隔符 | Specify the separator in csv file outputted by Excel

Excel 导入csv文件时候可以指定分隔符,但是输出是没有明显的选项,只是txt用空格,csv用逗号。 查了一下,这个需要去控制面板,区域语言选项,“格式”标签选高级,在数字里面就可以调整分隔符了。 这个还真是不直观,太隐蔽了。。。 In Excel the separator can be specified when import a csv file using the wizard, but there's no such an option when exporting, the only choices are txt and csv, where the space and comma are used as separator respectively. And I found on the Internet that, to change the symbol, go to the control panel, then "regional and language options". In the advanced options under the "format" tab, there's a "number" tab, where you can change the "list separator". This option is hidden so well...

ptrace 在 linux 和 freebsd 下的若干区别 | Several differences of ptrace between Linux and FreeBSD

最近要把一个程序移植到Debian-kfreebsd上,并不如想象中的顺利。 主要是ptrace在两个平台上不太一样。 首先是宏定义,linux底下都叫PTRACE_*,freebsd上都是PT_*。这个也许不算什么 然后是ptrace函数的参数,主要是value这个,linux下面是long很好用,但是freebsd下是int,这样64位的时候就有些问题。 但是freebsd的ptrace有个更好用的操作PT_IO,可以自定义读写长度,而linux底下没有,要自己搞。 最后一个,花了我很长时间才解决的,是CONTINUE这个操作,linux下面addr这个参数是被忽略的,直接从中断的地方继续;但是freebsd下面则可以利用这个参数指定从哪里继续,如果希望从中断的地方继续,则指定为1即可。 目前只遇到这些,从这些方面来看,还是freebsd的接口更好用一些。 Recently I've been porting a software from Linux to Debian-kfreebsd, but it's not as easy as I had expected. The problem is the interface of ptrace is not exactly the same between linux and kfreebsd. The first is the names of the macros, which are PTRACE_* under linux and PT_* under freebsd. Secondly the function `ptrace' is not the same, the parameter `value' is `long' under Linux, but `int' under freebsd, so it seems that there'll be a problem on 64 bit freebsd. However, there's another operation called PT_IO under freebsd, using which we can specify the number of bytes we ...