タグ

2013年12月29日のブックマーク (5件)

  • DM's Esoteric Programming Languages - Bogobogosort

    Mike Rosulek writes: I believe bogobogosort is O(n * (n!)n). Let BBS(n) be the expected time of bogobogosort on input size n, and SC(n) the expected time of the sort checking algorithm on input size n. Then BBS(n) = SC(n) + (1 - 1/n!) BBS(n) // with probability 1/n!, we finish, otherwise repeat BBS(n) SC(n) = O(n) + BBS(n-1) + (1-1/n)( BBS(n-1) + O(n) ) // with probability 1/n, the n-th guy is the

    niku_uchi
    niku_uchi 2013/12/29
    “I'm guessing this thing is at least O(n!n!).”
  • EventEmitterの代わりにEventEmitter2を使う - from scratch

    このエントリをNode.js Advent Calendarにするか迷いましたが、Advent Calendarとしてはちょっとマニアックだったので、没になった方もアップします。ブログエントリの大掃除中です。 Node.jsを使うならEventEmitterを知っとくべし、という記事とかありますが、EventEmitter使ってるといくつか疑問に当たりますよね。 EventEmitterおさらい EventEmitterの基的な機能をおさらいしておくと、EventEmitterというのは、イベントという単位で処理を行えるようにするためのモジュールで、イベントの受発信を行うことで非同期プログラミングを行いやすくするもの。 emitでイベントを発行 onで発行したイベントを受信 removeListenerでイベントを消すことができる onceで一回だけイベントを受信することができる で、こ

    EventEmitterの代わりにEventEmitter2を使う - from scratch
    niku_uchi
    niku_uchi 2013/12/29
  • serfとDockerでクラスタを組んでみる - $shibayu36->blog;

    最近Serfというツールも気になっていたので、とりあえずクラスタを組んでイベントハンドラの設定をしてみるところまでやってみました。 Serfとは http://www.serfdom.io/ https://github.com/hashicorp/serf Serf is a decentralized solution for service discovery and orchestration that is lightweight, highly available, and fault tolerant. Orchestrationという層を支援する軽いツールみたいですね。これをうまく使うことで、クラスタにjoinしたweb serverを自動的に配下に加えるHAProxyとかを実装したり出来ます。参考: Serf+HAProxyで作るAutomatic Load Balanc

    serfとDockerでクラスタを組んでみる - $shibayu36->blog;
    niku_uchi
    niku_uchi 2013/12/29
  • Ruboto

    Ruby support can be added to any modern Android application by adding JRuby as a dependency. The Ruboto project aims to add some additional sample code to make the integration between Java, Ruby, and the Android platform a pleasant developer experience. The Apps created thereafter depend on JRuby (jruby-jars) at runtime to provide full access to Android's Java APIs. Installation is straight-forwar

    niku_uchi
    niku_uchi 2013/12/29
    “Ruboto is a framework and tool chain to develop native Android apps, using the Ruby language we all know and love.”
  • tmuxで大量のサーバーを操る最高の方法 - Qiita

    こんにちはこんにちは 私は日々大量のサーバーで作業をする必要があるので tmux が欠かせません そんな中最高便利な記事が先日公開されました Tmuxでウィンドウをインタラクティブに移動する - Qiita [キータ] しかしこの記事が全く話題になっていません おそらく理解されていないのだと思います ということで私がもう少し詳しく説明したいと思います 先程の記事と同様に ssh-configにはパターンが使えるので便利 - Qiita [キータ] tmuxで色んなホストにsshする時に便利な.ssh/config - Qiita [キータ] の合計 3 記事を組み合わせて初めて達成できる最高のソリューションを紹介します tmux のウィンドウの名前 tmux で大量のウィンドウを立ち上げて ssh しているとどのウィンドウがどこのホストにいるのか分からなくなります そこで先程紹介した 2

    tmuxで大量のサーバーを操る最高の方法 - Qiita
    niku_uchi
    niku_uchi 2013/12/29