December 21, 2009

How come + and - appears at the beginning of the line on IRC?

調べようと思ったことの発端はplumに限らず現象を見たという話から。

手がかりはxchatのソースコード: src/common/proto-irc.c:

static void
process_named_msg (session *sess, char *type, char *word[], char *word_eol[])
{
....
case WORDL('N','O','T','I'):
{
int id = FALSE; /* identified */

text = word_eol[4];
if (*text == ':')
text++;

if (serv->have_idmsg)
{
if (*text == '+')
{
id = TRUE;
text++;
} else if (*text == '-')
text++;
}


上記のコードにあるようにxchatではある特定の条件(serv->have_idmsg)下に於いてメッセージの先頭の+および-を無視している。

では特定の条件とは何か:

static void
process_numeric (session * sess, int n,
char *word[], char *word_eol[], char *
text)
{
....
case 290: /* CAPAB reply */
if (strstr (word_eol[1], "IDENTIFY-MSG"))
{
serv->have_idmsg = TRUE;
break;
}
goto def;


CAPABコマンドの戻り値であるRPL_CLIENTCAPABIDENTIFY-MSGが渡されている場合、このような挙動になるらしい。

CAPABって何?

freenode: frequently-asked questions:
Your nick is how people on freenode know you. If you register it, you'll be able to use the same nick over and over. If you don't register, someone else may end up registering the nick you want. If you register and use the same nick, people will begin to know you by reputation. If they're running IRC software which supports CAPAB IDENTIFY-MSG, they'll be able to tell when someone is spoofing your identity.


ここよりNickServ関係であることが分かる。ということで、pruneでも似たようなコードを書いて+/-が出てくるのを回避。
http://github.com/tagoh/prune/commit/73cdf3301c422672c7a1757d6bc397d58c239721

December 8, 2009

prune - IRC protocol library for Ruby

I'm pleased to have first release of prune, IRC protocol library for Ruby now. which contains the IRC proxy daemon as the sample implementation, but works enough as powerful. in this release, strictly speaking, it doesn't have a server implementation in a class yet though, will be available in the future release.

Major features in prune are/will be:
  • Ruby-friendly to deal with the IRC protocol.
  • easy to extend the behaviour
  • the plugin mechanism
  • the reloading configuration support
Also, the features in the proxy daemon are:
  • able to keep multiple servers connection
  • the encoding support per channels.
For more details of this project, please see http://github.com/tagoh/prune. you can download the source code there too.


Enjoy,

December 2, 2009

mopera U 端末設定で作られるアカウント名を変更する

\HKCU\Software\HTC\SuperQuick\EmailAccountを任意の文字列に変更すれば実行後にPocketOutlookに作られるアカウント名がそれになる。

結構どうでもいいトリビア。

November 24, 2009

Keyboard layout is being messed up on Fedora 12

以前よりいろいろ問題の多かったキーボードまわりの設定だけれど、Fedora 12にアップグレードしたら案の定おかしくなってた。症状は\や_が入力できない、など。実際にはもっと広範囲にわたってキーレイアウトがぐちゃぐちゃに入れ替えられてる。カーソルキーが別の割り当てになってたりとか。
原因は以前EmulateWheelの件で設定した


Section "ServerFlags"
Option "AutoAddDevices" "false"
EndSection

の行が悪さをしていた模様。が、これを外すと前回と同じくEmulateWheelの設定が有効にならない。いろいろ試した末半ズボン先生のありがたいアドバイスによって解決。


Section "InputDevice"
Identifier "Keyboard0"
Driver "evdev"
Option "CoreKeyboard"
Option "XkbLayout" "jp"
Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "evdev"
Option "CorePointer"
Option "Protocol" "ExplorerPS/2"
Option "EmulateWheel" "true"
Option "EmulateWheelTimeOut" "200"
Option "EmulateWheelButton" "2"
Option "XAxisMapping" "6 7"
Option "YAxisMapping" "4 5"
Option "ZAxisMapping" "4 5"
Option "Device" "/dev/input/by-path/platform-i8042-serio-1-event-mouse"
EndSection

こんな感じで手元のX61ではAutoAddDevicesなしでもキーボードもEmulateWheelも期待通りの動作をするようになった。

October 26, 2009

Recent life cycle

  1. 6:30〜7:00の間 起床
  2. 朝ご飯の支度
  3. 身支度
  4. 必要に応じて洗濯
  5. 息子がご飯食べ終わるのを待つ
  6. 後片付け
  7. 通勤 1時間弱
  8. 仕事
  9. だいたい定時に退社
  10. 息子を風呂に入れる
  11. 遅くとも21時ぐらいまでには息子を寝かす
  12. 翌日のご飯の仕込み
  13. 自分の晩ご飯の支度
  14. 後片付け
  15. 風呂
  16. 寝る
時間ができたら仕事でもしようかと思いつつそんな余裕が全くない日々。とりあえずまだ生きてます。