タグ

2012年8月23日のブックマーク (6件)

  • PHP Best Practices: a short, practical guide for common and confusing PHP tasks

    A short, practical guide for common and confusing PHP tasks Last revised & maintainers This document was last reviewed on July 26, 2021. It was last changed on July 26, 2021. It’s maintained by me, Alex Cabal. I’ve been writing PHP for a long time now, and currently I run Scribophile, an online writing group for serious writers, Writerfolio, an easy online writing portfolio for freelancers, and St

    masakielastic2
    masakielastic2 2012/08/23
    PHP 5.3.6 以降であれば set names utf8 を使うのではなく charset を指定する。
  • クロージャデザインパターン (PHP 版)

    2013年4月13日追記: PHP 5.5 で finally 句が追加されたので Loan パターンを追記しました。 Closure Design Patterns で紹介されている Groovy のコードを PHP に翻訳しました。無名関数とクロージャを区別しても情報が分散してしまうのでクロージャに統一しました。Method Combination (関数合成)は省略しました。原文ではカリー化(currying) と書いている箇所を部分適用 (partial application) に訂正しました。カリー化と部分適用の違いについてはこちらのブログに解説があります。Groovy コアに当のカリー化メソッドを採用することへの要望があり、長期的には取り込まれる見込みのようです。 これらのパターンは Venkat Subramaniam 氏および Neal Ford 氏のプレゼン資料から抜

    masakielastic2
    masakielastic2 2012/08/23
    「アジャイルプラクティス」の著者(Venkat Subramaniam)と「プロダクティブ・プログラマ」の著者(Neal Ford・IBM のサイトに関数型プログラミングの連載あり)のスライドに掲載されているコードの抜粋を PHP に翻訳しました。
  • [#GROOVY-4998] Real currying support - jira.codehaus.org

    Hi. Groovy's Closure have a name of method 'curry'. But this is not work for a real currying, it work as a partial function application. So, I wrote method of 'Real currying'. Referenced http://en.wikipedia.org/wiki/Currying Closure add = {a, b, c -> a + b + c } // Closure of adding 3 arguments. assert add(1, 2, 3) == realCurry(add)(1)(2)(3) assert 6 == add(1, 2, 3) def curriedAdd = realCurry(ad

    masakielastic2
    masakielastic2 2012/08/23
    curry メソッドが行うことはカリー化ではなく部分適用なので、本当のカリー化メソッドを追加するよう改善要求。
  • 絵で見るモナド · eed3si9n

    2012-08-21 John Wiegley さんの “Monads in Pictures” を翻訳しました。翻訳の公開は人より許諾済みです。翻訳の間違い等があれば遠慮なくご指摘ください。 2012年8月20日 John Wiegley 著 2012年8月21日 e.e d3si9n 訳 これはモナドのチュートリアルではないし、ここには数学用語も出てこない。稿は、既にモナドを一応使えるぐらいには習った人を対象とする。視覚化することで、何のために何をやっているかが明らかになるはずだ。 関数 モナドに対する直感を得る一つの方法として関数からモナドへの抽象化をたどるというものがある。関数が何をやっているのかを簡単な絵で表してみよう。Haskell の関数の呼び出しの構文を上に、同じ演算を視覚化したものを下に置いた: 関数はある値 a を投射 (map) して別の値 b を得る。中で何が起

  • Unlink and SplFileObject

    masakielastic2
    masakielastic2 2012/08/23
    SplFileObject はファイルのクローズを自動的にやってくれる。
  • "The Best Programming Advice I Ever Got" with Rob Pike | | InformIT

    Rob Pike, now a Distinguished Engineer at Google, worked at Bell Labs as a member of the Unix Team and co-created Plan 9 and Inferno. He was central to the creation of the Go and Limbo programming languages. Rob shares an experience at Bell Labs that changed his approach to debugging. Save 35% off the list price* of the related book or multi-format eBook (EPUB + PDF) with discount code ARTICLE. *