I’m now using Ubuntu 10.04 (Lucid Lynx). I want to dig into the kernel. When I check the kernel package in Synaptic, I found the version is 2.6.32-22.33, but currently the mainline kernel version is 2.6.32.13. How could that be?

Then I found the following address: http://kernel.ubuntu.com/~kernel-ppa/info/kernel-version-map.html. There’s a map, and version 2.6.32-22.33 maps to mainline version 2.6.32.11+drm33.2. DRM stands for Direct Rendering Manager. It’s a backport module from 2.6.33 to provide video acceleration.

To further verify the version, I install the linux-source package. In /usr/src/linux-source-2.6.32.tar.bz2!/linux-source-2.6.32/Makefile:

But it is a modified version. To get the original kernel package, run the command:

There files will be downloaded: linux_2.6.32-22.33.dsc, linux_2.6.32.orig.tar.gz, linux_2.6.32-22.33.diff.gz. *.dsc is a signature, *.orig.tar.gz is the original source, *.diff.gz is the patch. In the case of packages made specifically for ubuntu, the last of these is not downloaded and the first usually won’t have “orig” in the name. In /usr/src/linux-source-2.6.32.orig.tar.gz!/linux-source-2.6.32/Makefile:

And after installed the source, the version number became same as that in the *.deb package.

Some additional words:

Today, I finally reverted to use pidgin instead of emphathy.
There’s a plugin call “musictracker” which displays the “now playing” info.

lucid_pidgin_now_playing

It seems that nickname cannot be changed when using MSN protocol.
I did set the friendly name, but Others cannot see.
And the personal message is called status in pidgin, so set it there.

For QQ protocol, using pidgin may cause activation problem.
An error shows to tell you to activate your account via jihuo.qq.com.
Open the account settings, uncheck the “Connect by TCP” may solve the issue.

I google a lot to find a plugin for rhythmbox to show lyrics automatically.
Though rhythmbox does have a lyrics plugin, it cannot find most Chinese lyrics.
Then I find LrcShow-X. It works well.

lucid_rhythmbox_lyrics

Sorry for leaving this blog outdated for so long.
Since go out of GFW is not a so easy task.

There’s something to mention about installation.

0. installation

I installed lucid from harddisk.
There’s an lock issue when modifying the partition table.
We should umount the iso first:

1. grub

The original grub installation will not probe Windows OSes.
See here. So you must do it manually.

2. qterm

The iBus IME issue seems to be fixed in this version.
But the “Home” and “End” key do not work correctly. This is a resolved bug.
So, change the key type to “linux” may workaround.

3. emphathy

Pidgin is replaced with emphathy.
Emphathy is not as powerful as pidgin.
But it integrates better with Gnome’s notification area.

4. totem/rhythmbox

These are video/audio players.
Please install essential codecs.
Otherwise, almost nothing could be played and seek function is not available.

Now, almost all media formats can be played.
Also, media plugins in firefox works.

5. fglrx

This is the graphics driver for ATI cards.
You may experience better performance and effects.
But after I installed it, I could not play Warcraft III using wine.
So I reverted to the original default graphics driver, and it works.
ubuntu1004_warcraft3
To play other 3D games, make sure your have turned off compiz firstly.

6. gimp

The gimp is not installed by defaut, so…

7. acpid

I’m running on a Thinkpad T60 machine.
The brightness function key works correctly, but the volume button does not.
Then I found that the hotkey mask should be enabled:
http://swiss.ubuntuforums.org/showthread.php?t=1328016
http://www.thinkwiki.org/wiki/thinkpad-acpi
After all, I add following line in the startup script, /etc/rc.local:

Then the volume button works.
The play/pause/stop/prev/next buttons also work in rhythmbox.

8. fstab

I want to mount all windows partitions when boot.
So /etc/fstab file should be edited automatically using pysdm:

For ntfs partitions, default option is OK.
For fat32 partitins, add the “utf8=1” string.
Or you may want to edit fstab manually.
You can copy from /etc/mtab file and do some little modification.
For me, the added modified lines are:

9. restricted packages

This will install some other useful packages.
The open-source java packages are included but not necessary.
Unmark them and install sun’s packages instead.

10. modify reserved space

11. ctrl+alt+backspace

See here:
Since Ubuntu 9.04, the Ctrl-Alt-Backspace key combination to force a restart of X is now disabled by default, to eliminate the problem of accidentally triggering the key combination. In addition, the Ctrl-Alt-Backspace option is now configured as an X keymap (XKB) option, replacing the X server “DontZap” option and allowing per-user configuration of this setting.
As a result, enabling or disabling the Ctrl+Alt+Backspace shortcut can now be done easily from the desktop.
– Enabling Ctrl-Alt-Backspace for Ubuntu 10.04
** Select “System” -> “Preferences” -> “Keyboard”.
** Select the “Layouts” tab and click on the “Layout Options” button.
** Select “Key sequence to kill the X server” and enable “Control + Alt + Backspace”.
– Enabling Ctrl-Alt-Backspace for Kubuntu 10.04
** Click on the Application launcher and select “System Settings”.
** Click on “Regional & Language”.
** Select “Keyboard Layout”.
** Click on “Enable keyboard layouts” (in the Layout tab).
** Select the “Advanced” tab. Then select “Key sequence to kill the X server” and enable “Control + Alt + Backspace”.

开门见山, 我就直接罗列了, 主要是naming convention, style convention 的话, 私以为自己还不错, 就不参考了.

0. General:
a) 命名要有意义.
b) 命名要一致. 比如不要先用prev, 然后用previous.
c) 命名尽量不要缩写. 超过2 个字母, 第一个字母大写其余小写; 只有2 个字母的则全部大写.

1. Class:
a) 类名: 单词首字母大写, 以Q 为首字母.
b) 成员变量: 除了第一个单词, 其余首字母大写.
c) 成员函数: 同上.
d) 静态成员: 同上.
e) 接口: Qt 似乎除了plugin 相关, 不太用接口(纯抽象类). 一般以QXxxInterface, QXxxPlugin 来命名.

2. 结构:
a) 命名跟类一样, 没有特别的convention.
b) 公有的结构以Q 为首字母. 如果是嵌套的, 似乎没有规律.

3. 枚举:
a) 命名跟类一样, 没有特别的convention.
b) 与类相关的枚举可以定义在类中, 这样可以用类名作为前缀.
c) 公有枚举放到公共的名字空间中. 类, 结构, 接口不放到这个名字空间.
d) 命名体现枚举值的相关性. 比如Qt::CaseInsensitive, Qt::CaseSensitive.
e) 尽量用枚举作为Flag 使用. Qt 中有QFlag, QFlags 两个类作为辅助.

5. 函数:
a) 全局函数: qXxxXxx. 比如qFill, qBinaryFind.

6. 宏:
a) 全部大写, 下划线分隔.
b) static const 的全局变量同上.

7. PS:
a) 编辑器的文本编码最好设成ascii, 这样就保证不会出现中文之类了.
b) 函数的参数, Qt 推荐使用指针, 而不是引用, 因为能显式说明参数会被修改.
c) 头文件include 的顺序, 越是specilized 的放在前面, 越是general 的越放在后面.

Qt 的coding convention 跟Java 的非常像. 私以为加上匈牙利命名法会更好一些. 其实又参考了wxWidgets 的部分代码, 由于它不用命名空间, 所以枚举的命名有些小不一样.

参考:
Designing Qt-Style C++ APIs
Qt – CodingConventions
Qt – CodingStyle