前の月 / 次の月 / 最新

~matubara/ChangeLog / 2006-07移動しました

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 31

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

2006-07-31 Mon

International Phonetic Alphabet (IPA) Chart in Unicode and XHTML/CSS [lx][ui][net]

<http://www.linguiste.org/phonetics/ipa/chart/>
IPA の一覧と簡易入力。
適当な転写+選択式のインクリメンタル検索入力ができるといいんだけど。

2006-07-30 Sun

Hindi NLP resources [hindi]

Web上リソース Hindi web-based computational linguistic resources
本場 Resource Center for Indian Language Technology Solutions (CFILT)
言語学・語学 Hindi Links

Wiktionaryも1000語くらいはあるっぽい。

番外 Link Grammar Language in India

国会議事録 英語 ヒンディー(PDF)

2006-07-29 Sat

The Scala Programming Language [programming][java][net]

<http://scala.epfl.ch/>
yet another JVM language

OOな継承と総称プログラミングができて、
関数型なパタンマッチとカリー化ができて、
closure と 中置記法ができて、
Java VM と .NET で走るバイナリにコンパイルできる。
Java のクラスファイルとは自由にリンクできる。

object Test {
  def main(args: Array[String]) = {
    Console.println("Hello, World!")
  }
}

参考 [[http://jijixi.azito.com/cgi-bin/diary/index.rb?date=20060410]]

fstab の上位互換としての autofs [linux]

shared          -user,rw,uid=1000,gid=100  \
/ -fstype=auto,iocharset=sjis :/dev/hda4 \
/ -fstype=cofs :cofs0 
と書くと、/dev/hda4 -> shared
もしくは、cofs0 -> shared
というように、同じマウントポイントに対して、複数の候補を割り当てられる。

2006-07-28 Fri

CMD から 実行可能スクリプトを実行する [win][howto][linux]

…ことはできないので、
.bat を付加した名前でバッチファイルを作る。
たとえば fairlatex.rb なら、

@echo off
e:
ruby e:\mydoc\bin\fairlatex.rb %1 %2 %3 %4 %5
これをパスの通ったディレクトリに置けば、fairlatex.rb という名前で実行できる。

日本語フォントの埋め込み [latex][howto]

$TEXMF/fonts/truetype に msgothic.ttc, msmincho.ttc をコピーする。

(普通は必要ないが)
$TEXMF/web2c/texmf.cnf

-SYSTTF = c:/{winnt,windows,winnt35}/fonts//;c:/usr/sysfonts//
+SYSTTF = c:/{winnt,windows,windows.1,winnt35}/fonts//;c:/usr/sysfonts//

$TEXMF/fonts/map/dvipdfm/base/cid-x.map
-% rml   H Ryumin-Light
-% gbm   H GothicBBB-Medium
-% rmlv  V Ryumin-Light
-% gbmv  V GothicBBB-Medium
+
+% rml   H Ryumin-Light
+% gbm   H GothicBBB-Medium
+% rmlv  V Ryumin-Light
+% gbmv  V GothicBBB-Medium
+
+rml  H msmincho.ttc
+gbm  H msgothic.ttc
+rmlv V msmincho.ttc
+gbmv V msgothic.ttc

フォントの集中管理 - ptetex Wiki
PDFの作り方 - TeX Wiki

2006-07-27 Thu

Jacques Garrigue -- Home Page [programming][net]

<http://www.math.nagoya-u.ac.jp/~garrigue/home-j.html>
講義資料充実しています。

MultiMap [java]

generics な継承とか。

import java.util.*;

interface MultiMap<K,V> extends Map<K,Set<V>>
{
    boolean put(K key, V value);
}

class MultiHashMap<K,V> extends HashMap<K,Set<V>> implements MultiMap<K,V>
{
    public boolean put(K key, V value)
    {
Set<V> s = get(key);
if ( s == null ) {
    s = new HashSet<V>();
    put(key, s);
}
return s.add(value);
    }
}

MultiMap<String,String> mmap = new MultiHashMap<String, String>();
mmap.put("ABC", "Abc");
mmap.put("ABC", "aBc");
mmap.put("ABC", "abC");
mmap.put("ABC", "Abc");
System.out.println(mmap);    //  ==>   {ABC=[aBc, abC, Abc]}

Vの配列を作ろうとして若干はまったので、メモ。

Java の enum [java]

って、思っていたより強力。

switch とか iterator とか使えるし、

enum Color
{
    RED,
    BLUE;
}

public class Test
{
    public static void main(String[] args)
    {
Color c = Color.RED;
String s="s";
switch (c) {
case RED:
    break;
case BLUE:
    s = "a";
    break;
default:
    ;
}

System.out.println(s + c);

for ( Color cc : Color.values() )
    System.out.println(cc);
    }
}

実は class だし。
enum Color
{
    RED (255,   0,   0),
    BLUE(  0,   0, 255);

    private final int r;
    private final int g;
    private final int b;
    Color(int r, int g, int b) 
    {
this.r = r;
this.g = g;
this.b = b;
    }

    public double red()   { return (double)r/255; }
    public double green() { return (double)g/255; }
    public double blue()  { return (double)b/255; }
}

Enums

2006-07-26 Wed

Java の switch 文 [programming]

「あらゆる分岐を、メソッドのオーバーロードに帰着させる」というのは、
オブジェクト指向設計の「標準形」のひとつだと思う。

switch 文

void proc(var variable) {
  switch ( variable ) {
  case c1:
    ...
    break;
  case c2:
    ...
    break;
  }
}
は、
interface Procedure{
  public void proc();
}
class C1 implements Procedure {
  void proc(){ ... }
}
class C2 implements Procedure {
  void proc(){ }
}

Procedure p = ...;
p.proc();
とか。

しかし、Javaのメソッドのオーバーロードによる分岐はあまり強力ではない。
(強力というのは、その構文だけでほとんど何でもできちゃうということ
ocaml,haskellの引数パターンマッチの方がはるかに便利っぽい。

もっとオブジェクト指向的な話では、
double dispatch、つまり、C1,C2 の型情報によって自動的な切り替えが起こるのと同じように(そして同時に)、
Procedure1とかProcedure2 に関して切り替えが起こってほしい、というのを実現した、
Visitor patternがある。

Keith Price Bibliography Annotated Computer Vision Bibliography [vis][net]

<http://iris.usc.edu/Vision-Notes/bibliography/contents.html>
Computer Vision を中心とした関連分野文献へのポインタ。

2006-07-25 Tue

Elementary, ... Googleで「はらへった」と検索するとピザが届くようにするまで [perl][net]

<http://e8y.net/blog/2006/07/25/p126.html>
Plagger のプラグイン作成事例として、とても分かりやすい。
何気なく使われている、Filterのあわせ技に注目。

Cygwin で cron [win][linux][howto][net]

<http://shooting-star.myhome.cx/cygwin/cron.html>
Windows のサービスとして、cron を登録する。
登録するためのプログラムはCygwinに含まれている。

$ cygrunsrv -I cron -d "CYGWIN cron" \
 -p /usr/sbin/cron \
 -a -D -e "CYGWIN=ntsec nosmbntsec"

CVS vs. SVN [svn]

 cvs -d repos get fltk svn co repos/trunk fltk

 cvs update -dP svn update

 cvs add name svn add name

 rm -f name svn remove name
 cvs remove name

 mv name newname svn move name newname
 cvs remove name
 cvs add newname

 cvs commit svn commit

 cvs diff svn diff

 cvs -d repos get -r foo fltk svn co repos/branches/foo fltk
                        svn co repos/releases/foo fltk

 cvs update -r foo svn switch repos/branches/foo
                svn switch repos/releases/foo

 cvs tag foo svn copy repos/releases/foo

 cvs tag -b foo svn copy repos/branches/foo


repos = username@cvs.sf.net:/cvsroot/fltk for CVS and
https://svn.easysw.com/public/fltk/fltk for Subversion.

via Subversion Quick-Start Guide - Fast Light Toolkit (FLTK)

Language Observatory [lx][ethno][net]

<http://gii2.nagaokaut.ac.jp/gii/blog/lopdiary.php?blogid=8>
多言語データの基盤整備・分析を行う「言語天文台」プロジェクト。

2006-07-24 Mon

非Administrator生活を快適に過ごすテクニック [howto][win]

<http://eside.homeip.net/columns/non-admin.html>
とりあえず、ユーザー切り替えの代わりに runas コマンドを使うことからはじめよう。

2006-07-22 Sat

Java の配列の型安全性の穴 [java]

public class Subarray
{
    public static void main(String[] args)
    {
Integer[] i = new Integer[1];
// i[0] = new String(""); はもちろん通らないけれども、
// 安全なはずの「上位型へのキャスト」を使うと ...
( (Object[])i )[0] = new String("");
    }
}

flatline's Wiki for memo - JavaのGenerics
A <: B は、「AはBのsubtype」と読む。

IBM dW : Java technology : Javaの理論と実践: Generics、了解! - Japan

2006-07-21 Fri

Intel C++ Compiler for Linux* - Intel Software Network [cxx][net]

<http://www.intel.com/cd/software/products/asmo-na/eng/compilers/clin/219856.htm>

Intel C++ Compiler for Linux*Free Non-commercial Unsupported Compiler

icc は C++ のソースのみ、 C++ のライブラリとのリンクする。
icpc は いつも(Cのソースでも) C++ のライブラリとリンクする。

2006-07-20 Thu

The Computer Language Shootout Benchmarks [programming][net]

<http://shootout.alioth.debian.org/>
言語のベンチマーク。

2006-07-19 Wed

Computer Vision Source Code [vis][net]

<http://www.cs.cmu.edu/~cil/v-source.html>

2006-07-18 Tue

Copy constructor and implicit type conversion [cxx]

#include <iostream>

class Complex
{
private:
  const double re;
  const double im;
public:
  Complex(double r = 0.0, double i = 0.0)
    : re(r), im(i)
  {
    std::cout << "constructor: " << *this << std::endl;
  }
  Complex(const Complex& c)
    : re(c.re), im(c.im)
  {
    std::cout << "copy constructor: " << *this << std::endl;
  }

  ~Complex()
  {}

  Complex operator=(const Complex& c) // field が immutable だと、デフォルトの代入はできない
  {
    return Complex(c);
  }

  friend Complex operator+(const Complex&, const Complex&);
  friend std::ostream& operator<<(std::ostream& s, const Complex&);
};
Complex operator+(const Complex& c1, const Complex& c2) // const .. & がないと
{                               // copy constructor が呼ばれる
  return Complex(c1.re + c2.re, c1.im + c2.im);
}
std::ostream& operator<<(std::ostream& s, const Complex& c)
{
  return s << "(" << c.re << ", " << c.im << ")@" << &c;
}

template<class T> T add(const T& a, const T& b)
{
  return a + b;
}


int main()
{
  double x = add(10, 20);
  std::cout << x << std::endl;

  Complex c1(10.0, -10.0);
  Complex c2(-2);

  std::cout << "add<>()" << std::endl;
  Complex c3(add(c1, c2));     // same to add<Complex>(c1, c2)
  std::cout << c3 << std::endl << std::endl;
 
  std::cout << "operator+()" << std::endl;
  Complex c4(c1 + c3);
  std::cout << c4 << std::endl << std::endl;

  std::cout << "operator+(), substitution" << std::endl;
  Complex c5 = c2 + c4;
  Complex c6;
  c6 = c5;
  std::cout << c5 << std::endl << std::endl;

  c6 = 0;
  add<Complex>(1, 2);

  return 0;
}

実行結果

30
constructor: (10, -10)@0x22ccb0
constructor: (-2, 0)@0x22cca0
add<>()
constructor: (8, -10)@0x22cc90
(8, -10)@0x22cc90

operator+()
constructor: (18, -20)@0x22cc80
(18, -20)@0x22cc80

operator+(), substitution
constructor: (16, -20)@0x22cc70
constructor: (0, 0)@0x22cc60
copy constructor: (16, -20)@0x22cc50
(16, -20)@0x22cc70

constructor: (0, 0)@0x22cc30
copy constructor: (0, 0)@0x22cc40
constructor: (2, 0)@0x22cc10
constructor: (1, 0)@0x22cc00
constructor: (3, 0)@0x22cc20


operator+を外で2項関数として定義する理由は、
第一引数に関して暗黙の型変換を有効にするため。
ようするに、
Complex(0,1)+1 も
1+Complex(0,1) も書けるようにするため。

上の方はどうでもよくて、面白いのは最後のところ。
引数のデフォルト値と演算子オーバーロードができると、こんなこともできるんですね...

Pragmas - perldoc.perl.org [perl][net]

<http://perldoc.perl.org/index-pragmas.html>
Perl の基本構文をオーバーライドするプラグマ。

演算子オーバーロードもあった。
(via T先輩のソース)

#! /usr/bin/env perl
use warnings;
use strict;

package Complex;
use overload
  '+'  => sub{ Complex->new(map $_[0]->{$_} + $_[1]->{$_}, qw/r i/)},
  '""' => sub{ "($_[0]->{r}, $_[0]->{i})" };

sub new($;$$){
  my($class,$r,$i) = @_;
  $r ||= 0;
  $i ||= 0;
  return bless {r => $r, i => $i}, $class;
}

1;

my $c = Complex->new(10) + Complex->new(0, 10);
print "$c\n";

MIT OpenCourseWare | Mathematics | 18.06 Linear Algebra, Spring 2005 | Video Lectures [math][net]

<http://ocw.mit.edu/OcwWeb/Mathematics/18-06Spring-2005/VideoLectures/index.htm>
1回目だけ視聴。
Row picture / Column picture ... 名前重要、ですね。

via 少年老い易く学成り難し

2006-07-17 Mon

Let's Boost [cxx][net]

<http://www.kmonos.net/alang/boost/>
STL の次は Boost。

STLもまだまだ勉強中だけど...
+STLのページ
+Standard Template Library プログラミング on the Web

+SGI - STL Programmer's Guide

boost::property_mapに書かれている concept というのは、Java の interface に近いのかな。

A Taxonomy of Finite Automata Minimization Algorithms - Watson (ResearchIndex) [string][net]

<http://citeseer.ist.psu.edu/35617.html>
オートマトンの最小化も、奥が深い。

import & checkout -- Subversion FAQ [svn][howto][net]

すでにあるディレクトリを作業ディレクトリとして継続して使いたいときの import (相当の方法)
<http://subversion.tigris.org/faq.html#in-place-import>

     # svn mkdir file:///root/svn-repository/etc \
 -m "Make a directory in the repository to correspond to /etc"
     # cd /etc
     # svn checkout file:///root/svn-repository/etc .
     # svn add apache samba alsa X11
     # svn commit -m "Initial version of my config files"

Oliver Strunk -- The Elements of Style - Index [lx][net]

<http://orwell.ru/library/others/style/index.htm>

2006-07-16 Sun

ブロック要素をセンタリング [markup][howto]

<table align=center>

のような効果が欲しいとき使えるCSS。

table タグは使いたくないけれど、table タグの効果が欲しい。
ということで、
水平方向のmargin:autoと、
display:table を組み合わせる。

<h1 style="border:1px black solid;   display:table;   margin: 0 auto;">test</h1>

水平方向の margin:auto は、LaTeX の\hfill と同様に解釈される。
display:table は、bounding box のサイズが「最小」になる。

2006-07-12 Wed

kagiPDF [latex]

数式・画像を含む LaTeX を出力できる、日本語対応の reStructuredText

基本的には、rst2latex.py のための小さなラッパー。

nkfLV が必要。

2006-07-11 Tue

カーネル法の最前線 ― SVM, 非線形データ解析, 構造化データ [learning][net]

<http://www.ism.ac.jp/~fukumizu/ISM_lecture_2006/>
福水先生による。

2006-07-10 Mon

CMU vs. Palmkit vs. Waterloo SLM Toolkit [lm]

+CMU
+Waterloo
+Palmkit

Palmkit のソースが一番丁寧に書かれていると思う。

waterloo は C++ 移植だけれども、基本的に CMU そのまんまという感じがする。
ただし、中国語・日本語への対応が追加されているとか。

性能は…やっぱりベンチマークとらないと。

Dave Brondsema's Blog - Using Cygwin, Keychain, SVN+SSH and TortoiseSVN in Windows [svn][net]

<http://brondsema.net/blog/index.php/2005/05/03/using_cygwin_keychain_svn_ssh_and_tortoi>

c:\Cygwin\bin\bash.exe --login -c "/usr/bin/ssh %*"

Statistical Natural Language Processing Reading List [nlp][list][net]

<http://ciir.cs.umass.edu/~fuchun/readlist_all/readlist/index.html>
mirror?

2006-07-09 Sun

計画数学第二 (東京工業大学・情報科学科) [math][opt][net]

<http://research.nii.ac.jp/~uno/mathpro.htm>
線形、非線形、組み合わせ、ネットワークフロー

2006-07-08 Sat

日本語速記 [ui]

日本語の音声を、キーボードを使って書き取る(人間音声認識)をやる方法。

1. 適当な文節区切りで、ローマ字うち。変換は(できる環境であっても)しない。
2. sumibiに貼りつけ or Emacs のsumibi-mode
3. 変換間違いを修正。

オンラインでやるのは 1. だけなので、速い。

以前、kakasi 使ってこの方法をやろうとしたけれど、
3. をやるUIがないので、削除追加が面倒すぎた。


ほんとうはカナで打ってやった方が速いかも。
(できないけど)

sumibi のレスポンスがもっと良ければ、実用的。
というか、入力という基本的 UI がネットワークインフラを
つねに要求しているというのが、困る。

文脈情報も取り込んだ、柔軟な変換の実現 <== Webをコーパスとする <== 機械学習的アプローチ

ふつうに、ローカルでデコードすればいいんじゃない?
学習には時間がかかるにしても、
デコードはそれほど重くないと思うのだけれど。

スペリング修正もあわせてやってくれるとありがたい。

svn switch [svn][net]

<http://subversion.bluegate.org/doc/re28.html>
リポジトリが引っ越したときの、.svn の中身だけの書き換え。
[2006-06-26-1]代替

例えばホスト名が変更されたり、URLスキーマが 変更されたり、リポジトリパスURLの先頭部分のどこかが変更されるような場合もあるでしょう。
新しい作業コピーをチェックアウトするよりも、svn switchを使って作業コピーの中に記録されているすべての URL の 先頭部分を一括して 「書き換えて」 やるほうが良いでしょう。
この置換には --relocateオプションを使ってください。

SLM Toolkit による N-gram 頻度の計数 [nlp][lm]

SLM Toolkit には、N-gram 頻度計数のコマンドとフォーマットがある。
(idngram, n=2,3)
CMU の方は チェインハッシュ、
Pamkit は内部ハッシュを使っている。

そのうちベンチマークしてみよう。

test.text

a b r a c a d a b r a


test.idngram (ascii)

1 2 5 2
1 3 1 1
1 4 1 1
2 5 1 2
3 1 4 1
4 1 2 1
5 1 3 1


言語モデル作成キットとして以外の使い道もあるよ、と。

Makefile for launching Palmkit [nlp][lm]

Palmkit (= CMU-Cambridge SLM Toolkit) は、
各ステップの処理が別コマンドになっていて、
ユーザーが好きなスクリプトで走らせられるようになっている。

評価実験をするときには、色々な訓練データを使ってやりたい。
新規データの追加をしたときには、それを検出してLMを生成して欲しい。

ということで make

まだ訓練部分しかないですが。

本当は、1つの訓練データに対してオプションを変えて実験をするときに、
再利用可能な途中結果を利用できるようにしたい。

##########################################
# commands
TX2FQ = text2wfreq
FQ2VC = wfreq2vocab
TX2ID = text2idngram
ID2LM = idngram2lm
EVALLM = evallm

############################################
# data directories
TRAINDIRS = train t1 t2
DEVELDIR = devel
TESTDIR  = test

# files
TEXT := $(foreach dir,$(TRAINDIRS),$(wildcard $(dir)/*.text))

.SUFFIXES: .text .wfreq .idngram .arpa

all: train devel

############################################
train: $(ARPA)

%.arpa: %.idngram %.vocab
$(ID2LM) -vocab $*.vocab -idngram $< -arpa $@
%.idngram: %.text %.vocab
$(TX2ID) -vocab $*.vocab $< $@
%.vocab: %.wfreq
$(FQ2VC) $< $@
%.wfreq: %.text
$(TX2FQ) $< $@

############################################
develop: train


############################################
test: train

ウィンドウズのDOSコマンド(Hishidama's Windows DOS-command Memo) [win][net]

<http://www.ne.jp/asahi/hishidama/home/tech/windows/command.html>

net start

動いているサービスの一覧を表示する。UNIXのpsに近い?
管理ツールで表示される一覧において、状態が「開始」となっているもの。
net start サービス名

サービスを起動する。
管理ツールで名前をクリックし、左側のメニューから「サービスの開始」をクリックするのと同じ。

2006-07-06 Thu

2006-07-05 Wed

let me see... [lx][ui][net]

<http://openlab.jp/edict/letmesee/index.html.ja>
CGI動作の辞書ビューア。
データはFPWBOOKが使える。

作業は以下のとおり。

+ プログラムのインストール
/var/www/localhost/cgi-bin 以下に置く。
/etc/lighttpd/lighttpd.conf
/etc/lighttpd/mod_cgi.conf
で、index.rb を Index として扱うようにする。

+ 辞書データ
FPWBOOK からダウンロード。
unzip で展開。
できたディレクトリを /usr/share/dicts 以下に置く。

/var/www/localhost/cgi-bin/letmesee/letmesee.conf
で、辞書ファイルの置き場とか、テーマを設定。

2006-07-04 Tue

Gentoo Linux Documentation -- Gentoo Linux GCC Upgrade Guide [gentoo][net]

<http://www.gentoo.org/doc/en/gcc-upgrading.xml>
gcc のバージョン変えたときは、忘れずに。

dot.emacs [emacs][net]

<http://www.sodan.org/~knagano/emacs/dotemacs.html>
emacs-lisp の例外処理。

(defmacro eval-safe (&rest body)
  "安全な評価。評価に失敗してもそこで止まらない。"
  `(condition-case err
       (progn ,@body)
     (error (message "[eval-safe] %s" err))))

.emacs に

(load 'some-module)

と書いてあると、some-module が見つからない場合に、
それ以降の評価がされない。

(eval-safe (load 'some-module))

なら、エラーは message バッファに残り、
評価は続けられる。

coLinux + X はどうすればいいか [win][linux][howto][net]

とりあえず、↓にいろいろ書いてある。
XCoLinux - coLinux
 
coLinux側にVNCを入れるというのが、
一番軽く動くらしい。

とりあえず、ssh X11Forwarding を採用。
coLinux は Gentoo で動いてる。
いつもはまるのだけれど、Gentoo での sshd の初期設定は、
X11Forward no
これを yes にしておかないと、X転送ができない。

Windows のローカル名前解決 [win][net]

hosts ファイル。
<http://vine-linux.ddo.jp/windows/hosts.php>

WindowsNT/2000/XP :  %SystemRoot%\SYSTEM32\Drivers\etc
Windows9x/Me      : %SystemRoot%

2006-07-01 Sat

Probability Tutorials [book][math][stat][net]

<http://www.probability.net/>
確率論の演習がたくさん。
解答つき

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

最終更新時間: 2009-02-01 00:57

Powered by chalow
inserted by FC2 system