2012-01-01から1年間の記事一覧

Mac OS X (Mountain Lion)のTerminalで全角記号の表示ズレを直す方法

mac

こんな感じのやつ. vimでhtmlの編集中とかとてもうざい. ので,ターミナルの環境設定の[詳細]タブを開いて,一番下のところ. 「Unicodeアジア云々…」のところにチェックを入れます. 直った…!

jsのif文

if (i > 0) { j = true; } else { j = false; } j = i > 0 ? true : false; 同義らしい.

Mountain Lionにしてvimでpython書こうとしたらなんか怒られた話

以下で解決した. https://gist.github.com/3186381includeのpathが変わっててpyconfig.hが読めないよーということかな? sudo mkdir -p /usr/include/python2.7 sudo ln -s /System/Library/Frameworks/Python.framework/Versions/Current/include/python2.…

転置行列

a = [range(10), range(11,20), range(21,30)] b = map(list, zip(*a)) print a print b [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [11, 12, 13, 14, 15, 16, 17, 18, 19], [21, 22, 23, 24, 25, 26, 27, 28, 29]] [[0, 11, 21], [1, 12, 22], [2, 13, 23], [3, 14,…

githug level14で詰まった

git

詰まったのでメモ こちらを見て解決しました. https://github.com/Gazler/githug/issues/70要するに.gitignoreを作る課題のところで.gitignore自体はすでに中身付きで存在するので, echo *.swp > .gitignoreとかやっちゃうともともとの中身が消えちゃうっ…

""と''

print "\n" print '\n' >> >>\nなんと地味な差

tweepy使用,public streamを垂れ流す

#coding:utf-8 import tweepy import sys consumer_key = '' consumer_secret = '' access_key = '' access_secret = '' class StreamListener(tweepy.StreamListener): def on_status(self, status): if sys.argv[1].decode('utf-8') in status.text: print…

perlのお勉強

ぼちぼちperlのお勉強をしています. 昨日はshift()等学んだ. my @a = (0, 1, 2); print shift(@a) >>0shiftは配列を引数にとりその第一要素を返す. 次のような場合は動作が異なる. sub a { my $x = shift // 1; # $xのデフォルト値の設定(引数(shift)…

cmdでのリダイレクト

D:\>cat test.txt aD:\>echo add >> test.txt D:\>cat test.txt a add'>>'で追記 D:\>echo overwrite > test.txt D:\>cat test.txt overwrite '>'で上書き