精确提问的艺术

老实讲,我已经不记得我多少次说过“你什么意思”这句话了。

很多人的提问几乎没有任何信息含量。

想要在*nix世界里提问,首先你可能已经学习过了《提问的艺术》,如果你还没学习过,那请先去学习一次。这篇文章哪都有,而且有中文版。于是本文的牢骚纯粹作为那篇文章的补充。

前提:不要做白痴!

至少如果你的问题如果包含一条出错信息,那么你应该先去搜索。如果你使用Google的话,应该至少学会引号的使用,这样能使你搜索的结果是包含整句话,而不是零散的几个词。其次,搜索要去掉所有只能在你机器上重现的内容,例如路径,进程号。

另外要善用Google的按时间搜索功能,如果你发现五年前有人遇到类似的问题,那么那个问题很可能不是你的问题。要找最近出现的内容。

1、不是害羞的时候!

如果你知道什么,不要有意把你知道的内容隐瞒起来。

2、你都干了些什么?!

精确不代表冗余的内容,在了解你的问题的基础上,你要列出相关的内容。以下是一些经验之谈。一个关键的方法就是找你做了什么。例如你安装了什么软件包,修改了什么配置。

在自己知识范围内确定可能的问题。

如果输出提示和什么文件相关,可以通过包管理器去查询那个文件所属的包。

在少数情况下,问题是可能绕一个曲线才会触发的(例如我有幸曾经发现过一次glibc的bug……触发曲线是 KDE->Qt->Strigi->glibc,但这种情况少之又少。),找到你知道的直接相关的问题。

找到前后的差异是很重要的。而且也是最容易的。包管理器都会提供你安装的log记录,如果你不记得了,包管理器的log也会帮你记得。

3、举一反三!

如果你的问题和许多环境有关,那么最好确定下你的问题是否与某个环境有关。比如我经常被问到的输入法问题,如果不能启用输入法,那么究竟是哪个程序不能启用?那么有哪个程序又能启用?这些也都是重要的信息。

再比如显卡驱动,你当然可能只有一台电脑,那么开源闭源驱动至少可以换着试试看。究竟是驱动的问题还是程序的问题这是一条重要的分水岭。

4、寻找同行者!

Linux的环境是非常复杂的,而且在这个环境下,很多人对于自己环境没有问题出于一种幸灾乐祸的态度(你懂的),比如说,你在Fedora的论坛上说你的Ubuntu出问题了,很大可能会收到的回答就是,来投奔Fedora吧!事实上也不能太怪别的论坛的人,他们可能压根不知道在你那边发生了什么。

所以先问和你有相同环境的人,也是很重要的一点,比较你们二人的环境配置也是有助于找到你的问题。

其实除了第一条之外,后三条和核心思想只有一句话,那就是比较。不要指望其他人一口气指出你的问题,你和他的距离已经超过世界上最遥远的距离了。

Posted in Linux | Tagged | 6 Comments

我怎么在 KDE 下开发 Fcitx

内容没啥,就是我布置plasma的展示……

另外就是我最爱的 KDevelop。以及 Activity 也方便我终端和恢复工作。

Posted in fcitx development | Tagged , | 3 Comments

更新域名

.tk -> .info
.tk 域名不再受到startssl的支持。

Update:

今天tk无端把我csslayer.tk 吞掉了!擦,想重新注册也未能成功,所以望请诸位更新地址。

Posted in 日志 | 7 Comments

Fcitx 4.2.0

fcitx 4.2.0
1. 码表支持构词码(郑码要求),显示时提示文本可以码表(仓颉要求)。
2. 重命名并整理API
3. API增加全局的上下文变量支持
4. 支持检测kimpanel进行自动切换。
5. 支持 alt + shift 作为激活/非激活模式的切换
6. 支持将第一个输入法作为非激活状态
7. kimpanel新的图标集
8. 大幅降低码表以及拼音的内存占用
9. 支持标点按当前输入法语言切换不同配置
10. -r 选项,用于替换已存在的fcitx。

fcitx-cloudpinyin 0.2.0
1. 取词单独放入一个线程中,解决curl multi在极少数时候依然是同步调用的问题
2. 修复一个在较新版本curl导致崩溃的bug

fcitx-configtool 0.4.0
1. 增加kcm-fcitx一样的修改输入法列表的功能
2. 支持使用gtk3进行编译

fcitx-fbterm 0.1.2
与主干代码同步

fcitx-googlepinyin 0.1.4
与主干以及libgooglepinyin同步

fcitx-sunpinyin 0.3.3
与主干代码同步

fcitx-ui-light 0.1.3
与主干代码同步

