タグ

2012年10月16日のブックマーク (12件)

  • rrails -- Preload rails environment to make rails/rake commands faster.

    Preload rails environment to make rails/rake commands faster. Download as .zip Download as .tar.gz View on GitHub Tweet #rrails Preload rails environment to make rails/rake commands faster. Why? Without rrails: $ time ( rails generate >/dev/null ) ( rails generate > /dev/null; ) 9.29s user 0.41s system 98% cpu 9.807 total $ time ( rake routes >/dev/null ) ( rake routes > /dev/null; ) 8.17s user 0.

    xef
    xef 2012/10/16
  • OAuth 2.0をはじめよう

    書は、Webアプリケーションのためのユーザー認証プロトコルであるOAuth 2.0の概要を紹介する書籍です。基礎となるOAuth誕生の背景や用語の解説から、 サーバサイドWebアプリケーションフロー、クライアントサイドWebアプリケーションフロー、リソース所有者パスワードクレデンシャルフロー、クライアントクレデンシャルフローなどの各認証フロー、またモバイルアプリケーションからユーザデータへのアクセスや、次世代の認可・認証技術OpenID Connect認証に関する内容を概説しています(OpenID ConnectについてはOpenID Connect Basic Client Profile 1.0 - draft 15に基づいています)。なお書はEbookのみの販売となります。 はじめに 書の表記規約について サンプルコードの利用について お問合せ先 謝辞 1章 はじめに OAut

    OAuth 2.0をはじめよう
    xef
    xef 2012/10/16
  • node.js と thread hog の話(2)

    [前回までの話へのリンク] ・node.js と thread hog の話(1) 最近になって「c10k 問題」が広く知られるようになったが、実際には、前回書いたように、thread を使いすぎるプログラム(thread hog なプログラム)はスケーラビリティが悪いということは、当時(90年代の終わりごろ)でもすでに「知る人は知る」問題になっていた。 複数のクライアントマシンとの間のソケットを開きっぱなしにしておく、Proxy Server、Chat Server、MMORPG に関わっている人達の間で、ソケット一つに thread を一つ割り当てるスタイルのプログラミングがスケーラビリティに欠けることが知られるようになったのもこのころである。 当時、Microsoft で MSN Messenger を作っている知り合いが「ついに1万人が同時接続しても大丈夫なアーキテクチャに到達した

    xef
    xef 2012/10/16
  • node.js と thread hog の話(1)

    ここ数日、 node.js で色々と作りはじめているのだが(node.js が一番力を発揮するのは、xmpp server や、push notification server のようにソケットを開きっぱなしにして非同期通信をするケースだと思うのだが、それについては来週のメルマガで詳しく解説する)、これで思い出すのが Microsoft 時代の「"thread hog" 退治」だ。 "thread hog" とは私が作った造語で、"memory hog" (メモリをやたらと使うプログラムのこと)と同じように、thread を不必要に作るプログラムのこと。 最初に出会った thread hog は、Microsoft が作っていた proxy server だった。コネクションが1000を超すとやたらと遅くなり、しまいには落ちてしまうという欠点を持っていたため、一時は「出荷出来ないところか、

    xef
    xef 2012/10/16
  • PerlによるFreeモナドの実装 - Pixel Pedals of Tomakomai

    悟りを開けると話題のFreeモナドをPerlで実装した。実装はこちら。 Freeモナドとは? モナドの性質の1つとして、flatten : TTX → TX (または join、またはη)によって重複する関手Tを1つに押しつぶせるという点がある。そのお陰で、TTTTTTXのようにTが複数ある型は考える必要がなく、XとTXという2つの型に限定して計算を考えることができる。が、モナドではない一般の関手Fではこの操作ができない。 じゃあこの操作を普通の関手でもできるようにしてやろうということを考えると自然とFreeモナドが構成できる。直和が定義できる圏であれば、自由モノイドを作るのと同じ要領でモナドを作ればよい。具体的には、関手を適用しない型、1回適用した型、2回適用した型、・・・*1のすべての直和をとる。つまり、TX = X + FX + FFX + FFFX + ... のような関手を作るこ

    PerlによるFreeモナドの実装 - Pixel Pedals of Tomakomai
    xef
    xef 2012/10/16
  • コーディング規約をまとめてみた (Rails編) - bojovs::blog

    半年ほど前に書いた「コーディング規約をまとめてみた (Ruby編)」に引き続き、Railsのコーディング規約もまとめてみました。前回と同じように、できるだけ理由を併記するよう努めました (主観的なものも含まれていますが…)。 気に入らない規約や、この記事に書かれている規約以外にも気をつけていることなどありましたら、コメントなどで教えてもらえると嬉しいです (理由も合わせて書いてくれると助かります)。 Railsのコーディング規約は以下のページを参考にまとめています。 http://guides.rubyonrails.org/contributingtorubyonrails.html#follow-the-coding-conventions https://github.com/bbatsov/rails-style-guide 前提 コード例は「コーディング規約をまとめてみた (Ru

    xef
    xef 2012/10/16
  • GitHub - rubocop/rails-style-guide: A community-driven Ruby on Rails style guide

    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

    GitHub - rubocop/rails-style-guide: A community-driven Ruby on Rails style guide
    xef
    xef 2012/10/16
  • Google Earth Fractals

    Self Similarity Fractals are usually associated with self similarity across scales. For pure/idealised mathematical fractals the self similarity may be across an infinite range of scales, such as the Sierpinski Gasket. In real life and in nature the self similarity is only across a range of scales. Branching structures, such as most of the examples shown here, are classic examples of self similari

  • Sol — a sunny little virtual machine

    During this weekend, together with a few evenings earlier this week, I created a rather simple virtual machine dubbed “Sol”, after the Swedish word for “sun”. I’ve read a lot about VM design and I’m into stuff like OS design, programming languages and other seeminlgy obscure and nerdy stuff surrounding the concept of a computer as a generic tool. A virtual machine (VM) is a software implementation

    Sol — a sunny little virtual machine
  • そのデッドロック、知ってました?

    こんにちわ。開発エンジニアのsugimotoです。 今回はPostgresqlのデッドロックについてちょっと書いてみます。 確認した環境はPostgresql9.1.4です。 ロックとかデッドロックについての説明は省きます。 デッドロックの調査 カタログテーブルのpg_locksを確認すると現在のロック状態がわかります。 pg_classと結合すればテーブル名もわかります。 各ロックの競合関係図はhttp://www.ecoop.net/memo/archives/2008-05-30-1.htmlがわかりやすくてお勧めです。 デッドロックの例 自分が経験したことのあるデッドロックの例を3つほどあげます。 例1.明示的なロックによるデッドロック 一番普通のパターンです。 にはこれが載っていることが多いです。 自分もつい2年くらい前まではデッドロックはこのパターンしかないと思ってました。

    そのデッドロック、知ってました?
  • Machine Learning: k-Means Clustering Algorithm in Javascript

    Burak Kanber, Engineer Author, tech CTO, engineer, and some other things too. Subscribe via RSS Twitter Contact Machine learning helps us navigate and process large volumes of data. We can ask all sorts of questions about our data, and hope that ML can answer them: what is this data point most similar to? Does the data come in patterns? Can we predict what will happen in the future, given past tre

    xef
    xef 2012/10/16
  • Communication Patterns in Cloud Haskell (Part 4)