remote_api 404 Not Found

on 2013/01/24 - 0 Comments

Google App Engine の remote_api が 404 Not Found になる件について。

app.yaml の handlers 定義の順序に気をつけましょう、というオチ。悲しい。

以下、引用:

9. The order that handlers in app.yaml, web.xml, and appengine-web.xml are specified in matters

One of the more common and subtle mistakes people make when configuring their app is to forget that handlers in the application configuration files are processed in order, from top to bottom. For example, when installing remote_api, many people do the following:

handlers:
- url: /.*
script: request.py

- url: /remote_api
script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py
login: admin

The above looks fine at first glance, but because handlers are processed in order, the handler for request.py is encountered first, and all requests - even those for remote_api - get handled by request.py. Since request.py doesn't know about remote_api, it returns a 404 Not Found error. The solution is simple: Make sure that the catchall handler comes after all other handlers.

The same is true for the Java runtime, with the additional constraint that all the static file handlers in appengine-web.xml are processed before any of the dynamic handlers in web.xml.


from 10 things you probably didn't know about

Joe Gebbia, Airbnb

on 2013/01/17 - 0 Comments

Aribnb の Joe Gebbia さん。

サービスの着想から立派に立ち上がった現在までを振り返ったプレゼンテーション。

Joe Gebbia: The Airbnb Story from Piers Fawkes on Vimeo.


次旅行に行く時にぜひ使ってみたいっすね。

Flask で認証チェック

on 2012/12/22 - 0 Comments -

すべてのリクエストに対して共通の前処理・後処理をかませたいというのはよくあることですが、Flask でどうやるかがドキュメントをぱっと読んで分からなかったので調べた時のメモ。

結論から言うと、before_request という annotation を使えばよい。また before_request を付けたメソッドのなかで redirect を使うこともできるので、認証の状態をチェックして、ログイン画面に redirect なんてことも可能。

Flask のメーリスでも流れていたっぽい。- Intercept all requests

こういうわりとよく使われそうな機能は Tutorial あたりでほんの少しだけでも言及していただけるととても助かるんだけど、言及されていないということは意外と使われていないということなのだろうか。

おしまい。

ipx - Extended IP Implementation

on 2012/11/18 - 0 Comments -

以前 IP の範囲判定を実装したことがあったのですが、その時のソースコードが発掘されたのでちょっと整えて github に公開してみました。

ipx - Extened IP Implementation @ github

こんな感じで使うことができます:


ポイントとしては以下な感じです。
  • CIDR 形式、IP 形式どちらでも範囲判定できる
  • unsigned int としての値を取得できる

また上記で使っている IP クラスの他に CIDR クラス、IPRange クラスも用意しました。
同じ範囲に対して複数の IP を判定したい時はこれらのインスタンスを生成して使うのがいいと思います。


国判定のロジックも一緒に発掘されたので後ほど機能として追加する予定です。

皇居(26km)

on 2012/11/14 - 0 Comments -

皇居5周。最後 26 分くらいまで徐々にビルドアップ。

昔のようには全く走れないのだけれども、それでも大分体ができてきた印象。
この調子でしばらく続ければ、春くらいにはもうちょっとシャキッと走れる気する。

11月:36km

TED : Jane McGonigal: Gaming can make a better world

on 2012/07/10 - 0 Comments -

ゲーミフィケーションに考察を与えてくれるトーク。



手軽さと意義深さの両立が今後の課題ですかね。

夏の思いで 2011

on 2012/07/06 - 0 Comments

昨年の夏、ちょうど転職前に行ったシンガポールにて。

夕暮れ時の黄昏れた感じがたまらなく好きでした。

Untitled
ということで、今年の夏もバタバタしそうです。

TED: Renny Gleeson: 404, the story of a page not found

on 2012/06/11 - 0 Comments



とはいえ、リンクが切れてたらすぐにホームにリダイレクトしてもらったほうが僕はうれしい。

TED : Sheena Iyengar: How to make choosing easier

on 2012/02/01 - 0 Comments -



自分が選びやすいようにというのもあるけど、相手にとっての選びやすさという点で色々と応用が利きそう。

TED : Mikko Hypponen: Three types of online attack

on 2012/01/19 - 0 Comments -


プライバシーの問題ではない。自由についての問題なのだ。