RECORDING MY FANTASY

Thursday, August 31, 2006

SCIM on CentOS...

Use update-alternatives to change the xinput setting so that can use SCIM in en_GB enviroment.

# update-alternatives --install /etc/X11/xinit/xinput.d/en_GB xinput-en_GB /etc/X11/xinit/xinput.d/scim-anthy 60
# update-alternatives --install /etc/X11/xinit/xinput.d/en_GB xinput-en_GB /etc/X11/xinit/xinput.d/scim-canna 50
# update-alternatives --install /etc/X11/xinit/xinput.d/en_GB xinput-en_GB /etc/X11/xinit/xinput.d/scim-prime 50
# update-alternatives --install /etc/X11/xinit/xinput.d/en_GB xinput-en_GB /etc/X11/xinit/xinput.d/scim-skk 50
# update-alternatives --install /etc/X11/xinit/xinput.d/en_GB xinput-en_GB /etc/X11/xinit/xinput.d/none 10

If want to change back en_GB enviroment not to use any input method,
use

# update-alternatives --config xinput-en_GB

to change the "Best Version".

---------

this is on the webpage : http://www.debian.org.hk/blog/301

but I have not tested yet.

understanding linux network internals chinese translation webpage

http://www.hlbbs.com/linuxdoc/

However, this book is not completed yet. but many contents have been translated.

I would like to join them, but don't know whether there's chance.

Monday, August 28, 2006

硬盘 I/O 功率分析方法---from Intel software Network

在多核系统上处理IO的一些经验方法:来自intel

多线程代码的硬盘 I/O
让 我们看下 I/O 对多线程代码的影响,以及多线程要求从硬盘读取数据时的最佳 I/O 策略。便于分析,本文作者根据 IJG 库创建了一个内部位图到 JPEG 代码,可利用其将一系列位图转化成 JPEG。下图显示了该应用的串行版本。"读取" 框是指以 64 KB 块大小读取位图文件(写 .JPG 文件时也是相同的块大小)。读/写时间占用了总运行时间的约 41%,而 BMP2JPEG 占用了约 59%。与读取文件(每个 BMP 文件都约为 10 MB)文件相比,输出 JPEG 相当小,因此大部分的读/写时间都被读取占用了。

点击查看大图

在双核设备上执行多线程的一个方法就是分散成两个线程。一个线程可负责奇数的文件,而另一个线程负责偶数的文件,如下图所示:



另一种多线程的方式是,在单线程上执行缓冲读/写,然后在多线程上处理计算密集型转换操作:



最后一种方法是采用排队的 I/O。在所有读取请求排队处创建 I/O 完成端口,多线程则在完成端口等待读取请求完成。转换操作首先启动,完整的输出文件经过缓存,最终在一个线程中被写出。该方法提供了系统的负载平衡,以及轻松扩展线程数量的可能性。



下图所示为这些多线程方法的性能:



当 利用多线程实施来执行缓冲 I/O 和排队 I/O时,性能扩展了约 1.52 到 1.56 倍,但 I/O 操作仍在两个线程中执行时,性能不会扩展。性能表现不佳是由于竞争线程引起了硬盘颠簸。当两个线程都在运行,同时硬盘试图读取 64 KB 数据块时,会导致硬盘严重的寻道/旋转损耗。由于需响应两个线程中的请求,每次读取缓存块后都要重新定位读取磁头。这就导致了次佳的硬盘旋转,增加了总读 取时间,还掩盖了多线程的性能优势。如下能量图表明排序 I/O 提供了最佳的功率和性能优化:

is there live writer @Linux?

These days, I try Windows Live Writer on Windows XP to publish my texts, it's very smart and easy to use, and it supports other web blogs as well. It can know the setting of one of your blog, it can get the template ,too.
I really would like to know whether there are some tools like live writer uner Linux, who can give me some advise?

Saturday, August 26, 2006

First E-shop experience

today I have finished one trade with my classmate, he opened one shop on taobao.com recently. through this, I think it can raise its reputation.

Thursday, August 24, 2006

David Turner's LCD ClearTye-like pateches and packages for Debian sid

http://quanli.googlepages.com/davidturner%27slcdcl...

 

it's for sid,

