前の月 / 次の月 / 最新

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

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-10-29 Sun

djbdns [linux][gentoo]

DNS はローカルでキャッシュすると、平均的には速くなることもあるかもしれない。
# 大学の環境ではLANが十分に速いので、基幹DNSの応答とローカルDNSの応答がほとんど変わらないっぽい

dnscacheの設定
HOWTO Setup a DNS Server with DJBDNS - Gentoo Linux Wiki

# dnscache-setup

で forward IP に /etc/resolv.conf の中身を入れれば、
動く。

2006-10-22 Sun

sshでSOCKSプロキシ [linux][net]

基本的に、TCP汎用のプロキシ。

<http://d.hatena.ne.jp/lurker/20060731/1154349129>

ssh -D 1080 login-server

で、プロキシをローカルに立ち上げる。
login-server はリモートにある閉じたネットワークへのログインサーバー。

プロキシの使いかた:

TSOCKS_CONF_FILE=/home/matubara/.tsocks.conf ssh 192.168.123.45


firefox だと URLパターンで細かい場合分けができる foxyproxy が便利かも。

2006-10-21 Sat

Java で木構造 [java]

富豪的プログラマは
javax.swing.tree.TreeNodeのインターフェイスで、実装は DefaultMutableTreeNode を使うらしい。

2006-10-18 Wed

高階 template [cxx]

ふつうにできるのを知ってショックでした。
以前、それらしく書いてみたらコンパイルエラーだったので、
できないと思い込んでいた。

// パラメータとして型を渡す template class
template< typename T > class T0 {};

// パラメータとして1階テンプレートクラスを渡す template class
template< template<typename> class T > class T1 {};

// パラメータとして2階テンプレートクラスを渡す template class
template< template<template<typename> class> class T > class T2 {};

// パラメータとしてテンプレートと型を受け取り、テンプレート適用をする
template<template<typename> class TMPL, typename T> class ApplyTmpl {
public:
  typedef TMPL<T> type;
  type constructor() { return type(); }
  type* newInstance() { return new type(); }
};

// パラメータとして値を渡す関数
int f0(int x) { return 0; }

// パラメータとして1階関数を渡す関数
int f1(int (*x)(int)) { return 0; }

// パラメータとして2階関数を渡す関数
int f2(int (*x)(int (*)(int))) { return 0; }

// パラメータとして関数と値を受け取り、関数適用をする
int apply_func(int (*x)(int), int y) {
  return x(y);
}

2006-10-16 Mon

Memos - tfidf.net [nlp][people][net]

<http://tfidf.net/memos/>
Manabu Sassano さん。

MUSASHI -- datamining [stat][net]

<http://musashi.sourceforge.jp/>
いわゆるひとつのデータマイニングツール。
ある時系列量を与えると、年間変動とノイズと長期的変動を分離したりできると思う。
(みてない)

2006-10-13 Fri

zsh を exec する方法 [linux][net]

<http://chasen.org/~daiti-m/text/zsh-exec.html>

# csh なら, .cshrc に

      if ($?prompt) then
  setenv SHELL /usr/local/bin/zsh
  if ( -x $SHELL ) exec $SHELL
      endif

# sh, bash なら, .profile に

      [ -x /usr/local/bin/zsh ] && exec zsh
      

Algorithms for drawing graphs -- an annotated bibliography [graph][net]

<http://dx.doi.org/10.1016/0925-7721(94)00014-X>

2006-10-09 Mon

数値計算ガイド -- Sun [programming][net]

<http://docs.sun.com/source/806-4847/ncgTOC.html>
浮動小数点演算の説明がかなり詳細。
via 浮動小数点数 - Wikipedia -

g++ -fstrict-aliasing [cxx][net]

<http://gcc.gnu.org/onlinedocs/gcc-4.0.3/gcc/Optimize-Options.html#index-fstrict_002daliasing-511>

int i = 10;
float f = *( (int*)&i );
は移植性が低いだけでなく、GCC4の最適化

-O2
-O1 -fstrict-aliasing -fschedule-insns

によって意味が変わる。

訂正版

