<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Web scratch</title> <atom:link href="http://efcl.info/feed/" rel="self" type="application/rss+xml" /><link>http://efcl.info</link> <description>フリーソフトやFirefoxなどについて、web全般なサイト</description> <lastBuildDate>Sat, 14 Apr 2012 15:37:26 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>テストで学ぶJavaScriptについて</title><link>http://efcl.info/2012/0414/res3059/</link> <comments>http://efcl.info/2012/0414/res3059/#comments</comments> <pubDate>Sat, 14 Apr 2012 14:38:26 +0000</pubDate> <dc:creator>azu</dc:creator> <category><![CDATA[javascript]]></category> <category><![CDATA[test]]></category><guid
isPermaLink="false">http://efcl.info/?p=3059</guid> <description><![CDATA[A Test-Driven JS Assessment というテストを通るようなコードを書いて、JavaScriptを学ぶものが公開されていたので、それの紹介です。JS Assessmentは最初に失敗するテストが用意さ [...]]]></description> <content:encoded><![CDATA[<p><a
href="https://github.com/rmurphey/js-assessment">A Test-Driven JS Assessment</a> というテストを通るようなコードを書いて、JavaScriptを学ぶものが公開されていたので、それの紹介です。<br
/><a
href="https://github.com/rmurphey/js-assessment">JS Assessment</a>は最初に失敗するテストが用意されていて、そのテストコードを通るような関数などを書いていってJavaScriptの力試し、学習をするものです。</p><p>簡単にやり方を書くと、Node環境を用意した状態で</p><p><code>git clone https://github.com/rmurphey/js-assessment.git</code>などで、リポジトリをダウンロードして、<br
/>ダウンロードしたディレクトリ内で、 nodeを使って以下のようコマンドを実行してテストが実行できるローカルサーバを立ち上げます。</p><pre><code>npm install
node bin/serve</code></pre><p>実行した状態で <a
href="http://localhost:4444">http://localhost:4444</a> というURLに行けば、Mochaで書かれたテストが走った結果が表示されます。</p><p>テストを通るコードの書き方は、node bin/serve を実行した時に表示されますが、</p><pre>To work on the tests, open a browser and visit http://localhost:4444. Then,
edit the tests in the files in the tests/app directory, reloading your browser
to see whether the tests are passing.

Each test will look something like this:

    it("you should be able to return a truthy value", function() {
      // define a function for fn so that the following will pass
      expect(fn()).to.be.ok();
    });

In the case of the above test, you'd need to define a value for fn (by default,
fn is a function that does nothing):

    it("you should be able to return a truthy value", function() {
      // define a function for fn so that the following will pass
      fn = function() {
        return true;
      };
      expect(fn()).to.be.ok();
    });

