プログラミング

sbt起動時に Failed to construct terminal エラーが出る

$ sbt [ERROR] Failed to construct terminal; falling back to unsupported java.lang.NumberFormatException: For input string: "0x100" ... stackoverflow.com どうも screen-256colorなどがダメなようなので 下記のようなファイルをPATHの優先順位が高…

boolから整数型に変換する時、falseは0に、trueは1になる

N1905 [conv.integral] If the destination type is bool, see 4.12. If the source type is bool, the value false is converted to zero and the value true is converted to one. [conv.bool] An rvalue of arithmetic, enumeration, pointer, or pointer…

今素直にvue-loaderをnpm installすると面倒くさい

2018-04-25に vue-loader15がリリースされたのだけど、色々変更が多く互換性が無くて設定が面倒だったので、vue-loader 14 を入れることにした。 npm install -D vue-loader@14

std::setの要素を追加・削除しても既存の要素への参照やイテレータは有効なまま維持される

N1905 23.1.2 - 8 The insert members shall not affect the validity of iterators and references to the container, and the erase members shall invalidate only iterators and references to the erased elements C++の連想コンテナ全般(setとかmap系…

mod_rewrite を使ってブラウザのURL欄には http://hoge.com/fuga と表示しつつページの中身は http://hoge.com/index.cgi/fuga を表示させる方法

.htaccess ファイルに以下のように書く RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^.* - [L] RewriteBase / RewriteRule ^(.*)$ index.cgi/$1 [L] Mojolicious::Lite を使ってて cgi だろうと単体で動かしてる時だろうと同じアドレ…

declval<T>() の返り値型が T&& である理由

メモ。 そもそも declval とは? 型T1, T2 があり、それらの値を乗算した結果の型を得たい場合、 素直に考えると decltype( T1() * T2() ) で得られそうだが、これは T1, T2 共にデフォルトコンストラクタが無いと T1(),T2()がコンパイルエラーになってしま…

SDL2で出来る事メモごく一部

http://www.libsdl.org/ SDLのバージョン2が出ると同時になんかサイトもオシャレになってるので, チマチマWikiを眺めてて知ったことをメモ. 尚,この記事は http://wiki.libsdl.org/ に書いてあること以上の内容はありません.

i686-w64-mingw32 のコンパイル済みバイナリ入れたら一発で動いた

ありがたくも有志がビルドしてくれてるバイナリが普通にあったのでそれ入れたら一発で出来ました. http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/gcc-4.7-release/ ここのi686-w64-mingw32-…

さくらVPSのcentos に i686-w64-mingw32 が……入れられない

http://kanedaq.blog24.fc2.com/blog-entry-10.html ここを参考にして gcc-4.8.2 をビルドしてみたが,手順5の途中で checking for wchar.h... (cached) yes checking for wctype.h... (cached) yes checking for ld version... 22300 checking for ld that…

とても単純なWebサービスを一時間で作った

作ったもの md.nyaocat.jp http://md.nyaocat.jp/?url=(マークダウンファイルのURL) これでMarkdownファイルをhtmlに変換して表示してくれる. あまりセキュリティ考えてないので悪いところがあったら教えてください. ソースコード Github nyaocat/md.nyaoc…