if it's for ubuntu, I will try it .

google blog's response for my blog: Non-spam review

Hello,
Your blog has been reviewed, verified, and cleared for regular use so that
it will no longer appear as potential spam. If you sign out of Blogger and
sign back in again, you should be able to post as normal. Thanks for your
patience, and we apologize for any inconvenience this has caused.
Sincerely,
The Blogger Team

 

--------------------

I am so glad, thank you, google!

Wednesday, August 23, 2006

redhat的kernel hacker果然不是盖的!

今天从redhat的网站上找到一篇介绍 异步的零拷贝的网络IO的paper

-The Need for Asynchronous, Zero-Copy Network I/O

Problems and Possible Solutions

作者是Red Hat, Inc. 的Ulrich Drepper, 他的webpage是

http://people.redhat.com/drepper/

发现他的主页上面很多与网络相关的文章,看来是一位网络方面的expert了.

现在做一个 从高速网络上传输数据写到磁盘上 的程序,发现在网卡1Gib,磁盘RAID0(两个SATA的盘)的情况下,如果传输以太网packet的速度在七八十兆的情况下,被应用程序丢掉的包就有很多了(2,000,000个中可能有几千个,有时候甚至是上万个了,非常恐怖).

影响因素很多了,主要的是有这么几个方面:

1. 磁盘写的速度有限制, SATA的盘理论值也就在70MBps了,这还是在写连续的文件,没有考虑磁道,扇区,磁头在切换位置时产生的比较大的影响.

2.接收的线程在接收数据的时候需要做几次非常多余但又在目前情况下不得不做的内存拷贝, -这样造成1Gib的网卡也不能达到理论上的125MBps的速度, 在100MBps的时候,网卡就要丢很多的包了,这还没有说kernel在调度的时候所发生的未知行为造成的丢包.

其他 的不说,还没有细看作者的文章,只是看了一下abstract和里面的一些figure,发现提出的方法非常适合高速网络的高速传输,如果去掉几次不必要的内存拷贝,网络的性能肯定大有提高吧?-待细看了文章再说吧.

some useful website related with Linux Kernel development

http://www.lkml.org

http://www.kerneltrap.org/

Saturday, August 19, 2006

Hands-on Preview: Motorola Rokr E2 music phone


Linux graphics stack vendor Trolltech recently supplied LinuxDevices.com with a Motorola Rokr E2 music phone for (p)review. The phone appears to be the same E2 that shipped in China last week through carrier China Mobile, but semi-localized to the U.S., to demonstrate the phone's capabilities to stateside carriers and journalists.


The Linux-powered Rokr E2 phone has FCC approval, and could be sold in U.S., pending carrier interest. As a tri-band (900/1800/1900MHz) GSM/GPRS phone, the E2 would most likely be picked up by Cingular, which operates a 1900MHz GSM band in the U.S.

Motorola lists the following key features and specs for the Rokr E2:
  • 2-inch, 240 x 320 TFT (262k colors)
  • Fast data transfers based on "drag-and-drop" USB 2.0 PC networking
  • Dedicated side-mounted hardware music-player keys
  • Built-in FM radio
  • Support for Motorola's new iRadio service
  • Support for Bluetooth- and 3.5mm jack-based headsets
  • 1.3-megapixel camera with 15 fps video capture and playback
  • MMS (multimedia messaging service) client
  • Opera browser
  • Unique "airplane mode" claimed to allow safe listening onboard airplanes
  • PIM (personal information manager) with picture caller ID
  • "Screen3" technology for "zero-click access to news, sports, entertainment, and other premium content"
Motorola's answer to Sony/Ericsson "Walkman" phones

The E2 follows up Motorola's Rokr E1, a non-Linux phone that included a somewhat crippled version of iTunes, the music player found in Apple iPods. It also follows up several Linux-based music phones that shipped in Asia, including the original E680 and second-generation E680i.

The Rokr E2 has an endless list of smartphone capabilities -- messaging of all kinds, PIMs, 1.3MP camera, contacts synchronization, Java runtime, games, video/photo/music players, Opera browser, and on and on and on. However, it is primarily positioned as a combination mobile phone and music player. As such, it competes directly with Sony/Ericsson "Walkman" phones.

