Just another Ruby porter,

〜2006年5月中旬〜


<Prev(,) | Next(.)> | Recent(/)>> | RDF

2006-05-11 (Thu)

[Ruby] 長いコマンドライン

短くする解決策としては

  1. mkmf.rbのcreate_headerを使う($defsから-D,-Uを取り除く処理は追加)
  2. Makefileで@を使ってコマンドラインを隠し、代わりにコンパイル中のファイル名を表示
という案が某所で出た。2番目はおいらの案ではあるが、Linux 2.6.xで導入されたmake V=1で切り替えられる機構が気に入っていたので前からあってもいいと思ってた。 でもV=1をどうやってるのか調べたらGNU makeに依存していて参考にならなかったり。

例えば

#! /bin/sh

if [ "$1" = 1 ]; then
  shift
  echo "$@"
fi
"$@"

というrun.shを作って

% echo 'all:; @sh run.sh $(V) cc -c foo.c' >Makefile
% touch foo.c
% make 
% make V=1
cc -c foo.c

というのはありかもしれない。ファイル名を表示がちょっと面倒だけど。


2006-05-12 (Fri)

[Makefile] make V=1とmake V=0

今日思いついたのは

V = @
Q = $(V:1=)
all:; $(Q)cc -c foo.c

というMakefileを作って

% make V=1

とする方法。でもどっちかというといままでのように@なしのverbose modeを defaultにしたほうが混乱がなくていいかもしれない。 何も表示しないというのもどこまで進んだのかわかりにくいし、 ファイル名ぐらいはechoするという機構を考えないといけないだろうな。 こんな感じかな。

V = 1
Q1 = $(V:1=)
Q = $(Q1:0=@)
ECHO1 = $(V:1=@:)
ECHO = $(ECHO1:0=@echo)
all:
	$(ECHO) Compiling foo.c
	$(Q)cc -c foo.c

これでdefaultとV=1はverbose modeでV=0でquiet modeになる。

% make
cc -c foo.c
% make V=1
cc -c foo.c
% make V=0
Compiling foo.c

GNU makeとpmakeでいけた。nmakeはECHO1の@:の部分を@remにしないとだめか? Borland makeはコマンドラインでの指定は負けるから!ifdefとか使う必要あり。


2006-05-13 (Sat)

[LDR] livedoor Readerのハイライト

今日の昼、立ち上げ放しのlivedoor Readerを見たらアクティブなアイテムがハイライトされてた。 sするとなぜか最初のフィードに戻ってしまったりで、 なんか変だなとreloadしたら直った。 でもハイライトもなくなった。なんか実験してたのが間違って出てしまったのか?

その時に 例のjの挙動というかアクティブなアイテムはどこで移動するのかを確かめてみたら、 半分以上スクロールするととアクティブなアイテムは次に進むことがわかった。 で、ハイライトされてればどこがアクティブだか一目瞭然なのでBloglinesと同じ挙動じゃなくても問題ないことに気づいた。 しかもスペースバーでスクロールしてもわかりやすい。

次のバージョンアップあたりで入る?


2006-05-14 (Sun)

[Soft] Keep It Secret! Keep It Safe! 0.19

About:
KisKis (Keep It Secret! Keep It Safe!) is an easy-to-use password manager. It allows the user to manage passwords for many different purposes, including network or Internet accounts, credit-card pin-numbers, and password-secured files. The accounts can be grouped hierarchically within a tree structure. Each account can be described by multiple attributes (such as user name or URL), file attachments, and comments. The history of each password change can be tracked. All passwords are stored in a single XML file using OpenPGP messages.

[Soft] QDBM: Quick DataBase Manager 1.8.53

Changes:
AIX is now supported. A bug about evaluating the RFC822 date format was fixed. The utility API was enhanced.

2006-05-15 (Mon)

[Unix] 2年前のcrontab

なぜか昨日起動したらしい。去年も起動してたらしいが気づかなかった。 crontabには年の指定がないからだった。 atじゃなくてcrontabならコメントアウトすれば履歴が残っていいやなんて考えが裏目に。 内容は停電直前にnsupdateでIPアドレスを変更するという設定を2年前にしていた。 突然今朝からアクセスできなくなったらしい。 そりゃ2年前は別のビルだからセグメントが全然違うもんなあ。 てゆか、まじで去年はどうしてたんだろう?

