C++
これはC++ Advent Calendar 2013 23日目の記事です。 目的: sshでリモートに接続して計算を行い、その結果を図として得たい場合、 図をダウンロードするしかないのですが、 いちいちダウンロードして画像ビューアに移ってという過程を経ずに ターミナル上で…
あけましておめでとうございます。 今年は辰年ということなので、dragonですよね。 というわけでdragonegg(http://dragonegg.llvm.org/)を使えるようにしてみました。 dragoneggとは dragoneggはGCCのプラグイン機能を使ってLLVMによる最適化をしようという…
のでちょっと書いてみた。C++11限定でBoostが必要。 こんな風に使う。 #include <iostream> #include "feux/multiple_for.hpp" typedef std::pair<int,int> Range; int main() { const Range range1 = std::make_pair(0,3); const Range range2 = std::make_pair(0,3); const Ra</int,int></iostream>…
http://blog.livedoor.jp/dankogai/archives/51761113.html経由で http://hirobanex.net/article/2011/12/1324792864を知ったわけですが、 こういうのって需要多いんですね。 これC++11なら標準ライブラリにあります。 C++11にまだ移行できない場合はBoostに…
とりあえずPDFにしたところで力尽きたので公開。 ブログ形式には後で変えます。たぶん。 https://docs.google.com/open?id=0Bz3ia7nrCMfHY2EzZjdmNjItNGVhNy00NTM4LWEyY2MtMTYwMTczNjJhZTNmはてダよりLatexの方が慣れてるとかほんとブログ書く気ないなあ・・…
元ネタはここ(http://ja.doukaku.org/295/)なんですが、 札幌C++勉強会で扱ったのでちょっとやってみる。方針は比較関数で文字列と数値に分けて、それぞれの場合で処理を分けてるだけ。 #include<iostream> #include<string> #include<vector> #include<fstream> #include<boost/lexical_cast.hpp> #include<boost/xpressive/xpressive.hpp> #include<boost/xpressive/regex_actions.hpp> str</boost/xpressive/regex_actions.hpp></boost/xpressive/xpressive.hpp></boost/lexical_cast.hpp></fstream></vector></string></iostream>…
結論としてiostream vs stdioではなく、ofstream vs fprintfの比較になってますもう過去に幾度と無くされてきた戦争な気がするのでドキュメントとして残す。iostreamはデフォルトでstdioより遅い。 ただし、http://homepage1.nifty.com/herumi/diary/0812.ht…
元ネタ > http://okajima.air-nifty.com/b/2011/01/2011-ffac.html #include<iostream> #include<vector> #include<cstdio> #include<string> #include<valarray> typedef std::vector<std::vector<int> > Field; const int width=6; const std::string data = " GYRR" "RYYGYG" "GYGYRR" "RYGYRG" "YGYRYG" "GYRYRG" "YGYR</std::vector<int></valarray></string></cstdio></vector></iostream>…
boost::optional::getをbindにかけたいと思っていろいろ試したメモ 結論はphoenix使え。以下いろいろ試したソース #include<iostream> #include<boost/optional.hpp> #include<boost/phoenix/phoenix.hpp> #include<boost/lambda/lambda.hpp> int main(const int argc,const char** argv) { using boost::phoenix::bind; using boost::phoenix::a</boost/lambda/lambda.hpp></boost/phoenix/phoenix.hpp></boost/optional.hpp></iostream>…