2010-04-01から1ヶ月間の記事一覧

[Linux] [Cygwin] Cygwin cross compile environment

古い情報ばかりなので書いとく。Ruby のクロスコンパイル環境を構築している人が複数いるので、その辺が参考になる。 Fedora-12-i686-Live-KDE.iso を入手。 仮想マシンに CD をマウントして起動、HDD にインストールする。HDD 容量は 6-8 GiB 見ておけばよ…

[Python] class の code object

example import traceback class Klass(object): class __metaclass__(type): def __init__(self, name, bases, dict): print '__metaclass__' traceback.print_stack() type.__init__(self, name, bases, dict) print 'class' traceback.print_stack() resu…

[Python] [unicode] unicodedata だけで半角->全角の変換ができるか

# -*- coding: utf-8 -*- """ Unicode Standard Annex #11 East Asian Width: http://www.unicode.org/reports/tr11/tr11-14.html """ import unicodedata def convert(s, errors=''): assert isinstance(s, unicode) result = [] for c in s: #unicodedata.…