signedとunsigened

C C++

signed int -> 符号付...負数も扱える。 unsigned int -> 符号なし...正数のみ。その分大きい正数も扱える。 http://www9.plala.or.jp/sgwr-t/c/sec13.html

ドット演算子とアロー演算子

C++

オブジェクトの実体に対してメンバや関数を参照する場合はドット演算子 . を使用する。 一方、オブジェクトのポインタに対して参照する場合はアロー演算子 -> を使用する。 MyObject obj1(); obj1.hoge(); MyObject obj2(); MyObject *obj2_ptr; obj2_ptr = …

error C2664: 'PathRemoveFileSpecW' : 1 番目の引数を 'char [1024]' から 'LPWSTR' に変換できません。(新しい機能 ; ヘルプを参照)

2>c:\visual studio 2010\projects\elasticsimulator\elasticsimulator\sim_data_io.cpp(26): error C2664: 'PathRemoveFileSpecW' : 1 番目の引数を 'char [1024]' から 'LPWSTR' に変換できません。(新しい機能 ; ヘルプを参照) 2> 指示された型は関連があ…

LINK : fatal error LNK1123: COFF への変換中に障害が発生しました: ファイルが無効であるか、または壊れています。

http://minus9d.hatenablog.com/entry/20121212/1355312498

attributeerror user has been swapped

AttributeError: Manager isn't available; User has been swapped for 'login.User' http://stackoverflow.com/questions/17873855/manager-isnt-available-user-has-been-swapped-for-pet-person

C/C++ inline, __forceinline, __attribute__

C C++

強制的にinlineしたい場合 __forceinline function_declarator; // Microsoft Specific__attribute__((always_inline)) function_declarator; // gcc http://msdn.microsoft.com/ja-jp/library/z8y1yy88.aspxhttp://stackoverflow.com/questions/8381293/how…

C/C++

C C++

http://vipprog.net/wiki/prog_lang/cpp.html

C/C++/Error warning: NULL used in arithmetic

In file included from ../SimulationBase/sim_vector.h:10:0, from sim_extern.h:7, from ElasticSimulator.cpp:2: ../SimulationBase/sim_util.h: In function 'const char* stristr(const char*, const char*)': ../SimulationBase/sim_util.h:101:39: wa…

Vim 環境パス設定時の注意

Vim

環境パスを設定する際、vimのパスの前にMinGWなどのUNIXコマンドが使えるようなソフトのパスがあるとそこでvimが先に引っかかってしまい、プロンプトで「vim」をたたくと落ちる。

C/C++ MinGWインストール

C C++

http://uturo2.nevernothing.jp/mingw32/

英語 「〜しかできない」

The only thing I can do is to 〜

英語 「例えば?」

Such as ?

英語 「〜がどんな感じか」

what 〜 is like

英語 「自分で」

by myself

英語 「あなたが思うほど〜ない」

I'm not as 〜 as you think.

英語 「〜が得意」「〜が苦手」

I'm good at 〜. I'm not good at 〜.

MySQL テーブル構造確認

describe [table name]; または show columns from [table name];

python オブジェクトの属性を調べる

print dir(obj) オブジェクトの持つ属性をprint

MySQL date/datetimeオブジェクトのinsert

cast("2014-11-08" as date) cast("2014-11-08 20:30:00" as datetime) insertのvaluesの部分は上記のようにしてinsert

Git rebaseを途中でやめる

Git

git rebase --abort git rebase -i の途中でよく分からなくなってrebaseの前に戻りたいとき

Git 過去のバージョンのファイルを閲覧

Git

git show [Hash]:[File Path] [Hash] -> コミットのハッシュ[File Path] -> クローンしてあるディレクトリからの相対パス

Git 過去のバージョンの閲覧

Git

git log -p -2 -p -> 各コミットのdiffを表示 -2 -> 直近の2エントリだけを表示

C/C++ 構造体ポインタの実体のない領域への参照

C C++

typedef struct { int a; } sample_t; int main() { sample_t *p; p->a = 10; } 以上は間違い。 ポインタpはアドレスを覚えておくだけの変数なので、まだ値を代入する領域が用意されていない。 よって実行時エラーになる。 ○対処法 p = (sample_t *)malloc(s…