- プログラムはまず日本語で書けるようにする
- 日本語化する事により、調べやすくなる。
- 何をテストすべきなのかも見えてくる
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/gawk -f | |
# usage: | |
# gawk -f poker.awk card.txt | |
# | |
# 1. ファイルから行単位で数字を読み出す | |
# 2. 数字を添え字にして連想配列にする | |
# 3. Value値に、同じ添え字(数字)があったら+1する | |
# 4. END句で、連想配列を全て読み出し、Value値が2の物があった場合に、one pairと表示する | |
# ※ 基本動作のみ |
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
# 参考URL: http://d.hatena.ne.jp/gmaxlab/20090329/1238329567 | |
import httplib, ssl | |
#HTTPで上手くいく場合 | |
http_session = httplib.HTTPConnection("squidのドメイン", 8080) | |
http_session.request("GET", "http://yahoo.co.jp/") | |
r1 = http_session.getresponse() | |
print r1.status, r1.reason | |
#HTTPSで失敗する場合 |
NewerOlder