The Walkman phones have proven extremely popular, shipping nearly four million units last quarter and helping Sony/Ericcson increase its 2006 net profits 91 percent, year over year, according to WirelessWeek.

Given the runaway popularity of both mobile phones and portable music players, combining the two only makes sense. But can the Rokr compete?

Seamless music/call handoff


Rokr E2 buds
(Click to enlarge)
The Rokr E2's headset's right speaker wire has a little pod that dangles at mouth level. The pod houses a microphone, and a small push-button. When a call comes in, the music pauses, and the phone starts ringing -- perhaps playing back an mp3 file that has been designated as the ringtone. The user pushes the button on the little pod, and answers the call, talking into the microphone on the little pod. When the call finishes, the music resumes right where it left off.

There's no need to fish for music player and phone, and no need to switch headsets. This is a big step forward in convenience, compared to separate devices.

The handoff works with the Rokr's built-in FM radio, too.

Nifty tricks with USB client ports and loadable kernel modules


"Connections" menu,
showing USB port in
"Memory card" mode

(Click to enlarge)
Another really innovative and useful Rokr E2 feature is a USB client port that can be switched easily between "modem" and "storage card" modes, depending on whether the device is being used as a phone or as a portable music player. In either mode, the phone begins charging its battery over the USB connection as soon as it is plugged in.

In the default "modem mode," the phone presents itself to a host PC as a USB modem. On our Debian Linux test system, the phone showed up as /dev/ttyACM0, and caused the USB subsystem's "CDC-ACM" driver to be loaded, as shown in the following kernel messages:

Jul 12 18:18:27 hank kernel: usb 1-4: new high speed USB device using ehci_hcd and address 5
Jul 12 18:18:28 hank usb.agent[5318]: cdc-acm: loaded successfully
Jul 12 18:18:28 hank kernel: cdc_acm 1-4:1.0: ttyACM0: USB ACM device
Jul 12 18:18:28 hank kernel: usbcore: registered new driver cdc_acm
Jul 12 18:18:28 hank kernel: drivers/usb/class/cdc-acm.c: v0.23:USB Abstract Control Model driver for USB modems and ISDN adapters

After that, we launched KMobileTools, a handy KDE application that enabled us to control the phone from our computer, using serial commands. Dialing out and taking calls worked great. However, we could not test SMS functionality due to a lack of GPRS service in our secret Nevada testsite location.

Were GPRS service available, presumably we could have also tried using the phone as an Internet gateway for the PC. The phone can serve as an Internet data "modem" through either its USB or Bluetooth interfaces. Our prototype had no difficulty bonding with our Nokia 770 Internet tablet via Bluetooth, and we appreciated the Rokr's wealth of confirmation messages, a nice safety feature in the era of Bluesnooping and Bluesnarfing.

Next, we shut down KMobilePhone, unplugged the phone, and switched its USB system to "storage card" mode. When we plugged the phone back in, it then presented its SD card to the PC as a USB storage device, as shown by the kernel messages below:

Jul 12 18:34:26 hank kernel: usb 1-4: new high speed USB device using ehci_hcd and address 6
Jul 12 18:34:27 hank kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Jul 12 18:34:27 hank usb.agent[5634]: usb-storage: already loaded
Jul 12 18:34:32 hank kernel: Vendor: Motorola Model: Phone Rev:
Jul 12 18:34:32 hank kernel: Type: Direct-Access ANSI SCSI revision: 04
Jul 12 18:34:32 hank kernel: SCSI device sda: 246016 512-byte hdwr sectors (126 MB)
Jul 12 18:34:32 hank kernel: sda: Write Protect is off
Jul 12 18:34:32 hank kernel: sda: sda1
Jul 12 18:34:32 hank kernel: Attached scsi removable disk sda at scsi2, channel 0, id 0, lun 0
Jul 12 18:34:33 hank scsi.agent[5661]: sd_mod: loaded successfully (for disk)
Jul 12 18:34:38 hank kernel: usb 1-4: reset high speed USB device using ehci_hcd and address 6

After that, we were able to mount the vfat-formatted card using (as root):
    mkdir /mnt/rokr; mount /dev/sda1 /mnt/rokr
