2013/02/21


一般的な Web Programmer ならば、HTTP Status code はすべて暗記していると聞きました。

しかし、僕は初心者なので、なかなか覚えきれていないので、HTTPのステータスコードをさがすのに便利なツールを用意しました。
httpstatus-vim です。インストール方法は bundle かなんかで以下を追加して下さい。
mattn/httpstatus-vim - GitHub
https://github.com/mattn/httpstatus-vim
使い方は以下のとおりです。 4xx なコードを列挙する。 :HttpStatus 4
400: Bad Request
401: Unauthorized
402: Payment Required
403: Forbidden
404: Not Found
405: Method Not Allowed
406: Not Acceptable
407: Proxy Authentication Required
408: Request Timeout
409: Conflict
410: Gone
411: Length Required
412: Precondition Failed
413: Request Entity Too Large
414: Request-URI Too Large
415: Unsupported Media Type
416: Request Range Not Satisfiable
417: Expectation Failed
418: I'm a teapot
422: Unprocessable Entity
423: Locked
424: Failed Dependency
425: No code
426: Upgrade Required
428: Precondition Required
429: Too Many Requests
431: Request Header Fields Too Large
449: Retry with
40x なコードを列挙する :HttpStatus 40
400: Bad Request
401: Unauthorized
402: Payment Required
403: Forbidden
404: Not Found
405: Method Not Allowed
406: Not Acceptable
407: Proxy Authentication Required
408: Request Timeout
409: Conflict
500 ってなんだっけ? :HttpStatus 500
500: Internal Server Error
403 ってなんだっけ? :HttpStatus 403
403: Forbidden
Bad なんとかってなんだっけ? :HttpStatus Bad
400: Bad Request
502: Bad Gateway
とりあえず全部みるか。 :HttpStatus
今日の参考資料
http://blog.64p.org/entry/2013/02/21/121830
Posted at by



2013/02/13


Boost 1.53 がリリースされたので入れた。
新しく追加されたライブラリ。
  • Atomic: C++11-style atomic<> from Helge Bahmann, maintained by Tim Blechmann.
  • Coroutine: Coroutine library, from Oliver Kowalke.
  • Lockfree: Lockfree data structures, from Tim Blechmann.
  • Multiprecision: Extended precision arithmetic types for floating point, integer and rational arithmetic from John Maddock and Christopher Kormanyos.
  • Odeint: Solving ordinary differential equations, from Karsten Ahnert and Mario Mulansky.
非同期関連が増えて面白くなってきた。
試しに boost::coroutine 使おうと思ったら boost::context の make_fcontext と jump_fcontext がアセンブラでシンボルエクスポートされてなさげ。普段は masm にパスを通しているのだけど、どうやら VC 付属の ml じゃないと駄目らしい。
気付くまでハマった。。。

ようやく動くようになった。 #include <boost/coroutine/coroutine.hpp>

int
main(){
  typedef boost::coroutines::coroutine<std::string()> ctype;

  ctype
  c([] (ctype::caller_type &yeild) {
    for (int i = 0; i < 10; i++){
      yeild(i % 2 == 0 ? "フル" : "チン\n");
    }
  });

  while(c) {
    std::cout << c.get();
    c();
  }

  return 0;
}
実行結果 フルチン
フルチン
フルチン
フルチン
フルチン
ブーストフルーチンでは無いので注意。
Posted at by



2013/02/08


日本人なら日本語だろ!!
日本語プログラム言語「なでしこ」公式ページ

「PC Online」に執筆していたコラム(へのリンク)が、PBSupport さんのページで、FM用(FileMaker)のデータベースとして公開されました。 これは、クジラ飛行机「文系サラリーマン...

http://nadesi.com/
#!cnako

データとはハッシュ
「hoge:foo  bar:baz time:20:30:58」を「\t」で正規表現区切る
それを反復
  それを「^([^:]+):(.*)」で正規表現マッチ
  データ@抽出文字列[0]は抽出文字列[1]

データを表示
実行結果 time=20:30:58
bar=baz
hoge=foo
参考資料
Posted at by