This document discusses string searching algorithms in PostgreSQL, specifically the Boyer-Moore-Horspool algorithm. It provides an overview of the algorithm and where it is implemented in PostgreSQL source code. It also discusses issues around multi-byte character sets and provides some references for further reading on the topic.
The document discusses the history and future of the Debian operating system, highlighting significant release dates from Sarge (2005) to Jessie (2015) and plans for Stretch (2017) and Buster (2019). It emphasizes ongoing community efforts, technical improvements in package versions, and the importance of volunteer contributions to the platform. Additionally, it addresses features in the latest releases and plans for enhancing user experience and infrastructure in future versions.
This document summarizes Grand Unified Configuration (GUC) parameters in PostgreSQL. It describes how GUC parameters can be modified, the contexts in which modifications can be reverted, and how to view current parameter settings and sources using pg_settings. It provides examples of modifying parameters at different scopes like system-wide, database-level, and for individual users.
This document summarizes the differences between the ruby-postgres and postgres-pr PostgreSQL database adapters for ActiveRecord in Ruby. It notes that postgres-pr is pure Ruby while ruby-postgres uses the libpq C library. It provides examples showing that postgres-pr is missing some functionality that ruby-postgres has like ParameterStatus support and asynchronous query execution. It concludes that while postgres-pr is useful, it has limitations that may prevent ActiveRecord from working properly, so ruby-postgres is likely better supported.
6. London school TDD
ロンドンのXPコミュニティが発祥
モックを積極的に使い、状態ではなく振る舞いに注目したTDDの
手法
Growing Object-Oriented Software Guided By Tests(2009)
通称The GOOS Book
実践テスト駆動開発(2012)
phpspecの作者「London school TDDを学ぶ上でベストなリソース」
(Full Stack Radio #15)
ただし結構難しい本
? GUIあり、ネットワーク通信あり、マルチスレッドあり
? 難しい問題を解決する手法を解説しようとすると、例も難しくなると
いう技術書のジレンマ
7. 個人的な体験として
The GOOS Bookを読む → 「なるほど(わからん)」
phpspecを知る → 「なるほど(わからん)」
phpspecについて調べる → 「それThe GOOS Bookに書いてあるよ」
The GOOS Bookを読む → 「ホンマや!」
? phpspecを学ぶこ
とでLondon School
TDDが理解できた
(気がする)
phpspecを使えば
London School TDD
を上手く説明でき
るのでは?
10. Outside-In/Inside-Out
class A {
function __construct(B $b) {
}
}
class B {
function __construct(C $c, D $d) {
}
}
class C {
}
class D {
}
Outside-In
? Bをダミー(Mock, Stub)に置き換え
てAをテストする
? AがBに要求しているものが明確にな
る
Inside-Out
? C,Dを先に実装してからBを実装する
? テストの粒度は次第に大きくなる
? ダミーを実装する手間はかからない
? Bを実装中はAが存在しないので、A
がBに何を要求するかわからない
29. class MarkdownSpec extends ObjectBehavior
{
...
function it_convers_text_from_an_external_source()
{
// $reader->getMarkdown()が"Hi, there"を返すとする
$this->toHtmlFromReader($reader)
->shouldReturn("<p>Hi, there</p>");
}
spec/MarkdownSpec.php
30. class MarkdownSpec extends ObjectBehavior
{
...
function it_convers_text_from_an_external_source()
{
$reader->getMarkdown()->willReturn("Hi, there");
$this->toHtmlFromReader($reader)
->shouldReturn("<p>Hi, there</p>");
}
spec/MarkdownSpec.php
31. use Reader;
class MarkdownSpec extends ObjectBehavior
{
...
function it_convers_text_from_an_external_source(Reader
$reader)
{
$reader->getMarkdown()->willReturn("Hi, there");
$this->toHtmlFromReader($reader)
->shouldReturn("<p>Hi, there</p>");
}
spec/MarkdownSpec.php
exampleに仮引数を書くとPhpSpecが$readerを渡
してくれる
32. C:?Users?ishida?src?phpspec>vendor?bin?phpspec run --fake
...
Would you like me to generate an interface `Reader` for you?
[Y/n]
...
Would you like me to generate a method signature
`Reader::getMarkdown()` for you?
[Y/n]
...
Do you want me to create `Markdown::toHtmlFromReader()` for you?
[Y/n]
...
Do you want me to make `Markdown::toHtmlFromReader()` always
return '<p>Hi, there</p>' for you?
[Y/n]
Method Markdown::toHtmlFromReader() has been modified.
/ skipped: 0% / pending: 0% / passed: 100% / failed: 0% / broken: 0%
/ 3 examples
1 specs
3 examples (3 passed)
43ms
Reader::getMarkdown()と
Makkdown::toHtmlFromReader()の仮実装の
自動生成
49. 参考資料
phpspec2: SUS and collaborators(2012)
(http://everzet.com/post/33178339051/sus-collaborators)
phpspec2のalphaリリース時の作者によるコンセプトの解説
Konstantin Kudryashov - Design How Your Objects Talk Through Mocking
at Laracon EU 2014
(https://www.youtube.com/watch?v=X6y-OyMPqfw)
Laracon EUでの作者によるモックを使った開発手法に関する講演。
phpspec自体は使われていない
Does TDD really lead to good design?
(http://codurance.com/2015/05/12/does-tdd-lead-to-good-design/)
Detroit schoolとLondon Schoolの比較など
Laracast
(https://laracasts.com/index/phpspec)
LaravelやPHPに関するスクリーンキャスト。一部無料