For some tests, the instructions will be more involved; in those cases, the
inline comments should give you the details you need.</pre><p>と書かれているように、tests/appにあるコードを編集して、それぞれのitの中にテストケースを通るような関数を定義したりして、<br
/> <a
href="http://localhost:4444">http://localhost:4444</a>にアクセスして全てのテストが通るようにするのが目的です。</p><p>e.g) <a
href="https://github.com/azu/js-assessment/commit/c955516d4a66de510585e50f7811253363422e8a">solve Arrays Test · c955516 · azu/js-assessment</a></p><p><img
title="arrays.js - js-assessment - [~_workspace_js_js-assessment].png" src="http://efcl.info/wp-content/uploads/2012/04/arrays.js-js-assessment-_workspace_js_js-assessment.png" border="0" alt="Arrays js  js assessment   ~ workspace js js assessment" width="600" height="400" /></p><p>テストコードはNodeで動くテストフレームワークの<a
href="http://visionmedia.github.com/mocha/">Mocha</a>を使って書かれています。<br
/>expectで期待してる動作は結構そのまま分かる感じなので、itのテスト文とあわせれば、大体期待してる挙動はわかるとは思いますが、<br
/><a
href="http://visionmedia.github.com/mocha/">Mocha</a>自体の挙動も少し知っておいたほうがいい場合もあります。</p><ul><li><a
href="http://blog.livedoor.jp/ryu22e/archives/65636256.html">ryu22eBlog : Node.jsのテスティングフレームワーク「Mocha」（前編）</a></li></ul><p>用意されてるテストはArrayの機能のテストやBackboneを使ったViewのテスト、非同期のテスト等が入っています。</p><p>これで、<a
href="https://github.com/rmurphey/js-assessment">A Test-Driven JS Assessment</a>の紹介は終わりですが、これ見た時に<a
href="http://el.jibun.atmarkit.co.jp/rails/2011/01/koan-3c38.html">禅の公案（Koan）</a>に何か似てるなとか思った。<br
/>JavaScriptでは</p><ul><li><a
href="https://github.com/liammclennan/JavaScript-Koans">liammclennan/JavaScript-Koans</a> ( <a
href="http://code.google.com/p/javascript-koans/">javascript-koans &#8211; Javascript learning tool. &#8211; Google Project Hosting</a> )</li><li><a
href="http://d.hatena.ne.jp/ninoseki/20111023/1319369396">禅の公安スタイルでCoffeeScriptを学ぶ「coffeescript-koans」 &#8211; にのせき日記</a></li></ul><p>あたりが知られてそうな気がします。(他にも色々あるみたいだけど <a
href="https://github.com/search?langOverride=&amp;q=Koans+Javascript&amp;repo=&amp;start_value=1&amp;type=Repositories&amp;utf8=%E2%9C%93">Search · Koans Javascript</a> ) <br
/>Koanとは以下のような穴埋め用のテストがかかれていて、そのテストを正しく書いてプログラミングを学べるものです。</p><pre><code lang="javasript">test("not", function() {
    not(__, 'what is a false value?');
});</code></pre><p>という穴埋め問題だったら</p><pre><code lang="javasript">test("not", function() {
    not(false, 'what is a false value?');
});</code></pre><p>のように、穴埋めするという感じのものです。</p><p>Koanと<a
href="https://github.com/rmurphey/js-assessment">JS Assessment</a>を比較すると、Koanは穴埋めという要素が強くてロジックなどは用意されてる感じになっています。<br
/>一方 、<a
href="https://github.com/rmurphey/js-assessment">A Test-Driven JS Assessment</a>はテストだけ書かれていて、ロジックなどを書いてそのテストを通るような関数を書くというものになっています。<br
/>似ているところもありますが、やりたいことは逆な感じなので、<a
href="https://github.com/rmurphey/js-assessment">A Test-Driven JS Assessment</a>の場合は人によって答えが全然違うという事もありえて、<br
/>実際のテストファーストなものを書くのに近い感じになっていそうです。</p><p>これを書きながら、JavaScriptを学ぶ時に、最初からテストと絡めて学習したほうが良い感じになるのかなということについて考えていました。<br
/>実際に新人教育とかでそういう事をしている<a
href="http://tech.kayac.com/">会社</a>さん等の成果とかを聞いてみたいですね。</p><ul><li> <a
href="http://rmurphey.com/blog/2012/04/12/a-baseline-for-front-end-developers/">A Baseline for Front-End Developers &#8211; Adventures in JavaScript Development</a></li><li><a
href="http://testfirst.org/">TestFirst.org &#8211; The Home of Test-First Teaching</a></li></ul>]]></content:encoded> <wfw:commentRss>http://efcl.info/2012/0414/res3059/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>ECMAScript勉強会 アウトラインメモ</title><link>http://efcl.info/2012/0407/res3047/</link> <comments>http://efcl.info/2012/0407/res3047/#comments</comments> <pubDate>Sat, 07 Apr 2012 12:57:38 +0000</pubDate> <dc:creator>azu</dc:creator> <category><![CDATA[javascript]]></category> <category><![CDATA[イベント]]></category> <category><![CDATA[ECMAScript]]></category><guid
isPermaLink="false">http://efcl.info/?p=3047</guid> <description><![CDATA[ECMAScript勉強会 に参加してきたのでその時のメモです。久々に結構難しい内容が多かった気がする。 ECMAScript勉強会 ECMAScript概要 &#8211; rika_t ECMAScript Stud [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://atnd.org/events/25793">ECMAScript勉強会</a> に参加してきたのでその時のメモです。<br
/>久々に結構難しい内容が多かった気がする。</p><h1 style="padding-top: 0.25em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: initial; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 23px; border-top-style: none; border-top-color: initial; margin: 0px;">ECMAScript勉強会</h1><h2 style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0.5em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 4px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 20px; border-top-style: solid; border-top-color: #e0e0e0;">ECMAScript概要 &#8211; rika_t</h2><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;"><a
style="color: #4183c4; text-decoration: none; padding: 0px; margin: 0px;" title="ECMAScript Study #1 Overview" href="http://www.slideshare.net/agigigigi/ecmascript-study-1-overview">ECMAScript Study #1 Overview</a></p><hr
style="padding: 0px; margin: 0px; border: 1px solid #dddddd;" /><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">途中参加</p><hr
style="padding: 0px; margin: 0px; border: 1px solid #dddddd;" /><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">newがあるのはなぜ</h3><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">プリミティブな型もメソッドやプロパティを持てるようにしたいため、ラッパーでラップしてた。</p><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">globalオブジェクト</h3><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">globalオブジェクトは必ずしもwindowではない</p><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">オブジェクトとクラス</h3><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">内部的には[[Class]]というクラスという文字列がでてきてた。</p><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ES6から内部的にClassというものがなくなってきてる。</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">リテラル記法やコンストラクタを使って様々なオブジェクトを表現してる</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;"><code
style="padding-top: 0px; padding-right: 0.2em; padding-bottom: 0px; padding-left: 0.2em; font: normal normal normal 12px/normal Monaco, 'Courier New', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; font-size: 12px; background-color: #f8f8ff; color: #444444; margin: 0px; border: 1px solid #dedede;">NativeBrand</code>という名前になってる</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">prototype</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">仕様書にのってるprototypeの図はわかりにくい</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">変数宣言</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">“var&#8221;キーワードの後にIdentifierを与える</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">opt = option としてInitiliser = “str&#8221;みたいに初期化も同時にできる</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">IdentifierName<ul
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">IdentifierStart (変数名の最初に文字列) か初めて</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">IdentifierName IdentifierPart</li></ul></li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;"><strong
style="padding: 0px; margin: 0px;">let</strong> から始まる内容はここで定義してる内容をかかれてる(他を見なくてもいい)</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">変数宣言の処理</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">return (normal,empty,empty) normalは正常終了</li></ul><h2 style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0.5em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 4px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 20px; border-top-style: solid; border-top-color: #e0e0e0;">ES.next 追っかけ &#8211; teramako</h2><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;"><a
style="color: #4183c4; text-decoration: none; padding: 0px; margin: 0px;" title="ES.next 追っかけ - ECMAScript 勉強会" href="http://teramako.github.com/doc/es6_study-20120407/index.html">ES.next 追っかけ &#8211; ECMAScript 勉強会</a></p><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">メーリングリストの購読</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">es-discussの購読</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ES.nextに追うため見るメーリングリスト</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">流量が多い</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">構文抽出</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">wiki.ecmascript.org に最新版のドラフトがアップロードされる</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">更新内容は色分け表示されてる</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ドラフト仕様から構文部分のみ抽出したものを作成</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">Mozillaの実装追いかけ</h3><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">＊SpiderMonkeyのHarmony実装をトラッキングするメタバグがある</p><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">構文解析</h3><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">JavaScriptがどうやって構文解析していくか</p><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">Reflect.parse()メソッド</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">結果をオブジェクトのツリーで返してくれる</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">reflect.jsmを読み込んでReflect.parseが利用できる</li></ul><h4 style="padding: 0px; margin: 0px; border: 0px initial initial;">iv/js</h4><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ES.nextの実装をパースできるツール</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">http://constellation.github.com/iv/js/es.next.html</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">esprimaを使ったものも最近でてきた</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">http://esprima.org/demo/parse.html</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">quasiリテラル</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ヒアドキュメント的に使えそう</li></ul><h2 style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0.5em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 4px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 20px; border-top-style: solid; border-top-color: #e0e0e0;">ES.next the corner case &#8211; Constellation</h2><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;"><a
style="color: #4183c4; text-decoration: none; padding: 0px; margin: 0px;" title="ES.next the corner cases" href="http://constellation.github.com/slides/contents/20120407/presentation.html#slide1">ES.next the corner cases</a></p><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">esprima<ul
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">コミッターやってる</li></ul></li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">ConstDeclarationの話</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">initializer必須</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">Blockスコープ</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">BNFだけでは判断できないで、semaniticsも見ないと行けないようになった *</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">block scope</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">staticに解析可能</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ブロックスコープになったことで、ランタイムでないと判定できなかったのが、静的に解析が可能</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;"><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">そのため速度がかなりよくなった</p></li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;"><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">再代入はsyntax errorにする</p></li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;"><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">これもパース時に判断できるので、速度がよくなる</p><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">const V = 20; V = 30;// syntax error</p></li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;"><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">early errorに分類(run timeより前)</p></li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">egal operator</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">is</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">isnt</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">より値の同一性に重きをおいたequal</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">is/isnt はContextual Keyword</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">Statement先頭にくるキーワードはcontextual Keywordになる<ul
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ofとか</li></ul></li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">文脈依存のキーワードのような扱い方をされるということ</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">&lt;| operator トライアングル演算子</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">常にArrayを継承できる</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;"><code
style="padding-top: 0px; padding-right: 0.2em; padding-bottom: 0px; padding-left: 0.2em; font: normal normal normal 12px/normal Monaco, 'Courier New', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; font-size: 12px; background-color: #f8f8ff; color: #444444; margin: 0px; border: 1px solid #dedede;">&lt;|</code>の右はリテラルしか置けない</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">なぜリテラルのみ<ul
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">JITとかに破壊的になってしまう</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">inline cacheが破壊されて、キャシュが機能しない</li></ul></li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">右側にfunctionリテラルときは挙動が変わる<ul
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">継承っぽくなる</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">Base.prototypeを[[Prototype]]にもつObjectが生成されて、インスタンスのprototypeに設定される</li></ul></li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;"><a
style="color: #4183c4; text-decoration: none; padding: 0px; margin: 0px;" title="ECMAScript と OOP パラダイム、それに ES.next の議論中 OOP 周りのシンタックス - oogattaの勉強日記" href="http://d.hatena.ne.jp/oogatta/20111204/1322982897">ECMAScript と OOP パラダイム、それに ES.next の議論中 OOP 周りのシンタックス &#8211; oogattaの勉強日記</a></li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">ES.next Library Extension</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">String/Number/Function などに機能を増やす<ul
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">repeat</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">startsWith</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">などの便利な関数</li></ul></li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">GlobalなものをNumberにいける<ul
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">isFinite</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">parseInt などをNumberにも追加する</li></ul></li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">duplicateな変数purge機構</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">関数スコープのレキシカルスコープ内で変数宣言が被った時にsyntax errorになる</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">new Date(NaN)</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ES.nextのnew Date(NaN).toString() Invalid Dateをかえすようになった</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">propertyの登場順</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">for-in , Object.keysなどの登場順が規定される</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">LHS</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">left hand side</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">今まで()でくくって中が式なら何でも入ってた</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">それがleft hand side expressionという部類のみになった</li></ul><blockquote
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0.6em; border-left-width: 5px; border-left-style: solid; border-left-color: #dddddd; color: #555555;"><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">(1,2,3) = 20;</p></blockquote><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">というのがSyntaxErrorになる(ES5はReferrenceErrorなった) またパース時に判断できる</p><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">ES.nextのバグ</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">draftにはバグある</li></ul><blockquote
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0.6em; border-left-width: 5px; border-left-style: solid; border-left-color: #dddddd; color: #555555;"><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">({responseText }) = res;</p></blockquote><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">そもそもオブジェクトリテラルの解釈</p><h2 style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0.5em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 4px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 20px; border-top-style: solid; border-top-color: #e0e0e0;">名前</h2><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ES.next<ul
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">バージョン番号がアレなので.nextという名前になってる</li></ul></li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;"><a
style="color: #4183c4; text-decoration: none; padding: 0px; margin: 0px;" title="strawman" href="http://wiki.ecmascript.org/doku.php?id=strawman:strawman&amp;amp;s=strawman">strawman</a>(ストローマン)<ul
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">とりあえずな感じのバージョン</li></ul></li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">Harmony<ul
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">いずれかのバージョンにはいるかも的なもの</li></ul></li></ul><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;"><a
style="color: #4183c4; text-decoration: none; padding: 0px; margin: 0px;" title="A brief history of ECMAScript versions (including Harmony and ES.next)" href="http://www.2ality.com/2011/06/ecmascript.html">A brief history of ECMAScript versions (including Harmony and ES.next)</a></p><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">CoffeeScript</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">is/isnt みたいにセマンティックが同じなのに、挙動が違うことで論争が起きるのが怖い</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">=&gt; とかでも論争がおきてる</li></ul><h2 style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0.5em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 4px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 20px; border-top-style: solid; border-top-color: #e0e0e0;">ECMAScript読書会</h2><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">6章からが本番</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">Annexに定義などが入ってる</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">Annex C はStrict mode</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">D, Eが変更点修正点</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">4.概要</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;"><blockquote
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0.6em; border-left-width: 5px; border-left-style: solid; border-left-color: #dddddd; color: #555555;"><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">この仕様では外部データの入力や計算結果の出力に関する規定はありません</p></blockquote></li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">仕様外だが他にもオブジェクトがあるかもしれない事は考慮する(DOM)</li></ul><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">4.2.2 Strict mode</p><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">“ECMAScriptは、言語において使えるいくつかの機能の使い方を制限したいと考えているユーザがいる可能性があることを認識しています。”</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">標準のものに追加してエラー条件が定義される</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">実装中の注意<ul
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">パース時にでるエラーと実行時エラー</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">パース時に出すエラーはパース時にstrict modeかどうかをみないといけない</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">関数の先頭にstringリテラルが連続してる　== ディレクティブ プロローグ という<ul
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">この範囲にuse strictが入っていればstrict modeになる</li></ul></li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ディレクティブ プロローグの最後に&#8221;use strict&#8221;;を書かれた場合などは、最初のほうのパースにもstrictを適応してエラーにする</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">関数の引数はどっち(中、外)のstrict modeなのか?<ul
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">中のstrict modeが適応されるので、関数内がstrict modeなら、関数名にevalとかしてる時もエラーにするようにする(disccuss)</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">body,param,functionName 全部strict modeに適応範囲とする</li></ul></li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;"><a
style="color: #4183c4; text-decoration: none; padding: 0px; margin: 0px;" title="Does 'use strict' in a FunctionBody apply strict mode FutureReservedWord restrictions to function name or arguments?" href="https://mail.mozilla.org/pipermail/es5-discuss/2011-January/003904.html">Does ‘use strict’ in a FunctionBody apply strict mode FutureReservedWord restrictions to function name or arguments?</a></li></ul></li></ul><h1 style="padding-top: 0.25em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: initial; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 23px; border-top-style: none; border-top-color: initial; margin: 0px;"></h1><p>メモ: Mou + github.css</p>]]></content:encoded> <wfw:commentRss>http://efcl.info/2012/0407/res3047/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Shibuya.XSS アウトラインメモ</title><link>http://efcl.info/2012/0405/res3027/</link> <comments>http://efcl.info/2012/0405/res3027/#comments</comments> <pubDate>Thu, 05 Apr 2012 05:02:01 +0000</pubDate> <dc:creator>azu</dc:creator> <category><![CDATA[イベント]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[XSS]]></category> <category><![CDATA[セキュリティ]]></category><guid
isPermaLink="false">http://efcl.info/?p=3027</guid> <description><![CDATA[Shibuya.XSS テクニカルトーク#1 : ATND に参加してきたので、その時のメモ。 Shibuya.XSS Shibuya.XSSまとめ &#8211; Togetter DOM Based XSSの傾向と対 [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://atnd.org/events/25689">Shibuya.XSS テクニカルトーク#1 : ATND</a> に参加してきたので、その時のメモ。</p><h1 style="padding-top: 0.25em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: initial; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 23px; border-top-style: none; border-top-color: initial; margin: 0px;">Shibuya.XSS</h1><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;"><a
style="color: #4183c4; text-decoration: none; padding: 0px; margin: 0px;" title="Shibuya.XSSまとめ - Togetter" href="http://togetter.com/li/283573">Shibuya.XSSまとめ &#8211; Togetter</a></li></ul><h2 style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0.5em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 4px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 20px; border-top-style: solid; border-top-color: #e0e0e0;">DOM Based XSSの傾向と対策 &#8211; mala</h2><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;"><a
style="color: #4183c4; text-decoration: none; padding: 0px; margin: 0px;" title="Shibuya.XSSで発表してきました - 金利0無利息キャッシング – キャッシングできます - subtech" href="http://subtech.g.hatena.ne.jp/mala/20120405/1333620763">Shibuya.XSSで発表してきました &#8211; 金利0無利息キャッシング – キャッシングできます &#8211; subtech</a></p><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">機械的なスキャンで見つけづらいXSS</p><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">location.hash経由で発火が多い、</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">サーバ側にアクセスログが残りづらい</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ビーコンでlocation.hashを記録する事も可能だけど、実行順序で潰される事がある</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">location.hashでの問題</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">XHR2</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">どんな時に見つけにくい</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">パラメーターをパースして利用してる場合</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ソースを読まないと見つけにくい。</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">難読化されてるとしんどい</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">レガシーコード</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">どうするのがいいのだろうか</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">バリデーション?</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">バリデーションが必要な状況</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">openにファイル名渡す -&gt; パイプでコマンド実行可能</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ファイル開く関数とコマンド実行を分けて使うべき</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">役割に応じて「それだけを行うように」する</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">バリデーションが必要なライブラリ</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">直接使うときは安全に倒す</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">そもそも安全にすることを考える</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">外部リソース読み込めないようには無理</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">コーディング規約での対処</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">jQueryの場合</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">セレクタの使い方を徹底する</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">findを使って$関数の直接使用を避ける</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">$関数は汎用的すぎ</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">コーディング</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">XHRのリクエストは必ず絶対パス+動的パス</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">絶対パスが/のみだと突破できる</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">/api/的な感じに</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">問題点</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">HTML5等で今まで安全だったかもしれないものが崩壊して、可能な攻撃が増える</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">DOM XSS撲滅装置</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">location.hashにタグが会った場合は消す等</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">その文字列を使わないことが保証されてるなら割りと効果的</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">広告やブログパーツ等、自分で治せないもの等の緊急的</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">潜在的なXSS</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">パスワードを盗めるか?</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ブラウザのパスワード自動入力機能でパスワードを盗める場合がある</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">セッション乗っ取り + パスワード盗み</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">パスワードの盗み方</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">自動でフィルインされた値を読み取る</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">自動的に盗むことが可能</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">自動フィルイン + クリックジャッキング -&gt; 半自動</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">フォームの宛先を攻撃サイトに誘導</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">事例</h3><blockquote
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0.6em; border-left-width: 5px; border-left-style: solid; border-left-color: #dddddd; color: #555555;"><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">?to=javascript:eval(location.hash)#攻撃コード</p></blockquote><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ログイン後のリダイレクトのURL先でjavascript:を実行可能</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">対策</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">そのパスワードを入力するドメインをサブドメインで独立させる<ul
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ログイン機能だけを持ったサブドメインを作成する</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">他のjsを入れない、厳しめのルール</li></ul></li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">フェールセーフ設計</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">サンドボックス</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">パスワードを入力するページは外部jsを完全排除するとか</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">パスワード入力ページはそれ専用のサブドメインへ</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">ブラウザ側のリスク軽減</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">XSSフィルタ</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">パスワードの自動フィルイン対策</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">元々危険だったものが更に危険になる =&gt; 理解されないことが多い</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">攻撃パターン</h3><ol
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">iframeで埋め込む -&gt; サードパーティクッキー有効なら発動</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">短縮URL + replaceStateでURL偽装</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ポップアップWIndowとサードパーティ</li></ol><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">ユーザー側の対策</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">NoScript</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">複雑なルールを設定しないと安全に利用できない</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">攻撃者が嫌う設定を使う<ul
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">サードパーティクッキーオフ、ポップアップのブロク、リダイレクトの防止</li></ul></li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">初見のURLは全部シークレットモードで開くとか</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">まとめ</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">DOM Based XSSはたくさんある</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">XSSがあっても安全にすることを考える</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">焼肉、刺身</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">XSS発見者には肉か刺身をおごる慣例(*人徳が必要)</li></ul><h2 style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0.5em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 4px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 20px; border-top-style: solid; border-top-color: #e0e0e0;">x-autocompletetypeの実験 by はまちちゃんさん</h2><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">x-autocompletetypeのデモ</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">http://hamachiya.com/junk/x-autocompletetype.php</li></ul><h2 style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0.5em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 4px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 20px; border-top-style: solid; border-top-color: #e0e0e0;">サニタイズ言うぞキャンペーン &#8211; TAKESAKO</h2><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">mixiの新着検索ページでXSSで1件</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">いぬぼくxSS</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">7年前と少し違う状況</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">jQuery</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">XHR2</li></ul><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">サニタイズ的なものが必要になる場合がある。</p><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">kintone</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ライブラリ除いて10万行ぐらい</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">社内勉強会</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">jQueryは甘え</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">Closure Templateのエスケープ機能について</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">サニタイズコンテント</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">JavaScriptでHTMLのパーサー的に書かれてる</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">問題を起こしそうな文字列などが定義されてる</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">Closure Template &#8211; Contextual Autoscape</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">JavaScriptエスケープとHTMLエスケープ等の区別をおこなってくれる</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">CSS、属性値等で異なるエスケープを行う</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">無毒化とかを文脈依存で対処される</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">http://d.hatena.ne.jp/teppeis/20120318/1332092081</li></ul><h2 style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0.5em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 4px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 20px; border-top-style: solid; border-top-color: #e0e0e0;">オフレコ &#8211; 春山</h2><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ベンチャーから始めると、フローの把握ができてない所が存在する</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">そのフローの把握が重要</li></ul><h2 style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0.5em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 4px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 20px; border-top-style: solid; border-top-color: #e0e0e0;">JS Array Hijacking with MBCS &#8211; hasegawa</h2><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;"><a
style="color: #4183c4; text-decoration: none; padding: 0px; margin: 0px;" title="Shibuya.XSS テクニカルトーク#1 開催しました。 - 葉っぱ日記" href="http://d.hatena.ne.jp/hasegawayosuke/20120405/p1">Shibuya.XSS テクニカルトーク#1 開催しました。 &#8211; 葉っぱ日記</a></p><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">Array形式のJSONをジャックする</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">Firefox 修正済み</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">UTF-8をShift-JISで解釈すると壊れた解釈をしてしまう問題</li></ul><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">Mozillaはポテンシャル的な脅威にも対処してくれる</p><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">Content-Typeとcharset をちゃんとつける</li></ul><h1 style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.5em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 4px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 23px; border-top-style: solid; border-top-color: #aaaaaa;">LT</h1><h2 style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0.5em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 4px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 20px; border-top-style: solid; border-top-color: #e0e0e0;">mixi scrap Challenge</h2><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">学生向けのセキュリティイベント</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">用意したmixiクローンサイトに攻撃してもらって脆弱性を見つけてもらう</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">イベント用に使ったサイト</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">イベント用のmixiサイトをクローンしてXSSを探してもらう</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">日記ページにあるXSSを探して、スタッフアカウントに対して攻撃URLを送ってもらう<ul
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">得点方式</li></ul></li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">問題</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ネギ男に、イラクとnicknameがalertされるURLを踏ませて下さい</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ネギ男に….</li></ul><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">みたいな問題形式</p><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">実際のサービスのクローンを舞台にして</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">盛り上がった</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">より実践的な体験をしてもらえた<ul
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">XSSをみつけるだけではなくSNSの使用を考慮して実践的な内容になった</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">問題をつくやすかった</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">git-grep “XSS” revertで過去に対応してXSS問題から引き出す</li></ul></li></ul><h2 style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0.5em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 4px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 20px; border-top-style: solid; border-top-color: #e0e0e0;">AjaxアプリケーションのXSS対応入門 &#8211; 徳丸</h2><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">入門書にもAjax的な問題</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">X-Content-Type-Options: nosniff</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">JSONハイジャック</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">JSONを罠サイトからスクリプト要素を呼び出す</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">通常はただのデータなので、読み取りはできないはず…</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">JSONハイジャックで読み取りができてしまう =&gt; 既にブラウザは対策済み</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">Androidだとまだ発生する(4.0.3だと問題ない)</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">対策</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ヘッダチェックが無難</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">あんまりいい方法がない</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">外部APIは基本的に信用しない</li></ul><h2 style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0.5em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 4px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 20px; border-top-style: solid; border-top-color: #e0e0e0;">CSS HTML Attribute Reader &#8211; kyo_ago</h2><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">The Sexy Assassinで紹介されてるCSS HTML Attribute Readerがどこまで危険か検証してみた http://bit.ly/HU74ad</p><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">CSS Attributeでパスワードの取得 -moz-anyと合わせ技</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">外部からCSS書けるということ自体が問題</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">:visited の履歴取得も最近のブラウザは対策されてる</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">ロングIPアドレス</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ドット無しでドメインを書くことができる</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ドットを無効化しても、数字だけでドメインを書く事ができるので問題が起こる場合があるかも</li></ul><h2 style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0.5em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 4px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 20px; border-top-style: solid; border-top-color: #e0e0e0;">セキュリティ小ネタ &#8211; send</h2><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">http://d.hatena.ne.jp/send/20120405/p1</p><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">rootkit</h3><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">rootやadminが使えなくなってた</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">対策<ul
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">別の所からpsやkill等のバイナリを持ってきてきて殺してた</li></ul></li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">chattrされてた<ul
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">細かい改ざんをやっていた</li></ul></li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">対策として改ざん検知などの導入で数ヶ月使った</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">よく狙われる脆弱性</h3><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">JSだとimg onerror</p><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">src属性指定後すぐ発火してしまう</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">ドキュメントに追加しなくても発火してしまってる(高速)</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">onerrorは除去しにくいので対策しにくい</li></ul><h2 style="margin-top: 1.5em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0.5em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 4px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 20px; border-top-style: solid; border-top-color: #e0e0e0;">余談</h2><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">最初にサブドメイン以下にtest. やadmin.とかを見る</li><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">crossdomein.xml</li></ul><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">パスワード入力はやっぱり別ドメインに分けるべき</h3><h3 style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px; border: 0px initial initial;">DOS</h3><p
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; line-height: 1.5em; padding: 0px;">くよくよくよくよ</p><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"><li
style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding: 0px;">セキュリティを使うと守ると考えるは違う</li></ul><h1 style="padding-top: 0.25em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: initial; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 23px; border-top-style: none; border-top-color: initial; margin: 0px;"></h1><p>メモ : Mou + Github.css</p><ul
style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 2em; padding: 0px;"></ul>]]></content:encoded> <wfw:commentRss>http://efcl.info/2012/0405/res3027/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>カヤック社内勉強会でBusterJSについて発表してきた</title><link>http://efcl.info/2012/0324/res3020/</link> <comments>http://efcl.info/2012/0324/res3020/#comments</comments> <pubDate>Sat, 24 Mar 2012 08:14:05 +0000</pubDate> <dc:creator>azu</dc:creator> <category><![CDATA[javascript]]></category> <category><![CDATA[library]]></category> <category><![CDATA[test]]></category> <category><![CDATA[イベント]]></category><guid
isPermaLink="false">http://efcl.info/?p=3020</guid> <description><![CDATA[完全にノープランでしたが、唐突にカヤックの社内勉強会に参加してきて、今色々触っているJavaScriptのテストフレームワークのBuster.JSについて発表してきました。(部外者です&#8230;) JavaScrip [...]]]></description> <content:encoded><![CDATA[<p>完全にノープランでしたが、唐突にカヤックの社内勉強会に参加してきて、今色々触っているJavaScriptのテストフレームワークの<a
href="http://busterjs.org/">Buster.JS</a>について発表してきました。(部外者です&#8230;)</p><div
class="kwout" style="text-align: center;"><a
href="http://azu.github.com/slide/Kamakura/busterJS.html#slide1"><img
style="border: none;" title="JavaScript Testing FrameworkのBusterJSを使う" src="http://kwout.com/cutout/9/vs/8q/s2u_bor_rou.jpg" alt="http://azu.github.com/slide/Kamakura/busterJS.html#slide1" width="600" height="429" /></a><p
style="margin-top: 10px; text-align: center;"><a
href="http://azu.github.com/slide/Kamakura/busterJS.html#slide1">JavaScript Testing FrameworkのBusterJSを使う</a> via <a
href="http://kwout.com/quote/9vs8qs2u">kwout</a></p></div><p>スライド : <a
href="http://azu.github.com/slide/Kamakura/busterJS.html#slide1">JavaScript Testing FrameworkのBusterJSを使う</a></p><p>今JavaScriptのテストフレームワークは色々ありますが、<a
href="http://busterjs.org/">Buster.JS</a>は<a
href="http://code.google.com/p/js-test-driver/">JsTestDriver</a>と似た仕組みを持ったテストフレームワークです。<br
/>Nodeで書かれてる所が大きく違いますが、細かい仕組み等は<a
href="http://busterjs.org/docs/architecture/">Buster.JS Architecture overview</a>という文章が公開されているのでそこを見るのがいいです。</p><p>中心となってる作者の一人は<span
class="autopagerize_page_element"><a
href="http://sinonjs.org/" target="_blank">Sinon.JS</a>、<a
href="http://tddjs.com/" target="_blank">Test-Driven JavaScript Development</a>で有名なChristian Johansenですが、<br
/><a
href="http://www.amazon.co.jp/dp/4048707868/">テスト駆動JavaScript</a>で書かれてるようなノウハウが詰まった感じのテストフレームワークになっているので、触っていてとても楽しいツールになっている気がします。<br
/>また<a
href="http://code.google.com/p/js-test-driver/">JsTestDriver</a>はブラウザ向けという感じが強いですが、<a
href="http://busterjs.org/">Buster.JS</a>はNodeで書かれているのもあって、Nodeでテストを実行するという方法も行えるのでNodeのテストもできるようになっていると思います。 </span></p><p><span
class="autopagerize_page_element">まだ、<a
href="http://busterjs.org/changelog/beta2/">Beta 2</a>なので実装されてない部分やWindows未対応(Windowsで試すなら<a
href="https://github.com/mroderick/try-busterjs">try-busterjs</a>とか)などの点もありますが、<br
/>それ以上に勢いを感じられるので今後のテストフレームワークの選択肢の一つになってくれるんじゃないかなーと思います。</span></p><p><span
class="autopagerize_page_element">WebStormでも使いやすくするために、<a
href="http://azu.github.com/slide/Kamakura/busterJS.html#slide26">WebStorm Integrate</a>についてもスライドに少し書いてあります。</span></p><p> </p>]]></content:encoded> <wfw:commentRss>http://efcl.info/2012/0324/res3020/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>横浜JSTDDハンズオンでWebStormについて発表してきた</title><link>http://efcl.info/2012/0226/res3015/</link> <comments>http://efcl.info/2012/0226/res3015/#comments</comments> <pubDate>Sun, 26 Feb 2012 13:29:58 +0000</pubDate> <dc:creator>azu</dc:creator> <category><![CDATA[javascript]]></category> <category><![CDATA[イベント]]></category> <category><![CDATA[TDD]]></category> <category><![CDATA[WebStorm]]></category> <category><![CDATA[アウトライン]]></category><guid
isPermaLink="false">http://efcl.info/?p=3015</guid> <description><![CDATA[横浜JSTDDハンズオンに参加してきて、WebStormというIDEはどういうものなのかについて発表してきました。 WebStorm指南書 発表してきた資料置いておきます。 後から資料として見やすいように画像をたくさん入 [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://atnd.org/events/25519">横浜JSTDDハンズオン</a>に参加してきて、WebStormというIDEはどういうものなのかについて発表してきました。</p><div
class="kwout" style="text-align: center;"><a
href="http://azu.github.com/slide/webstorm/webstorm.html#slide1"><img
style="border: none;" title="WebStorm指南書" src="http://kwout.com/cutout/b/v4/vx/5az_bor_rou.jpg" alt="http://azu.github.com/slide/webstorm/webstorm.html#slide1" width="600" height="515" /></a><p
style="margin-top: 10px; text-align: center;"><a
href="http://azu.github.com/slide/webstorm/webstorm.html#slide1">WebStorm指南書</a></p></div><p>発表してきた資料置いておきます。</p><p>後から資料として見やすいように画像をたくさん入れながらWebStormの機能紹介について書いたので、WebStormについて知りたい方は読むといいです。<br
/>また、最近出たばかりの<a
href="http://blog.jetbrains.com/webide/2012/02/phpstorm-webstorm-4-0-early-access-program-started/">WebStorm 4.0 Early Access Program</a>についても書いてあるので興味がある人はどうぞ。</p><p> </p><div
class="kwout" style="text-align: center;"><a
href="http://azu.github.com/slide/webstorm/webstorm.html#slide12"><img
style="border: none;" title="WebStorm指南書" src="http://kwout.com/cutout/9/97/aj/bqs_bor_rou.jpg" alt="http://azu.github.com/slide/webstorm/webstorm.html#slide12" width="600" height="439" /></a><p
style="margin-top: 10px; text-align: center;"><a
href="http://azu.github.com/slide/webstorm/webstorm.html#slide12">スライドの見方</a></p></div><p>スライドは上記のように機能の紹介がベースで、それの利用方法やこういう機能があって便利という感じのスライドになってます。</p><div
class="kwout" style="text-align: center;"><a
href="http://azu.github.com/slide/webstorm/webstorm.html#slide39"><img
style="border: none;" title="WebStorm指南書" src="http://kwout.com/cutout/f/7n/bp/mv7_bor_rou.jpg" alt="http://azu.github.com/slide/webstorm/webstorm.html#slide39" width="600" height="394" /></a><p
style="margin-top: 10px; text-align: center;"><a
href="http://azu.github.com/slide/webstorm/webstorm.html#slide39">WebStormの楽しさ</a></p></div><p>Web開発等JavaScript周りの環境も変化してきているので、それにあわせてエディタやIDEももっと変化するといいなーと思う部分にいろいろ挑戦してる感じがしてるのがWebStormが好きな所でもあります。<br
/>とりあえず、<a
href="http://www.jetbrains.com/webstorm/index.html">WebStorm</a>は<a
href="http://www.jetbrains.com/webstorm/download/index.html">30-day trial</a>なので、試してみるといいかもしれません。他のエディタ等もいろいろ競争して質が上がっていくといいなー。</p><hr
/><p><a
href="http://atnd.org/events/25519">横浜JSTDDハンズオン</a>の方ではJsTestDriverを使ったハンズオンをしたのでその時のアウトラインメモ。<br
/>Twitterのまとめは <a
href="https://yukar.in/note/ckFoT5">横浜JSTDDハンズオン #JSTDD つぶやきまとめ &#8211; Yukarin&#8217;Note</a> に</p><h1>TDDとは何か</h1><ul><li>プログラマが行うホワイトボックステスト</li><li>開発的なアプローチ(TDD)</li><li>ドキュメント的なアプローチ (サンプルコード</li></ul><h1>TDD</h1><ul><li>開発を行うためにテストを行う</li><li>コードカバレッジは考慮しない</li><li>先に大きなインターフェイスを書いて設計を行う</li></ul><h2>BDD</h2><ul><li>振る舞いを先に定義する</li><li>開発を始めるときは重要だけど、開発を進めるといらない</li></ul><h2>ドキュメントアプローチ</h2><ul><li>ドキュメントの代わりにテストを書く</li><li>キッチンシンクと言われたりするような主要な機能についてテストを書く</li><li>開発当初は微妙だけど、公開するにつれて重要になる。</li></ul><h2>品質的なアプローチ</h2><ul><li>コードカバレッジは管理していく段階で重要になる</li><li>コードカバレッジを重視すると、ドキュメント的な役割がし難く。</li></ul><h2>結合テスト</h2><p>Seleniumとかの話</p><h1>JsTestDriverのアーキテクチャ</h1><h1>JsTestDriverの使い方</h1><h3>setUp</h3><p>各テスト実行前に実行される</p><h3>tearDown</h3><p>各テストが終わる事に実行される</p><h3>AsyncTestCase</h3><p>引数で同期か非同期化を分けられるので、SyncTestCaseにもできる。</p><p>各テストにはqueueという引数がわたってくる 非同期テストはとても面倒</p><h2>sinon.js</h2><p>非同期テストを楽にするFakeテストができる</p><h2>JSTestDriverのエラーになりやすい所</h2><ul><li>serverオプションに/を付けるとエラー</li><li>複数人で同じサーバのJSTestDriverを使える(パブリックはやめとけ)</li><li>ブラウザでアクティブでないタブのsetTimeoutがゆっくりになるので、それぞれウィンドウで実行するのがよい</li></ul><h1>Sinon.js</h1><p>トロイの木馬の手引きをしたスパイの名前が由来</p><hr
/><p><strong>ツール</strong></p><ul><li><strong><a
href="http://www.inkcode.net/qute">Qute for PC/Mac</a></strong></li><li><a
href="http://www.jetbrains.com/webstorm/index.html">WebStorm</a></li></ul><p>書いたコードは <a
href="https://github.com/azu/YokohamaJSTDD">azu/YokohamaJSTDD &#8211; GitHub</a> に置いてあります。</p><p> </p>]]></content:encoded> <wfw:commentRss>http://efcl.info/2012/0226/res3015/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Mozilla Vision 2012 Conference Day アウトラインメモ</title><link>http://efcl.info/2012/0121/res2997/</link> <comments>http://efcl.info/2012/0121/res2997/#comments</comments> <pubDate>Sat, 21 Jan 2012 13:44:16 +0000</pubDate> <dc:creator>azu</dc:creator> <category><![CDATA[Firefox]]></category> <category><![CDATA[イベント]]></category> <category><![CDATA[javascript]]></category><guid
isPermaLink="false">http://efcl.info/?p=2997</guid> <description><![CDATA[Mozilla Vision 2012 – Conference Day Mozilla Vision 2012 Conference Dayに参加してきたので、その時のメモです。(いつも通り正確性は保証されません) &#038; [...]]]></description> <content:encoded><![CDATA[<h1 style="margin-top: 0px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; font-weight: bold; font-style: normal; font-size: 30px; line-height: 36px; font-family: inherit; color: #404040; padding: 0px; border: 0px initial initial;">Mozilla Vision 2012 – Conference Day</h1><p><a
href="http://mozilla.jp/events/vision/2012/conference/">Mozilla Vision 2012 Conference Day</a>に参加してきたので、その時のメモです。(いつも通り正確性は保証されません)</p><p><img
title="NewImage.png" src="http://efcl.info/wp-content/uploads/2012/01/NewImage.png" alt="NewImage" width="448" height="600" border="0" /></p><p><span
id="more-2997"></span></p><p>&nbsp;</p><h1>Boot to Gecko</h1><p>B2G = Boot to Gecko</p><h3>なぜ必要なのか</h3><p>モバイルは閉鎖的すぎる</p><p>過去を振りかえる</p><ul><li>2002年 ブラウザの場合</li></ul><p>IE のみだったので、拡張性はなかった。 拡張する必要がなかった</p><p>やがて複数のブラウザが登場して競争するようになった。 ブラウザ間で実装の競争が起こると</p><ul><li>UXが良くなる</li><li>ユーザーはハッピーになる</li><li>標準化も良くなっていく -&gt; 書き手もハッピー</li></ul><h3>ブラウザとモバイル</h3><p>モバイルプラットフォームは閉鎖的で、プラットフォーム側がコントールできるようにしている。</p><p>様々なプラットフォームに対応しようとするとそのプラットフォームに対応しないといけない -&gt; 時間の無駄になってる。</p><p>プラットフォームを移行するとデータが移行できない。 このようなsilosがあるとオープンではない</p><p>これを変えるためにB2Gを作っていく。</p><h3>Webプラットフォームができる事</h3><p>オープンなものにするために必要なもの</p><ul><li>オープンなApp Marketsが必要</li><li>プラットフォーム間を移行する際にデータも移行できる Firefox Syncのデバイスを超えた同期システム。</li><li>BrowserID</li></ul><p>ネイティブアプリだと使えるケドWebからは使えないモバイルの機能があるのはWebのバグなども</p><h3>Boo2Gecko</h3><p>B2Gに必要なもの</p><ul><li>iOS負けないUX</li><li>オープンスタンダートを構築する。B2G以外でも同じAPIが利用できる</li><li>Apps。Web自体がapp storeみたいなもの</li></ul><h3>デモ</h3><ul><li>ロックスクリーン、ホーム画面もWebアプリとして実装されている</li><li>60FPS出るようにしている</li></ul><p>電話ができるようにWeb APIとしてDevice APIを実装してある。 ネイティブコードではなくてWebの技術で実装されている。</p><p>ホーム画面もHTMLベースなので、ソースコードが見られる</p><ul><li>Quake 3を使ったアプリ<ul><li>WebGLのエンジン</li></ul></li></ul><p>クラッシュしたけど、直ぐ立ち上がる。</p><h3>B2Gの実装</h3><p>iOSなどのネイティブAPIの代わりに、Webエンジン/標準化されたDevice APIsがあり、ネイティブUIの代わりにWebベースのUIが存在する。</p><p>すべて再開発するわけではなく、Webレイヤー以外の部分は既存のものをサイっ利用したりする。</p><p>Gonk ( Androidのものも再利用) WebランタイムにMozillaは集中開発して、GPSなど他の部分に関してはAndroidのコードを利用する。</p><h3>B2Gは何がしたい</h3><ul><li>モバイルをオープンにしたい</li><li>プランや開発やソースコードもオープンにしている</li><li>作成したAPIを標準化したい</li><li>オープンなエコシステムを作成したい</li><li>Boot2Webkit など他の実装も作れるようにしたい</li><li>B2Gで動くものはB2Wでうごくようになるべき</li></ul><p>一からはじめたプロジェクトではない。 Androidのコミュニティ</p><h3>Q&amp;A</h3><p><em>Q</em> どのようにして標準化していくのか。 それぞれの実装に対してそれぞれのUIがあるから、ポートする作業していく必要がでていく。 Gaiaに対してのUIのガイドラインが必要</p><p><em>A</em> 標準化していくのはシステムのテーマ</p><p><em>Q</em> non-nativeなものを場合、ゲーム等最大限の性能出すためにネイティブAPIを開発するの?</p><p><em>A</em> ネイティブAPIを実装するつもりはない。 WebGLがOpenGLが遅ければそれはWebのバグである。 クロスプラットフォームを常に担保していくという目的を持っているので、少し遠回りでもWeb APIをやっていく。</p><p><em>Q</em> アプリが落ちたときに他のシステムを巻き込むの?</p><p><em>A</em> プライオリティの高いものを別のプロセスを走らせる事もできる。 OSがとても軽量なので、全てがダウンしても直ぐに起動できる。</p><p>電話のプロセスは別のものとして動いてるのでOSがダウンしても生きてる。 プロセスのセパレーションと呼ばれるものが実装できてる。</p><p>Linuxカーネルがあってその上にいくつかのXULや電話やBTなどのプロセスなどを起動していく。そして最後にB2Gのプロセスが起動して、その中でWeb Appが起動する。</p><p>Chromelessのようなイメージで、全てがiframeのようなものになって、iframeにマニフェストを与えて、iframeを別プロセスで動作させることができる。</p><p><em>Q</em> どのようにB2Gを提供していくか? Mozillaがサポートするの?</p><p><em>A</em> Mozillaは直接デバイスを出荷することはなく、 Mozilla Phoneパートナーと一緒してやっていく。 メジャーなキャリアとはやり取りを始めていて、最終的にそのキャリアが出していくことになる。</p><p><em>Q</em> デバイスを買ってきて、OSとしてB2Gを後入れるということはできるの?</p><p><em>A</em> 今サムソンのデバイスを使ってるが勝手に入れてる。 なので、将来的にはより多くのデバイスをサポートして行って、そのような事が可能になる</p><h1>Web 標準の今、そして未来</h1><p>Tantek Çelik</p><p>スライド : <a
href="http://tantek.com/presentations/2012/01/open-web/">Open Standards Stories &amp; Practices</a></p><p>CSSの標準化に参加したことについてのお話</p><ul><li>ISO</li></ul><p>買った上で誰でも見ることができる =&gt; 昔のオープン</p><ul><li>CalConnect</li></ul><p>お金を払った上にテストに参加できる。 テストスイートなのに、対象が限定されている。</p><p>W3Cはだれても見られるオープン</p><ul><li>W3C tests</li></ul><p>CSS WGはレポートを公開していたので誰でも見ることができた。 CalcConnectは公開してはいけないという縛りがあった</p><p><strong>オープンなテストは再現性が担保されている</strong></p><h3>まだCSS WG不満があった</h3><p>更にテスト、レポートをオープンにしていく必要がある。</p><ul><li>Blog</li><li>Wiki</li></ul><p>CSS WGのWikiを作成した。まだ閉ざされていた部分があったが、IRCやバグトラッカーなども公開していくようにした。</p><p>当時にメーリングリストはあったが、W3Cのメンバーでないとみられないようになっていたが、テクニカルな内容のものは全てPublicにしていくようにした。</p><ul><li>editor &#8216;s drafts</li></ul><p>これもエディターが書いてる途中のものも公開していくようにした。</p><ul><li>last call</li></ul><p>2011になってCSS2.1がやっとRCになった。9年もかかった。</p><p>CSS3の確固たる基盤になるCSS2.1ができた。</p><h3>学んだ事</h3><p>オープンは進化する</p><h2>2. XFN</h2><ul><li>2003年</li></ul><p>SXSWという会議に参加した時の話。</p><p>ブログロールの仕組みについての会議で、ものすごく複雑な仕様になっていた。</p><p>rel=&#8221;friend&#8221;がついてればいいぐらいな簡単なものを提案した。</p><p>実際にどういう状態がfriendなのかについて調査した。</p><h3>CC</h3><p>XFNは初めてのCCライセンスを使ったオープンな標準化となった。 そこからフィードバックをもらってXFN1.1をリリースした。</p><h3>rel=me</h3><p>一番大きな6文字。自分を示すrel属性で、多くのSNSなどで使用されている。</p><h3>rel=me , OAuth</h3><p>２つを組み合わせることで、OpenIDをよりシンプルなものを実現できるでは?</p><p>XFNから学んだものは単純でシンプルであるべきということ</p><h2>3. MicroFormat</h2><ul><li>rel=license</li></ul><p>この時初めてMicroFormatという事が使われた</p><p>その頃はまだ標準に関するWikiがなかったので、Wikiで公開した。= 初めてのWikiで公開され知多Web標準</p><h3>人を表現するhtml</h3><p>classnameでつけていた習慣など、定義されていた言葉を元に定義した。</p><h3>hcard , hcalendar</h3><p>既にある用語を元に作成した標準。 既存のフォーマットを使用したので馴染みやすい。</p><h2>Webレビューのフォーマット</h2><p>いろいろ研究した</p><p>80/20の法則 : 比較などのある程度のフォーマットの表現が見えてきた</p><ul><li>hreview</li></ul><p>hreviewという標準化した</p><h3>microformats.org</h3><p>これまでの標準化団体とは少し異なる。</p><ul><li>プロセスそのものを文章化</li><li>今までの教訓を掲載した</li><li>IRCもオープンに</li><li>パブリックなログを公開</li></ul><p>wikiがemail以上の公式な文章であるとした。 -&gt; Wikiが厳格であるようにした</p><ul><li>IRCに変更をとばすbot</li><li>スパムの除去</li></ul><p>Wikiのイイ点としては同時に翻訳が行えるようになった。 今も標準化作業中に17ヶ国に翻訳作業がされている。</p><p>どんどんフィードバックを送る。標準化は誰でも参加ができる環境に翻訳は重要</p><p>Wikiは誰でも参加できる。W3Cは組織としての参加が必要になってる。</p><p>全てPublic domain / CC0にすることで全てがオープンであることを体現する。</p><h3>microformats2</h3><p>更にシンプルになるMicroformat。 ユーザーはシンプルなしようが求められる。</p><h2>4. HTML5</h2><ul><li>2004年</li></ul><p>W3Cのワークショップが始まり。</p><p>HTM + CSS + DOM VS XHTML2 +XForms +etc..</p><p>これまでを進化させていく方向　VS W3CのXML</p><p>incremental VS replace</p><p>進化させていくと置き換えていくの対決</p><p>HTML VS XML は8:11でHTMLは負けた</p><p>ベンダーはHTMlの方を支持していた。MS,Apple,Mozilla等</p><p>Web自体は進化しないと行けない</p><h3>WHATWGが設立</h3><p>ここでHTMLは進化していった。</p><p>Web Apllication specがHTMl5になっていった。</p><p>Core+new APIsという構成はCSSも同じ</p><p>WHATWGはMITライセンスをしようした!!! これまであるライセンスを再利用した</p><p>W3Cは独自のライセンス &#8211; フォークが許されないライセンス</p><h3>W3CとWHATWGの共通点</h3><ul><li>要素</li></ul><p>エディタを信頼する VS WG全体で協議する</p><p>というような対立が生まれてた。</p><h2>5. W3C CGs (コミュニティグループ)</h2><ul><li>2011年</li></ul><p>2011にW3Cコミュニティグループができた</p><p>あるテーマに関するコミュニティグループは4人いればできる</p><h3>CC0 &amp; OWFa の仕様</h3><p>Mozillaの弁護士にそれぞれ調べて持ったが、どちらもいい感じだった。 オープンに使えるライセンス。</p><h2>仕様作成の10個のベストプラクティス</h2><ol><li>オープンに作る(標準をオープンに作っていく)</li><li>オープンに反復を行う(完璧じゃなくてもいいから試行錯誤を出す)</li><li>オープンWikiを使う</li><li>オープンに討議をする</li><li>ブログ、Tweet、あらゆる手を使ってオープンに</li><li>オープンなアーカイブ&amp;ログ</li><li>Wiki編集はIRCに投げる</li><li>オープンテストスイート(堅牢、反復的に</li><li>テストレポートをオープンにする</li><li>可能な限りコミュニティを巻き込む( 多くの人を巻き込む)</li></ol><p>境界を超えた範囲で巻き込んだ作業をする。標準はグローバル</p><h2>Q&amp;A</h2><p><em>Q</em> MicroFormats以外に草の根的なものはありますか?</p><p><em>A</em> OAuthはメーリングリストだけでできてきた</p><p><em>Q</em> ベストプラクティスはWeb以外に対しても適応できる?</p><p><em>A</em> 他にも適応できるだろう.</p><p>Facebookがオープンプラットフォームということをやろうとしている</p><p><em>Q</em> W3Cのノンフォークライセンスだということだけど、コミュニティができてフォークが行われてる。W3Cが変わってきてるの?</p><p><em>A</em> 今は２つの方向ができてきてる。 HTML5はまだノンフォークなライセンスになってる。</p><p>将来的には切り替わるかもしれない。</p><h1>pdf.js — HTML5 と JavaScript の限界に挑戦する</h1><h3>なぜpdf.jsが必要なのか</h3><p>信頼されたネイティブコードは脆弱性があると問題になる。</p><h3>pdfに何が必要なのか</h3><p>portableなのに巨大なフォーマット</p><ul><li>Adobeのみが実装してるサブセットがある</li><li>pdfの一部サブセットを実装することを目的にした</li></ul><p>圧縮されたpdfを戻して、パースしてdrawTextみたい形にしてレンダリングする。</p><p>Document -&gt; ページとオブジェクトがある。</p><h3>HTML/CSS/JS</h3><ul><li>JavaScriptはTyped Arrayなどを使用して高速化</li><li>Fast 2D Canvas、GPUで加速的</li><li>CSS @fant-face フォントに対応、ダイナミックにフォントをロードする機能</li><li>data: URI バイナリデータをJavaScript上で作れる</li></ul><p>SVGなどを使わなかった理由もある。 = スピード</p><h3>pdf.jsの手順</h3><h4>ダウンロード</h4><p>バイナリデータをXHRでresponseTYpe = &#8220;arraybuffer&#8221;でダウンロードできる。</p><h4>デコード、解読、パース</h4><ul><li>PNG,LZWデコーダーをJavaScriptで書いた</li><li>パーサーもJavaScriptで書いた</li></ul><h4>レンダリング</h4><p>パースしたものをレンダリングしていくのが大変</p><ul><li>2D CanvasでLineやarcsなどを描いていく</li><li>bitmapもimgで描画する</li></ul><h4>問題</h4><ul><li>2DCanvasは十分ではなかった。</li><li>Dash line等Canvasには実装されてなかった。 even odd ruleなどもそう</li></ul><p>解決方法として2DCanvas自体を拡張していく</p><p>bitmap画像のデコードをサポートしてなかった。</p><ul><li>img と Canvasはjpeg2000</li><li>フォーマットを追加するのは大変</li><li>JavaScriptでデコーダーを書く</li></ul><p>フォントの問題</p><ul><li>OpenType , TrueTypesなどブラウザはサポートしてないTypeがあった</li><li>Type1は一番PDFで使わてるのにCSS Font faceでサポートされてない</li></ul><p>解決方法としてOpenTypeに変換して、中間フォーマット的にType1をサポートした。</p><p>まだまだやることはいろいろ</p><ul><li>Shading fillはCSS gradientsで実装されてる</li><li>Image Mask はCanvasがネイティブでできる</li><li>PostScriptオブジェクト &#8211; PostScriptのインタープリタをJSで</li><li>TYpe3フォント PDF.js自体でレンダリングを行ってる</li></ul><p>pdfをWeb技術でレンダリングする事に成功した。</p><h3>デモ</h3><ul><li>Web技術で実装するとモバイルでも動かせる</li><li>フルのPDFレンダラーがブラウザ上で走っている</li></ul><h3>PDFビューアーのUI</h3><p>UIを作っていく</p><ul><li>ページビュー(サイドでページをプレビューする)</li><li>ハイパーリンクのサポート</li><li>テキストの選択 &#8211; 難しい</li><li>テキストの検索 &#8211; 難しい</li></ul><h4>ハイパーリンクの実装</h4><p>2種類のリンク方式がある</p><ul><li>相互参照</li><li>外部リング</li></ul><p>Webブラウザが認識できるaリンクに変換した。 そのオブジェクトをpdf.jsでレンダリングした上にaリンクを重ねたものを表示して扱うようにした。</p><p>相互参照はポイントへ飛ぶようにしていて、バックボタンが機能するようになっている。</p><h4>テキストの選択</h4><p>Canvasは画素が並んでいるだけなので選べないが、オーバーレイに透過性を持ったdivタグでテキストを描画している。</p><p>アクセシビリティもサポートできている。</p><h3>pdf.jsの高速化</h3><h4>コンパイル</h4><p>pdf.jsはPDFのサブセットをレンタリング</p><ul><li>PDFレンダラーはインタープリタだった</li><li>PDFレンダラーのJITコンパイルする switch等をコンパイルしたら省略できるので、直接draw*を呼べるようにできて十数倍の動作速度が得られる。</li><li><a
href="http://blog.mozill*A*com/cjones/2011/06/15/overview-of-pdf-js-guts/">Overview of pdf.js guts &lt; Chris Pitchin&#8217; Hey</a></li></ul><p>ダイナミックなコンパイレーションを行なってFunction()で実行してる。</p><h4>Web Workers</h4><p>Web Workersを使って別のスレッドで、デコード、パース、フォント変換、デコードイメージを行う。</p><ul><li>main threadではdrawを行なっていく。(これはUIブロックを生む)</li><li>別スレッドで実行してるものはUIブロックの影響されない</li><li>同時併用でタスクを実行できるので高速化</li></ul><h3>pdf.jsの現状</h3><ul><li>大部分の機能は完成している</li><li>Firefox,Chromeの拡張して利用できる</li></ul><p><em>* HTML/JS/CSS Can redner PDFs *</em></p><h3>next</h3><ul><li>PDF内のテキストを検索</li><li>HTTP byte-rangeリクエストを使ってPDFを分割ロード。メモリの削減になる</li><li>Web Worker内でCanvasをサポート。UIブロックを潰せる</li><li>(maybe) WebGLで高速レンダリング？？？ GPUをもっと使える</li></ul><h3>質問</h3><p><em>Q</em> なぜCanvasを使用したのか?</p><p><em>A</em> JavaScriptが直接やり取りできる。SVGはDOMを経由しないといけないため、より早くするには難しい。</p><p>PDFではPDFファイルがあるのだからDOMを作成してやるのは不要だ。</p><p><em>Q</em> 政府などでフォームとしてPDFを利用する場合。インタラクティブなPDFな方向はするのか?</p><p><em>A</em> ２つのフォームフォーマットがある</p><ul><li>Acro format &#8211; 標準化されてる</li><li>XNA format &#8211; プロレタリア</li></ul><p>PDF.jsでも実装しやすい部類のもの。 AdobeではSpiderMonkeyベースのエンジンが使わていて、Validationが行われていたりする。</p><p>pdf.jsは100%のpdfのサポートするわけではないので、フォームなどのやり取りをべーすとするならばHTMLベースのほうがよいものになるかもしれない。</p><p><em>Q</em> セキュリティポリシーについて</p><p><em>A</em> pdf.jsの用途について</p><p><em>A</em> メールクライアントなどの場合 HTMLのセキュリティポリシーに寄っていく(クロスドメインの問題がでるかもしれない)</p><p><em>Q</em> テキストの描画方法</p><p><em>A</em> PDFは左から右へ書けというようなコマンドが存在する。 まだ、サポートしてないが、Canvasの機能を一部利用かもしれない。</p><p><em>Q</em> Canvasにテキスト選択を追加しなかった理由?</p><p><em>A</em> Canvasにそれが実装されなかったのはとても管理が大変だったから。パフォーマンスとテキスト選択のトレードオフの結果</p><p><em>Q</em> 対応するブラウザについて</p><p><em>A</em> pdf.jsはオープンWeb標準を使って作っていくという方向から始まった。だが、ブラウザにはまだ実装されていない機能があって、その部分が拡張実装として、Firefox や Webkitに実装されていった。</p><p>dot line と even fill あたりが互換性ブラウザの問題を生んでる。 =&gt; スタンダートを追加していく</p><p>重要なのはTyped Arrayのサポートが大事で高速に動作するにはこれが必須。# LT</p><h1>LT</h1><h2>&#8220;実践&#8221;Emscripten</h2><ul><li>Alon zakai<ul><li>EmScriptenの作者</li></ul></li><li>C, C++をLLVMでJavaScriptへ変換する<ul><li>バイトコードになってそれをエミュレート</li></ul></li><li>手作業よりも少し遅いぐらい</li><li>まとめ<ul><li>2-4倍ぐらい遅くなる</li><li>変換作業が短くすむ</li></ul></li><li>JSViz<ul><li>GraphVizを変換</li><li>アニメーション機能付き</li><li>グラフを考えるようにするのを視覚化</li></ul></li></ul><h2>ブラウザプレゼンテーションの教育的利用</h2><ul><li>Nurota Lab.</li><li>教師と生徒とのやり取りが必要になる。<ul><li>臨機応変に内容を変えられるようにする</li><li>黒板以上のことをできるようにする</li></ul></li><li>インタラクティブにコードを実行しながら事業を進行できる</li><li>Webページを埋め込むとかWeb技術を使える</li><li>数学とか物理とか利用方法がある</li></ul><h2>Firefox Syncサーバを建てて見た</h2><ul><li>Firefox Sync<ul><li>保存情報をアドオンを同期する機能</li><li>Androidとも同期できる</li></ul></li><li>Mozillaのサーバに情報が転送される<ul><li>ローカで暗号化されてから送信している</li></ul></li><li>Syncサーバを自前で建てて利用する<ul><li>証明書を用意してHTTPSでやり取りできる</li></ul></li><li>Python, SQLite、Macurialで動く<ul><li>ビルドして、コマンドだけ動く</li></ul></li><li>いろいろ調整しないと動かないけど</li></ul><h2>Firefox 布教大作戦</h2><ul><li>Firefox を 灘高校 に広める<ul><li>IE 83%のシェアな高校</li></ul></li><li>Firefoxノートを1300部発注<ul><li>教員に止められた</li></ul></li><li>「布教」は簡単ではない</li></ul><h2>Firefoxのゴキゲンな通知UI</h2><ul><li>Popup Notifications<ul><li>doorhangerがコードネーム</li></ul></li><li>ノンブロッキングな通知UI</li><li>PopupNotification.show()<ul><li>6つの引数で設定</li></ul></li><li>通知の複数表示ができないバグ</li><li>ドキュメントが充実してない<ul><li>コードはドキュメントになってる</li></ul></li><li>まとめ</li></ul><h2>ドアハンガーをもっと簡単につかいたい! &#8211; Piro</h2><ul><li>PopupNotication.jsmの罠<ul><li>CSSでアイコンの表示</li><li>コードバックをたくさん指定しないといけない</li></ul></li><li>簡単に扱えるライブラリを書いた</li></ul><h2>海外の開発コミュニティをを利用して世界デビューをしよう</h2><ul><li>Linuxに企業として参加<ul><li>コミニティに参加していくには</li></ul></li><li>ユーザーもどんどん参加する</li><li>英語のレベルはあまりきにしない</li><li>批判されても落ち込まない</li><li>思いついたらすぐ投稿(反応を早く)</li><li>オープンにディスカッションをする</li><li>キーとなる人を早く見つける</li><li>まずは感謝</li></ul><h2>才能のソーシャルメディア</h2><ul><li>Stylelist DirectoryというSNSサービス<ul><li>才能のソーシャルメディア</li><li>美容師のソーシャルメディア</li></ul></li><li>欧米だと美容師は芸術家的に個人活動<ul><li>日本だとサロン</li></ul></li><li>美容師が才能を発揮できるようなサイト<ul><li>活躍のアピール</li><li>一般の人たちもそれらに反応</li></ul></li><li>Joomla の CMSを使って運営してる<ul><li>他の業界とのコラボレーションとかやっていきたい</li></ul></li></ul><h2>Scratchでつなぐオープンな学び</h2><ul><li>Openな学び</li><li>Scratch<ul><li>8 &#8211; 12歳向けのMITが開発してるソフト</li><li>80万人ぐらいアクティブユーザー</li></ul></li><li>デモ</li></ul><h2>Interop Tokyoでのオープンなネットワークエンジニア育成</h2><ul><li>Interop<ul><li>ネットワークの国内最大のイベント</li><li>いろんな会社の機器を使ってネットワークを構築する</li><li>超ネット</li></ul></li><li>ShowNet<ul><li>STMプログラム</li><li>インターネット技術者を育てる</li></ul></li></ul><h1 style="margin-top: 0px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; font-weight: bold; font-style: normal; font-size: 30px; line-height: 36px; font-family: inherit; color: #404040; padding: 0px; border: 0px initial initial;"><span
style="font-size: 24px; color: #000000; line-height: normal;">まとめ</span></h1><p>Web 標準の今、そして未来 by Tantek Çelik がとても面白かった。仕様を作っている側からの視点の話は結構貴重な貴重な気がした。</p><p>Mozilla飯よかった。</p><p>メモツール(セッションごとに別々のファイルで保存)</p><ul><li><a
href="http://www.inkcode.net/qute">Qute for PC/Mac</a></li><li><a
href="http://mouapp.com/">Mou</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://efcl.info/2012/0121/res2997/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>今まで書いたJavaScript情報の読み方をまとめてみた</title><link>http://efcl.info/2012/0116/res2985/</link> <comments>http://efcl.info/2012/0116/res2985/#comments</comments> <pubDate>Mon, 16 Jan 2012 14:49:50 +0000</pubDate> <dc:creator>azu</dc:creator> <category><![CDATA[javascript]]></category> <category><![CDATA[イベント]]></category><guid
isPermaLink="false">http://efcl.info/?p=2985</guid> <description><![CDATA[もう既に見た人もいるかもしれませんが、オフライン勉強会でJSer.info一周年について発表してきた &#124; JSer.infoで今まで書いてた記事のまとめ的な発表をしてきました。 海外のJavaScript情報を見つけよう [...]]]></description> <content:encoded><![CDATA[<p>もう既に見た人もいるかもしれませんが、<a
href="http://jser.info/post/15883533195">オフライン勉強会でJSer.info一周年について発表してきた | JSer.info</a>で<br
/>今まで書いてた記事のまとめ的な発表をしてきました。</p><ul><li><a
title="海外のJavaScript情報を見つけよう" href="http://efcl.info/2011/0116/res2185/">海外のJavaScript情報を見つけよう</a></li><li><a
title="世界のJavaScript情報を読もう" href="http://efcl.info/2011/0117/res2229/">世界のJavaScript情報を読もう</a></li><li><a
title="今からRSS購読すべきタグと検索結果" href="http://efcl.info/2010/1025/res2018/">今からRSS購読すべきタグと検索結果</a></li><li><a
title="ブラウザの最新情報を知るために、Web開発者が読んでおくべきブログ" href="http://efcl.info/2011/0301/res2303/">ブラウザの最新情報を知るために、Web開発者が読んでおくべきブログ</a></li><li><a
href="http://azu.github.com/slide/HowToLearn/#slide1">HOW TO LEARN</a> (これだけ記事じゃないですが)</li></ul><p><a
href="http://azu.github.com/slide/offline_study/javascript_world.html#slide1">世界のJavaScriptを読もう @ 2012</a>を発表していた時、<a
href="http://azu.github.com/slide/offline_study/javascript_world.html#slide29">RSS購読フロー</a>の部分がなぜか<a
href="http://twitter.com/tatsuoSakurai/statuses/158419082654400512">受け</a>が<a
href="http://twitter.com/koichik/statuses/158542707378233344">良かった</a>ようなので、簡単な補足を書いておきます。</p><p><img
title="social_flow.png" src="http://efcl.info/wp-content/uploads/2012/01/social_flow.png" border="0" alt="Social flow" width="600" height="528" /></p><p>自分はRSSリーダを多用しているので、何でもRSSにしてとりあえずRSSリーダーに流れてくるような状況を作っています。<br
/>Webサイトを見ていて、Read It Latorなどで後で読むことにしても結局読むのを忘れてしまうことがあるため、Read It Latorに登録したリストがRSSとしてRSSリーダーに流れてくるといった感じです。</p><p>Pinboardやはてなブックマークや<a
href="http://azu.github.com/slide/offline_study/javascript_world.html#slide22">ソーシャルニュース</a>サイト等もRSSで購読していると、同じ記事を扱ったものが何度もRSSに出てきます。<br
/>これは<a
href="http://efcl.info/2010/1025/res2018/">今からRSS購読すべきタグと検索結果</a>でLDRの読み方にでも書いていましたが、SBMなどは量が多くなってしまうので、全て目を通そうとすると気疲れします。<br
/>そのため、SBMや検索結果等のRSSは高めのレートにして心理的に飛ばしやすい(LDRでいうSキーを押す)状態にしています。</p><blockquote><p>なんで検索結果のRSSは★4にしてるかというと、検索結果RSSで出てくるサイトは★3のサイトと被ったりすることがあるので、<br
/>★4で飛ばしても★3で出てくるからまあいいっかと適当な感じで読める安心感が生まれます。</p> <a
title="今からRSS購読すべきタグと検索結果 | Web scratch" href="http://efcl.info/2010/1025/res2018/">今からRSS購読すべきタグと検索結果 | Web scratch</a></blockquote><p>ここから、発表してたときにウケてた部分ですが、RSSリーダで読んでいるときに少しでも気になった記事は<br
/>とりあえずTwitterへ投稿しています。(<a
href="http://userscripts.org/scripts/show/46441">Post Now browsing to Twitter</a>がLDRから直接投稿できるようにしているのもその辺の関係)<br
/>一応軽くは目を通してからTwitterへ投稿していますが、専門的な記事や英語の記事など一度みるだけじゃ理解が出来なかったり、判断が難しい記事も多いと思います。</p><p>そういう時にTwitterのフォロワーから反応があると理解しやすかったりします。<br
/>またFavやRTがあったものが流れてくるようにRSSを購読しておけば、重要な記事 (少なくてもフォロワーが興味を持った記事)が再度RSSとして流れてくるようになります。</p><div><blockquote
class="twitter-tweet" lang="ja"><p>ありのまま今起こった事を話すぜ！『おれは奴が情報を選別してくれてると思ったらいつのまにか選別させられていた』 何を(ry という素晴らしいフィードバックを見た</p> — koichikさん (@koichik) <a
href="https://twitter.com/koichik/status/158542707378233344">1月 15, 2012</a></blockquote><script src="//platform.twitter.com/widgets.js"></script></div><p>こういう感じで、重要な記事は何度もRSSとして流れるようにして、読み忘れを減らしたり &amp; 心理的に軽い気持ちでフィードを読み飛ばしても大丈夫なように意識しています。<br
/>他の人の力も借りて手を抜きつつ、人があまり見ないようなところもチェックするようにして、いろいろな情報を共有できればいいかなと思います。</p><p>どういう所などをみているかについては<a
href="http://jser.info/post/15883533195">オフライン勉強会でJSer.info一周年について発表してきた | JSer.info</a>のスライドの方にもまとめたのでそちらを見てください。</p><ul><li><a
href="http://jser.info/post/15883533195">オフライン勉強会でJSer.info一周年について発表してきた | JSer.info</a></li></ul><p> </p><ul></ul>]]></content:encoded> <wfw:commentRss>http://efcl.info/2012/0116/res2985/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>shibuya_sp 勉強会 vol1 アウトラインメモ</title><link>http://efcl.info/2011/1213/res2982/</link> <comments>http://efcl.info/2011/1213/res2982/#comments</comments> <pubDate>Tue, 13 Dec 2011 14:52:44 +0000</pubDate> <dc:creator>azu</dc:creator> <category><![CDATA[iPhone]]></category> <category><![CDATA[イベント]]></category> <category><![CDATA[Android]]></category> <category><![CDATA[iOS]]></category> <category><![CDATA[test]]></category><guid
isPermaLink="false">http://efcl.info/?p=2982</guid> <description><![CDATA[#shibuya_sp 勉強会 vol1 : ATNDに参加してきたので、その時のメモです。 iOSアプリケーションのUnit Test &#8211; 岸川 テストを習慣化するには なぜテストを書かないか テストの効果 [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://atnd.org/events/22758#comments">#shibuya_sp 勉強会 vol1 : ATND</a>に参加してきたので、その時のメモです。</p><h3>iOSアプリケーションのUnit Test &#8211; 岸川</h3><h4>テストを習慣化するには</h4><h4>なぜテストを書かないか</h4><ul><li>テストの効果がわかりにくい</li><li>iPhoneアプリのテストってどう書けばいいのかワカラナイ</li><li>デバイス固有のデータを利用していたりする</li></ul><h4>ツール/フレームワークを使う</h4><ul><li>繰り返し実行するのが簡単</li><li>自動化できる</li><li>テスト結果が見えてくるようになる</li></ul><h4>無理をしない</h4><ul><li>モデルのテストは書きやすい</li><li>論理構造はそう簡単に変わらないはず</li><li>繰り返し実行するメリットがあるので(正常系/例外/異常/境界値)をちゃんとテストする</li></ul><p>表示は論理構造が簡単にひっくり返る事があるので、テストを無理に書こうとしない</p><h4>テストしやすいコードを書く努力はする</h4><ul><li>テストしやすいコードは、使い易いコードなので良い設計にも繋がる</li><li>メソッドをきちんと分けてあげる</li></ul><h4>単体テストをワークフローに取り入れる</h4><ul><li>OCUnit</li><li>GHUnit</li></ul><h6>OCUnit</h6><ul><li>XCode標準</li><li>XCodeと統合されてるが、アサーションが貧弱</li><li>非同期テストがサポートされてない</li></ul><p>GHUnit</p><ul><li>XCode非標準</li><li>アサーションが豊富</li><li>まともなテストができる(teardown/setup)</li><li>非同期テストのサポート(waitを使える)</li><li>OCUnitのテストケースも実行可能</li><li>viewのテスト機能が追加された</li></ul><h4>Viewのテスト</h4><p>GHVerifyView  あらかじめ取っておいた画面の画像と照らしあわせてテストしてくれる 画像での比較</p><h3>Flashからcocos2dに移植した話 &#8211; CAつりポンチーム</h3><ul><li><p>Flashとcocos2dに移植した</p></li><li><p>1万７千件のレビュー</p></li><li><p>平均4.5☆</p></li><li><p>Twitterによる拡散</p></li><li>完全無料広告なし</li><li>アメーバピグ</li><li>ストレスフリー</li><li>App Storeのレビュー誘導</li></ul><h4>オフライン対応</h4><h4>非会員対応</h4><ul><li>ほぼすべての機能を非会員でも遊べる</li><li>会員と非会員の差別化</li><li>タイトル画面の対応のみ</li><li>ポイントの管理をローカルにおいて、サーバ側からポイント管理を排除</li></ul><p><strong>iPod Touchのユーザーが30%</strong> =&gt; オフライン対応の成果?</p><h3>cocos2dとFlash</h3><p>大量の画像を書きだす</p><ul><li>手動は日が暮れるので</li><li>アクションを作って、画像ファイル名=レイヤー名にしてバッチで生成</li></ul><h4>texturepacker を知る</h4><ul><li>一枚の画像に素材を貼り付けて、座標データからファイルを切り出して表示する</li><li>CSS スプライトみたいな</li></ul><h4>AutoSD</h4><p>自動でRetinaと通常の解像度を作成できる</p><h4>Spriteはフォルダ管理</h4><p>Finder上でフォルダ構造そのままにSPriteを管理できて楽 texturepacker上に反映する</p><h4>見ていて飽きないガチャを作れという司令</h4><p>まずはFlashで動きを作る</p><ol><li>色を選ぶ</li><li>ガチャを出すアニメーション</li></ol><h4>自作AIRツールで座標の抽出</h4><p>swfから座標の抽出をするソフトを作成した</p><ul><li>座標系の違いを補正する スクリーン座標 -&gt; デカルト座標</li><li>Flash上のレイアウトがそのままcocos2dに移植</li></ul><p>cocos2dを利王した最適化と高速化</p><ul><li>描画処理の高速化</li><li>テクスチャロードの非同期化</li></ul><h4>iPhoneのOpenGLの傾向と対策</h4><ul><li>OpenGLの描画を呼び出すほどオーバーヘッドが大きなリ重くなる傾向</li><li>なので、texturepackerを使ってテクスチャを一回でロードしたりして 呼び出し回数を減らした。</li></ul><h4>テクスチャロードの非同期化</h4><ul><li>非同期で先にテクスチャを読み込んで、読み込み待ちを減少させる</li><li>addImageAsyncを使って非同期ロード</li></ul><h4>テクスチャフォーマットの調整</h4><ul><li>RGBA4444に統一してる(32bit -&gt; 16bit)</li></ul><h4>モーション制御の最適化</h4><p>CCPawnやCCSequenceを処理コストが多いでの、人体とかが苦手だった。 モーションデータを削減して、モーション制御をNEONで並列処理にして最適化</p><h4>コンフィグの微調整</h4><p>ccConfig.hでCC<em>USES</em>VBOを無効にするだけで結構変わる</p><h4>Time Profiler</h4><p>順次上から見て最適化をしていく</p><h4>まとめ</h4><ul><li>テクスチャは一枚にまとめてCCSpriteBatchNodeで描画</li><li>NEONなどSIMDを使って最適化</li><li>ccConfig.hをみてチューニング</li></ul><h3>OCTOBAから見た面白いAndroidアプリ &#8211; 丸岡</h3><h4>Android Market</h4><p>アプリ削除率</p><ul><li>37%?</li></ul><p>OCTOBA</p><ul><li>男性が多い</li><li>30-40代が多い</li></ul><h4>パーミッションの問題</h4><p>Any.Do</p><ul><li>機密ログデータの読取</li><li>このパーミッションを要求するアプリはレビューしない</li></ul><p>いろいろなパーミッション</p><ul><li>機密ログデータの読取</li><li>連絡先データの読取</li><li>SMSメッセージの送信</li><li>アカウントの認証情報を利用</li><li>起動中のアプリケーション情報</li><li>端末ステータスとIDの取得</li></ul><p>広告SDKでGPSデータを利用してターゲティングを使用したりするものもある。 組み込んだアプリでGPSを使ってなくても、パーミッションが求められる</p><h4>レビューの基準</h4><h6>人気ジャンル</h6><p>セキュリティが5月(2011)あたりが入ってる</p><ul><li>ツール・設定系</li><li>ゲームエンタメ系</li></ul><p>昔はツール系が多かったが、ゲームエンタメ系が増えてきている</p><h4>検索キーワード</h4><ol><li>電話帳</li><li>時計</li><li>メール</li></ol><h3>使ってもらえるアプリの考え方 &#8211; fladdict</h3><h4>ATMアプリを考えてみる</h4><p>架空の事例で考える</p><h4>リサーチ</h4><ul><li>既存のATMの機能?</li><li>既存のATMの不便?</li><li>どういう時に使う</li></ul><h6>既存のATMの機能</h6><ul><li>残高確認</li><li>入金、引き出し</li><li>送金</li><li>設定変更</li></ul><p>オンラインバンキングを含めるともっとたくさんあるので、 どの機能をアプリに含めるのかを考える -&gt; 絞り込む、利用の想定</p><h4>シナリオ</h4><ul><li>通販などの振込</li><li>通常の送金</li><li>支払い忘れへの緊急対応</li><li>残高確認</li></ul><p>逆にスマートフォンで保険や税金管理などの操作はしないとのでいらないはず</p><p>90%のユーザーが必要な機能を入れる</p><ul><li>ヘルプなしでわかるアプリを作る</li><li>アプリを起動してからそのアプリのタスクを1-2駅程度の間に完了できるようにする</li></ul><p>必要な機能を絞り込んでから、コンセプトを立てる</p><h4>コンセプトの定義</h4><p>iPhoneアプリは大体4つの形がある</p><ul><li>ユーティリティ型</li><li>ナビゲーション型(TableView)</li><li>タブ型</li><li>没入型(全画面)</li></ul><p>それぞれのタイプをプロトタイピングして検証していく。</p><h4>ユーティリティ型</h4><ul><li>最低限だけの機能</li><li>残高の確認</li><li>送金ができる</li></ul><h4>ナビゲーション型</h4><p>ユーティリティより機能は増える</p><ul><li>ニュース</li><li>残高</li><li>送金</li><li>設定</li></ul><h4>タブ型</h4><p>ナビゲーション型と似た機能を持つが、平行して機能を使える</p><h4>没入型</h4><p>iPhoneのUIに頼らないので時間がかかる</p><ul><li>実際の画面に似せるなど</li><li>ナビゲーションを出してみたり</li><li>現実のメタファ</li></ul><p><strong>今回はナビゲーション型かタブ型</strong></p><h4>ナビゲーション型</h4><ul><li>拡張しやすい</li><li>単純</li></ul><p>タブ型</p><ul><li>拡張に限界がある</li><li>平行して機能を利用できるのが利点</li></ul><p>ナビゲーション型は階層が深いと、作業を切り替えるにコストがかかるので、タブ型の方がやりやすい</p><h4>タブ型のメニュー</h4><p>よく使うものから左から右へ配置していく</p><p>ニュースを残高確認後に見る人はあまりいない ニュースをATM側としては配信したいので、ニュースを左に持ってきて自動的に見せるようにした。</p><h4>設定画面</h4><ul><li>ピンコード</li><li>アカウント名</li><li>銀行アカウントのパスコード</li></ul><h4>入力UI</h4><ul><li>Pickerを使って桁ミスなくすなど</li><li>送金時はボタンのミスタッチをなくす</li><li>スライドで送金処理を完了させる &lt;= 難しいUIな気がする…</li><li>最初にボタンを詰め込みすぎない</li></ul><hr
/><p>Edit <a
href="http://www.inkcode.net/qute">Qute for PC/Mac<br
/><br
/></a></p>]]></content:encoded> <wfw:commentRss>http://efcl.info/2011/1213/res2982/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>JavaScriptのいろいろなコーディングルールをまとめてみた</title><link>http://efcl.info/2011/0527/res2764/</link> <comments>http://efcl.info/2011/0527/res2764/#comments</comments> <pubDate>Fri, 27 May 2011 13:20:55 +0000</pubDate> <dc:creator>azu</dc:creator> <category><![CDATA[javascript]]></category> <category><![CDATA[まとめ]]></category><guid
isPermaLink="false">http://efcl.info/?p=2764</guid> <description><![CDATA[JavaScriptの書き方はJavaScript自体がある程度自由なためいろいろな書き方ができますが、一貫性を持って書いた方がバグなども発生しにくくなるため、コーディングルールを定めておくのはよいことだと思います(特に [...]]]></description> <content:encoded><![CDATA[<p>JavaScriptの書き方はJavaScript自体がある程度自由なためいろいろな書き方ができますが、一貫性を持って書いた方がバグなども発生しにくくなるため、コーディングルールを定めておくのはよいことだと思います(特に複数人の開発の場合)</p><p>有名な企業やライブラリはコーディングルールも公開している事が多いので適当にまとめてみました</p><h4><a
href="https://developer.mozilla.org/ja/JavaScript_style_guide">JavaScript style guide &#8211; MDC Docs</a></h4><p>Mozilla/Firefox向けのものなので、一部ECMAScriptの範囲を超えたものも含まれています。 <br
/>多くの人が見ていると思うので、見たことない人は一度読んでみるといいです。</p><h4><a
href="http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml">Google JavaScript Style Guide</a></h4><p><a
href="http://cou929.nu/data/google_javascript_style_guide/">Google JavaScript Style Guide 和訳 — Google JavaScript Style Guide 和訳</a>(日本語版) <br
/>Googleのコーディングルールですが、ルールを並べるだけではなくなぜ悪いのかについても触れているので、一読をお勧めします。 <br
/><a
href="http://code.google.com/intl/ja/closure/utilities/docs/linter_howto.html">Closure Linter</a>というチェックツールもあるため、採用しやすいかもしれない。</p><h4><a
href="http://docs.jquery.com/JQuery_Core_Style_Guidelines">JQuery Core Style Guidelines &#8211; jQuery JavaScript Library</a></h4><p>jQuery Coreのもの。 <br
/>Typeチェックの仕方についても触れている。</p><h4><a
href="http://dojotoolkit.org/community/styleGuide">Dojo Style Guide &#8211; The Dojo Toolkit</a></h4><p>Dojoのコーディングルール。 <br
/>コード例が豊富で、命名規則やホワイトスペースの扱いなど細かいところまで入ってる。</p><h4><a
href="http://nodeguide.com/style.html">Felix&#8217;s Node.js Style Guide</a></h4><p><a
href="http://popkirby.github.com/contents/nodeguide/style.html">Felix&#8217;s Node.js Style Guide(和訳)</a>(日本語版) <br
/>Node.jsにおけるコーディングルール。(公式なものではない。no official document) <br
/>Node.jsに限らず、クライアントサイドJavaScriptに置いても参考になる部分は多い。</p><h4><a
href="http://javascript.crockford.com/code.html">Code Conventions for the JavaScript Programming Language</a></h4><p>Douglas Crockfordによるもの。 <br
/>コーディングルールというよりは慣習的なもの。 <br
/>同作者による<a
href="http://www.jslint.com/">JSLint</a>も併用しましょう。(<a
href="http://www.jslint.com/">JSLint</a> or <a
href="http://www.jshint.com/">JSHint</a>は他のコーディングルールであっても採用してよいもの)</p><h4><a
href="http://jibbering.com/faq/notes/code-guidelines/">Code Guidelines for Rich Internet Application Development</a></h4><p>コーディングルールではなくてガイドライン的なものです、HTMLやCSS、JavaScriptについてのガイドラインを書かれている。</p><h4><a
href="https://developer.apple.com/library/mac/#documentation/ScriptingAutomation/Conceptual/JSCodingGuide/Introduction/Introduction.html">Introduction to Apple JavaScript Coding Guidelines</a></h4><p><a
href="http://developer.apple.com/jp/documentation/ScriptingAutomation/Conceptual/JSCodingGuide/">JavaScript Coding Guidelines for Mac OS X</a>(日本語版) <br
/>Appleによるコーディングのガイドライン。 <br
/>&#8220;JavaScriptのベストプラクティス&#8221;でコーディングで気をつける事について触れている。</p><h4><a
href="http://www.webkit.org/coding/coding-style.html">The WebKit Open Source Project &#8211; WebKit Coding Style Guidelines</a></h4><p>JavaScriptではありませんが、Webkitにおけるコーディングルール。 <br
/>ホワイトスペースやLine breakingの所はJavaScriptの場合でも参考になる。 <br
/>uupaaさんがこれをベースに一部分を変更した感じで使ってるそうです。</p><ul><li><a
href="http://code.google.com/p/uupaa-js/wiki/CodingStyle">CodingStyle &#8211; uupaa-js &#8211; JavaScript Coding Style Guide &#8211; JavaScript Library for Casual Creator &#8211; Google Project Hosting</a></li></ul><h4><a
href="http://d.hatena.ne.jp/amachang/20100917/1284700700">サイボウズで学んだこと &#8211; IT戦記</a></h4><p>amachangによるもの。 <br
/>大規模 JavaScript 開発におけるルールや命名規則、デバッグ、パフォーマンスについて触れています。 <br
/>コーディングルールを整えてどのように実践したかについて参考になります。</p><h4><a
href="http://www.amazon.co.jp/exec/obidos/ASIN/4873114888/book042-22/ref=nosim/">JavaScriptパターン</a> (オライリー本)</h4><h4></h4><div
class="azlink-box" style="margin-bottom: 0px;"><div
class="azlink-image" style="float: left;"><a
name="azlinklink" href="http://www.amazon.co.jp/exec/obidos/ASIN/4873114888/book042-22/ref=nosim/" target="_blank"></a><img
style="border-style: none;" src="http://ecx.images-amazon.com/images/I/51ZoMJ%2BrLhL._SL160_.jpg" alt="JavaScriptパターン ―優れたアプリケーションのための作法" /></div><div
class="azlink-info" style="line-height: 120%; float: left; margin-left: 15px;"><div
class="azlink-name" style="line-height: 120%; margin-bottom: 10px;"><a
name="azlinklink" href="http://www.amazon.co.jp/exec/obidos/ASIN/4873114888/book042-22/ref=nosim/" target="_blank"></a>JavaScriptパターン ―優れたアプリケーションのための作法<div
class="azlink-powered-date" style="line-height: 120%; margin-top: 5px; font-family: verdana; font-size: 7pt;">posted with <a
href="http://sakuratan.biz/azlink/dp/JavaScript%E3%83%91%E3%82%BF%E3%83%BC%E3%83%B3%20%E2%80%95%E5%84%AA%E3%82%8C%E3%81%9F%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AE%E3%81%9F%E3%82%81%E3%81%AE%E4%BD%9C%E6%B3%95/4873114888/book042-22" target="_blank">AZlink</a> at 2011.5.27</div></div><div
class="azlink-detail">Stoyan Stefanov,豊福 剛 <br
/>オライリージャパン <br
/>売り上げランキング: 8213</div><div
class="azlink-link" style="margin-top: 5px;"><a
href="http://www.amazon.co.jp/exec/obidos/ASIN/4873114888/book042-22/ref=nosim/" target="_blank">Amazon.co.jp で詳細を見る</a></div></div></div><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>この書籍の<a
href="http://efcl.info/adiary/JavaScriptPatterns/Chapter2Essentials">Chapter 2. Essentials</a>において、JavaScriptのコーディングルールが紹介されています。 <br
/>また避けるべき事やどう書くべきなのかについてもかなり深く書かれています。</p><p>コーディングルールは&#8221;どう書けばいいのか分からない&#8221;という人向けのものではないと思います。どう書いたらいいのか分からない人は、まずなぜそのように書いたらダメなのかを知るのがよいと思います。 <br
/>そのため、書き方に不安を持ってる人はなぜダメなのかについても触れている<a
href="http://cou929.nu/data/google_javascript_style_guide/">Google JavaScript Style Guide 和訳</a>を読むのがよいと思います。(読みやすい日本語版もあるしね) <br
/>コーディングルールはコードに一貫性を持つためにあると思います。頻繁にルールを変える必要はないと思いますが、必ずしもそのルールが、その時の(実行環境|JavaScript)において最適な書き方ではない場合もあります。そういうときはルールの更新をしましょう。</p><h4>おまけ</h4><p>自分の場合は<a
href="http://www.jetbrains.com/webstorm/">WebStorm</a>の<a
href="http://efcl.info/2010/1027/res2023/">自動整形</a>に任せている(といっても膨大なルール設定があるため、上記で紹介したコーディングルールを自動化できる)ので、基本的にはIDE任せという書き方にしています。 <br
/>セミコロン忘れなどについてはcomplete current statement機能(<a
href="http://blog.livedoor.jp/okashi1/archives/51751259.html"> [WebStorm]Complete Current Statementがとても便利な件(・∀・)</a>)を使ったり、<a
href="http://www.jetbrains.com/webstorm/">WebStorm</a>のシンタックスチェックはかなり優秀なのでエラーも書いてる途中で発見しやすいです。(シンタックスチェックも細かく制御できる) <br
/>そのため、やっぱり道具任せといった感じではありますが、WebStormを使用していない場合も同じコードが書けるようにある程度のルールは持っています。 <br
/><a
href="http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml">Google JavaScript Style Guide</a> + <a
href="http://www.webkit.org/coding/coding-style.html">WebKit Coding Style Guidelines</a> に近いですが、ホワイトスペースなど見た目的なちょっとした違いにはそこまで厳しくしない感じで書いています。 <br
/>if, for, while, doなどの{}は省略しない(<a
href="http://www.memetodo.co.cc/2011/05/webstorm_29.html">WebStormの自動整形で中括弧を強制的につける</a>)、誰が見てもある程度読める感じにする、ブレークポイントを打ちやすい空間を作るように配慮するなどなどで、他のコーディングルールに書いてある事と同じようなものだと思います。</p> ]]></content:encoded> <wfw:commentRss>http://efcl.info/2011/0527/res2764/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>第七回ありえるえりあ勉強会 アウトラインメモ</title><link>http://efcl.info/2011/1013/res2971/</link> <comments>http://efcl.info/2011/1013/res2971/#comments</comments> <pubDate>Thu, 13 Oct 2011 14:55:07 +0000</pubDate> <dc:creator>azu</dc:creator> <category><![CDATA[javascript]]></category> <category><![CDATA[イベント]]></category><guid
isPermaLink="false">http://efcl.info/?p=2971</guid> <description><![CDATA[第七回ありえるえりあ勉強会 〜JSで大規模・エンタープライズ開発〜に参加してきたので、その時のメモ。 「JavaScriptで大規模ゲーム開発」渋川 ソーシャルゲームの定義 ユーザー間で非同期のやり取りが発生する ngC [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://partake.in/events/2de2385a-fe4a-42ea-98a4-a321c9249bcf">第七回ありえるえりあ勉強会 〜JSで大規模・エンタープライズ開発〜</a>に参加してきたので、その時のメモ。</p><h3>「JavaScriptで大規模ゲーム開発」渋川</h3><h5>ソーシャルゲームの定義</h5><ul><li>ユーザー間で非同期のやり取りが発生する</li></ul><h4>ngCore</h4><ul><li>マルチプラットフォーム<ul><li>同一ソースでAndroidとiOSに対応</li><li>テスト環境はFlashにも対応</li></ul></li></ul><h5>ゲームの構成</h5><ul><li>ngCore上にゲームロジック/JavaScript</li><li>サーバ/APach+FCGI上に認証とか結果の書き込みをMobageサーバに</li></ul><h5>役割分担</h5><ul><li>ngCoreのクライアント<ul><li>アクションシーン</li><li>サーバ側で作ったデータの再生</li></ul></li><li>ゲームサーバ<ul><li>パラメーター保持、変化</li><li>アイテム管理</li><li>ミッションのスロットの目の決定など</li><li>ずる防止をするためサーバ側でロジックがある</li></ul></li></ul><h5>ngCoreの開発サイクル</h5><ul><li>node.jsで書かれたビルドサーバでビルドを行う。<ul><li>ファイルの結合とか</li></ul></li></ul><h5>コード</h5><ul><li>CJSライクなモジュール</li><li>クラスを作るsubclass関数</li><li>ゲームはmain関数から始まる</li><li>Core.UpdateEmitter でゲームループを回す</li></ul><h5>ゲームの基本構成</h5><ul><li>シンプルなクラス群<ul><li>Sceneクラスを継承してシームを作っていく</li><li>Sceneを遷移してゲームの遷移が行われる</li></ul></li><li>サーバ側からjsonのジョブスタックを受け取る<ul><li>ミッション結果なども配列で返ってくる</li><li>知らないジョブが来たら無視が基本方針</li><li>クライアントは順番に再生していくだけ</li><li>新しいミッションも簡単に追加できる</li></ul></li><li>サーバエラーがおきたらホーム画面に強制的に戻る</li></ul><h5>DnLig/ngGo</h5><ul><li>DnLib<ul><li>ゲーム開発の共通ライブラリ</li></ul></li><li>ngGo</li></ul><h5>開発拠点</h5><ul><li>サンフランシスコ</li><li>日本</li><li><p>パキスタン</p></li><li><p>SKypeチャットが主なインフラ</p></li><li>git<ul><li>git flow</li></ul></li><li>ドキュメントSphinx</li></ul><h5>ngGo/ngBuilder</h5><ul><li>– データ駆動で行えるように</li><li>- パラメーターチューニングのしやすさ</li></ul><h5>デバッグとテスト</h5><ul><li>デバッグメニュー<ul><li>サーバにデバッグ用画面がある</li></ul></li><li>Jasmineを使ってる</li></ul><h5>今後のngCore</h5><ul><li>3D対応、HTML5対応</li></ul><h4>まとめ</h4><p>JavaScriptベースで</p><h3>オフラインWebアプリケーションの作り方 (白石)</h3><p>Google Gearsを使ってオフラインアプリケーションを作ったことがある。</p><h4>オフラインWebアプリケーション</h4><h5>Google Gears</h5><ul><li>Google Gears終了 –&gt; HTML5へ以降を推奨<ul><li>HTML5を中心にするようになった</li></ul></li></ul><h4>オフラインでも読めるアプリの作り方</h4><ul><li>それほど実装は難しくない</li><li>アプリケーションキャッシュを利用すればいい</li></ul><h5>アプリケーションキャッシュとは</h5><ul><li>静的なリソースをキャッシュすることができる機能</li><li>ローカルキャッシュの利点</li><li>IE以外のブラウザでは実装されてる</li></ul><h5>キャッシュマニフェスト</h5><ul><li>リソースのリストを作成する</li><li>Titanium Mobileのリファレンスはローカルキャッシュされてる</li></ul><h5>アプリケーションキャッシュのJavaScript API</h5><ul><li>window.applicationCacheにJavaScriptから操作できるアプリケーションキャッシュAPIがある。</li></ul><h5>アプリケーションキャッシュを利用する上での注意点</h5><ul><li>キャッシュマニフェストを更新しないとリロードで反映しない</li><li>キャッシュ容量が限られている<ul><li>モバイルとかだと10MBぐらい</li></ul></li></ul><h4>オフラインでも書けるアプリの作り方</h4><ul><li>割りと面倒なもの</li><li>デスクトップアプリとやりたい事はあんまり変わらない</li></ul><h5>オフラインWebアプリを作るポイント</h5><ul><li>基本はリッチクライアント+同期機能</li></ul><h5>利用できるローカルストレージ</h5><ul><li>Web Storage</li><li>Web SQL Database</li><li>Indexed Database API</li><li>File API<ul><li>ドメインごとに仮想的な空間</li><li>セキュリティ的なものがあるため</li></ul></li></ul><h5>双方向同期</h5><p>かなり難しく面倒くさい – フェールセーフ – 更新の衝突 – 同期のタイミング – ネットワーク状態、データの状態管理 – ローカルDBのスキーマ管理/サーバのスキーマと2つできてしまう – ローカルDBのクオータ(5MBぐらい)</p><pre><code>- 容量の限界がきたときにどうするか
</code></pre><h4>まとめ</h4><ul><li>オフラインアプリケーションといっても読む/書くの2つがある</li><li>書く/同期的なアプリケーションはかなり面倒臭い<ul><li>割り切ったほうがいい</li></ul></li></ul><h3>スケールするUIについて – @monjudoh</h3><p>Objective-Cで非同期処理のチェーンライブラリとか</p><h5>要素数</h5><p>ループの中でbind/unbindしてたので大量に追加されたときに重たかったのでliveメソッドに変更 bindはここの要素に付けるから、要素が多いと死ぬ。delegateとかliveはその枠の方にイベント一個張るだけだから軽くてすむ。</p><h5>D&amp;D</h5><ul><li>ユーザが触れる範囲だけにイベントを付ける</li><li>D&amp;Dは複数のイベントから成り立つので複雑(down-&gt;move-up)</li></ul><h5>要素の生成</h5><ul><li>UITableView<ul><li>表示範囲+ぐらいのみを描画してる</li><li>再利用してる</li></ul></li></ul><h3>JavaScriptのテスト事情 –  @os0x</h3><ul><li>JavaScriptのテスト<ul><li>まだまだ未成熟</li></ul></li><li>二種類<ul><li>JavaScriptのテスト<ul><li>JavaScriptだけなので比較的わかりやすい</li></ul></li><li>JavaScriptを含めたテスト<ul><li>UIとかも含むインテグレーションテスト</li></ul></li></ul></li></ul><h5>インテグレーションテスト</h5><ul><li>インテグレーションテストは書くのが大変</li><li>動いてあることが保証できるので重要<ul><li>後から追加修正とかも</li></ul></li></ul><h5>インテグレーションテストの定番 – Selenium</h5><ul><li>インテグレーションテストは遅い</li></ul><h5>テスト実行環境</h5><ul><li>カピバラさん + Webkit</li></ul><h5>QUnit,Jasmine</h5><ul><li>Jasmineの方がアプリケーションテストは向いてる</li></ul><h5>jasmine-headless-webkit</h5><ul><li>jasmine のspecをCUI環境で実行できる</li></ul><h3>Titanium Mobile – Masui Yuichiro</h3><ul><li>ココログ</li><li>liblis</li><li>AKB</li><li>サイボウズLiveの</li><li>MobSnap</li></ul><h4>Titanium Mobile</h4><ul><li>JavaScriptだけでアプリを作成できる</li><li>Titanium Mobile のモジュール売買できる<ul><li> mobile market place</li></ul></li></ul><h4>モバイルのUX</h4><ul><li>それぞれのプラットフォームに合わせた形に変換する</li><li>それぞれに合わせたUIはUXに</li><li>タブバーの位置がAndroid/iPhoneで逆になったり</li></ul><h4>飯食う</h4><ul><li>追加モジュールとサポートのみが有料</li><li>認定トレーニング</li></ul><ul></ul><p>感想</p><ul><li>ちょっと落ち着きがなかった気がするの</li><li>あまり掘り下げた感じにはならなかったのは少しもったいない気がした。</li></ul><p>メモ環境</p><ul><li><a
href="http://mouapp.com/">Mou</a></li></ul><p> </p><ul
style="margin-top: 0px; margin-right: 0px; margin-bottom: 18px; margin-left: 25px; font-weight: normal; font-style: normal; font-size: 13px; line-height: 1; font-family: inherit; list-style-type: disc; list-style-position: initial; list-style-image: initial; padding: 0px; border: 0px initial initial;"></ul>]]></content:encoded> <wfw:commentRss>http://efcl.info/2011/1013/res2971/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching using disk: basic
Object Caching 748/748 objects using disk: basic

Served from: efcl.info @ 2012-05-18 02:06:05 -->