We then cd'ed to the card and scp'ed some high-quality variable bitrate mp3 files from our network-based music server.

zd:# cd /mnt/rokr/
zd:/mnt/rokr# ls
MyMusic MyPhoto MyVideo
zd:/mnt/rokr# cd MyMusic
zd:/mnt/rokr/MyMusic# scp user@2nz:mp3/corey_harris/daily_bread/*.mp3 .
01_daily_bread.mp3 100% 7178KB 1.2MB/s 00:06
02_i_see_your_face.mp3 100% 4272KB 1.4MB/s 00:03
03_got_to_be_a_better_way.mp3 100% 4846KB 1.2MB/s 00:04
04_a_nickel_and_a_nail.mp3 100% 5180KB 1.3MB/s 00:04
05_the_sweetest_fruit.mp3 100% 5692KB 1.4MB/s 00:04
06_mami_wata_feat_olu_dara.mp3 100% 4428KB 1.1MB/s 00:04
07_lambs_bread.mp3 100% 5256KB 1.3MB/s 00:04
08_just_in_time.mp3 100% 4636KB 1.5MB/s 00:03
09_khaira.mp3 100% 4452KB 1.1MB/s 00:04
10_big_string.mp3 100% 7836KB 1.3MB/s 00:06
11_more_precious_than_gold.mp3 100% 5950KB 1.5MB/s 00:04
12_the_bush_is_burning.mp3 100% 4872KB 1.2MB/s 00:04
13_the_paech_feat_olau_darabonus_track.mp3 100% 13MB 1.2MB/s 00:11
zd:/mnt/cdrom/MyMusic# cd
zd:~# sync && umount /mnt/cdrom
Obviously, we could also have tried copying some JPEGs to the MyPhoto directory, or some video files to the MyVideo directory, after first converting them to .3gp format using something like ffmpeg or 3gpwiz.


The elusive item
(Click to enlarge)
For a while, we struggled to figure out how to create a playlist on the Rokr phone out of these new tracks, without having to laboriously load each song one at a time and "apply" them to a playlist. Eventually, we found the "rescan" utility that updates the Rokr's internal database of music files and id3v2 tags; it resides under a context-button in the top-level "My Media" interface layer, rather than anywhere within the music player itself. After that, we could quickly create playlists. However, it seemed strange that the update script would not simply be configured to run automatically at each SD Card remount (i.e., when the phone is unplugged from the PC).

Uh-oh... a show-stopper?

Next, we began listening to the Rokr, and trying it out with various headphones and systems to see whether it actually produced good sound. To our surprise and horror, the Rokr punted when asked to drive a car- or home-stereo's line-in jack, falling back on its tiny, tinny built-in speakerphone speaker after about half a second. This seems like a serious failing, since every other portable stereo device we've ever used could easily be plugged into our home and car systems.

The ear buds that come stock with the Rokr are not terrible. They are efficient and support loud listening levels in fairly noisy environments. However, when auditioned in a quiet environment, they seem to have poor high-frequency response, and tend to make everything sound slightly muffled, like FM radio.

Other headphones with standard 1/8th inch stereo mini-plugs worked while playing back mp3 files in our prototype Rokr, and sounded better than the stock earbuds. However, if you want to take advantage of the cool "music/call handover" feature described above, you have to use the stock earbuds. Additionally, the FM Radio refused to work with anything but the stock headphones, suggesting that it probably uses the mic wire as its antenna.

Anyhow, if the Rokr E2 achieves anything close to the popularity of the Sony/Ericsson's Walkman phones, aftermarket audiophile headphones and adapters for line-level audio out are likely to reach market in short order.

Another slight flaw, in our opinion, is that the Rokr E2's audio circuitry is switched off between each played-back file. This probably helps save some battery power. However, it produces audible static between each song in a playlist. Worse, clicking around the interface with headphones on and the volume turned up a bit becomes absolutely maddening, due to all the static pops and spikes. There's probably a way to disable interface feedback clicks -- everything else on the phone is customizable -- but it was not easily found.

Speaking of customizability, a few words about the Rokr's "Chameleon" interface are in order.

It's two -- Two! -- interfaces in one


