前の月 / 次の月 / 最新

MuraTaka 速記メモ / 2008-04

01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

2009 : 01 02 03 04 05 06 07 08 09 10 11 12
2008 : 01 02 03 04 05 06 07 08 09 10 11 12
2007 : 01 02 03 04 05 06 07 08 09 10 11 12
2006 : 01 02 03 04 05 06 07 08 09 10 11 12
2005 : 01 02 03 04 05 06 07 08 09 10 11 12
2004 : 01 02 03 04 05 06 07 08 09 10 11 12

2008-04-30 Wed

2008-04-29 Tue

住所から緯度経度を検索 Geocoding [Google]

- Geocoding - 住所から緯度経度を検索

Agile Web Development with Rails, Third Edition [Ruby]

- The Pragmatic Bookshelf Agile Web Development with Rails,
Third
Edition

Beta PDF + Paper Book で $53.95。
Beta PDF だけなら、$24.00。

ちなみに Second Edition は、$19.95 で今買えるようだ。

RSS Reader を NetNewsWire に切り替える [Tool]

- Free RSS Reader - Online News Reader - NewsGator
しばらく試していたのだが、Vienna の時のもっさり感が無く、メモリも
そこまで消費されない。
Vienna から乗り換えることにする。
幸い、Vienna の「購読を書き出し」機能がちゃんと機能するようになっ
ていたこともトリガーになったのは皮肉だな。。

2008-04-28 Mon

2008-04-25 Fri

NetNewsWire が無料になっていたんだ [Tool]

RSS Reader はずっと
- Vienna
を使っている。
使い勝手は問題ない。うん、しかもフリーウェア。
何が問題か?
購読数が100を超えた辺りからかなり重くなってきた。もさもさと。数的
にしかたないのかな・・・
もっとさくさく動いてくれるものはないものか。

- Free RSS Reader - Online News Reader - NewsGator
  via NewsGator、RSSリーダーを無料化 - ITmedia News

NetNewsWire が無料になっていたとは。
しばらく試してみる。

2008-04-23 Wed

Tiger に Mongrel を入れておく [Mac][Ruby]

$ sudo gem install mongrel
Password:
Updating metadata for 19 gems from http://gems.rubyforge.org/
...................
complete
Bulk updating Gem source index for: http://gems.rubyonrails.org/
Bulk updating Gem source index for: http://gems.rubyonrails.org/
Building native extensions.  This could take a while...
Building native extensions.  This could take a while...
Successfully installed daemons-1.0.10
Successfully installed fastthread-1.0.1
Successfully installed mongrel-1.1.4
3 gems installed
Installing ri documentation for daemons-1.0.10...
Installing ri documentation for fastthread-1.0.1...

No definition for dummy_dump

No definition for dummy_dump

No definition for rb_queue_marshal_load

No definition for rb_queue_marshal_dump
Installing ri documentation for mongrel-1.1.4...
Installing RDoc documentation for daemons-1.0.10...
Installing RDoc documentation for fastthread-1.0.1...

No definition for dummy_dump

No definition for dummy_dump

No definition for rb_queue_marshal_load

No definition for rb_queue_marshal_dump
Installing RDoc documentation for mongrel-1.1.4...

2008-04-21 Mon

Subversive には file プロトコルがないんだ・・・ [Aptana]

Subclipse にはあるのだが、Subversive には file プロトコルがないようだ。
ローカルで扱うものもあるのでがっくり。

Tiger に MacPorts で lynx を入れておく [Mac]

apachectl の status を見るのに、lynx が必要なんだ。
入れておく。

$ sudo port search lynx
lynx                           www/lynx       2.8.6rel.5   Text-based web browser
u-61127100184:/etc/httpd/users taka$ sudo port install lynx
--->  Fetching lynx
--->  Attempting to fetch lynx2.8.6rel.5.tar.bz2 from http://lynx.isc.org/current/
--->  Verifying checksum(s) for lynx
--->  Extracting lynx
--->  Applying patches to lynx
--->  Configuring lynx
--->  Building lynx with target all
--->  Staging lynx into destroot
--->  Installing lynx 2.8.6rel.5_1+ssl
--->  Activating lynx 2.8.6rel.5_1+ssl
--->  Cleaning lynx

Trac の設定 [Mac][Trac]

以下の条件下で設定。
- Subversion レポジトリ
  - /Users/user_name/repository/test-pro1
- Trac レポジトリ
  - /Users/user_name/project/trac

$ trac-admin /Users/user_name/project/trac/test-pro1 initenv
Creating a new Trac environment at /Users/user_name/project/trac/test-pro1

Trac will first ask a few questions about your environment 
in order to initalize and prepare the project database.

 Please enter the name of your project.
 This name will be used in page titles and descriptions.

Project Name [My Project]> TestPro1

 Please specify the connection string for the database to use.
 By default, a local SQLite database is created in the environment 
 directory. It is also possible to use an already existing 
 PostgreSQL database (check the Trac documentation for the exact 
 connection string syntax).

Database connection string [sqlite:db/trac.db]> 

 Please specify the type of version control system,
 By default, it will be svn.

 If you don't want to use Trac with version control integration, 
 choose the default here and don't specify a repository directory. 
 in the next question.

Repository type [svn]> 

 Please specify the absolute path to the version control 
 repository, or leave it blank to use Trac without a repository.
 You can also set the repository location later.

Path to repository [/path/to/repos]> /Users/user_name/repository/test-pro1

 Please enter location of Trac page templates.
 Default is the location of the site-wide templates installed with Trac.

Templates directory [/opt/local/share/trac/templates]> 

