<?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>ものぐさ備忘録 &#187; Links</title>
	<atom:link href="http://www.ginriki.net/wd/category/links/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ginriki.net/wd</link>
	<description>ソフトウェア関係の話を中心とした備忘録的日記</description>
	<lastBuildDate>Sun, 11 Jul 2010 15:48:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>FlashPlayer10で外部swfのロードに失敗する件</title>
		<link>http://www.ginriki.net/wd/2008/11/05/46/</link>
		<comments>http://www.ginriki.net/wd/2008/11/05/46/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 07:25:15 +0000</pubDate>
		<dc:creator>ginriki</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.gikogeek.net/wd/?p=46</guid>
		<description><![CDATA[2008/10にFlashPlayer10が正式リリースされました。
Flashの動作に若干変更が加えられたようで、バイト先のWebサイトで今まで正常動作していたFlashがFlashPlayer10では動かないという問 [...]]]></description>
			<content:encoded><![CDATA[<p>2008/10にFlashPlayer10が<a href='http://www.itmedia.co.jp/news/articles/0810/15/news067.html'>正式リリース</a>されました。</p>
<p>Flashの動作に若干変更が加えられたようで、バイト先のWebサイトで今まで正常動作していたFlashがFlashPlayer10では動かないという問題が起きました。</p>
<p>挙動を調べてみると、MovieClipLoader.loadClipで外部swfのロードに失敗してます。</p>
<p>外部swfとして指定するURLは実際にはPHPファイルを指しており、GETパラメータを変えることで<br />
PHPファイルが出力するswfデータが変わるようになってます。</p>
<p>どうも、PHPファイルがswfデータを出力する際に指定してるHTTPレスポンスヘッダが良くないようなので、調べてみるとContent-disposition 指定がswfロードに失敗する原因でした。</p>
<p>そこで、下記のようにContent-dispositionの指定をコメントアウトしたら、FlashPlayer10でも<br />
外部swfのロードに成功しました。</p>
<div class="igBar"><span id="lphp-2"><a href="#" onclick="javascript:showPlainTxt('php-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-2">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#FF9933; font-style:italic;">//...略</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#FF9933; font-style:italic;">// header(&quot;Content-disposition: attachment;filename=&quot; . $filename);</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"Content-type: application/x-shockwave-flash"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"Content-length: "</span> . <a href="http://www.php.net/filesize"><span style="color:#000066;">filesize</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$filepath</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <a href="http://www.php.net/readfile"><span style="color:#000066;">readfile</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$filepath</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Content-dispositionの仕様はRFCで規定されています。その内容については、<a href='http://www.studyinghttp.net/header#Content-Disposition'>こちら</a>によくまとめられています。<br />
以下、一部引用</p>
<pre>
Content-Disposition レスポンスヘッダフィールドは、ユーザがその内容を
ファイルに保存したい場合にオリジンサーバが既定のファイル名を提案する事を
意味するように勧告されている。
</pre>
<p>Adobe的には、Flashでロードするswfコンテンツに、ファイルを保存する場合に指定するフィールドを指定するなってことなんでしょうかねえ。</p>
<h4>その他FlashPlayer10の問題</h4>
<p>FlashPlayer10になって、バージョン番号が１桁から２桁に増えたため、<br />
バージョンチェックを適当に行うJavascriptを書いているサイトなどでは、<br />
FlashPlayer10をFlashPlayer1と勘違いして、Flashが表示されない問題が起きてるようです。<br />
<a href='http://bakera.jp/ebi/topic/3302'>http://bakera.jp/ebi/topic/3302</a></p>
<p>・・・なんとなく２０００年問題を思い出しました。</p>
<h4>追記</h4>
<p>Adobe公式の<a href='http://www.adobe.com/devnet/flashplayer/articles/fplayer10_security_changes_02.html#head32'>FlashPlayer10におけるセキュリティ上の変更点解説</a>の中で、<br />
Content-Disposition: attachment 指定されたswfに対する挙動を変えた理由が書いてありました。</p>
<p>不特定の人がファイルをアップロード/ダウンロードできるアップローダサイト等で、<br />
信頼できないユーザによってアップロードされたswfが、そのサイトドメイン上で実行される危険性を<br />
なくすためだそうです。</p>
<p>画像やxmlファイルなどは、Content-Disposition: attachmentがHTMLレスポンスヘッダに<br />
ついていても、今までと同様に動作するそうです。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ginriki.net/wd/2008/11/05/46/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>各種言語の文法</title>
		<link>http://www.ginriki.net/wd/2008/09/11/11/</link>
		<comments>http://www.ginriki.net/wd/2008/09/11/11/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 21:26:25 +0000</pubDate>
		<dc:creator>ginriki</dc:creator>
				<category><![CDATA[BNF]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[文法]]></category>
		<category><![CDATA[言語仕様]]></category>

		<guid isPermaLink="false">http://www.gikogeek.net/wd/?p=11</guid>
		<description><![CDATA[以前のブログで各種言語の文法がBNFとかで書いてあるサイト群をメモりました。
でも、SQLのBNFリンクは入れてなかったことに最近気づいたので、改めてこちらに記事を作りなおしておきます。

 C/C++, Java, C [...]]]></description>
			<content:encoded><![CDATA[<p><a title="前のブログ" href="http://d.hatena.ne.jp/gikogeek/20080429">以前のブログ</a>で各種言語の文法がBNFとかで書いてあるサイト群をメモりました。<br />
でも、SQLのBNFリンクは入れてなかったことに最近気づいたので、改めてこちらに記事を作りなおしておきます。</p>
<dl>
<dt> C/C++, Java, COBOL, Prolog, SmallTalk</dt>
<dd><a title="http://www.csci.csusb.edu/dick/samples/index.html" href="http://www.csci.csusb.edu/dick/samples/index.html">http://www.csci.csusb.edu/dick/samples/index.html</a></dd>
<dt>Python</dt>
<dd><a title="http://www.python.jp/doc/2.3.5/ref/" href="http://www.python.jp/doc/2.3.5/ref/">http://www.python.jp/doc/2.3.5/ref/</a></dd>
<dt>Ruby</dt>
<dd><a title="http://www.ruby-lang.org/ja/man/html/_B5BFBBF7BNF_A4CBA4E8A4EBRuby_A4CECAB8CBA1.html" href="http://www.ruby-lang.org/ja/man/html/_B5BFBBF7BNF_A4CBA4E8A4EBRuby_A4CECAB8CBA1.html">http://www.ruby-lang.org/ja/man/html/_B5BFBBF7BNF_A4CBA4E8A4EBRuby_A4CECAB8CBA1.html</a></dd>
<dt>PHP<sup>1</sup></dt>
<dd><a title="http://www.phpcompiler.org/doc/grammar.html" href="http://www.phpcompiler.org/doc/grammar.html">http://www.phpcompiler.org/doc/grammar.html</a></dd>
<dt>ECMAScript</dt>
<dd><a title="http://tomcopeland.blogs.com/EcmaScript.html" href="http://tomcopeland.blogs.com/EcmaScript.html">http://tomcopeland.blogs.com/EcmaScript.html</a></dd>
<dt>Javascript</dt>
<dd><a title="http://www.mozilla.org/js/language/grammar14.html" href="http://www.mozilla.org/js/language/grammar14.html">http://www.mozilla.org/js/language/grammar14.html</a></dd>
<dt>ActionScript</dt>
<dd><a title="http://www.m2osw.com/en/action_script.html#grammar" href="http://www.m2osw.com/en/action_script.html#grammar">http://www.m2osw.com/en/action_script.html#grammar</a></dd>
<dt>C#</dt>
<dd><a title="http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf" href="http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf">http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf</a></dd>
<dd>
<ul>
<li> Annex A. Grammar参照</ul>
</li>
</dd>
<dt>SQL</dt>
<dd><a title="http://savage.net.au/SQL/" href="http://savage.net.au/SQL/">http://savage.net.au/SQL/</a></dd>
</dl>
<p>なお、正確な言語文法が知りたい方は、それぞれの言語仕様書を見た方が良いです。上記リンク先は、ある程度文法がわかればよい人向けです。</p>
<ol class="footnotes"><li id="footnote_0_11" class="footnote">PHPの場合、言語仕様では文法が決まってないそうです。リンク先は、有志の人がそれっぽく作った文法ということになります。</li></ol>]]></content:encoded>
			<wfw:commentRss>http://www.ginriki.net/wd/2008/09/11/11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>仕様書等のリンク集</title>
		<link>http://www.ginriki.net/wd/2007/06/09/18/</link>
		<comments>http://www.ginriki.net/wd/2007/06/09/18/#comments</comments>
		<pubDate>Sat, 09 Jun 2007 14:25:40 +0000</pubDate>
		<dc:creator>ginriki</dc:creator>
				<category><![CDATA[Links]]></category>
		<category><![CDATA[仕様書]]></category>

		<guid isPermaLink="false">http://www.gikogeek.net/wd/?p=18</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<div class="section">
<p>ソフトウェア実装の際、様々な仕様書を参考にすることがありますが、どんな仕様書がどこにあるのか忘れることがあるのでメモっておきます。</p>
<p>仕様書だけではなく、複数の仕様書について言及、比較をしている資料も挙げておきます。</p>
<h4> オブジェクトファイルに関する仕様書等</h4>
<ul>
<li> Microsoft Portable Executable and Common Object File Format Specification: Windows上の実行可能ファイルとオブジェクトファイルに関する仕様書<span class="footnote"><a href="/gikogeek/#f1" name="fn1" title="仕様書をpdfではなくdocファイルで提供するあたりがMicrosoft的だなあ・・・">*1</a></span></li>
</ul>
<p><a href="http://www.microsoft.com/japan/whdc/system/platform/firmware/PECOFF.mspx" target="_blank">http://www.microsoft.com/japan/whdc/system/platform/firmware/PECOFF.mspx</a></p>
<ul>
<li> Tool Interface Standard (TIS) Portable Formats Specification: Linux/BSD系 OSの標準的なオブジェクトファイルであるELFに関する仕様書.そのほかにDwarf<span class="footnote"><a href="/gikogeek/#f2" name="fn2" title="ELFとともによく使われるデバッグ情報の一種">*2</a></span>やOMFの仕様も書かれている</li>
</ul>
<p><a href="http://www.acm.uiuc.edu/sigops/rsrc/pfmt11.pdf" target="_blank">http://www.acm.uiuc.edu/sigops/rsrc/pfmt11.pdf</a></p>
<ul>
<li> Introduction to Mach-O Programming Topics: Mac OS Xで使われるオブジェクトファイル形式Mach-Oを使ってプログラムを書く上で参考になるTopic集（Mach-Oの構造に関する記述含む）</li>
</ul>
<p><a href="http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachOTopics/introduction.html" target="_blank">http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachOTopics/introduction.html</a></p>
<h4> OSが提供する機能やその機能を利用するアセンブラ、C言語、C標準関数に関する仕様書等</h4>
<ul>
<li> Manpage of STANDARDS: C と UNIX の標準規格を昔から現在の物まで列挙してあります。各規格の関係を把握するのに役立ちます。</li>
</ul>
<p><a href="http://www.linux.or.jp/JM/html/LDP_man-pages/man7/standards.7.html" target="_blank">http://www.linux.or.jp/JM/html/LDP_man-pages/man7/standards.7.html</a></p>
<ul>
<li> Calling conventions for different C++ compilers and operating systems: コンパイラ、OSの違いに伴うC++の呼び出し規約の違いに関する記述が主ですが、OSによるcallee-save registerやcaller-save registerの違い等についても書かれているのでC++とは関係なく参考になります</li>
</ul>
<p><a href="http://www.agner.org/optimize/" target="_blank">http://www.agner.org/optimize/</a></p>
<ul>
<li> The Single UNIX Specification Version 3: 現在、多くのOSが準拠していると思われるUNIX OSとCに関する仕様書</li>
</ul>
<p><a href="http://www.unix.org/single_unix_specification/" target="_blank">http://www.unix.org/single_unix_specification/</a></p>
<h4> プログラミング言語に関する仕様書等</h4>
<ul>
<li> RubySpec: Rubyの仕様は文書化されていないのですが、それだと困るっていうんで有志の人がRubyマニュアルやCRubyの実装を元に仕様ぽい規定を収集したもの。直接CRubyの実装を読むよりは、ずっと楽です。</li>
</ul>
<p><a href="http://www.headius.com/rubyspec/index.php/Main_Page" target="_blank">http://www.headius.com/rubyspec/index.php/Main_Page</a></p>
<ul>
<li> Python Reference Manual: Pythonの文法や機能に関する仕様書</li>
</ul>
<p><a href="http://docs.python.org/ref/ref.html" target="_blank">http://docs.python.org/ref/ref.html</a></p>
</div>
<div class="footnote">
<p class="footnote"><a href="/gikogeek/#fn1" name="f1">*1</a>：仕様書をpdfではなくdocファイルで提供するあたりがMicrosoft的だなあ・・・</p>
<p class="footnote"><a href="/gikogeek/#fn2" name="f2">*2</a>：ELFとともによく使われるデバッグ情報の一種</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.ginriki.net/wd/2007/06/09/18/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