Joystick and
context buttons
The Rokr does not have a touchscreen. Most operations are done using a tiny four-way+down toggle-stick, and two context-sensitive buttons, although the music player and other features are blessed with hardware buttons of their own (click here to see the music player's side-mounted hardware controls, and here to see the side controls for voice commands and keyboard locking).


Custom "Pokiok Falls"
wallpaper, stock icons

(Click to enlarge)
The Rokr E2 is one of the first phones equipped with Motorola's new "Chameleon" interface, a Motorola creation written on top of Trolltech's basic Qtopia Core graphics framework and interface toolkit. In the best tradition of Linux itself, and true to its name, Chameleon is highly user-customizable.

In stock form, the Chameleon interface offers a deceptively simple, task-based interface to Rokr features such as the camera, messaging system, Opera browser, and so forth. The interface is so simple that the Rokr could easily be mistaken on casual inspection for a midrange "feature-phone."


Control Panel-like
interface

(Click to enlarge)
However, from the homescreen, pushing the tiny joystick straight in brings up a Control Panel-like interface with a 3 x 4 matrix of graphical icons. This matrix resembles the home screen created by Trolltech for its Qtopia Phone Edition stack, albeit with more sophisticated animated icons. This Control Panel-like interface leads to application and configuration sub-menus three or four levels deep in some cases, exposing a lot of capability, and also a lot of complexity. However, complexity is mitigated by a clever "Customize Home" feature accessible from the homescreen.

The "Customize Home" feature lets the user configure the functionality of four graphical shortcut icons on the Rokr E2's homescreen. The shortcuts are actuated by toggling the phone's little joystick right, left, up, or down, providing instant access to frequently used applications or configuration screens of the user's choosing.

Novice users might leave the stock icons alone, for fast access to the camera, messaging, SIM card addressbook, and call log. Users with lots of mobile devices could add a Bluetooth connection shortcut, in place of the camera link, as shown in the photo at right, or perhaps a shortcut to Motorola's Motosync interface for backing up and sharing data with PCs.



Customizable UI
(Click to enlarge)
In time, most every user will likely wish to customize the phone's primary home interface according to their usage habits and taste. The icons can also be hidden, without affecting shortcut functionality.

In general, LinuxDevices.com testers liked the Chameleon interface, because it helped them quickly make use of the phone's features, without a big learning curve. Testers also praised the UI as "snappy, colorful, and entertaining" -- the button-press feedback audio clips sound like they were sampled from the Flaming Lips song, "Yoshimi Battles the Pink Robots, Pt. 2," one observer stated.

Some menu item names, such as "apply to playlist," are rather mystifying. However, the Rokr E2 we tested appears to have been configured by Trolltech as a demo unit. Hence, its Chinese-language interface may have been translated into English by Norwegians. Any E2's reaching U.S. customers will obviously benefit from interface improvements and commercial service integrations such as iRadio from both Motorola and carriers.

Conclusion


Rokr E2 kit
(Click to enlarge)
The Rokr E2 is an astonishingly functional device characterized by innovation, integration, and ingenuity. Physically, it's a gem to behold, much smaller and thinner than it looks in photographs. The device works well as a phone. The networking options are bountiful, even without WiFi. We liked the funny little music player well enough once we got used to it. The hardware buttons, such as keylock, are well-placed and well-chosen. The software user interface is fun and clever. Battery life is good... there's not much not to love here.

We do hope Motorola will fix the problem that prevents the Rokr E2 from driving line-level inputs, such as those found on home and car stereos. Motorola did not respond by publication time with regards to plans to fix the problem. Were it not for that failing, we could whole-heartedly endorse the Rokr, because it's a mighty fun gadget to have around. Look out, Sony/Ericsson...

For zillions and zillions of screenshots of the Rokr's "Chameleon" interface, see this Russian-language article. For another Rokr E2 preview, look here. More about Motorola's other Linux-based phones can be found here.

The Motorola Rokr E2 was originally expected to be available to consumers in the first half of 2006, priced between $200 and $250 with a two-year contract. Its radio technologies and carriers have not yet been announced. Further details will be announced upon consumer availability, the company says.

Monday, August 14, 2006

Thursday, August 10, 2006