- 自分の頭のなかにある考えを書き出す。
- その中で固定観念は訂正する(自分が勝手に強化して感じている箇所なので)。
- 対策を考える。
- 来週、父と会う予定がある。
- 食事に誘われている。
- 食事になれば、今まで父は必ず飲酒してきている。
# -*- coding: utf-8 -*- | |
import itertools | |
cards = tuple('[[RESULT{}]]'.format(num) for num in xrange(2, 11)) | |
for cards in itertools.combinations(cards, 5): | |
print(''.join(cards)) |
生活感あふれる擬似コード | |
なるべく、現状をそのままに書きます。 | |
改善点があればコメントで。 | |
必要に応じて Gist から GitHub に移行します。 |
# coding: utf-8 | |
import re | |
pattern = re.compile(ur''' | |
そ | |
[ねげ] | |
( | |
ん | |
| | |
[えぇー]な? | |
) |
(深刻化しないうちに)お金で解決
first, *rest = (1, 2, 3, 4, 5) | |
# ってやると、 first == 0 で rest == [2, 3, 4, 5] になる。 |
# coding: utf-8 | |
import itertools | |
def byte_bitwise_by(op): | |
def _bitwise(a, b): | |
return ''.join(chr(op(ord(x), ord(y))) for x, y in zip(a, b)) | |
return _bitwise | |
#coding: utf-8 | |
assert set('カベドン') == set('ドカベン') |