2014-01-01から1年間の記事一覧

DjangoでDBにテーブル追加

①Modelにクラス追加 ②makemigrations python manage.py makemigrations ③migrate python manage.py migrate

mysql_exceptions.OperationalError: (1701,

mysql_exceptions.OperationalError: (1701, 'Cannot truncate a table referenced in a foreign key constraint http://stackoverflow.com/questions/5452760/truncate-foreign-key-constrained-table

mysql_exceptions.OperationalError: (2019, "Can't initialize character set utf-8

utf-8 -> utf8 http://purazumakoi.hatenablog.com/entry/2013/11/20/202637

テーブルを空にする

SQL

truncate table [table]; http://www.dbonline.jp/mysql/insert/index12.html

SQLコマンドでSQL文を見る

SQL

show create table [table]; http://stackoverflow.com/questions/5317889/sql-keys-mul-vs-pri-vs-uni

ユーザー管理

http://www.karakaram.com/mysql-user-grant

setAttribute

setAttributeしたい時はjQuery使えないっぽい getElementByIdとかquerySelectorAllとか使うquerySelectorAllはリストを返す http://qiita.com/3upjp/items/bf575019a5894decb51b https://developer.mozilla.org/ja/docs/Web/API/document.querySelectorAll

datepickerで任意の日付にCSSを適用

http://acro-engineer.hatenablog.com/entry/20111117/1321575622 http://d.hatena.ne.jp/aroundthedistance/20101209/1291871545

.gitignoreの反映

Git

自分のローカルでのみ無視したい場合はホーム下に.gitignoreと.gitconfigをつくる .gitignore *.pyc *~ .gitconfig [core] excludesfile = ~/.gitignore 既に追跡対象にいている場合は git rm --cached で追跡対象から外してcommitする http://qiita.com/y_m…

datepickerの土日の色をカスタマイズ

http://zuoka.blogspot.jp/2013/05/jquery-ui-datepicker-css.html

ブロック要素を含んだリストに角丸を適用するとき

CSS

リストタグの中にラベルタグなどを入れている場合で、 label {display: block;} というようにラベルをブロック要素としている場合、border-radiusを使う時は label {border-radius: 10px;} ul {border-radius: 10px;} というようにlabelタグとulタグの2つにb…

python manage.py migrateでエラー

$ python manage.py migrate --list 上記のコマンドでmigrationの状態を確認 admin [X] 0001_initial auth [X] 0001_initial contenttypes [X] 0001_initial login [X] 0001_initial manager [X] 0001_initial [X] 0002_auto_20140922_1937 [ ] 0003_auto_20…

DBのテーブルにカラム追加

http://ameblo.jp/ekispresso/entry-11485508958.html

pyqt 親ウィンドウから子ウィジェットを作成するとき、selfをつけてクラス変数にして子ウィジェット作成

http://stackoverflow.com/questions/5899826/pyqt-how-to-remove-a-widget

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.