2004-04-13から1日間の記事一覧

シリアライズ

途中結果をダンプしておけば解釈文の時間が稼げるものと思慮。http://www.ruby-lang.org/ja/man/index.cgi?cmd=view;name=PStore

iconv

sjisのファイルをiconvで変換すると \ と ~ が変なコードになる 何故だろう? 何かオプションあるのかな?

unicodeと僕

http://homepage1.nifty.com/nomenclator/unicode/ucs_utf.htm http://www.unicode.org/charts/ http://www.unicode.org/charts/PDF/UE000.pdf http://www.unicode.org/charts/PDF/UF0000.pdf http://www.unicode.org/charts/PDF/U100000.pdf

apacheのダウンロード時にファイル名を指定

DLさせるファイル名をCGI側で指定するには、HTTPヘッダで以下のように指定します。ASP(ActivePerl)でも動作することは確認済みです。例えばPerlでの記述。 $filename = 'test.zip'; print "Content-Type: application/octet-stream\n"; print "Content-Dispo…

任意のフォルダ内のzipファイルを解凍

ruby -e 'Dir.glob("*.zip"){|f| puts `unzip -n #{f}`}'

utf8を読めるようにする

apt-get install mule-ucs *[unzip] 同一のファイルを上書きしない。 >|| -n never overwrite existing files. If a file already exists, skip the extraction of that filewithout prompting. By default unzip queries before extracting any file that a…

インストール

apt-get install emacs21

参考URL

http://ruby-ldap.sourceforge.net/

簡単な検索

#!/usr/bin/ruby require 'ldap' basedn='dc=n9d,dc=cx' LDAP::Conn.new('localhost',LDAP::LDAP_PORT).bind{|conn| # conn.perror("bind") #接続の成功を表示するときここのコメントアウトをはずす conn.search2(basedn,LDAP::LDAP…

使い方

ううっ、英語しかねえ。しかも、/usr/doc/libldap-rubyにしか・・・ LDAP::LDAP_VERSION LDAP::LDAP_MAX_VERSION LDAP::VERSION LDAP::MAJOR_VERSION LDAP::MINOR_VERSION LDAP::LDAP_PORT LDAP::LDAPS_PORT LDAP::LDAP_API_INFO_VERSION LDAP::LDAP_VENDOR_…

csvを扱うクラス

csv

#!/usr/bin/ruby -Ks class Csv include Enumerable def initialize(filename) raise if !File.exist?(filename) # 初期化 @key,@line =[],[] # body File.open(filename){|file| @key=csv_split(file.gets.gsub!(/\n|\r/,'')) # key node=Hash.new …