Creating and Initializing Project
 Installing default wiki pages
 /opt/local/share/trac/wiki-default/CamelCase => CamelCase
 /opt/local/share/trac/wiki-default/InterMapTxt => InterMapTxt
 /opt/local/share/trac/wiki-default/InterTrac => InterTrac
 /opt/local/share/trac/wiki-default/InterWiki => InterWiki
 /opt/local/share/trac/wiki-default/RecentChanges => RecentChanges
 /opt/local/share/trac/wiki-default/SandBox => SandBox
 /opt/local/share/trac/wiki-default/TitleIndex => TitleIndex
 /opt/local/share/trac/wiki-default/TracAccessibility => TracAccessibility
 /opt/local/share/trac/wiki-default/TracAdmin => TracAdmin
 /opt/local/share/trac/wiki-default/TracBackup => TracBackup
 /opt/local/share/trac/wiki-default/TracBrowser => TracBrowser
 /opt/local/share/trac/wiki-default/TracCgi => TracCgi
 /opt/local/share/trac/wiki-default/TracChangeset => TracChangeset
 /opt/local/share/trac/wiki-default/TracEnvironment => TracEnvironment
 /opt/local/share/trac/wiki-default/TracFastCgi => TracFastCgi
 /opt/local/share/trac/wiki-default/TracGuide => TracGuide
 /opt/local/share/trac/wiki-default/TracImport => TracImport
 /opt/local/share/trac/wiki-default/TracIni => TracIni
 /opt/local/share/trac/wiki-default/TracInstall => TracInstall
 /opt/local/share/trac/wiki-default/TracInterfaceCustomization => TracInterfaceCustomization
 /opt/local/share/trac/wiki-default/TracLinks => TracLinks
 /opt/local/share/trac/wiki-default/TracLogging => TracLogging
 /opt/local/share/trac/wiki-default/TracModPython => TracModPython
 /opt/local/share/trac/wiki-default/TracNotification => TracNotification
 /opt/local/share/trac/wiki-default/TracPermissions => TracPermissions
 /opt/local/share/trac/wiki-default/TracPlugins => TracPlugins
 /opt/local/share/trac/wiki-default/TracQuery => TracQuery
 /opt/local/share/trac/wiki-default/TracReports => TracReports
 /opt/local/share/trac/wiki-default/TracRevisionLog => TracRevisionLog
 /opt/local/share/trac/wiki-default/TracRoadmap => TracRoadmap
 /opt/local/share/trac/wiki-default/TracRss => TracRss
 /opt/local/share/trac/wiki-default/TracSearch => TracSearch
 /opt/local/share/trac/wiki-default/TracStandalone => TracStandalone
 /opt/local/share/trac/wiki-default/TracSupport => TracSupport
 /opt/local/share/trac/wiki-default/TracSyntaxColoring => TracSyntaxColoring
 /opt/local/share/trac/wiki-default/TracTickets => TracTickets
 /opt/local/share/trac/wiki-default/TracTicketsCustomFields => TracTicketsCustomFields
 /opt/local/share/trac/wiki-default/TracTimeline => TracTimeline
 /opt/local/share/trac/wiki-default/TracUnicode => TracUnicode
 /opt/local/share/trac/wiki-default/TracUpgrade => TracUpgrade
 /opt/local/share/trac/wiki-default/TracWiki => TracWiki
 /opt/local/share/trac/wiki-default/WikiDeletePage => WikiDeletePage
 /opt/local/share/trac/wiki-default/WikiFormatting => WikiFormatting
 /opt/local/share/trac/wiki-default/WikiHtml => WikiHtml
 /opt/local/share/trac/wiki-default/WikiMacros => WikiMacros
 /opt/local/share/trac/wiki-default/WikiNewPage => WikiNewPage
 /opt/local/share/trac/wiki-default/WikiPageNames => WikiPageNames
 /opt/local/share/trac/wiki-default/WikiProcessors => WikiProcessors
 /opt/local/share/trac/wiki-default/WikiRestructuredText => WikiRestructuredText
 /opt/local/share/trac/wiki-default/WikiRestructuredTextLinks => WikiRestructuredTextLinks
 /opt/local/share/trac/wiki-default/WikiStart => WikiStart
 Indexing repository
 [2]
---------------------------------------------------------------------
Project environment for 'TestPro1' created.

You may now configure the environment by editing the file:

  /Users/user_name/project/trac/test-pro1/conf/trac.ini

If you'd like to take this new project environment for a test drive,
try running the Trac standalone web server `tracd`:

  tracd --port 8000 /Users/user_name/project/trac/test-pro1

Then point your browser to http://localhost:8000/test-pro1.
There you can also browse the documentation for your installed
version of Trac, including information on further setup (such as
deploying Trac to a real web server).

The latest documentation can also always be found on the project
website:

  http://trac.edgewall.org/

Congratulations!

- 【特集】使ってる? Issue Tracking - trac 楽々ことはじめ (5) tracで管理するプロジェクトの設定 エンタープライズ マイコミジャーナル

を参考に設定を行う。

