関数の途中で戻って再開出来るとか、C言語コードだけ見てたらとても奇妙な冒険。 #include "stdafx.h" #include <Windows.h> const int LOOP_COUNT_IN_MAIN = 5; const int LOOP_COUNT_IN_FIBER = 5; PVOID pMainFiber; PVOID pFibers[4]; struct DestroyChecker { ~Des</windows.h>…
環境は、Visual C# 2010 Express の Microsoft Office (Excel) 2007。 Microsoft Excel Object Library を追加する。 ソリューションエクスプローラから、参照設定を右クリックし、参照の追加をクリックする。 COMタブを選択し、Microsoft Excel 12.0 Object…
クラステンプレートのメンバ関数テンプレートを外部で定義する。 - erio_nk://memo でメンバ関数テンプレートの定義方法は記述してあったが、 ただのメンバ関数や静的メンバ変数の定義方法を記述していなかったので。 template <class T> struct Hoge { // 静的メンバ</class>…
Windows 7 Visual C++ 2010 Express x64 ビルド環境構築 - 日々のコーディングについてのページ こちらのサイトの丸写し状態だが…。 Visual C++ 2010 Express はインストールされているものとして、以下の手順を踏む。 Microsoft Windows SDK for Windows 7 …
int _tmain(int argc, _TCHAR* argv[]) { int rhs32 = 63; __int64 rhs64 = 63; // NG { __int64 flags = 1 << rhs32; printf("%llx\n", flags); } // OK { __int64 flags = static_cast<__int64>(1) << rhs32; printf("%llx\n", flags); } // NG { __int64 flags = 1 </__int64>…
#include <stdio.h> struct BoolAlign { bool _bool0; int _int0; bool _bool1; bool _bool2; int _int1; bool _bool3; bool _bool4; bool _bool5; int _int2; bool _bool6; bool _bool7; short _short0; bool _bool8; short _short1; bool _bool9; int _int3; }; int</stdio.h>…
struct DATA { int _hoge; int _fuga; int _piyo; DATA() : _hoge(0) , _fuga(0) , _piyo(0) {} }; int main() { // error C2552 DATA data[3] = { { 1, 1, 1 }, { 2, 2, 2 }, { 3, 3, 3 }, }; return 0; } Download Visual Studio 2005 Retired documentati…
アセンブラに興味がわいた為、昔買って本棚のこやしになっていた高級言語プログラマのためのアセンブラ入門作者: 林晴比古出版社/メーカー: ソフトバンク クリエイティブ発売日: 2005/11/30メディア: 単行本購入: 2人 クリック: 40回この商品を含むブログ (1…
// 空ファイルを作成する。 #include <windows.h> #include <tchar.h> #include <stdio.h> int WINAPI _tWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nShowCmd ) { if (__argc <= 1) return 0; // コマンドライン引数の数 TCHAR* file = __targv[1]; /</stdio.h></tchar.h></windows.h>…
SVN関連 実行ファイル C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe以降、各コマンドのパラメーター。 Update /command:update /path:"$D" Commit /command:commit /path:"$D" Add /command:add /path:"$D" Revert /command:revert /path:"$D" Show l…
class Hoge { public: class Fuga; private: static void PrivateFunc() { } }; class Hoge::Fuga { public: class Piyo; private: static void PrivateFunc() { // インナークラスからアウタークラスのprivateメンバにアクセス出来る Hoge::PrivateFunc(); …
テンプレートかPythonスクリプトいじれば出来るんでしょ?とか 思っていたら意外と大変だった。 tracのチケット一覧取得は、それ用のクエリ文がtrac環境初期化時に DBに突っ込まれていて、一覧ページにアクセスをしたらDBから まずそのクエリを取り出し、更…
Apacheの設定 ちなみにApacheのバージョンは2.2.14(Win32)。 2.2からhttpd.confの設定が結構変わるとか変わらないとか? mod_python ここのWin32 Binariesからmod_python-3.3.1.win32-py2.5-Apache2.2.exeをダウンロードしてインストール。 Apacheのディレク…
ぴゃー大量にアクセスされていたお! /var/log/secureここにsshdの認証のログがある。 以下のよーなコマンドで成功のログを見る。 # cd /var/log/ # grep "Accepted" secure*以下例。 secure-20091025:Oct 24 22:00:00 localhost sshd[24407]: Accepted pass…
Windowsで入れるのめんどい。 1. Pythonインストール ClierSilverの都合で2.5をインストール。とりあえず2.6に変更。 ここのpython-2.5.4.msi(For x86 processors: python-2.5.4.msi)。 ここのpython-2.6.3.msi(Windows x86 MSI Installer (2.6.3))。 ※なん…
class Hoge { public: void Echo() { std::cout << "echo 'Hoge'" << std::endl; } void ConstEcho() const { std::cout << "const echo 'Hoge'" << std::endl; } }; class Moke { Hoge _hoge; public: void Echo() { std::cout << "echo 'Moke'" << std::en…
会社のVistaマシンで、表題の件がうまくいかなかったので動くようにしたメモ。 Vistaが原因なのかは不明。 最近Cygwinがレジストリに保存しなくなったとかなんとか?よくわからんけど。 とりあえず以下の様なエラーダイアログが出る。 レジストリキーSOFTWAR…
#include <iostream> #include <vector> #include <algorithm> /* // 関数内じゃなければ、gccでもOK(当たり前だけど)。 struct Proc { void operator () (int val) { std::cout << val << std::endl; } }; */ int main() { // ローカルファンクタクラス struct Proc { void operator ()</algorithm></vector></iostream>…
前回のは仕事用に会社へ持ってったのですが、だんだんキー配置にも慣れてきて、 逆に自宅のキーボードでスカったりする事が頻発したので購入踏み切り。 5万の出費は痛いなぁああ!PS3買えちゃうよ。 そっち買っても良かったけども。 でもキータッチ感がホン…
コピー元のデータ(vector)が壊れてもいい場合(コピー元が一時バッファの様な場合)、 vectorの要素コピーはoperator = ()よりswap()のが早そう。 以下チョーいい加減な検証プログラム。 #include <cstdio> #include <cstdlib> #include <string> #include <vector> typedef std::vector<std::string> Strings</std::string></vector></string></cstdlib></cstdio>…
Happy Hacking Keyboard | HHKB Professional JP | PFU キータイプ時のことこと感、キーの吸い付くような手触り、シックな墨色、 チョーいいです(*´ω`) 問題は、普通ののキーボードとはキー配置が微妙に違うところぐらいかな。 ファンクションには慣れてき…
int value; int& ref = value = 0; // 一行で。 refをvalueで初期化したあと、refの指す値を0にセット。 int& ref = value; ref = 0; と書きたくないだけです。 もしかしたら嫌われる書き方かもしれない。 なんせ書いてる自分もちょい怪しい気分なので…でも…
vectorで表現するstringを、vstringと呼んでみるテスト。 typedef std::vector<char> vstring; コレで何がしたいのかと言うと、C文字列を表現したいのです。 ヌル文字で終端するアレ。 何故かと言えばやっぱり、可変長配列だから。 ほとんどの(凡人)プログラマがst</char>…
スクリプト言語による効率的ゲーム開発 C/C++へのLua組込み実践 (GAME DEVELOPER)作者: 浜中誠出版社/メーカー: ソフトバンククリエイティブ発売日: 2008/09/27メディア: 大型本購入: 13人 クリック: 322回この商品を含むブログ (40件) を見るイベントスクリ…
そもそも宣言や定義時は何も考えず同じ名前で書ける模様。 構造体の方は、structキーワードで修飾すれば変数の宣言や定義が出来る。 #include <iostream> // Hoge構造体 struct Hoge { Hoge() { std::cout << "Constructor Hoge" << std::endl; } }; // Hoge関数 void </iostream>…
#include <iostream> #include <cmath> // for fmod float roundDegree(float x) { if (x >= 0.f) { return fmod(x, 360.f); } else { return 360.f - fmod(-x, 360.f); } return x; } int main() { std::cout << roundDegree(10.f) << std::endl << roundDegree(120.30f) << </cmath></iostream>…
ゲーム、ラノベ同様に技術書も積み本する人ですが、最近崩し始めました。Effective C++ 原著第3版 (ADDISON-WESLEY PROFESSIONAL COMPUTING SERIES)作者: スコット・メイヤーズ,小林健一郎出版社/メーカー: ピアソン・エデュケーション発売日: 2006/04/29メ…
private継承の振る舞いメモ。 // 基底クラス class Base { public: int _publicData; void PublicFunc() {} protected: int _protectedData; void ProtectedFunc() {} private: int _privateData; void PrivateFunc() {} }; // private継承したクラス class …
テンプレートパラメータに指定できるもの - Faith and Brave - C++で遊ぼう にある通り、テンプレートにはポインタが渡せると言う事で、 以下の様に文字列等を渡してみる。 #include <iostream> // 文字列 (char*) char hoge[] = "hoge"; static char fuga[] = "fuga";</iostream>…
// 元のHogeクラステンプレート。 template <class T> struct Hoge { // メンバ関数テンプレートを宣言する。 template <class U> void Fuga(U val); }; // 定義。templateを二つ重ねて指定する! template <class T> template <class U> void Hoge<T>::Fuga(U val) { std::cout << "fuga;" << val <</t></class></class></class></class>…