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

はてなさん

なんか記事の編集 page ( 詳細編集 mode ? ) が変わってるぽいんだけど相変わらず「記事を書く」を押してもまっさらな textbox が出てくるんではなくてその日の以前書いた記事の編集画面になるんだね、仕方ないね。

stdint.h in VS10

VS10 で stdint.h が使えるようになってることに今更気付いた。以下の code が compile 通るようになってる。 http://github.com/januswel/cpplib/blob/master/header/elapsed.hpp http://github.com/januswel/cpplib/blob/master/sample/elapsed/main.cpp V…

wav file

なんかすごい久しぶりな気がする。というのはおいといて wav file ( RIFF WAV linear PCM ) の header を読み書きする C++ header を書いてみた。 fmt sub-chunk の拡張部分とか考え気すらないので bug とかなければこれで fix 。 http://github.com/januswe…

C++ の program framework

http://d.hatena.ne.jp/janus_wel/20100522/1274515252 で言ってた file template の分割をやったら Makefile を書かざるを得なくなって書いたら書いたでアレ ? これ copy & rename & replace すれば量産できるんじゃね ? という流れで作ってみた。 http://g…

main.hpp やめました

http://d.hatena.ne.jp/janus_wel/20100508/1273332573 で言ってたアレ、やめた。というのも仕分け対象というよりは援助・施策対象になりそうなところの構成員に「意味のないものを書くな」と direct に諭されたのでコレ使いながらいろいろ書いたり詰めたり…

STL だけで Perl の grep

sequence_container ( http://www.cplusplus.com/reference/stl/ の表参照 ) を出力先とすると下の code が多分素直な書き方。 sequence_container.resize(std::count_if(src.begin(), src.end(), pred)); std::remove_copy_if( src.begin(), src.end(), seq…

code template for cpp

code のひな形という意味での template 。 http://github.com/januswel/dotfiles/blob/master/vimfiles/template/-.cpp あーえーとうちは vim でアレコレしてるので filename だとか comment 内のよくわからないアレだとかは以下を参照で。 autotmpl.vim htt…

VIM 7.2 with VC2008

久しぶりにいろいろ更新しとこうと思って覗いたらでてた。で、 VC2008でコンパイルした32bit版です。VC2008でコンパイルするためにVC2003でコンパイルしていた過去の版で利用できていたいくつかの機能は使えなくなっています。 香り屋 — KaoriYa と書いてあ…

main.hpp

program を書く上で必要になりそうなものをまとめた header file 。 wmain.cpp のほうは内部の文字列処理をすべて wchar_t および std::wstring でやる場合。 http://github.com/januswel/cpplib/blob/master/header/main.hpp http://github.com/januswel/cp…

impltest

処理系の挙動を check するための code 群を cpplib repository につっこむことにした。 library じゃないんだけど形式知だしまぁ似たようなもんと言うことで一緒くたに。 std::bind2nd の check http://github.com/januswel/cpplib/blob/master/impltest/bi…

grep

sequence container を引数に取る関数を定義してしまったのでじゃあこれもという感じで。 http://github.com/januswel/cpplib/blob/master/header/algorithm.hpp http://github.com/januswel/cpplib/commit/ba15e77b2f0706e73cf30dd566b007a4292b1729 http:/…

algorithm と functional で

Visual Studio 2010 で reference な引数に std::bind2nd できるようになったのでうちの cpp library を と を使って書き直してみた。 http://github.com/januswel/cpplib/commit/5222ccf23ba3082b1ce44da90f9e93fa51d80765 http://github.com/januswel/cppl…

join, split

Perl や javascript でいうところの join と split を書いてみた。 http://github.com/januswel/cpplib/blob/master/header/typeconv.hpp http://github.com/januswel/cpplib/commit/e04a31543657f5e23c67ea4fbc4326a3ab093805 http://github.com/januswel/c…

Visual Studio 2010 Express

いつの間にかでてた -> http://www.microsoft.com/japan/msdn/vstudio/express/ 。とりあえず compiler だけ cmd.exe から使ってるんだけど vs9 で通らなかった以下の code がきちんと通るようになっていてちょっと感動した。 #include <algorithm> #include <functional> #include <iostream></iostream></functional></algorithm>…

pointer to overloaded function

最初どうするんだろうと思ったけど C では「関数の pointer 」型を宣言するのに戻り型と引数を指定していたし C++ compiler は signature でどの関数が呼ばれているかを判断しているわけなのでじゃあ signature を構成する引数と ( member function の場合 )…

pointer to member

念のためとかせっかくだからで全然意味が違ってきてしまうことに気付いたのでまとめ。ある class の member ( data member でも member function でもいい ) への pointer を取る場合、その関数の qualified-id ( global 名前空間を起点として名前空間や cla…

algorithm.hpp

ひょんなことから まわりの関数 ( http://www.cplusplus.com/reference/algorithm/ ) を使うようになってあー iterator という interface ですべて操作するわけかなるほどとか思ってたんだけど欲しいものがなかったので書いてみた。 http://github.com/janus…