I’ve been using Rails 4 (beta) a lot recently. In a previous post we looked at how ActionController::Live can be used with Server-Sent Events, but the problem with that is that there’s no way for the client to communicate back to the web server. Enter: WebSockets. The main issue with implementing WebSockets is that they have to keep their connections open for a long period of time, and when you’re
これはLL Ringというイベントの「じゃんけん2.0」に出場する際に「多くの構文に改行が必須であるPythonで書かれたじゃんけんエージェントをワンライナーにしていたらウケるかな」と思ってワンライナー化しているときに書いたメモです。自分用のメモのつもりだったので書き殴ってありますが、意外と人気のようなので近いうちに加筆します。 実は後から書いた英語版(How to make oneliner in Python?)の方が整理されているのかも。 完成したワンライナー def文を式にする defは改行を要求するのでlambdaに置き換える必要がある。 def foo(x): return x + 1(ここに改行) foo = lambda x: x + 1 globals().__setitem__("foo", lambda x: x + 1) lambdaは式しか含むことが出来ないので、
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く