union int_float {
	int   as_int;
	float as_float;
}
int_float x;
int i = 10;
x.as_int = i;
float f = x.as_float;	

g++ 4.x はデフォルトでこの問題を起こす最適化が有効になっている。
g++ 4.0.3 はそれにもかかわらず、警告を出さない。

対処:
1) g++3 を使う
2) g++ 4.1 以降でコンパイルして問題箇所を見つけ、修正する

Yuval Yaari - Post details

Text Highlighting Script [perl][net]:
<http://planet.gentoo.org/developers/yuval/2006/10/07/text_highlighting_script>
Getoptはハッシュで受け取れたのか。

#!/usr/bin/perl
use Getopt::Std;
use Term::ANSIColor;
my $word = shift;
my %hash;
getopts('c:', \%hash);
$colour = $hash{'c'} || 'red';
while (<STDIN>) {
s/($word)/colored($1, $colour)/ge;
print
}

2006-10-07 Sat

unison によるディレクトリの同期 [linux]

unison -sshargs=-1 -ui=text -servercmd=/space/home/matubara/bin/unison ~/public_html ssh://www-tsujii//space/home/matubara/public_html

やたら長いが、

-sshargs=-1

は ssh コマンドのオプションで、SSH version 1 の指定。

-servercmd=...

はサーバー側の unison 実行ファイルのありか。

色々なアーキテクチャに対するバイナリが配布されているので、
ssh で入れるマシン間の同期はこれでOK。
# バイナリがなければOcamlコンパイラが必要

Qt 4.2 -- Qt Tutorial [cxx][net]

<http://doc.trolltech.com/4.2/tutorial.html>
一見 Java awt, swing と似ている。
SIGNAL & SLOT のイベント処理のところは違うけれど。

qmake -project
qmake
make

2006-10-06 Fri

bitwise operators [cxx][net]

<http://www.icce.rug.nl/documents/cplusplus/cplusplus03.html#an208>

x = ~x;
x = compl x;


x = x ^ 0;
x = x xor 0;

2006-10-05 Thu

Adaptive topic-dependent language modelling using word-based varigrams

Chapter10.Boost.StaticAssert [cxx][net]

<http://boost.org/doc/html/boost_staticassert.html>
コンパイル時に、型変数の値チェックとかできる。
かなり便利かも。

#include <iterator>
#include <boost/static_assert.hpp>
#include <boost/type_traits.hpp>

template <class RandomAccessIterator >
RandomAccessIterator foo(RandomAccessIterator from, RandomAccessIterator to)
{
   // this template can only be used with
   // random access iterators...
   typedef typename std::iterator_traits< RandomAccessIterator >::iterator_category cat;
   BOOST_STATIC_ASSERT((boost::is_convertible<cat, const std::random_access_iterator_tag&>::value));
   //
   // detail goes here...
   return from;
}

2006-10-04 Wed

Julius によるオフライン音声認識 for Windows [sr][lm]

目的:wav2txt
動かすだけなら、すごく簡単です。
まともに使えるようにするのは、かなり大変です。

Julius ディクテーションキットをダウンロードする。

fast.jconf の
-input
-sscalc
などを適切に編集する。

run_fast.bat
として動かす。


Julius は基本的にはデコーダ。
雑音通信路モデルでいうと、
・通信路モデルに相当する triphone HMM の定義
・情報源に相当する 3-gram 言語モデル
さらに、
・言語モデルの単語に対する読みの辞書
を必要とする。

HMM は対象音声の特性にあったもの、
言語モデルは対象分野にあったものが望ましい。
特に背景雑音が音響モデルの想定外な音声や、
標本化周波数が音響モデルの想定外な音声は、
ほとんど認識できない。
背景雑音はともかく、
標本化周波数は、人間が聞いた場合はあまり違いがないように聞こえるので、
注意が必要。

本来、背景雑音や標本化周波数は、
よりクリアな方が認識しやすい、という程度の意味しかないが、
それは音響モデルがその条件に合わせて訓練されている、
という前提が成り立っての話。

音響モデルをつくるには、

2006-10-02 Mon

lintsh [linux][net]

<http://code.dogmap.org./lintsh/>
bash family 内部の互換性問題

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