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

read it later!!

http://www.sgi.com/tech/stl/stl_introduction.html http://www.boost.org/community/generic_programming.html http://www.boost.org/doc/libs/1_35_0/libs/libraries.htm #fedora9...

これだ!

Boost.Spiritを使おう!

だめだー.

MSVC7.xだと*_oarchiveにSTLをつっこめない. ちなみにfedoraだと同じコードで動いています.まぁ実行時エラーだからコンパイル通ってるんだけどね. やっぱりMSVC7.xはもう古いのか.こっちではこの機能を使うのはあきらめよ.

相性?

なんか #include の前に #include // d3d9.hでも があるとダメなようです. ていうかそうです. ちなみに #include の方が先に書いてあれば問題ないです.他のヘッダファイルに影響を及ぼすなんて,ダメな子だなぁ.ぁ,DirectX SDK November 2007です. ヘ…

binary_iarchive

boostのバージョンを1_35にあげました. msvc7.xで#include とすると大量のバグが…www んー,boostのインストールに失敗したのか,msvcが悪いのか…. 調べてみます.

template friend in vc7.x

C++

msvc7.x以前ではtemplateに対してfriendできないらしいwww 苦肉の策. private: // devel # 苦肉の策の印 #if (_MSC_VER < 1400) public: #endif // (_MSV_VER < 1400) #if (_MSC_VER >= 1400) template<class WC, class GC> friend class afc::gui::custom_window; #endif //</class>…

fopen_s

C++

Visual Studio 2003にはfopen_sとか無かったw #if (_MSC_VER >= 1400) // 1400 == MSVC8.0(MSVS2005) errno_t err = _wfopen_s(&fp, path, mode); #else fp = _wfopen(path, mode); #endif

暗号化

Boost.Serializationでserializeしたバイナリデータを,暗号化.…は略したけど,バイナリデータに対してBoost.Serializationを呼ぶ. バイナリデータを扱うときはfopenとか使わなきゃならないんだよね.std::fstreamとか使うと色々整形されたりしてうまく扱…

まとめた

AFC

ヘッダファイルが多いのでまとめた.ついでに環境によって自動的に最適(推奨)な型が選ばれるようにした.といっても現在の動作対象はwin32 && directx9.0cのみwww インクルードは#include だけでおkにw あと,templateが多いのでその辺をまとめ.temp…

afclib -> afc

AFC

afclibだと冗長なのでnamespaceとかフォルダとかafcにしてみた. ていうか今起きたw

2D画像は一応完成?

AFC

