タグ

algorithmとphpに関するkoyhogeのブックマーク (3)

  • 言語の GC 機能と参照カウント (後編-1) - moriyoshiの日記

    追記: 最後の図の「C」の参照カウントが 1 ではなく 2 になっていたのを修正 次回は cycle collector の実装と、回避方法について書く予定。 言語の GC 機能と参照カウント (中編) と 2008 年の 5 月 31 日に書き残して早 1 年と 2 ヶ月を迎えようとする中の後編です。 Cycle collector の実装方法について Bacon らによる「Concurrent Cycle Collection in Reference Counted Systems」という論文が有名と思われる。この論文では、まず同期的な cycle collector の実装の改善について述べ、さらにそれを非同期的な方式へ拡張する方法について述べている。今回は、最初の同期的な方法のアルゴリズムについてのみ見ていく。 基的には mark and sweep 論文には以下のような説明と

    言語の GC 機能と参照カウント (後編-1) - moriyoshiの日記
  • PHPでsleep sort

    コロンブスの卵的なソートアルゴリズム「sleep sort」をPHPで実装してみました。 via . 常識を覆すソートアルゴリズム!その名も”sleep sort”! – Islands in the byte stream fork使うので、pcntlを有効にします。 sudo port install php5-pcntl さくっと実装。 実行 % php sleepsort.php % 12345678910 トラックバック:2 このエントリーのトラックバックURL /blog/2011/05/sleep_sort_php.html/trackback Listed below are links to weblogs that reference PHPでsleep sort from Shin x blog pingback from Sleep sortの各言語での実装まとめ

  • Rubyの浮動小数点数リテラルの扱いは正しいのか - hnwの日記

    題名の通りなんですが、前回の記事「PHP以外全員不正解」に対して「ダウト!」を頂戴したのでまとめてみます。 Cのこの動作が、唯一無二絶対のものであるとする根拠はどこにあるのでしょうか? strtod によれば、 If the subject sequence has the decimal form and at most DECIMAL_DIG (defined in ) significant digits, the result should be correctly rounded. If the subject sequence D has the decimal form and more than DECIMAL_DIG significant digits, consider the two bounding, adjacent decimal strings L and

    Rubyの浮動小数点数リテラルの扱いは正しいのか - hnwの日記
    koyhoge
    koyhoge 2007/08/03
    濃すぎてついていけませんw
  • 1