設定を終えて。
各ユーザ用の conf ファイルに設定を行って起動をかけたが、config エ
ラー。チェックしてみると、SetEnv が使えないと。
$ sudo /usr/sbin/apachectl configtest 
 Processing config directory: /private/etc/httpd/users/*.conf
 Processing config file: /private/etc/httpd/users/taka.conf
Syntax error on line 11 of /private/etc/httpd/users/taka.conf:
Invalid command 'SetEnv', perhaps mis-spelled or defined by a module not
included in the server configuration

有効にして再度チェック。
$ diff -u /etc/httpd/httpd.conf /etc/httpd/httpd.conf.20080103 
--- /etc/httpd/httpd.conf       2008-04-21 11:40:44.000000000 +0900
+++ /etc/httpd/httpd.conf.20080103      2008-01-03 08:22:35.000000000 +0900
@@ -203,7 +203,7 @@
 # Example:
 # LoadModule foo_module libexec/mod_foo.so
 #LoadModule vhost_alias_module libexec/httpd/mod_vhost_alias.so
-LoadModule env_module         libexec/httpd/mod_env.so
+#LoadModule env_module         libexec/httpd/mod_env.so
 LoadModule config_log_module  libexec/httpd/mod_log_config.so
 #LoadModule mime_magic_module  libexec/httpd/mod_mime_magic.so
 LoadModule mime_module        libexec/httpd/mod_mime.so
@@ -246,7 +246,7 @@
 #  [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]
 ClearModuleList
 #AddModule mod_vhost_alias.c
-AddModule mod_env.c
+#AddModule mod_env.c
 AddModule mod_log_config.c
 #AddModule mod_mime_magic.c
 AddModule mod_mime.c
$ sudo /usr/sbin/apachectl configtest
Processing config directory: /private/etc/httpd/users/*.conf
 Processing config file: /private/etc/httpd/users/user_name.conf
Syntax OK
OK。

再起動し、アクセスしてみる。
http://localhost/test-pro1
500 Internal Server Error (The user www requires read _and_ write permission to the database file /Users/user_name/project/trac/test-pro1/db/trac.db and the directory it is located in.)
だそうだ。

Web サーバの起動ユーザにも書き込みが行える権限を与えておく。

コンテンツの文字コードは、UTF-8 で扱っているのだが、Web のソースの
表示が文字化けしている。HTML の charset が charset=iso-8859-15 に
なっているからだが、どこで直す?

- <projectenv>/conf/trac.ini

に default_charset = iso-8859-15 の記載がる。これを
default_charset = utf-8 としておく。

また、元ネタも直しておかないとイチイチ手間。
うん?元ネタはどこだ?

■ 参考

- TracIni - アクセンスのおまけ - Trac

Tiger に MacPorts で trac を入れておく [Mac]

sudo port install trac
関連するパッケージをたくさん入れたようだが、ログを消してしまった。。

DokuWiki を使ってみる::サイドメニュー [Wiki]

追加したテンプレートは、
- - [[Sidebar Template j:insites]]
- plugin:indexmenu2 DokuWiki
の2つ。

- Sidebar Template j:insites
から
CURRENT VERSION (2006-11-06 including rc2006-09-22 and later)
をダウンロード。
$DokuWiki_HOME/lib/tpl
配下に展開する。
日付つきの長いディレクトリ名になるので、sidebar としておく。

DokuWiki の管理画面にアクセス。
[サイト設定]->[template] で先ほど展開した sidebar が選択できるよう
になっているので選択して設定を保存。

また、この[サイト設定]のページに、[テンプレート] がの目次が追加さ
れる。これは Sidebar テンプレートの設定用。以下の設定としておく。

- Enable the sidebar
  チェック
- Sidebar page name
  sidebar
- Layout
  inside
- Orientation
  right
- Show edit button (if user has edit permission for sidebar)
  チェック
- Edit button text
  edit sidebar

- plugin:indexmenu2 DokuWiki
から indexmenu プラグインをインストールしておく。

sidemenu の編集は、

http://<host name>/wiki/doku.php?id=sidebar
にアクセスして行う。

- プログラムを作ってます dokuwikiのセットアップ

2008-04-20 Sun

Ubuntu nkf を入れておく [Ubuntu]

と、入っていなかったんだ。。

$ sudo apt-get install nkf
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています                
Reading state information... 完了            
以下のパッケージが新たにインストールされます:
  nkf
アップグレード: 0 個、新規インストール: 1 個、削除: 0 個、保留: 0 個。
116kB のアーカイブを取得する必要があります。
展開後に追加で 295kB のディスク容量が消費されます。
取得:1 http://jp.archive.ubuntu.com gutsy/universe nkf 2.07-1 [116kB]
116kB を 1s で取得しました (103kB/s)
未選択パッケージ nkf を選択しています。
(データベースを読み込んでいます ... 現在 159858 個のファイルとディレクトリがインストールされています。)
(.../archives/nkf_2.07-1_i386.deb から) nkf を展開しています...
nkf (2.07-1) を設定しています ...

Ubuntu MeCab のインストールと UTF-8 化 [Ubuntu][MeCab]

$ sudo apt-get install mecab
[sudo] password for taka:
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています                
Reading state information... 完了            
以下の特別パッケージがインストールされます:
  libmecab1 mecab-jumandic mecab-utils
以下のパッケージが新たにインストールされます:
  libmecab1 mecab mecab-jumandic mecab-utils
アップグレード: 0 個、新規インストール: 4 個、削除: 0 個、保留: 0 個。
13.4MB のアーカイブを取得する必要があります。
展開後に追加で 81.0MB のディスク容量が消費されます。
続行しますか [Y/n]? Y
取得:1 http://jp.archive.ubuntu.com gutsy/universe libmecab1 0.95-1.1 [317kB]
取得:2 http://jp.archive.ubuntu.com gutsy/universe mecab-utils 0.95-1.1 [4954B]
取得:3 http://jp.archive.ubuntu.com gutsy/universe mecab-jumandic 5.1+20070304-1 [13.0MB]
取得:4 http://jp.archive.ubuntu.com gutsy/universe mecab 0.95-1.1 [111kB]
13.4MB を 2s で取得しました (5823kB/s)
未選択パッケージ libmecab1 を選択しています。
(データベースを読み込んでいます ... 現在 159778 個のファイルとディレクトリがインストールされています。)
(.../libmecab1_0.95-1.1_i386.deb から) libmecab1 を展開しています...
未選択パッケージ mecab-utils を選択しています。
(.../mecab-utils_0.95-1.1_i386.deb から) mecab-utils を展開しています...
未選択パッケージ mecab-jumandic を選択しています。
(.../mecab-jumandic_5.1+20070304-1_all.deb から) mecab-jumandic を展開しています...
未選択パッケージ mecab を選択しています。
(.../mecab_0.95-1.1_i386.deb から) mecab を展開しています...
libmecab1 (0.95-1.1) を設定しています ...

mecab-utils (0.95-1.1) を設定しています ...
mecab-jumandic (5.1+20070304-1) を設定しています ...
Compiling Juman dictionary for Mecab.  This takes long time...
reading /usr/share/mecab/dic/juman/unk.def ... 37
emitting double-array: 100% |###########################################| 
reading /usr/share/mecab/dic/juman/Rengo.csv ... 913
reading /usr/share/mecab/dic/juman/Suffix.csv ... 1163
reading /usr/share/mecab/dic/juman/Noun.keishiki.csv ... 10
reading /usr/share/mecab/dic/juman/Demonstrative.csv ... 76
reading /usr/share/mecab/dic/juman/Special.csv ... 124
reading /usr/share/mecab/dic/juman/ContentW.csv ... 483161
reading /usr/share/mecab/dic/juman/AuxV.csv ... 421
reading /usr/share/mecab/dic/juman/Noun.koyuu.csv ... 29805
reading /usr/share/mecab/dic/juman/Prefix.csv ... 75
reading /usr/share/mecab/dic/juman/Assert.csv ... 30
reading /usr/share/mecab/dic/juman/Postp.csv ... 104
reading /usr/share/mecab/dic/juman/Noun.suusi.csv ... 46
reading /usr/share/mecab/dic/juman/Noun.hukusi.csv ... 74
emitting double-array: 100% |###########################################| 
reading /usr/share/mecab/dic/juman/matrix.def ... 1509x1509
emitting matrix      : 100% |###########################################| 

done!

mecab (0.95-1.1) を設定しています ...
Compiling Juman dictionary for Mecab.  This takes long time...
reading /usr/share/mecab/dic/juman/unk.def ... 37
emitting double-array: 100% |###########################################| 
reading /usr/share/mecab/dic/juman/Rengo.csv ... 913
reading /usr/share/mecab/dic/juman/Suffix.csv ... 1163
reading /usr/share/mecab/dic/juman/Noun.keishiki.csv ... 10
reading /usr/share/mecab/dic/juman/Demonstrative.csv ... 76
reading /usr/share/mecab/dic/juman/Special.csv ... 124
reading /usr/share/mecab/dic/juman/ContentW.csv ... 483161
reading /usr/share/mecab/dic/juman/AuxV.csv ... 421
reading /usr/share/mecab/dic/juman/Noun.koyuu.csv ... 29805
reading /usr/share/mecab/dic/juman/Prefix.csv ... 75
reading /usr/share/mecab/dic/juman/Assert.csv ... 30
reading /usr/share/mecab/dic/juman/Postp.csv ... 104
reading /usr/share/mecab/dic/juman/Noun.suusi.csv ... 46
reading /usr/share/mecab/dic/juman/Noun.hukusi.csv ... 74
emitting double-array: 100% |###########################################| 
reading /usr/share/mecab/dic/juman/matrix.def ... 1509x1509
emitting matrix      : 100% |###########################################| 

done!

Processing triggers for libc6 ...
ldconfig deferred processing now taking place

$ sudo dpkg -l "*mecab*"
[sudo] password for taka:
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-f/Unpacked/Failed-cfg/Half-inst/t-aWait/T-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ 名前                バージョン       説明
+++-=====================-=====================-==========================================================
ii  libmecab1             0.95-1.1              Libraries of Mecab
ii  mecab                 0.95-1.1              Japanese morphological analysis system
un  mecab-ipadic          <なし>              (説明 (description) がありません)
ii  mecab-jumandic        5.1+20070304-1        Juman dictionary compiled for Mecab
ii  mecab-utils           0.95-1.1              Support programs of Mecab

jumandic は入っているのに、ipadic はインストールされなかったんだ。。
入れておく。
$ sudo apt-get install mecab-ipadic
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています                
Reading state information... 完了            
以下のパッケージが新たにインストールされます:
  mecab-ipadic
アップグレード: 0 個、新規インストール: 1 個、削除: 0 個、保留: 0 個。
11.9MB のアーカイブを取得する必要があります。
展開後に追加で 53.6MB のディスク容量が消費されます。
取得:1 http://jp.archive.ubuntu.com gutsy/multiverse mecab-ipadic 2.7.0+20060707-1 [11.9MB]
11.9MB を 2s で取得しました (5336kB/s) 
未選択パッケージ mecab-ipadic を選択しています。
(データベースを読み込んでいます ... 現在 159869 個のファイルとディレクトリがインストールされています。)
(.../mecab-ipadic_2.7.0+20060707-1_all.deb から) mecab-ipadic を展開しています...
mecab-ipadic (2.7.0+20060707-1) を設定しています ...
Compiling IPA dictionary for Mecab.  This takes long time...
reading /usr/share/mecab/dic/ipadic/unk.def ... 40
emitting double-array: 100% |###########################################| 
reading /usr/share/mecab/dic/ipadic/Noun.demonst.csv ... 115
reading /usr/share/mecab/dic/ipadic/Noun.proper.csv ... 26121
reading /usr/share/mecab/dic/ipadic/Noun.adjv.csv ... 3310
reading /usr/share/mecab/dic/ipadic/Suffix.csv ... 1294
reading /usr/share/mecab/dic/ipadic/Postp-col.csv ... 90
reading /usr/share/mecab/dic/ipadic/Noun.place.csv ... 67294
reading /usr/share/mecab/dic/ipadic/Adverb.csv ... 3024
reading /usr/share/mecab/dic/ipadic/Verb.csv ... 128946
reading /usr/share/mecab/dic/ipadic/Noun.org.csv ... 16596
reading /usr/share/mecab/dic/ipadic/Noun.adverbal.csv ... 772
reading /usr/share/mecab/dic/ipadic/Noun.others.csv ... 144
reading /usr/share/mecab/dic/ipadic/Adnominal.csv ... 135
reading /usr/share/mecab/dic/ipadic/Noun.number.csv ... 41
reading /usr/share/mecab/dic/ipadic/Conjunction.csv ... 170
reading /usr/share/mecab/dic/ipadic/Symbol.csv ... 198
reading /usr/share/mecab/dic/ipadic/Noun.csv ... 58793
reading /usr/share/mecab/dic/ipadic/Auxil.csv ... 199
reading /usr/share/mecab/dic/ipadic/Prefix.csv ... 206
reading /usr/share/mecab/dic/ipadic/Filler.csv ... 19
reading /usr/share/mecab/dic/ipadic/Noun.nai.csv ... 42
reading /usr/share/mecab/dic/ipadic/Postp.csv ... 146
reading /usr/share/mecab/dic/ipadic/Interjection.csv ... 252
reading /usr/share/mecab/dic/ipadic/Noun.verbal.csv ... 12041
reading /usr/share/mecab/dic/ipadic/Noun.name.csv ... 32174
reading /usr/share/mecab/dic/ipadic/Others.csv ... 2
reading /usr/share/mecab/dic/ipadic/Adj.csv ... 26790
emitting double-array: 100% |###########################################| 
reading /usr/share/mecab/dic/ipadic/matrix.def ... 1316x1316
emitting matrix      : 100% |###########################################| 

done!
と、この時点で、辞書が EUC-JP で入っている。

UTF-8 化する。

$ sudo su -
$ cd /usr/share/mecab/dic/ipadic/
# for i in *; do mv $i $i.euc; nkf -w $i.euc > $i; done

再構築。

$ sudo dpkg-reconfigure mecab-ipadic
Compiling IPA dictionary for Mecab.  This takes long time...
reading /usr/share/mecab/dic/ipadic/unk.def ... 40
emitting double-array: 100% |###########################################| 
reading /usr/share/mecab/dic/ipadic/Noun.demonst.csv ... 115
reading /usr/share/mecab/dic/ipadic/Noun.proper.csv ... 26121
reading /usr/share/mecab/dic/ipadic/Noun.adjv.csv ... 3310
reading /usr/share/mecab/dic/ipadic/Suffix.csv ... 1294
reading /usr/share/mecab/dic/ipadic/Postp-col.csv ... 90
reading /usr/share/mecab/dic/ipadic/Noun.place.csv ... 67294
reading /usr/share/mecab/dic/ipadic/Adverb.csv ... 3024
reading /usr/share/mecab/dic/ipadic/Verb.csv ... 128946
reading /usr/share/mecab/dic/ipadic/Noun.org.csv ... 16596
reading /usr/share/mecab/dic/ipadic/Noun.adverbal.csv ... 772
reading /usr/share/mecab/dic/ipadic/Noun.others.csv ... 144
reading /usr/share/mecab/dic/ipadic/Adnominal.csv ... 135
reading /usr/share/mecab/dic/ipadic/Noun.number.csv ... 41
reading /usr/share/mecab/dic/ipadic/Conjunction.csv ... 170
reading /usr/share/mecab/dic/ipadic/Symbol.csv ... 198
reading /usr/share/mecab/dic/ipadic/Noun.csv ... 58793
reading /usr/share/mecab/dic/ipadic/Auxil.csv ... 199
reading /usr/share/mecab/dic/ipadic/Prefix.csv ... 206
reading /usr/share/mecab/dic/ipadic/Filler.csv ... 19
reading /usr/share/mecab/dic/ipadic/Noun.nai.csv ... 42
reading /usr/share/mecab/dic/ipadic/Postp.csv ... 146
reading /usr/share/mecab/dic/ipadic/Interjection.csv ... 252
reading /usr/share/mecab/dic/ipadic/Noun.verbal.csv ... 12041
reading /usr/share/mecab/dic/ipadic/Noun.name.csv ... 32174
reading /usr/share/mecab/dic/ipadic/Others.csv ... 2
reading /usr/share/mecab/dic/ipadic/Adj.csv ... 26790
emitting double-array: 100% |###########################################| 
reading /usr/share/mecab/dic/ipadic/matrix.def ... 1316x1316
emitting matrix      : 100% |###########################################| 

done!

$ mecab -O wakati
上野発の夜行列車降りたときから青森駅は雪の中
上野 発 の 夜行 列車 降り た とき から 青森 駅 は 雪 の 中
^D
OK!
jumandic の方もやっておく。

と、再構築に失敗する。
$ sudo dpkg-reconfigure mecab-jumandic
Compiling Juman dictionary for Mecab.  This takes long time...
reading /usr/share/mecab/dic/juman/unk.def ... 37
emitting double-array: 100% |###########################################| 
reading /usr/share/mecab/dic/juman/Rengo.csv ... 913
reading /usr/share/mecab/dic/juman/Suffix.csv ... 1163
reading /usr/share/mecab/dic/juman/Noun.keishiki.csv ... 10
reading /usr/share/mecab/dic/juman/Demonstrative.csv ... 76
reading /usr/share/mecab/dic/juman/Special.csv ... 124
reading /usr/share/mecab/dic/juman/ContentW.csv ... 483161
reading /usr/share/mecab/dic/juman/AuxV.csv ... dictionary.cpp(194) [lid >= 0 && rid >= 0 && matrix.is_valid(lid, rid)] invalid ids are found lid=773 rid=8354
うーん、仕方ない。。
AuxV.csv だけ外して再構築しておく。

■ 参考
- SpamAssassin-JP 82 Re: SpamAssassin 3.1.0の日本語対応パッチ
- Trivial Journal 2.0(2006-10-10)

Ubuntu Apache2 PHP を利用可能に [Ubuntu]

$ sudo dpkg -l "apache*"
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-f/Unpacked/Failed-cfg/Half-inst/t-aWait/T-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ 名前                バージョン       説明
+++-=====================-=====================-==========================================================
un  apache-common         <なし>              (説明 (description) がありません)
un  apache-utils          <なし>              (説明 (description) がありません)
ii  apache2               2.2.4-3ubuntu0.1      Next generation, scalable, extendable web server
un  apache2-common        <なし>              (説明 (description) がありません)
ii  apache2-doc           2.2.4-3ubuntu0.1      documentation for apache2
un  apache2-mpm           <なし>              (説明 (description) がありません)
un  apache2-mpm-event     <なし>              (説明 (description) がありません)
un  apache2-mpm-perchild  <なし>              (説明 (description) がありません)
un  apache2-mpm-prefork   <なし>              (説明 (description) がありません)
un  apache2-mpm-threadpoo <なし>              (説明 (description) がありません)
ii  apache2-mpm-worker    2.2.4-3ubuntu0.1      High speed threaded model for Apache HTTPD
ii  apache2-utils         2.2.4-3ubuntu0.1      utility programs for webservers
ii  apache2.2-common      2.2.4-3ubuntu0.1      Next generation, scalable, extendable web server

$ sudo dpkg --get-selections | grep apache
apache2                                         install
apache2-doc                                     install
apache2-mpm-worker                              install
apache2-utils                                   install
apache2.2-common                                install

PHP を使えるようにしないといけないので、PHP のモジュールを入れなく
ては。さて何を入れるべき?
$ sudo dpkg -l "*php*"
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-f/Unpacked/Failed-cfg/Half-inst/t-aWait/T-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ 名前                バージョン       説明
+++-=====================-=====================-==========================================================
un  libapache2-mod-php4   <なし>              (説明 (description) がありません)
un  libapache2-mod-php5   <なし>              (説明 (description) がありません)
un  php5-cli              <なし>              (説明 (description) がありません)

libapache2-mod-php5 を入れておけばいいのかな?

$ sudo apt-get install libapache2-mod-php5
[sudo] password for user_name:
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています                
Reading state information... 完了            
以下の特別パッケージがインストールされます:
  apache2-mpm-prefork php5-common
提案パッケージ:
  php-pear
以下のパッケージは「削除」されます:
  apache2-mpm-worker
以下のパッケージが新たにインストールされます:
  apache2-mpm-prefork libapache2-mod-php5 php5-common
アップグレード: 0 個、新規インストール: 3 個、削除: 1 個、保留: 0 個。
3197kB のアーカイブを取得する必要があります。
展開後に追加で 6312kB のディスク容量が消費されます。
続行しますか [Y/n]? Y
取得:1 http://jp.archive.ubuntu.com gutsy-updates/main apache2-mpm-prefork 2.2.4-3ubuntu0.1 [435kB]
取得:2 http://jp.archive.ubuntu.com gutsy-updates/main php5-common 5.2.3-1ubuntu6.3 [219kB]
取得:3 http://jp.archive.ubuntu.com gutsy-updates/main libapache2-mod-php5 5.2.3-1ubuntu6.3 [2543kB]
3197kB を 0s で取得しました (3495kB/s) 
dpkg: apache2-mpm-worker: 依存関係に問題があります。しかし要求に従い削除しています:
 apache2 は以下に依存 (depends) します: apache2-mpm-worker (>= 2.2.4-3ubuntu0.1) | apache2-mpm-prefork (>= 2.2.4-3ubuntu0.1) | apache2-mpm-event (>= 2.2.4-3ubuntu0.1) ...しかし:
  パッケージ apache2-mpm-worker は削除されようとしています。
  パッケージ apache2-mpm-prefork はまだインストールされていません。
  パッケージ apache2-mpm-event はまだインストールされていません。
(データベースを読み込んでいます ... 現在 159735 個のファイルとディレクトリがインストールされています。)
apache2-mpm-worker を削除しています ...
 * Stopping web server apache2
   ...done.
未選択パッケージ apache2-mpm-prefork を選択しています。
(データベースを読み込んでいます ... 現在 159729 個のファイルとディレクトリがインストールされています。)
(.../apache2-mpm-prefork_2.2.4-3ubuntu0.1_i386.deb から) apache2-mpm-prefork を展開しています...
未選択パッケージ php5-common を選択しています。
(.../php5-common_5.2.3-1ubuntu6.3_i386.deb から) php5-common を展開しています...
未選択パッケージ libapache2-mod-php5 を選択しています。
(.../libapache2-mod-php5_5.2.3-1ubuntu6.3_i386.deb から) libapache2-mod-php5 を展開しています...
apache2-mpm-prefork (2.2.4-3ubuntu0.1) を設定しています ...
 * Starting web server apache2
   ...done.

php5-common (5.2.3-1ubuntu6.3) を設定しています ...
libapache2-mod-php5 (5.2.3-1ubuntu6.3) を設定しています ...

Creating config file /etc/php5/apache2/php.ini with new version
 * Reloading web server config apache2
6883
   ...done.

ちゃんと動いているか確認しておく。
php_info.php
<?php
phpinfo();
?>
問題ないようだ。

Ubuntu パッケージ管理コマンドの整理 [Ubuntu]

すぐ忘れるのでメモ。

- apt-cache search "keyword"
  パッケージの検索
- apt-cache show <pakage name>
  パッケージの説明、依存情報
- apt-get install <pakage name>
  パッケージ名を指定してインストール。
- apt-get -f install <pakage name>
  パッケージのインストール時に展開、設定が中断した時にやり直す。
- apt-get clean
  インストール後、ダウンロードしたファイルを削除する。
- apt-get [--purge] remove <pakage name>
  パッケージの削除。purge を指定した場合、設定ファイルも削除する(完全削除)。

- dpkg -l "パッケージ名パターン"
  パッケージ名パターンにパターンを指定する。
- dpkg -L <pakage name>
  パッケージがインストールをしたフィアル一覧
- dpkg --get-selections | grep "パッケージ名パターン"
  ホールドパッケージの確認。

DokuWiki を使ってみる [Wiki]

- wiki:ja:dokuwiki DokuWiki

- DokuWiki splitbrain.org

- wiki:install DokuWiki
にそってインストール。

と、その前に。
PHP で書かれているので、PHP 環境が必要となるので、準備しておく。

■ 日本語対応

そのままでも日本語対応はされているのだが、検索に問題あり。
- DokuWikiの日本語対応 DokuWiki@higuchi.com
をやっておく。

$ diff -u indexer.php indexer.php.org 
--- indexer.php 2008-04-20 23:54:09.000000000 +0900
+++ indexer.php.org     2008-04-11 23:12:55.000000000 +0900
@@ -6,9 +6,6 @@
  * @author     Andreas Gohr <andi@splitbrain.org>
  */
 