約一か月前に「一週間で終わらせる」と言って,やっと終わりました(ぇw #しかも2D画像表示だけw いや,「一週間で終わらせる部分」はほぼ一週間で終わったけど,その後のやつがきつかった. とりあえずこんな感じ? なんかincludeするヘッダファイルが多…

std::merge

コンテナへのイテレータが入ったコンテナをマージする.std::vector<>へのconst_iteratorが入ったstd::vector<>をstd::mergeする. なんか必要になったんで. 今回はintです. #include <algorithm> #include <functional> #include <iostream> #include <iterator> #include <vector> #include <boost/bind.hpp> // 参照先を返す</boost/bind.hpp></vector></iterator></iostream></functional></algorithm>…

MSWord07...

etc

直ってなかった…. ただ文章中(一文中)にすでに小文字が使われていたから入力できたみたい. ちなみいその小文字はどうやって入力したかというと,以前のエントリで書いた時のやつをコピーしてもってきましたw 要は前の文書ファイルからコピーと. いつに…

さきほどのエントリでviという単語がkeyword貼られていたので見てみた. keyword vi http://d.hatena.ne.jp/keyword/vi するとviを含むkeywordに「魔法先生ネギま!」が…. keyword 魔法先生ネギま! http://d.hatena.ne.jp/keyword/%cb%e2%cb%a1%c0%e8%c0%b…

MSWord07直った?

etc

以前アルファベットの小文字が入力できないと書きました. http://d.hatena.ne.jp/graighle/20080429/1209498865 今日レポートを書いていたら「途中で」急に直りました.文章打ってただけなのに…ww やっぱり意味がわかりません. なにも設定とかはいじらな…

boost::lambda::bind(

etc

Mirosoft Visual StudioにはIntellisenseというものがあります.候補を一覧表示してくれるのです. std::sort(候補1: void sort(_RanIt _First, _RanIt _Last, _Pr _Pred); 候補2: void sort(_RanIt _First, _RanIt _Last); みたいな. すごく便利なのですが…

前のやつできました.

これの下のバージョンができました. http://d.hatena.ne.jp/graighle/20080511/1210536299 #include <iostream> #include <map> #include <vector> #include <algorithm> #include <boost/bind.hpp> // イテレータの指す先を返す template<class IT> struct unref : std::unary_funtion<IT, typename std::iterator_traits<IT>::value_type> { const typ…</it,></class></boost/bind.hpp></algorithm></vector></map></iostream>

if_

以下のことをやりたいのですが,できません. というか寝ますので今日やったことをまとめてみただけです. ちなみに今日は12時間程MHFをやっていましたwww 多分明日はやらないかなぁ. #include <algorithm> #include <map> #include <boost/lambda/bind.hpp> #include <boost/lambda/if.hpp> namespace bll = boost::l</boost/lambda/if.hpp></boost/lambda/bind.hpp></map></algorithm>…

Fedora9[1]

日記を書いたのに投稿されてないw まぁupgradeは無事に終わりました. ただ,日本語に変換できませんwww 見れはしますが. 今の興味はC#(箱○の開発言語)なんで,パッチ当たるまで我慢します. となりにwindowsXPあるんで困らないですし.

Fedora9

Fedora9へupgradeしてみますwまぁ上手くいかないことは判っているので,楽しみながらやりますw

std::bind*

C++

C++のbindを勉強しました.なるほどねー. #include <iostream> #include <vector> #include <functional> #include <algorithm> #include <boost/fcpp/prelude.hpp> int main(){ boost::fcpp::list<int> ls = boost::fcpp::enum_from_to(0, 9); std::vector<int> v; std::copy(ls.begin(), ls.end(), back_inserter(v)); std::copy(v.beg</int></int></boost/fcpp/prelude.hpp></algorithm></functional></vector></iostream>…

できたーww

一つ目はできたーw #include <iostream> #include <map> #include <vector> #include <algorithm> #include <boost/bind.hpp> struct test { void show(int x) const{ std::cout << x << std::endl; } }; int main(){ typedef std::map<int, object> my_map; typedef my_map::value_type my_pair; std::map<int, test> m; // まぁこの例</int,></int,></boost/bind.hpp></algorithm></vector></map></iostream>…

これをやりたいw

以下のをやりたいけど,できんw #include <iostream> #include <map> #include <vector> #include <algorithm> #include <boost/bind.hpp> struct test { void show(int x) const{ std::cout << x << std::endl; } }; int main(){ std::map<int, test> m; // まぁこの例だとstd::mapの意味はないですがw m[0] = test(); m</int,></boost/bind.hpp></algorithm></vector></map></iostream>…

std::bind*って…

C++

std::bind*って引数が2つまでしか対応してないんだ…. Boost.Bindを使えってことか….

boost::bindすげーw

Boost.Bindすげーw これは感動するwww

別のファイル

AFC

5時間ほど(libファイルを作るプロジェクトの)プログラミングして. そのlibファイルの動作を試すための別のプロジェクトをコンパイルしたら,今まではできてたのに,リンカたん: void afclib::gui::directx::resource::texture::width() constの実装が見つか…

自作Linux?

自作Linuxを作りたい.けど,これといって目的がないw いやあるんだけど,結局Xをいじるだけになりそうw自作Linuxじゃなくて自作XWM. もうここは割り切ってWMを作ろうかな. うん,面白そう. でもやることが多いので後回しー.夏休みに入る頃には(本格…

みにでぃすぷれい

AFClib.GUIでゲーム(音ゲー)を作る予定なんだけど,こういうの対応してると面白そうとか思ったりw http://journal.mycom.co.jp/series/volt/015/index.html

Kiki's Delivery Service

etc

KiKi's Delivery Service わらたw

mapをsort

C++

mapのデータをmapのindexとは別の値でソートする.何か基本的すぎて別に書く必要はないかもしれないけど,覚書.AFClib.GUIで使うの.カテゴリには入れてないけど. 後暇つぶし(MHF内の時間が過ぎるのを待っているww ぁ,サンプルは生徒の点数を保存して…