タグ

2011年10月19日のブックマーク (6件)

  • quick sortよりも高速でmerge sortのように安定しているソートアルゴリズムtim sort [勘違い] - Islands in the byte stream

    <追記>ベンチマークプログラムに誤りがありました。ソート済のシーケンスに対してソートを掛けていました。ご指摘ありがとうございます>ak氏 そんな夢のようなソートアルゴリズムがあるのかというと、あるらしいんです。それがtim sortと呼ばれるアルゴリズムです。 画期的(?)なソートアルゴリズム「Sleep Sort」:濃縮還元オレンジニュース|gihyo.jp … 技術評論社 このあたりで拾ってきたネタですね。 merge sortを改良したアルゴリズムで、安定*1しており、しかも実行速度にも優れているとか。アルゴリズムの性能の評価は済んでいるらしく、CPythonやJDK7には既に導入済みのようですね。 ならば当然Perlのソートも…と考えるわけですが、まず評価のためにJavaのソースをC++にそのまま移植してみました。それがこれ(いちおうテスト済): https://github.co

    quick sortよりも高速でmerge sortのように安定しているソートアルゴリズムtim sort [勘違い] - Islands in the byte stream
  • Test Driven Development With Python

    Test-driven development (TDD) is an iterative process where tests are written before code to validate requirements. It follows the "red-green-refactor" cycle: write a failing test, write code to pass the test, refactor code. The document demonstrates TDD with a palindrome checker function, writing multiple tests to handle different cases before refactoring the code. Unit testing frameworks like un

    Test Driven Development With Python
    kk6
    kk6 2011/10/19
  • Qt 4.7: QML Elements

    kk6
    kk6 2011/10/19
  • PythonでTDD その2 – 日曜研究室

    さっき書いたばかりのPythonでTDDですが、Python2.7でunittestのdiscoveryができるようになった今、複数テストの自動実行がそんなに面倒な訳がないと思い、調べ直してみたところすげー簡単に全体テストとサブパッケージ毎のテストが出来ることが判明。 ディレクトリ構成は前回のままで、test.pyとtests配下の__init__.pyが必要なく、以下のコマンドでそれぞれ実行出来ます。 全体テスト(全部の単体テストを実行) python -m unittest discover -p '*test.py' -v サブパッケージ毎のテスト python -m unittest discover -s 'tests/tests_libs' -p '*test.py' -v 単体テスト python -m unittest discover -s 'tests/tests_li

    kk6
    kk6 2011/10/19
  • Rolling with Ruby on Rails

    Now, next, and beyond: Tracking need-to-know trends at the intersection of business and technology AI/ML Few technologies have the potential to change the nature of work and how we live as artificial intelligence (AI) and machine learning (ML). Future of the Firm Everything from new organizational structures and payment schemes to new expectations, skills, and tools will shape the future of the fi

    Rolling with Ruby on Rails
    kk6
    kk6 2011/10/19
  • テスト駆動開発・実践編 - Strategic Choice

    ケント・ベック師の著書で、TDDの教科書「テスト駆動開発入門」の、「Part1 Money オブジェクトの例」を写経して、TDDを「実践」し、これまで学習した「パターン」「プラクティス」を理解し、定着させます。目次テスト駆動開発・実践編01・黄金の回転(「第1章 複数通貨のMoney」より)テスト駆動開発・実践編02・テストファースト(「第2章 オブジェクトの退化」より)テスト駆動開発・実践編03・(「第3章 すべてに対する等価性」より)テスト駆動開発・実践編04・(「第4章 プライベート化」より)テスト駆動開発・実践編05・(「第5章 『フランク』に話す」より)テスト駆動開発・実践編06・(「第6章 再度、すべてに対する等価性」より)テスト駆動開発・実践編07・(「第7章 りんごとみかん」より)テスト駆動開発・実践編08・(「第8章 オブジェクトの生成」より)テスト駆動開発・実践編09・

    kk6
    kk6 2011/10/19