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

pipとeasy_installの違い

何が違うんだかわからんけど、virtualenv先でもscons使いたかったのでpipでインストールしようとしたら入らんのでどうしようか悩んでたけど、easy_installしたらサクっと入った。 そういうこともあるのね。

boost with sqlite3

// -*- coding: utf-8-with-signature-dos -*- //============================================================================== #include <sqlite3.h> #include <boost/format.hpp> #include <boost/bind.hpp> #include <string> #include <iostream> #include <functional> using boost::format; using boost::bind; …</functional></iostream></string></boost/bind.hpp></boost/format.hpp></sqlite3.h>

boost勉強中

boostが楽しいassignとかlambdaとか便利やわ〜。 // -*- coding: utf-8-with-signature-dos -*- //============================================================================== #include <boost/lambda/lambda.hpp> #include <boost/lambda/bind.hpp> #include <boost/assign.hpp> // lambda/bind.hppと一緒にincludeする</boost/assign.hpp></boost/lambda/bind.hpp></boost/lambda/lambda.hpp>…

コメントアウトの切り替え

ふと思いついたpythonで#if/defのようなことをやる方法 C/C++:#if/defを使う #if 0 ... 無効 ... #else ... 有効 ... #endif #if 1 ^ .. 0->1に書き換え ... 有効 ... #else ... 無効 ... #endif C/C++:コメントを使う /* ... 無効 ... /*/ ... 有効 ... /…

py2exeのデフォルトエンコーディング

環境:python2.7 / win32 py2exeでexe化するとデフォルトエンコードが設定されずasciiのままになります。この状態で日本語をprintするとエンコードエラーになり正常に動作しない。いままでsys.stdout=codecs.getwriter('cp932')(sys.stdout)って書いてたけど…

crc32

最近PTVS(http://pytools.codeplex.com/)なんて面白いものも出てくるし、Aptanaがver3になってpydev標準装備など、どんどんpythonブームが来ている感じがしてワクワクします。 crc32 crc32の計算方法を調べたのでメモしておきます。 from binascii import cr…

PyPy 1.5

http://morepypy.blogspot.com/2011/04/pypy-15-released-catching-up.html もう1.5が出た。活発やねぇ。 1.4も1.5も速度が上がらないなぁと思ってたらwin64だったからっぽいですね。 32bitで試したらかなり速くなった!これたぶんx64だとハナから諦めてnoji…

bs-showの拡張

bsのファイル一覧表示を使っていましたが、ディレクトリも表示したくなったので調べてみました。 (when (load "bs") (defun my-visits-non-file-or-dir (buffer) (and (not (buffer-file-name buffer)) ; ファイルパスが入っていない (not (eq (buffer-local…