memo.xight.org - 2006-08-01

2006-08-01 Tue

mysqldump2email - MySQLのダンプファイルをzipアーカイブしてメール送信

- Summary
以下のモジュールが必要
MIME::Lite
DateTime
YAML

- Usage

% mysqldump2email --conf /path/to/config.yaml


- config.yaml sample

mysqldump:
  command: /usr/bin/mysqldump
  username: your-mysql-username
  password: your-mysql-password
  #host: localhost
 
zip:
  command: /usr/bin/zip
  # if encryption needed
  #password: your-zip-password
 
mail:
  from: user@example.com
  to:   user@example.com
  route:
    via:  smtp
    host: localhost:25
  #route:
  #  via:  sendmail
 
gspace:
  enable: 0
  directory: /
 
tmpdir: /tmp
#time_zone: Asia/Tokyo


- Reference
Ogawa::Memoranda - 2006-07-24 - mysqldump2email公開
http://as-is.net/blog/archives/001149.html

- via
オレンジニュース - 2006-07-28
http://secure.ddo.jp/~kaku/tdiary/20060728.html#p04

ctype と is_* , str_* の処理速度比較

- Summary
ctype関数はCライブラリを使用しているため,is_*, str_*より高速とのこと.
だが実際に比較してみると,is_* の方が速い.

- ctype_digit 版

$t = microtime_float();
for($i=1;$i<=1000000;$i++){
	if(ctype_digit(1234567890)) {
		print "";
	}
}
print microtime_float()-$t."\n";
 
function microtime_float() {
	list($usec, $sec) = explode(" ", microtime());
	return ((float)$usec + (float)$sec);
}


- is_int 版
$t=microtime_float();
for($i=1;$i<=1000000;$i++){
	if(is_int(1234567890)) {
		print "";
	}
}
print microtime_float()-$t."\n";
 
function microtime_float() {
	list($usec, $sec) = explode(" ", microtime());
	return ((float)$usec + (float)$sec);
}


- Reference
1人で稼ぐ日記 - 2006-05-02 - [PHP]ctypeとis_num
http://kokoromo.jugem.cc/?eid=210

microtime
http://php.s3.to/man/function.microtime.html

digg stack, digg swarm - digg.com の視覚化

- digg stack
クリックして拡大クリックして拡大
単位時間当たりのdigg数を高さで表現.
総 digg 数を色で表現.
digg数が増えると,リアルタイムにスタックが積まれる.

- digg swarm
クリックして拡大クリックして拡大
文字が書いてあるノードが記事を表現.
黄色いノードがユーザを表現.
記事の位置関係は,ばねモデルで表現しているようだ.

- Reference
digg labs / swarm
http://labs.digg.com/swarm/

digg labs / stack
http://labs.digg.com/stack/

flickr - Digg Swarm for Windows Desktops
http://www.flickr.com/photos/therift/198688791/

- via
MOONGIFT - Digg Swarm for Windows Desktops
http://fw.moongift.jp/intro/i-2144.html

MOONGIFT - Digg Swarm for Windows Desktops レビュー
http://fw.moongift.jp/review/i-2145.html