2010-09-01から1ヶ月間の記事一覧

boost/accumulators

C/C++で、平均値、最大値、最小値、分散、中央値等の統計量を計算するなら、boost::accumulators が便利。2017年6月13日追記.情報が古かったので更新しました #include <iostream> #include <boost/accumulators/accumulators.hpp> #include <boost/accumulators/statistics.hpp> using namespace boost::accumulators; int main() { accumulato</boost/accumulators/statistics.hpp></boost/accumulators/accumulators.hpp></iostream>…

boost/format.hpp

iostream って使いにくい。特に浮動小数点数を使う時は printf系に分がある気がする。たとえば以下のCのコードも #include <stdio.h> int main() { printf("%10d\n", 12345); printf("%10.3f\n", 12.345); printf("%10.6f\n", 12.345); return 0; } std::cout を使う</stdio.h>…

emacs が"GConf Error:"が出して起動しない場合の対処方法

emacs が以下のエラーで起動しない場合は GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://project…