-
-  define ('PRE_TOKENIZER', '/usr/bin/mecab -O wakati');
-
   if(!defined('DOKU_INC')) define('DOKU_INC',fullpath(dirname(__FILE__).'/../').'/');
   require_once(DOKU_CONF.'dokuwiki.php');
   require_once(DOKU_INC.'inc/io.php');
@@ -53,9 +50,7 @@
  * @author Tom N Harris <tnharris@whoopdedo.org>
  */
 function wordlen($w){
-    //$l = strlen($w);
-
-    $l = utf8_strlen($w);
+    $l = strlen($w);
     // If left alone, all chinese "words" will get put into w3.idx
     // So the "length" of a "word" is faked
     if(preg_match('/'.IDX_ASIAN2.'/u',$w))
@@ -208,28 +203,6 @@
 
     list($page,$body) = $data;
     
-    if(function_exists(proc_open) && defined('PRE_TOKENIZER')) {
-         $dspec = array(
-            0 => array("pipe", "r"),
-            1 => array("pipe", "w"),
-            2 => array("file", "/dev/null", "w")
-        );
-        $process = proc_open(PRE_TOKENIZER, $dspec, $pipes);
-        if(is_resource($process)) {
-            stream_set_blocking($pipes[0], FALSE);
-            stream_set_blocking($pipes[1], FALSE);
-            fwrite($pipes[0], $body . "\n");
-            fclose($pipes[0]);
- 
-            $body = '';
-            while(!feof($pipes[1])) {
-                $body .= fgets($pipes[1], 32768);
-            }
-            fclose($pipes[1]);
-            proc_close($process);
-        }
-    }
-
     $body   = strtr($body, "\r\n\t", '   ');
     $tokens = explode(' ', $body);
     $tokens = array_count_values($tokens);   // count the frequency of each token
@@ -499,9 +472,7 @@
             $wild |= 2;
             $wlen -= 1;
         }
