タグ

2010年1月16日のブックマーク (6件)

  • michiness.com

    michiness.com 2024 著作権. 不許複製 プライバシーポリシー

    michiness.com
    mooz
    mooz 2010/01/16
  • Array.concatで配列のクローン(コピー)を作成する - latest log

    JavaScriptで配列のクローンを作成しようとして、悩んでいる方もいらっしゃるようですが、 以下のように、for ループや再帰なコードを手書きする必要はなくて、Array.concat() で配列のクローンは作成できます。 Array.prototype.clone = function(){ return Array.apply(null,this) } Array.prototype.clone = function() { if ( this[0].constructor == Array ) { var ar, n; ar = new Array( this.length ); for ( n = 0; n < ar.length; n++ ) { ar[n] = this[n].clone(); } return ar; } return Array.apply( null,

    Array.concatで配列のクローン(コピー)を作成する - latest log
    mooz
    mooz 2010/01/16
    concat ひとつで<del> deep なコピーも出来てる。</del> (追記: deep では無い) Chrome 4 なら slice の倍速いらしい。
  • Google Python スタイルガイド

    概要¶ これは Google Python Style Guide Revision 2.29 を日語に訳したものです。 家ガイドは CC-By 3.0 ライセンス の基で公開されています。また、ガイドも同ライセンスを継承します。 家ガイドの著者は以下の通りです。 Amit Patel Antoine Picard Eugene Jhong Jeremy Hylton Matt Smart Mike Shields また、ガイドの翻訳者は以下の通りです。 Kosei Kitahara ガイドに誤植、誤訳があった場合は issue で教えてください。 その他ガイドに関する問い合わせは、サイト最下部に記載のメールアドレスか @Surgo にお願いします。 はじめに¶ PythonGoogle で使われている主要なスクリプト言語です。 このスタイルガイドは Python によ

    mooz
    mooz 2010/01/16
    良く用いられる Python の機能を鳥瞰するという意味合いでも有益。
  • ブラウザウィンドウのサムネイルを描画する « Mozilla Developer Street (modest)

    タブカタログ拡張機能のようにWebページのサムネイル画像を表示する拡張機能の多くは、 html:canvas 要素の二次元描画コンテクストの drawWindow メソッドへWebページの window オブジェクトなどを引数で渡してサムネイルの描画を行っています(canvas を使って図形を描く – MDC)。 この drawWindow メソッドの引数にWebページの window オブジェクトではなく、ブラウザウィンドウの ChromeWindow オブジェクトを渡すことで、ブラウザウィンドウのサムネイル画像を描画することも可能です。しかし、以下のようにブラウザタブ内に表示されたWebページまでは描画されず、背景色で塗りつぶされたようになってしまいます。 この問題を解決するには、ブラウザウィンドウのサムネイルの上に、Web ページのサムネイルを重ねて描画する必要がありそうです。ここで

    ブラウザウィンドウのサムネイルを描画する « Mozilla Developer Street (modest)
    mooz
    mooz 2010/01/16
    Canvas にブラウザのサムネイルを描画。
  • Free High-Quality Wallpapers For Desktop & Mobile - Wallhalla

    Explore carefully curated world of free, hiqh quality wallpapers for desktop and mobile

    Free High-Quality Wallpapers For Desktop & Mobile - Wallhalla
    mooz
    mooz 2010/01/16
    壁紙検索。特化されたインタフェースの良い例として。
  • Fire and Ice

    For today's entry, an exercise in contrasts: Fire and Ice. Fire can be a life-sustaining, constructive element, or, at worst, a powerfully destructive force - something we humans continue to use, play with, and struggle to control. Ice is closer to the natural state of the universe, cold, still and lifeless. Earth's orbit lies in a "Goldilocks zone" where we may seasonally experience icy environme

    Fire and Ice
    mooz
    mooz 2010/01/16
    炎と氷