やっぱ履歴は別に取ってatを使おう。


2006-05-16 (Tue)

[LDR] livedoor Readerのshift+ctrlとFirefoxのshift+ctrl+tab

Firefox上のlivedoor Readerでなんか勝手に次のフィードが読まれてしまうなと思ったら、
shift+ctrl+tabで前のタブへ移動した際にshift+ctrlがlivedoor Readerに食われてしまってるのが原因だった。
これは非常にうっとうしい。
ctrl+shiftも意味を持ってるし、どんなに速く3つ同時に打っても無駄。
sもshift+↓もあるんだからそんなコンビは要らないと思うんだけどなあ。
shift+ctrl+何かというキーバインドは結構ありがちなだけに。

というわけで、shift+ctrl, ctrl+shiftを殺すgreasemonkeyを作らないと。


2006-05-17 (Wed)

[Google] Google NotebookのNote Thisボタン

右下のOpen Notebook(N)を右クリックしてEnable 'Note This' buttonをチェックすると、
選択するだけで右側に+ボタンが出現して、
コンテキストメニューを呼び出さなくても いきなりnote thisできるという今日のトリビア。


2006-05-18 (Thu)

[Ruby] Nabble - ruby-talk forum

なんか知らないうちにruby-talk MLのミラーができてた。

This forum is an archive for the mailing list: ruby-talk@ruby-lang.org( info). Messages posted here will be sent to this mailing list.

Ruby Lang forum を見るとなんかほとんどのRuby関係のMLをカバーしてるようだ。 ruby japanese forum でSubjectも化けずにちゃんと日本語表示されていてちょっと感動した。


2006-05-19 (Fri)

[LDR] livedoor Readerのshift+ctrlとctrl+shiftを殺す

Keybind.addすれば上書きされそうなので、function(){}で置き換えてしまおう。 本当はキー自体を消したいけどよくわからなかった。

javascript:Keybind.add("shift+ctrl|ctrl+shift", function(){});void(0)

をロケーションバーで入力したら一応無効になった。 greasemonkey化する程でもないのでbookmarkletにしとく。

間違えるとJavascriptコンソールを立ち上げなくても中の人がエラーを教えてくれるとこが憎い。

missing ) after argument list,javascript:Keybind.add("ctrl+shift", function(){}]);void(0),1

という感じで。

それにしてもshift+ctrlとctrl+shiftって位置的に意味が逆だよなあと思ってたんだけど、 それはHHKの所為だった。HHKだとctrlの位置はshiftの上だしね。


2006-05-20 (Sat)

[Soft] BusyBox 1.1.3

Changes:
This release makes passwd use salts, fixes a memory freeing bug in ls, fixes the "build all sources at once" mode, makes mount -a not abort on the first failure, fixes msh so Ctrl-c doesn't kill background processes, makes patch work with patch hunks that don't have a timestamp, make less' text search a lot more robust (the old one could segfault), and fixes readlink -f when built against uClibc.

[Soft] libzip 0.7.1

About:
libzip is a C library for reading, creating, and modifying zip archives. Files can be added from data buffers, files, or compressed data copied directly from other zip archives. Changes made without closing the archive can be reverted. The API is documented by man pages.

[Soft] mp3togo 0.4.0

About:
mp3togo loads MP3, Ogg Vorbis, FLAC, and WAV files on to a portable MP3 player by decoding them (if required) and reencoding in a consistent lower bitrate MP3 (or Vorbis) format. The idea is to take music from a library of diverse archival quality encodings and convert it to a space efficient format playable on a portable device. mp3togo will run as a stand alone program, or can be imported as python modules to use its components in another program. The package installs a command line executable named mp3togo in /usr/bin. For command line options use --help.

<Prev(,) | Next(.)> | Recent(/)>> | RDF


WWW を検索 jarp.does.notwork.org を検索

わたなべひろふみ
Key fingerprint = C456 1350 085F A320 C6C8 8A36 0F15 9B2E EB12 3885
Valid HTML 4.01!