-        //if ($wlen < 3 && $wild == 0 && !is_numeric($xword)) continue;
-       if (preg_match('/[^0-9A-Za-z]/u', $string) && $wlen < 3 && $wild == 0 && !is_numeric($xword)) continue;-
+        if ($wlen < 3 && $wild == 0 && !is_numeric($xword)) continue;
         if(!isset($tokens[$xword])){
             $tokenlength[$wlen][] = $xword;
         }
@@ -640,34 +611,12 @@
  */
 function idx_tokenizer($string,&$stopwords,$wc=false){
     $words = array();
-
-    if(function_exists(proc_open) && defined('PRE_TOKENIZER')) {
-        $dspec = array(
-            0 => array("pipe", "r"),
-            1 => array("pipe", "w"),
-            2 => array("file", "/dev/null", "w")
-        );
-        $process = proc_open(PRE_TOKENIZER, $dspec, $pipes);
-        if(is_resource($process)) {
-            stream_set_blocking($pipes[0], FALSE);
-            stream_set_blocking($pipes[1], FALSE);
-            fwrite($pipes[0], $string . "\n");
-            fclose($pipes[0]);
-            $string = '';
-            while(!feof($pipes[1])) {
-                $string .= fgets($pipes[1], 32768);
-            }
-            fclose($pipes[1]);
-            proc_close($process);
-        }
-    }
-
     $wc = ($wc) ? '' : $wc = '\*';
 
     if(preg_match('/[^0-9A-Za-z]/u', $string)){
         // handle asian chars as single words (may fail on older PHP version)
-        // $asia = @preg_replace('/('.IDX_ASIAN.')/u',' \1 ',$string);
-        // if(!is_null($asia)) $string = $asia; //recover from regexp failure
+        $asia = @preg_replace('/('.IDX_ASIAN.')/u',' \1 ',$string);
+        if(!is_null($asia)) $string = $asia; //recover from regexp failure
 
         $arr = explode(' ', utf8_stripspecials($string,' ','\._\-:'.$wc));
         foreach ($arr as $w) {

2008-04-19 Sat

オープンソースのパッケージをまとめて簡単にインストール BitNami [BitNami]

オールインワンってやつ。
環境によっては、導入し辛いものも関連するアプリを含めてまとめてイン
ストール。ディレクトリ配下で全て完結するので他の環境に影響を与えな
いところがよい。パッケージ個別で各アプリをもってしまう(例えば
Apache が一杯。。。のような)ので、冗長と言えば冗長で、リソースの無
駄使いではあるが、独立しており、何よりてっとり早いところが利点であ
る。

- BitNami: Open Source. Simplified

とりあえず iBook G4 Panther に入れるのをてこずった Trac を Ubuntu
で上げておく。

Aptana の入力でバックスラッシュが円マークになってしまう [Aptana]

あれっ?バックスラッシュが円マークになってしまう・・・
何か設定で解決できないのだろうか・・・
取りあえず、Option + バックスラッシュキー で入力する。

Aptana に Mylyn を入れておく [Aptana]

Aptana は v3.2 Callisto なので、v3.2 系の Mylyn を探す。
以下のサイトでダウンロード可能。
- Eclipse Mylyn Download Archives

ダウンロードしたファイルを
[ヘルプ]->[ソフトウェア更新]->[検索およびインストール]
の[インストール/更新]ダイアログにて、[インストールする新規フィー
チャーを検索]を選択。
[次へ]で開く"更新アクセス先サイト"で[新規ローカル・サイト]をクリッ
クし、ダウンロードした zip ファイルを解凍したディレクトリを選択。

インストールするフィーチャーの選択にて、
- Mylyn ブリッジ: Java 開発
- MyLyn ブリッジ: Eclipse SDK
は外しておく。
JDT を入れる必要が出てくるため。

あと、この後に、プラグイン・マネージャーにある [Aptana RadRails
Mylyn Connector] を入れておく。

iBook G4 Panther に trac を入れておく [Mac][trac]

MacPorts で入れようとしたが、途中 trac が依存している(?)ライブラリの
インストールに失敗してしまい、入ってくれない。

- インタアクト株式会社--業務内容--公開資料

こちらから trac-0.10.4-ja-1 をダウンロードして、

$ python setup.py install
で入れてみた。

/Library/Frameworks/Python.framework/Versions/2.4/bin
にパスを通しておく。

$ trac-admin /Users/trac/ruby_work/trunk initenv
でインストールを始める。

早速エラー。
Creating and Initializing Project
Failed to create environment. global name 'sqlite' is not defined
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/trac/scripts/admin.py", line 613, in do_initenv
    options=options)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/trac/env.py", line 145, in __init__
    self.create(options)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/trac/env.py", line 250, in create    DatabaseManager(self).init_db()
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/trac/db/api.py", line 71, in init_db
    connector.init_db(**args)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/trac/db/sqlite_backend.py", line 121, in init_db
    cnx = sqlite.connect(path, timeout=int(params.get('timeout', 10000)))
NameError: global name 'sqlite' is not defined
Failed to initialize environment. 1
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/trac/scripts/admin.py", line 617, in do_initenv
    sys.exit(1)
SystemExit: 1

$ sudo port install py-sqlite

2008-04-18 Fri

iBook G4 Panther に MacPorts をインストール [Mac]

Panther では fink を使っていたのだが、MacPorts を使うことに。
- The MacPorts Project -- Download & Installation
よかった。Panther 用も提供されているんだ。。

で、インストールドライブを MacOSX ドライブでない別のドライブにした
ところ、

$ sudo port -d selfupdate
can't find package macports
    while executing
"package require macports"
    (file "/opt/local/bin/port" line 42)
のエラーに遭遇。
$ ls -la /opt
lrwxr-xr-x  1 root  admin  20 19  4 00:28 /opt -> /Volumes/Another/opt
環境変数含めて問題はずなんだが・・・

もしやと思い、インストールを MacOSX ドライブにして再度入れ直す。
問題なし。。

$ sudo port -d selfupdate
$ sudo port -d sync
しておく。

2008-04-17 Thu

2008-04-16 Wed

Web サイトを作成するスタンダードを知る [Design]

スタンダードってあるのか?ということで、何かよいノウハウがあればと
購入。ふーむ、確かにと思わせる内容。
初心者の方に渡して独習してもらうのに最適な本じゃないかな。

Webデザイン Illustrator&Photoshop (デジハリデザインスクールシリーズ)
デジタルハリウッド
技術評論社
売り上げランキング: 21194


今日は Illustrator でワイヤーフレームを作成し、Photoshop に移った
ところまで。Illustrator も、Photoshop も基本的には初めて触るようなもの。。
しかし、Photoshop でのトリミングにはビックリした。さすがだなぁ。

2008-04-15 Tue

Aptana で EUC-JP を扱う [Aptana]

エンコードのプルダウンに出てこないので、使えないのか?と思いきや、
[その他]に直接 EUC-JP と書けば使えた。。

2008-04-14 Mon

Aptana で Subversion と連携 Subversive [Aptana]

Aptana は今現在 Eclipse 3.2 ベースなので、
- Eclipse Subversive - Downloads
を使用することはできない。
ので、
- Polarion Community
を使用する。

- JDT Core Component
が必須ということで要求され先に進めなくなる。
はて?入れようと思ったのだが、JDT を入れればいいんだよね??入れ方
がよくわからん。。
Subversive を使おうと思っていたのだが、仕方ないので、Subclipse を
使うことにする。

2008-04-19 追記

[プラグイン・マネージャー]を使って入れると、何のことはない、アッサ
リはいる。。
[プラグイン・マネージャー]は、[ウィンドウ]->[ビューの表示]->[その
他]から、ビューの表示ダイアログを開き、 [Aptana Standard Views]の
階層化にあるのでそれをダブルクリック。

2008-04-13 Sun

JavaScript イベントハンドラ [JavaScript]

- イベントハンドラ

Aptana のプロジェクト [Aptana]

Web サイトをつくる時には、新規のプロジェクトで、"Aptana
Projects"->"Default Web Project" を選んだ方がよさげ。
プロジェクトの新規作成時に"JavaScript ライブラリーのインポート機能
"にて、サード・パーティのライブラリのインポートも合わせて可能。

Java開発者のための Ajax実践開発入門を読む3 [JavaScript]

4章に入る。

これまで情報としては確認していたが、今回実際自分の手で初めて Ajax
を試してみた。。。かなり時代遅れだが。。

・XMLHttpRequest.onreadystatechange コールバック関数
・XMLHttpRequest.readyState
がミソなんだ。

読み込みデータは、
・普通のテキストファイル (XMLHttpRequest.responseText)
・XML ファイル (XMLHttpRequest.responseXML)
・JSON ファイル (XMLHttpRequest.responseText)
で試してみる。XML が扱い易い。

5章に入る。

復習。

Function クラスで定義されている apply メソッドは、引数に指定されて
たスコープと引数で自分自身を実行する。JavaScript によるクラスの継
承を使う際に利用される。

Wi-Fi 電波で位置がわかる PlaceEngine [Tool]

- PlaceEngine
  via PlaceEngineをrubyから使う? - Okiraku Programming

2008-04-06 Sun

2009 : 01 02 03 04 05 06 07 08 09 10 11 12
2008 : 01 02 03 04 05 06 07 08 09 10 11 12
2007 : 01 02 03 04 05 06 07 08 09 10 11 12
2006 : 01 02 03 04 05 06 07 08 09 10 11 12
2005 : 01 02 03 04 05 06 07 08 09 10 11 12
2004 : 01 02 03 04 05 06 07 08 09 10 11 12

最終更新時間: 2009-01-02 23:56