This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def add(x, y, k): | |
k(x + y) | |
def subtract(x, y, k): | |
k(x - y) | |
def multiply(x, y, k): | |
k(x * y) | |
def isequivalent(x, y, k): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import math | |
import sys | |
# yahoo!形態素解析 | |
import morphological | |
# SQLiteを利用する | |
import sqlite3 as sqlite | |
# 相対パス指定 | |
import os.path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# フランス書院文庫サイト | |
# http://www.france.jp/servlet/Satellite/f/index.html?sc=f71270871087046729808901234752345 | |
import math, sys | |
# yahoo!形態素解析 | |
import morphological |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import math, sys | |
# yahoo!形態素解析 | |
import morphological | |
def getwords(doc): | |
words = [s.lower() for s in morphological.split(doc)] | |
return tuple(w for w in words) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import math, sys | |
# yahoo!形態素解析 | |
import morphological | |
def getwords(doc): | |
words = [s.lower() for s in morphological.split(doc)] | |
return tuple(w for w in words) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import matplotlib.pyplot as plt # 可視化用ライブラリ | |
import random | |
class DynamicKelly: | |
def __init__(self, prob = 0.25, odds = 4.8, count = 30, money = 40000, div = 4): | |
"""初期化。 | |
インスタンスを生成すると自動でモンテカルロ法による |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import matplotlib.pyplot as plt # 可視化用ライブラリ | |
import random | |
class Kelly: | |
"""モンテカルロ法によるケリーの公式のシミュレーション。 | |
v = Kelly(勝率, オッズ[, 試行回数, 総資金]) | |
で実行する。デフォルトでは試行回数は30回、総資金は10,000の設定 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import random | |
class Kelly: | |
"""モンテカルロ法によるケリーの公式のシミュレーション。 | |
v = Kelly(勝率, オッズ[, 試行回数, 総資金]) | |
で実行する。デフォルトでは試行回数は30回、総資金は10,000の設定 | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# generated by wxGlade 0.6.3 on Thu Jun 30 04:26:38 2011 | |
import wx | |
import datetime as dt | |
from wx.lib.pubsub import Publisher as pub | |
# begin wxGlade: extracode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
### http://www.python.jp/doc/2.5/lib/node85.html を参照 | |
from datetime import date | |
from time import strptime | |
class seizaAndEto: | |
def __init__(self): | |
### http://ja.wikipedia.org/wiki/%E5%B9%B2%E6%94%AF#.E5.B9.B4.E3.81.AE.E5.B9.B2.E6.94.AF を参照 |