fcitx-keyboard 0.1.0
使用键盘布局作为输入法,支持对应语言的单词补全,需要安装对应语言的拼写检查。同时可以解决非gtk/qt程序中无法使用compose key的问题。

fcitx-libpinyin 0.1.0
libpinyin 支持,提供不包含在libpinyin中额外的繁体中文数据。依赖 libpinyin >= 0.5.0

fcitx-chewing 0.1.0
libchewing 支持

fcitx-table-extra 0.1.0
包含,郑码,仓颉3/5/大字符,嘸蝦米等额外码表

kcm-fcitx 0.3.0
1. 增加仅显示当前语言的输入法

另外对于gnome-shell用户,可以自行尝试
https://github.com/csslayer/kimpanel-for-gnome-shell
插件,目前还处于实验性阶段。发布时会直接提交到gnome-shell插件的网站。

关于部分新功能的介绍参见
https://www.csslayer.tk/wordpress/fcitx-dev/fcitx-keyboard/
https://www.csslayer.tk/wordpress/kde/fcitx-impanel-autoswitch/

另 外fcitx的m17n,anthy,hangul支持在开发中。同时也非常感谢参与fcitx的开发的taylorchu(fcitx- chewing),pipitu(fcitx-anthy),ELizabeth HONG(fcitx-hangul),Cheer Xiao(fcitx-m17n) (排名不分先后),繁体中文的翻译Alisha,以及一起开发kimpanel的gnome-shell版本的bigeagle。另外感谢debian的fcitx维护者,Aron Xu和Yunqiang Su,opensuse的doublechou,stecue,以及其他一起帮助测试fcitx的朋友和所有fcitx用户,非常感谢。

Posted in fcitx development | 56 Comments

Re-ask: Why Fcitx?

I wrote some post about “Why Fcitx” before, while I was little bit worried about fcitx’s future. But for now, I already have some idea for this question.

There is already several input method framework on Linux world, why Fcitx is needed? First let’s review the history of Fcitx. Fcitx was born in 2002, which by that time was named “gWubi”. It got renamed “fcitx” some year later. It’s never an input method framework, but an input method collection.

In 2007, there is some incident for Fcitx, you can find the detailed link on wikipedia. At that time I didn’t even use Linux yet. The story for me on Fcitx began with that I became a KDE user. At that time, IBus nor Scim is not a good choice for Qt based program, so I moved to Fcitx, and found there is a little plasmoid, called kimpanel. Fcitx’s kimpanel support is only a branch inside fcitx, and didn’t sync with trunk for a long time. So I decided to port it to the trunk. That‘s the chance that I become a Fcitx developer, till now. I want to make Fcitx a unique framework, which cannot be replaced. I carefully learn the all existing function of Fcitx, and I thought I finally found an awesome road for Fcitx.

Fcitx is famous of its lightweight, and quick speed, this idea didn’t chance even after I change Fcitx a lot. And it’s become even more light for the core, actually. Now I want to add some new properties to Fcitx, including native feeling, flexibility, and consistency.

Thanks to dbus, and kimpanel, I could make fcitx to use the most native UI on all the desktop, including GNOME, and KDE. And if you just want a xlib based UI? Ok, fcitx-ui-light is for you. And I even provides two configuration tool, for gtk users and KDE users, which could brings them the most native feeling on theirs system.

The second property is flexibility . Fcitx don’t choose the interprocess model, because that will breaks some flexibility of Fcitx. Input method is basically interprocess key stroke and mouse event passing between program. But I want input method can access some global property easily, and interact with each other, that’s why I stop my step for the interprocess input method support. Fcitx could be extended very easy, with nearly no limitation.

Consistency is the last property, which brings together with the first two properties. First, code is largely reused between input method, which brings consistency among different input method. The question about why this input method can customize punctuation, why that cannot, could hardly happen on Fcitx. Fcitx input method can share the built punctuation module, which also reduce the effort for developing an CJK input method. Other great features, like cloud-pinyin, auto switch, and quick phrase, are also shared among different input methods. This idea cannot be achieved by all existing input method framework.

What can be done with fcitx? Everything you can think of, for example, tweet sending could be extended to fcitx easily; bind a hotkey with specific input method could also be possible. You want a ncurses based configuration tool? Ok, just use fcitx-config to do the thing you want. Need some more dbus interface, fcitx-dbus is there and you can implement your own dbus module. I can hardly say there is some limitation to make your own input method module.

Feel free to join the development with Fcitx, to bring some more cool stuff to the input method world.

Posted in fcitx development | Tagged | 11 Comments