- [Ruby] 単体テストツールと、コマンド実行テスト 〜 その1: 検討
# 関数 func01() のテスト
def test_func01
assert_equal(xxxxx, @obj.func01()) # テスト対象のメソッドを呼び出す
end # 関数 func02() のテスト
def test_func02
assert_equal(xxxxx, @obj.func02())
end
end
- kwatchの日記
## デコレータやジェネレータ式は 2.4 以降
@ classmethod
def f (cls, *args):
print , .join(str(x) for x in args) ## 2.3
- trac ganttcalendar [gentoo]
# cd /var/lib/trac/(my_project)/trunk # python setup.py bdist_egg (※) /var/lib/trac/(my_project)/trunk/dist 以下に tracganttcalendarplugin-0.2-py2.5.egg が出来上がる # cp /var/lib/trac/(my_project)/trunk/dist/*py2.5.egg /var/lib/trac/(my_project)/plugins/. (※) 出来上がったplugin を入れる
- 暗号、数学、時々プログラミング
!doctype html public -//w3c//dtd xhtml 1.0 strict//en
html xmlns= xml: lang = ja lang = ja
head
title learning javascript / title
style type = text/css
body {
background : #fff ;
font-size : 13px ;
font-family : helvetica , verdana, arial, sans-serif ;
max-width : 900px ;
margin-left : auto ;
margin-right : auto ;
margin-top : 0px ;
color : #000 ;
}
- 人工知能に関する断創録
# ピッチファイルをロード
pitch = []
f = open(pitch_file, rb )
while true:
# 4バイト(float)ずつ読み込む
b = f.read(4)
if b == : break ;
# 読み込んだデータをfloat型(f)でアンパック
val = struct.unpack( f , b)[0]
pitch.append(val)
f.close()
- 人工知能に関する断想録
#coding:utf-8
import wave
from numpy import *
from pylab import *
- name 3333’s memo (個人用メモなんで間違いがあるかも知れません)
#print date, kari_kamoku, kingaku, kashi_kamoku, kashi_hojo, tekiyou
print of, lineoutstr % {
id : id,
date : date,
kari_kamoku : kari_kamoku,
kari_hojo : kari_hojo,
kari_taishogai : kari_taishogai,
kingaku : kingaku,
kashi_kamoku : kashi_kamoku,
kashi_hojo : kashi_hojo,
kashi_taishogai : kashi_taishogai,
tekiyou : tekiyou,
} + r n ,
|