<?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>進・日進月歩</title>
	<atom:link href="http://blog.gijutsuya.jp/harajune/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.gijutsuya.jp/harajune</link>
	<description>IT, Jazz, study, engineering, すべての真実とクリエイティビティのために</description>
	<lastBuildDate>Tue, 23 Feb 2010 16:44:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>git diff を VimDiff で見よう</title>
		<link>http://blog.gijutsuya.jp/harajune/2010/02/24/git-vimdiff/</link>
		<comments>http://blog.gijutsuya.jp/harajune/2010/02/24/git-vimdiff/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 16:44:16 +0000</pubDate>
		<dc:creator>harajune</dc:creator>
				<category><![CDATA[雑記]]></category>

		<guid isPermaLink="false">http://blog.gijutsuya.jp/harajune/?p=1058</guid>
		<description><![CDATA[
最近、自分ががしがしコミットしていたソースツリーを他人と共有する必要があり、人がどういう変更をしていたのかを確認する必要が出てきました。
コンフリクトを避けるのはもちろんですが、互いの空気をソースから読み取るというのは重要です。
要は git diff を見ればいいんですが、git diff はぱっとみよくわかりませんね・・・・

世の中にはスーパーハカーがいたりするのでこれでいいのかもしれませんが、超一般ピープルである私にはちょっときついです。そこでGitVimDiffです。
motemen さんの git.vim をベースにさせていただきました。これはmoteます・・・・！
スクリプトを.vim/pluginsにコピーしてvimを起動します。
そこでいきなり:GitVimDiffと入れてみます。するとHEADからの差分が表示されます。
さて、今回の目的は他人のコミットとの差分を表示することです。git logでハッシュ値を確認してそれとworking ソースの差分を表示してみましょう。
例えば、 :GitVimDiff cb110a2a9c1532b8737ed37953aeaaa48436351c とか入れてみます。すると、このコミットの時のソースコードとの差分が出ます。これが冒頭のスクリーンショットです。
git diffよりも大分見やすくなりましたね！すばらしい。
vimscript歴2時間で作成したコードなのでまだまだ改善の余地はあるのではないかと思いますが、突っ込み改善歓迎です。
]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.gijutsuya.jp/harajune/wp-content/uploads/2010/02/git-vim.png"><img class="aligncenter size-full wp-image-1059" title="git-vim" src="http://blog.gijutsuya.jp/harajune/wp-content/uploads/2010/02/git-vim.png" alt="git-vim" width="539" height="380" /></a></p>
<p>最近、自分ががしがしコミットしていたソースツリーを他人と共有する必要があり、人がどういう変更をしていたのかを確認する必要が出てきました。<br />
コンフリクトを避けるのはもちろんですが、互いの空気をソースから読み取るというのは重要です。</p>
<p>要は git diff を見ればいいんですが、git diff はぱっとみよくわかりませんね・・・・</p>
<p><a href="http://blog.gijutsuya.jp/harajune/wp-content/uploads/2010/02/git-diff.png"><img class="aligncenter size-full wp-image-1060" title="git-diff" src="http://blog.gijutsuya.jp/harajune/wp-content/uploads/2010/02/git-diff.png" alt="git-diff" width="533" height="379" /></a></p>
<p>世の中にはスーパーハカーがいたりするのでこれでいいのかもしれませんが、超一般ピープルである私にはちょっときついです。そこで<a href="http://github.com/harajune/git-vim" target="_blank">GitVimDiff</a>です。</p>
<p><a href="http://github.com/motemen/git-vim" target="_blank">motemen さんの git.vim</a> をベースにさせていただきました。これはmoteます・・・・！</p>
<p>スクリプトを.vim/pluginsにコピーしてvimを起動します。<br />
そこでいきなり:GitVimDiffと入れてみます。するとHEADからの差分が表示されます。</p>
<p>さて、今回の目的は他人のコミットとの差分を表示することです。git logでハッシュ値を確認してそれとworking ソースの差分を表示してみましょう。<br />
例えば、 :GitVimDiff cb110a2a9c1532b8737ed37953aeaaa48436351c とか入れてみます。すると、このコミットの時のソースコードとの差分が出ます。これが冒頭のスクリーンショットです。</p>
<p>git diffよりも大分見やすくなりましたね！すばらしい。</p>
<p>vimscript歴2時間で作成したコードなのでまだまだ改善の余地はあるのではないかと思いますが、突っ込み改善歓迎です。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gijutsuya.jp/harajune/2010/02/24/git-vimdiff/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Webサービスとコンセプトとビジョンとコンサルとか</title>
		<link>http://blog.gijutsuya.jp/harajune/2010/02/12/websevice-vision-concept-consultant/</link>
		<comments>http://blog.gijutsuya.jp/harajune/2010/02/12/websevice-vision-concept-consultant/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 17:17:45 +0000</pubDate>
		<dc:creator>harajune</dc:creator>
				<category><![CDATA[雑記]]></category>

		<guid isPermaLink="false">http://blog.gijutsuya.jp/harajune/?p=1054</guid>
		<description><![CDATA[最近コンセプトとかビジョンとか言ってる人がたくさんいます。
正直、何を言っているのかがさっぱりわからない人が多かったため、今まで完全にスルー対象でした。
しかし、最近のcookpadやpixiv,mixi,gree,DeNAを見たり戦略コンサルに就活するにあたり色々勉強している流れで、ほんのり理解できた気がしたので書き散らかしてみようかと思いました。
コンセプトの代表格と言えば自分の中では高須賀さんです。
詳細な理屈はあまり腑に落ちていないので覚えていないのですが、常々コンセプトの重要性について説いて回っており、新しいコンセプトに出会いたいと真剣に思っているようです。
一方でビジョンの代表格はMITメディアラボで石井教授のNIIでの講演の言葉を今でも覚えています。
technologyは一年で古くなる。
needsは10年で古くなる。
しかしビジョンは100年続かせることができる。
すごく抽象的で概念的な言い方をすれば、よく学生が言うような「本質」だとか「軸」だとかそういうものであるような気がします。（これに関してまた色々と言いたい事は無いことも無いのですが、また暇な時に・・・・）
自分もwebサービス作りに絡んで4,5年経つのでぼんやりとその重要性に関しては認識していました。
実に色んな種類のサイトやらシステムやらを作りましたが、明確に流行るものと流行らないものには差があった様に思います。
簡単に言えば、見ればすぐに誰が使うかわかるものと、一体誰が使うのかが謎なものです。
もちろん謎だけど流行ってるものというのもありますが（自分は絵をかかないのでなぜpixivが流行ってるかは理解しがたい）、ユーザ的には何らかの共通点を見いだすことができそうだなと漠然と感じています。
きっとこれがコンセプトやビジョンに当たるのではないだろうかと思います。
さて、コンセプトやビジョンというものはwebサービスにおいて重要なんでしょうか？おそらく答えはyesです。
webサービスとは読んで字のごとく「webを通じてなんらかのサービスを提供」するものです。
pixivならイラストを見たり描いたり。mixiなら友達との交流。ECサイトなら買物。そいういう感じです。
色々なサービスについて色んなことが言えるのですが、今回は議論をわかりやすくするために特にSNSについて取り上げたいと思います。
SNSは、少なくとも日本に関して言えばmixi・gree(前期)に始まり、OpenPNE系などのSNS乱立時代を経て、メジャーなところではモバゲー・gree(後期)・pixiv等にいたっています。
モバゲーもgree(後期)もpixivもSNSなのかと疑問を持たれる方もいると思いますが、それはもっともですし、しかもそこがキーポイントです。
SNSは、先発組と後発組で明確に戦略が変わっています。
皆様ご存知の通り先発組の代表格はmixiとgree(前期)です。
この両者の争いに関しては他に譲りますが、基本的にはどちらがデファクトになるかという争いでした。
機能やデザイン面での多少の差異はありますが、どちらも日記・コミュニティ・足跡など非常に似た機能を持ち合わせており利用目的も非常に似ていました。
どちらが先にデファクトになるのか。デファクトになりインフラとして機能するようになるか。これがとにかく重要でした。
一方で後発組をみてみると、pixiv, gree(後期),モバゲーなどがあります。
これらはSNSという体裁がある一方で、ゲームやイラストといった特定のコンセプトを明確に打ち出しその地位を不動のものとしつつあります。
pixivといえばイラスト、gree・モバゲーといえばゲームという形です。
（携帯ゲームは携帯固有の大人の事情があるためgreeとモバゲーはデファクト争い以外の色々な要素がありそうです）
非モテSNSやゲイSNSなどOpenPNEをベースとしたSNSのうちある程度流行ったものもコンセプトを明確にしているものと言えます。
個々でのポイントは、後発組はコンセプトを明確にしているという点です。
これらの事例からわかる通り、先発組は汎用的な用途でマスをとりデファクトをとる戦略、後発組はコンセプトを打ち出し特定の用途に特化する戦略が有効であることがわかると思います。
実は、この傾向は動画サイトにもある程度言えます。代表的な例としてyoutubeとニコニコ動画を考えてみましょう。
youtubeは動画配信サイトとして不動の地位を築いている先発組です。youtube動画の埋め込み機能を使い（違法動画ではありますが）PVのまとめサイトやネタ動画サイトのインフラとして使われるようになっています。
一方で後発組であるニコニコ動画は、ご存知の通り初期段階ではyoutubeをインフラとして利用しており、その上にコメントでのコミュニケーションというコンセプトを上乗せして成功しました。
他にもフリーメールにおけるgmail(大容量化)、検索におけるgoogle(膨大な対象ページ)など多くがこうした後発組は「あるコンセプト」に従っているという例に当てはまります。
コンセプトはwebサービスにおいてなぜこうまでに重要なのでしょうか？
それはユーザがそのwebサービスにたどり着くためにはコンセプトが必要だからです。
例えばレシピを探そうと思ったとしましょう。図書館に行く、googleで探す、NHKを見るなど色んな方法が考えられます。
こうした様々な方法の中からあえてcookpadにアクセスする理由とは何でしょうか？
検索エンジンからたどり着くということもあるでしょうが、そうでなければ、「cookpadはレシピサイト」というコンセプトのサービスであるからです。
webサービスにたどり着くためには、現実の行為に対応されたコンセプトが必要なのです。
そしてそのコンセプトの中でナンバーワンであることがさらに重要です。
レシピと聞いてどのwebサービスを思い出すでしょうか？居酒屋なら？クーポンなら？多くの人が同じようなwebサービスを思い浮かべることでしょう。
しかしそれ以外のサイトについていくつあげることができますか？ググっちゃダメですよ。
たいていどんなサイトに関してもググってみれば似たようなサイトを見つけることができますが、最初に思い浮かぶサイトは大抵の人が同じモノです。
この立ち位置を築くことがwebサービスにはとても重要です。
これらを一言でまとめてしまうと、「適当な大きさのニッチでナンバーワンになればおk」なんですが、このことは本当に多くのwebサービスに当てはまっているということがわかります。
さて、コンセプトとビジョンの重要性についてはある程度ご納得いただけたでしょうか。
当たり前すぎることを連ねた感じはありますが、webサービスで起業したいという人でもこの「コンセプト」や「ニッチNo1」の重要性をあまり感じていないように思います。
長文となりましたが、webサービスにおいてビジョンやコンセプトというものがいかに重要であるかということが少しでも感じ取れていただけたら幸いです。
ここからは蛇足。
学生しつつプログラミングを通して、ある程度の分析を加えつつ、時々気分でアドバイスしたりして来てるんですが、戦略コンサルを就職希望しているのはこういう話が好きだというのが一番です。
全体から傾向をつかむとか、なにかの本質的な原因を探るとか好きなんですね。好きだからこんな長文がかけます（ぉ
平均よりはITのことしってますしきっと経験もあるんだろうと思いますが、元はと言えば会社とか経営とか絡んでみたいと思って全て始まってますし、それだけのモチベーションで（学生でかわいがってもらってた可能性はあるにしても）個人名で仕事もらえる程度にはなりました。
戦略と技術のどちらの方が貢献できるのかと聞かれると非常に答えずらいのですが、世間の人から技術的な点を聞かれることが多い一方で、私は戦略的な穴の方が気になって気になってしょうがないと思っていたりもします。
技術的にgoogleにはいれるほどなのかと聞かれるとかなり微妙ですが、それなりになんとかしますしなぜかいつもそこの人員が足りていないので実務上そっちに回ることが多いのですが、ここらで１回技術屋さんやめて戦略を専業でやってみたいものだなぁというふうに思っています。
この文章はとりあえず過去の事例をいくつか上げてみた程度なので、あまり戦略的な分析ではないですが、なんか適当な目的を考えていつか書いてみたいなぁと思います。
蛇足でした。こういうのは就職活動始める前にやるべきだな。
※コンセプト重要ですが、トライアンドエラーを認めてないわけじゃないです
]]></description>
			<content:encoded><![CDATA[<p>最近コンセプトとかビジョンとか言ってる人がたくさんいます。<br />
正直、何を言っているのかがさっぱりわからない人が多かったため、今まで完全にスルー対象でした。<br />
しかし、最近のcookpadやpixiv,mixi,gree,DeNAを見たり戦略コンサルに就活するにあたり色々勉強している流れで、ほんのり理解できた気がしたので書き散らかしてみようかと思いました。</p>
<p>コンセプトの代表格と言えば自分の中では<a href="http://d.hatena.ne.jp/ttakasuka/" target="_blank">高須賀さん</a>です。<br />
詳細な理屈はあまり腑に落ちていないので覚えていないのですが、常々コンセプトの重要性について説いて回っており、新しいコンセプトに出会いたいと真剣に思っているようです。</p>
<p>一方でビジョンの代表格はMITメディアラボで石井教授のNIIでの講演の言葉を今でも覚えています。</p>
<blockquote><p>technologyは一年で古くなる。<br />
needsは10年で古くなる。<br />
しかしビジョンは100年続かせることができる。</p></blockquote>
<p>すごく抽象的で概念的な言い方をすれば、よく学生が言うような「本質」だとか「軸」だとかそういうものであるような気がします。（これに関してまた色々と言いたい事は無いことも無いのですが、また暇な時に・・・・）</p>
<p>自分もwebサービス作りに絡んで4,5年経つのでぼんやりとその重要性に関しては認識していました。<br />
実に色んな種類のサイトやらシステムやらを作りましたが、明確に流行るものと流行らないものには差があった様に思います。<br />
簡単に言えば、見ればすぐに誰が使うかわかるものと、一体誰が使うのかが謎なものです。<br />
もちろん謎だけど流行ってるものというのもありますが（自分は絵をかかないのでなぜpixivが流行ってるかは理解しがたい）、ユーザ的には何らかの共通点を見いだすことができそうだなと漠然と感じています。<br />
きっとこれがコンセプトやビジョンに当たるのではないだろうかと思います。</p>
<p>さて、コンセプトやビジョンというものはwebサービスにおいて重要なんでしょうか？おそらく答えはyesです。</p>
<p>webサービスとは読んで字のごとく「webを通じてなんらかのサービスを提供」するものです。<br />
pixivならイラストを見たり描いたり。mixiなら友達との交流。ECサイトなら買物。そいういう感じです。<br />
色々なサービスについて色んなことが言えるのですが、今回は議論をわかりやすくするために特にSNSについて取り上げたいと思います。</p>
<p>SNSは、少なくとも日本に関して言えばmixi・gree(前期)に始まり、OpenPNE系などのSNS乱立時代を経て、メジャーなところではモバゲー・gree(後期)・pixiv等にいたっています。<br />
モバゲーもgree(後期)もpixivもSNSなのかと疑問を持たれる方もいると思いますが、それはもっともですし、しかもそこがキーポイントです。</p>
<p>SNSは、先発組と後発組で明確に戦略が変わっています。<br />
皆様ご存知の通り先発組の代表格はmixiとgree(前期)です。<br />
この両者の<a href="http://www.mindreading.jp/blog/archives/200701/2007-01-16T1007.html" target="_blank">争いに関しては他に譲り</a>ますが、基本的にはどちらがデファクトになるかという争いでした。<br />
機能やデザイン面での多少の差異はありますが、どちらも日記・コミュニティ・足跡など非常に似た機能を持ち合わせており利用目的も非常に似ていました。<br />
どちらが先にデファクトになるのか。デファクトになりインフラとして機能するようになるか。これがとにかく重要でした。</p>
<p>一方で後発組をみてみると、pixiv, gree(後期),モバゲーなどがあります。<br />
これらはSNSという体裁がある一方で、ゲームやイラストといった特定のコンセプトを明確に打ち出しその地位を不動のものとしつつあります。<br />
pixivといえばイラスト、gree・モバゲーといえばゲームという形です。<br />
（携帯ゲームは携帯固有の大人の事情があるためgreeとモバゲーはデファクト争い以外の色々な要素がありそうです）<br />
非モテSNSやゲイSNSなどOpenPNEをベースとしたSNSのうちある程度流行ったものもコンセプトを明確にしているものと言えます。<br />
個々でのポイントは、後発組はコンセプトを明確にしているという点です。</p>
<p>これらの事例からわかる通り、先発組は汎用的な用途でマスをとりデファクトをとる戦略、後発組はコンセプトを打ち出し特定の用途に特化する戦略が有効であることがわかると思います。</p>
<p>実は、この傾向は動画サイトにもある程度言えます。代表的な例としてyoutubeとニコニコ動画を考えてみましょう。<br />
youtubeは動画配信サイトとして不動の地位を築いている先発組です。youtube動画の埋め込み機能を使い（違法動画ではありますが）PVのまとめサイトやネタ動画サイトのインフラとして使われるようになっています。<br />
一方で後発組であるニコニコ動画は、ご存知の通り初期段階ではyoutubeをインフラとして利用しており、その上にコメントでのコミュニケーションというコンセプトを上乗せして成功しました。</p>
<p>他にもフリーメールにおけるgmail(大容量化)、検索におけるgoogle(膨大な対象ページ)など多くがこうした後発組は「あるコンセプト」に従っているという例に当てはまります。</p>
<p>コンセプトはwebサービスにおいてなぜこうまでに重要なのでしょうか？<br />
それはユーザがそのwebサービスにたどり着くためにはコンセプトが必要だからです。</p>
<p>例えばレシピを探そうと思ったとしましょう。図書館に行く、googleで探す、NHKを見るなど色んな方法が考えられます。<br />
こうした様々な方法の中からあえてcookpadにアクセスする理由とは何でしょうか？<br />
検索エンジンからたどり着くということもあるでしょうが、そうでなければ、「cookpadはレシピサイト」というコンセプトのサービスであるからです。<br />
webサービスにたどり着くためには、現実の行為に対応されたコンセプトが必要なのです。</p>
<p>そしてそのコンセプトの中でナンバーワンであることがさらに重要です。</p>
<p>レシピと聞いてどのwebサービスを思い出すでしょうか？居酒屋なら？クーポンなら？多くの人が同じようなwebサービスを思い浮かべることでしょう。<br />
しかしそれ以外のサイトについていくつあげることができますか？ググっちゃダメですよ。<br />
たいていどんなサイトに関してもググってみれば似たようなサイトを見つけることができますが、最初に思い浮かぶサイトは大抵の人が同じモノです。<br />
この立ち位置を築くことがwebサービスにはとても重要です。</p>
<p>これらを一言でまとめてしまうと、「適当な大きさのニッチでナンバーワンになればおk」なんですが、このことは本当に多くのwebサービスに当てはまっているということがわかります。</p>
<p>さて、コンセプトとビジョンの重要性についてはある程度ご納得いただけたでしょうか。<br />
当たり前すぎることを連ねた感じはありますが、webサービスで起業したいという人でもこの「コンセプト」や「ニッチNo1」の重要性をあまり感じていないように思います。</p>
<p>長文となりましたが、webサービスにおいてビジョンやコンセプトというものがいかに重要であるかということが少しでも感じ取れていただけたら幸いです。</p>
<p>ここからは蛇足。</p>
<p>学生しつつプログラミングを通して、ある程度の分析を加えつつ、時々気分でアドバイスしたりして来てるんですが、戦略コンサルを就職希望しているのはこういう話が好きだというのが一番です。<br />
全体から傾向をつかむとか、なにかの本質的な原因を探るとか好きなんですね。好きだからこんな長文がかけます（ぉ</p>
<p>平均よりはITのことしってますしきっと経験もあるんだろうと思いますが、元はと言えば会社とか経営とか絡んでみたいと思って全て始まってますし、それだけのモチベーションで（学生でかわいがってもらってた可能性はあるにしても）個人名で仕事もらえる程度にはなりました。</p>
<p>戦略と技術のどちらの方が貢献できるのかと聞かれると非常に答えずらいのですが、世間の人から技術的な点を聞かれることが多い一方で、私は戦略的な穴の方が気になって気になってしょうがないと思っていたりもします。<br />
技術的にgoogleにはいれるほどなのかと聞かれるとかなり微妙ですが、それなりになんとかしますしなぜかいつもそこの人員が足りていないので実務上そっちに回ることが多いのですが、ここらで１回技術屋さんやめて戦略を専業でやってみたいものだなぁというふうに思っています。</p>
<p>この文章はとりあえず過去の事例をいくつか上げてみた程度なので、あまり戦略的な分析ではないですが、なんか適当な目的を考えていつか書いてみたいなぁと思います。</p>
<p>蛇足でした。こういうのは就職活動始める前にやるべきだな。</p>
<p>※コンセプト重要ですが、トライアンドエラーを認めてないわけじゃないです</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gijutsuya.jp/harajune/2010/02/12/websevice-vision-concept-consultant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>rubygemsのtwitterを拡張</title>
		<link>http://blog.gijutsuya.jp/harajune/2010/02/08/extends-twitter-rb/</link>
		<comments>http://blog.gijutsuya.jp/harajune/2010/02/08/extends-twitter-rb/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 12:42:13 +0000</pubDate>
		<dc:creator>harajune</dc:creator>
				<category><![CDATA[雑記]]></category>

		<guid isPermaLink="false">http://blog.gijutsuya.jp/harajune/?p=1052</guid>
		<description><![CDATA[rubyからtwitterを便利に使うgemにtwitterというのがあります。
デフォルトだとand検索しか出来ないのですがor検索したいですね。
と、いうだけの簡単な拡張を書きました。
PLAIN TEXT
CODE:




#extend_twitter.rb


&#160;


module Twitter


&#160; &#160; class Search


&#160; &#160; &#160; &#160; def ors&#40;query&#41;


&#160; &#160; &#160; &#160; &#160; &#160; @query&#91;:ors&#93; = "#{query}"


&#160; &#160; &#160; &#160; &#160; &#160; self


&#160; &#160; &#160; &#160; end 


&#160; &#160; end 


end 






こうやってつかうと、twitterとついったーのor検索が出来ます。単純だけど便利。
PLAIN TEXT
CODE:




root_dir = File.dirname&#40;File.expand_path&#40;__FILE__&#41;&#41;


require "rubygems"


require "twitter"


require "#{root_dir}/extend_twitter.rb"


&#160;


tweets = Twitter::Search.new.ors&#40;"twitter ついったー"&#41;.since&#40;nil&#41;.per_page&#40;100&#41;


tweets.each do &#124;tweet&#124;


&#160; &#160; puts "#{tweet["from_user"]}:\t#{tweet["id"]}\t#{tweet["text"]}"


end 






rubyの拡張性は異常。
]]></description>
			<content:encoded><![CDATA[<p>rubyからtwitterを便利に使うgemにtwitterというのがあります。<br />
デフォルトだとand検索しか出来ないのですがor検索したいですね。<br />
と、いうだけの簡単な拡張を書きました。</p>
<div class="igBar"><span id="lcode-3"><a href="#" onclick="javascript:showPlainTxt('code-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-3">
<div class="code">
<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;">#extend_twitter.<span style="">rb</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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;">module Twitter</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; class Search</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; &nbsp; &nbsp; &nbsp; def ors<span style="color:#006600; font-weight:bold;">&#40;</span>query<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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; @query<span style="color:#006600; font-weight:bold;">&#91;</span>:ors<span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#CC0000;">"#{query}"</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; end </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; &nbsp; end </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">end </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>こうやってつかうと、twitterとついったーのor検索が出来ます。単純だけど便利。</p>
<div class="igBar"><span id="lcode-4"><a href="#" onclick="javascript:showPlainTxt('code-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-4">
<div class="code">
<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;">root_dir = File.<span style="">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span>File.<span style="">expand_path</span><span style="color:#006600; font-weight:bold;">&#40;</span>__FILE__<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;">require <span style="color:#CC0000;">"rubygems"</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;">require <span style="color:#CC0000;">"twitter"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">require <span style="color:#CC0000;">"#{root_dir}/extend_twitter.rb"</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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">tweets = Twitter::<span style="">Search</span>.<span style="">new</span>.<span style="">ors</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"twitter ついったー"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="">since</span><span style="color:#006600; font-weight:bold;">&#40;</span>nil<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="">per_page</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">100</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;">tweets.<span style="">each</span> do |tweet|</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; puts <span style="color:#CC0000;">"#{tweet["</span>from_user<span style="color:#CC0000;">"]}:<span style="color:#000099; font-weight:bold;">\t</span>#{tweet["</span>id<span style="color:#CC0000;">"]}<span style="color:#000099; font-weight:bold;">\t</span>#{tweet["</span>text<span style="color:#CC0000;">"]}"</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;">end </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>rubyの拡張性は異常。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gijutsuya.jp/harajune/2010/02/08/extends-twitter-rb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>twitterをキーワードを通してみる</title>
		<link>http://blog.gijutsuya.jp/harajune/2010/01/23/twitter_streaming_keyword/</link>
		<comments>http://blog.gijutsuya.jp/harajune/2010/01/23/twitter_streaming_keyword/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 05:06:48 +0000</pubDate>
		<dc:creator>harajune</dc:creator>
				<category><![CDATA[雑記]]></category>

		<guid isPermaLink="false">http://blog.gijutsuya.jp/harajune/?p=1047</guid>
		<description><![CDATA[
twitter streaming apiというのをご存知ですか？ twitterをリアルタイムに見るためのAPIです。
このAPIにはキーワードを使って、自分の好きな情報だけをリアルタイムに取得するためのfilterという機能があります。
これを使ってコードを出力し、表示したのが上の画像です。
「ruby」「pixiv」「pixpedia」「hrjn」「harajune」というキーワードでtwitterをリアルタイムに監視しています。
色々試したのですが、どうも日本語はうまくtokenizeできていないらしくうまく表示できません。
ただ、アルファベットの単語はうまくいくようで、ほぼ100%見つけ出すことができます。
この仕組のいいところはいくつかあります。

本当に最先端の情報を得ることができる
followしてない人の発言でも見ることができる

「リアルタイム性」が協調されるtwitterですが、所詮自分がfollowしている範囲を監視していたところで、最新の結果なんか得られません。
本当に最新の情報を得たいと思うなら、twitter全体を監視すればいい！
簡単ですね（ぉ
なのでやってみました（ぉぉぉ
twitterは人物ベースの情報共有を行うものですが、このtwitter streaming apiを使えば話題ベースで情報を得ることができます。
どんな小さな、どこの誰が言ったものであろうと、twitter上で発言さえされていればそれを取得することができます。
もちろん欠点もあります。例えば「iPhone」で探すと情報が大量すぎてものすごいスピードで流れて行ってしまいます。
さすがにこれを人力で監視するのは無理なので、何らかの方法で話題を分類する必要があるでしょう。
仕組み
あまり詳細には書きませんが。
情報収集には、このブログのスクリプトをほぼそのまま流用させてもらいました。
これを、ターミナルで起動します。例えばこんな感じ。
ruby twitter_stream.rb &#62;&#62; twitter_stream.log
こうしてtwitterから特定のキーワードだけをリアルタイムに取得します。
そして表示部分はgeektoolを使います。
geektoolはコマンドの実行結果をデスクトップに表示するためのツールです。
geektoolをつかいこの検索結果をデスクトップに表示します。
例えばこんな感じ。
tail -n 5 twitter_stream.log
すると、この記事の冒頭のような感じになります。
簡単ですね。
geektoolの使い方等を覚えたりしたので多少時間がかかりましたが、全体で一時間少々でこれを作れました。
本当に簡単ですね！！素晴らしい時代だ。
では、みなさん。楽しいtwitterライフを！
]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.gijutsuya.jp/harajune/wp-content/uploads/2010/01/twitter.png"><img class="alignnone size-full wp-image-1048" title="twitter_streaming" src="http://blog.gijutsuya.jp/harajune/wp-content/uploads/2010/01/twitter.png" alt="twitter_streaming" width="388" height="248" /></a></p>
<p><a href="http://apiwiki.twitter.com/Streaming-API-Documentation" target="_blank">twitter streaming api</a>というのをご存知ですか？ twitterをリアルタイムに見るためのAPIです。<br />
このAPIにはキーワードを使って、自分の好きな情報だけをリアルタイムに取得するためのfilterという機能があります。<br />
これを使ってコードを出力し、表示したのが上の画像です。<br />
「ruby」「pixiv」「pixpedia」「hrjn」「harajune」というキーワードでtwitterをリアルタイムに監視しています。</p>
<p>色々試したのですが、どうも日本語はうまくtokenizeできていないらしくうまく表示できません。<br />
ただ、アルファベットの単語はうまくいくようで、ほぼ100%見つけ出すことができます。</p>
<p>この仕組のいいところはいくつかあります。</p>
<ul>
<li>本当に最先端の情報を得ることができる</li>
<li>followしてない人の発言でも見ることができる</li>
</ul>
<p>「リアルタイム性」が協調されるtwitterですが、所詮自分がfollowしている範囲を監視していたところで、最新の結果なんか得られません。<br />
本当に最新の情報を得たいと思うなら、twitter全体を監視すればいい！<br />
簡単ですね（ぉ<br />
なのでやってみました（ぉぉぉ</p>
<p>twitterは人物ベースの情報共有を行うものですが、このtwitter streaming apiを使えば話題ベースで情報を得ることができます。<br />
どんな小さな、どこの誰が言ったものであろうと、twitter上で発言さえされていればそれを取得することができます。</p>
<p>もちろん欠点もあります。例えば「iPhone」で探すと情報が大量すぎてものすごいスピードで流れて行ってしまいます。<br />
さすがにこれを人力で監視するのは無理なので、何らかの方法で話題を分類する必要があるでしょう。</p>
<p><strong>仕組み</strong></p>
<p>あまり詳細には書きませんが。</p>
<p>情報収集には、<a href="http://d.hatena.ne.jp/shibason/20090816/1250405491" target="_blank">このブログのスクリプト</a>をほぼそのまま流用させてもらいました。<br />
これを、ターミナルで起動します。例えばこんな感じ。</p>
<blockquote><p>ruby twitter_stream.rb &gt;&gt; twitter_stream.log</p></blockquote>
<p>こうしてtwitterから特定のキーワードだけをリアルタイムに取得します。<br />
そして表示部分は<a href="http://projects.tynsoe.org/en/geektool/">geektool</a>を使います。<br />
geektoolはコマンドの実行結果をデスクトップに表示するためのツールです。<br />
geektoolをつかいこの検索結果をデスクトップに表示します。<br />
例えばこんな感じ。</p>
<blockquote><p>tail -n 5 twitter_stream.log</p></blockquote>
<p>すると、この記事の冒頭のような感じになります。</p>
<p>簡単ですね。</p>
<p>geektoolの使い方等を覚えたりしたので多少時間がかかりましたが、全体で一時間少々でこれを作れました。<br />
本当に簡単ですね！！素晴らしい時代だ。</p>
<p>では、みなさん。楽しいtwitterライフを！</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gijutsuya.jp/harajune/2010/01/23/twitter_streaming_keyword/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2009年のIT、技術、プログラミングに対する所感</title>
		<link>http://blog.gijutsuya.jp/harajune/2009/12/31/2009-it-programing/</link>
		<comments>http://blog.gijutsuya.jp/harajune/2009/12/31/2009-it-programing/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 06:44:24 +0000</pubDate>
		<dc:creator>harajune</dc:creator>
				<category><![CDATA[雑記]]></category>

		<guid isPermaLink="false">http://blog.gijutsuya.jp/harajune/?p=1045</guid>
		<description><![CDATA[今年はさりとて目立つことはしていないのですが、色々とITや技術に関しては思うことがありました。
2009年を総括すると「コンテンツ」の年であったように思います。
それの筆頭がmixiアプリやfacebookアプリを始めとしたソーシャルゲームであったように思います。
色々と細かいこと言えるんですが、正直私の興味の対象外なのであまり言及しません。
こういってしまうと、正直今年ほどIT的につまらなかった年はないなーと思ったりもします（ぉ
今年感じた感想意見を書いてみたいと思います。

だんだんと難しいITに注目が集まってきた（機械学習とか並列計算とか
テーマのはっきりしたサイトがウケル
毎年いってるけど、やっぱりどんどんプログラムかける人は増えている

また、関連して、来年はこうなるだろうなということを書いてみます。

ソーシャルを超えた 1 to 1
プログラマはメタプログラマへ

だんだんと難しいITへ
難しいというと語弊がありますが、単純に言うと「その分野の知見やノウハウ」が試される時代へと変わってきました。
わかりやすく具体的に言うと「mapreduce(Hadoop)」や「機械学習」などがそれに当たるでしょうか。
ここ数年こういった事をテーマとした勉強会や読書会が多かったように思います。
今までも大規模サイトを扱う上でのノウハウなどは普通にあったわけですが、より数学やアルゴリズムに対して焦点が当たるようになったと思います。
こうした、map reduceや機械学習といったものは、教科書通りに実装すれば確かにうごくものです。
しかし、必ずしも望んだ結果がでるとは限りません。精度が悪かったり計算に時間がかかりすぎたりすることもあります。
このとき個別の事情に合わせてチューニングするテクニックがあります。
こうしたチューニングテクニックやノウハウを持ってる人材が今年求められ始めたような気がします。
テーマのはっきりしたサイトがウケル
具体的に言えば cookpad や pixiv などでしょうか。
「cookpadにいけばレシピが見つかる」「pixivにいけばイラストが見れる」こういうブランディングが大変効果的であることがはっきりと見えてきました。
これに気づいたのは、彼女にあげたPCの使い方を見ていたときです。
彼女は、「今日は餃子が食べたい」といってPCを開き食べログを見ます。「鍋にしよう」といってPCを開きcookpadを見ます。
彼女にとっては、PCは本や辞書と一緒なのです。使わないときは棚にしまっておいて、「鍋のレシピをみたいなー」と思ってPCを開くわけです。
携帯ゲームのメインターゲットであるような中高生は24時間携帯触っているかもしれないですし、私みたいなプログラミングばかりしてるような人種は24時間PCの前にいるでしょうが、ほとんど大多数の人はそんな状況にはありません。
想像に固くはないと思いますが、ずっとtwitterが垂れ流されてたりとか、skypeやメッセでガンガン連絡がくるような生活をしている人は大変稀です。
ほとんどのひとは、日中営業で外まわっていたり、買い物していたり、子供の送り迎えをしているわけです。
そんな人達がダラダラネットを見てるなんてことは基本的にはないでしょう。
結局そうした大多数の人達は、どうやってwebサイトを見るのか。
答えは至極当たり前で、「必要なときにPCを開き、必要なwebサイトを見る」です。
ネットニュースとかにも興味がない大多数の彼女ら / 彼らにとっては、テーマがはっきりしておりそれが必要とされることが重要なのです。
すごく当たり前なことなのですが、実際目の当たりにして目が覚めた気分でした。
毎年いってるけど、やっぱりどんどんプログラムかける人は増えている
某社でコードを書いているわけですが、インターン生が何組かきました。
PHPもSQLも書いたことがないという20歳にも満たない人たちが一週間でそれらを覚えて画像掲示板を作ったりしてました。
セキュリティとか、コードが汚いとか、細かいことはたくさん言えますが、立派に動いています。（それどころかハーディ君のセンスにはみんな驚愕
（別にプログラミングがそれほど難しいと感じたことはないのですが）正直プログラム書くだけならそんなものです。
正直いままでは、サーバが高いだとかPCが高いだとか本が高いだとかモテないだとか、そういう（中高生にはキツイ？）参入障壁が多少なりともあったわけですが、もうそんなのはありません。
やっぱりこれからは、どんどんプログラムかける人たちが増えていくんだなーと感じました。
今年のまとめ：
と、いう感じで、結局は毎年思ってることでもあるんですが、もう「プログラムが書ける」とかいう基準がすでにゴミ化してるんですよね。
むしろ、技術者としては「経験」「ノウハウ」が求められるようになっていっています。
またウェブのマーケティングとしては、いかにユーザの日常に入り込むかが求められています。じゃないとwebサイトなんて開いてもらえません。彼女ら / 彼らは、PCを開いてすらいないのですから。
というわけで、こっからはちょっとした予言？
ソーシャルを超えた 1 to 1
個人的な見解を言えば、webはもともとソーシャルでした。
パソコン通信なんてものも含めて考えれば、地域ごとのホストでオフ会するとかよくありましたし、掲示板作って身近なひとと連絡とるというのがデフォルトだったように思います。
（私も、KCLという茨城のパソコン通信のオフ会に小学校の頃いったり、高校の友達と掲示板とかやってました）
もともとあるコミュニティを前提としたソーシャルと言えるかもしれません。
時期的には前後しますが、mixiやgreeもどちらかというとこの種のサイトであるように思います。
yahoo / googleなどの検索エンジンの登場があって、はじめて1 to 1のつながりというものができました。
友達のウェブや紹介無しに、ダイレクトに必要な情報にアクセス出来るようになったのは、大変革命的なことでした。
それが、今またソーシャルに戻ってきました。
巨大掲示板を始めとして、OKWebや食べログやcookpadなど多くのサイトが生まれました。
これは、共通の話題やテーマを提供することで、知らない人同士でコミュニティを形成させるというソーシャルの形です。
そして、私は再び 1 to 1への革命が起きると考えています。
検索エンジンは、必要な情報へのダイレクトアクセスの方法を提供しました。CGM / UGMサイトはそのサイト内限定で知らない人へのダイレクトアクセスの方法を提供しました。
ひょっとしたら、特定のサイトに閉じずに、特定の知らない誰かにダイレクトでアクセスするような 1 to 1が次世代のあたらしいサービスになるのかもしれないと考えています。
プログラマはメタプログラマへ
すごく簡単に言うと、フレームワークを作るエンジニアという感じでしょうか。
先程「プログラミングなんて誰もでもできる」といったことへの答えのひとつがこれであるように思います。
Gaucheで有名な史郎さんがこの前講義で言っていた言葉でもあります。
プログラムは書くだけなら誰でもできますが、可読性や保守性を考えたコードを書くことはそれほど簡単ではありません。
これをLisperである史郎さんはマクロで拡張しまくってやるようですが、普通のphpやrubyでもこれは可能です。
適度な抽象化とカプセル化を行うことで、割と簡単にコードはすっきりします。
確かに、最初からすべての可能性を盛り込んで抽象化を行うことは困難です。が、ウェブサイトであればMVCの分離という程度の抽象化は誰でもやるべきだと思いますし、データアクセスの抽象化はどんなプログラミングであっても必須であるように思います。
よく、「綺麗なコードだからといっても意味がない」というはなしもよくききます。
綺麗であることに時間をかけるよりは、さっさと完成して動いた方が嬉しいという話ですね。
ただ、これは一人のスーパーエンジニアが全部どうにかするということを前提とした発想であり、早々に破綻します。
そのスーパーエンジニアがやめてしまったらどうするんですか？そのシステムの保守は？運用は？
そのエンジニアがインフルエンザにかかったら、サイトの更新を止めちゃうんでしょうか？
そういうわけにはいかないでしょう。
システムの規模が大きくなればなるほど、早々に他人にコードを見せたりいじったりしてもらわないといけない事態が発生します。
それにスーパーエンジニアには、スーパーなことをしていただかないとしょうがない（給料高いだろうし）ので、細かい修正はスーパーじゃない人にしてもらうというのが健全というものではないでしょうか。
これからのプログラマ / エンジニアは、コードを書くだけではなくプロジェクト全体を最適化することも考え、それをコードに反映することができる。
こういう能力が付加価値として必要なんではないでしょうかと思います。
まとめ：予言
人と人とをダイレクトに繋ぐ仕組みというのがあれば流行る気がする。
プログラマはメタプログラマになっていく
まとめ：全体
どうも今年は自分がボーッとしてたのもあるのでしょうが、あまりITサービスで面白いものはでなかったように思います。
sekai cameraやソーシャルゲームは大いに盛り上がってましたが、もともとジオタグ関連には否定的なのと、ゲームに興味がないのと、儲かってもなんかしれてそうというのでいまいちでした。
(yelpとかの話もされたことがあるのですが、yelpとその場に行かないとコメントが見れないseka cameraを単純に比較できるのはなぜなのか最期までよくわからなかった)
来年の目標というよりは、個人的な願望として、もっと全体のことを考えて最適化するようなことをしていきたいというのもありメタプログラマという話をしてみました。
また、ソーシャルは大いに結構だと思うのですが、インターネットの醍醐味は全く知らない何か/誰かを発掘出来ることであると思っている点から、知らない誰かへのダイレクトアクセスが今後なにか起こるのではないかなと言ってみました。
何はともあれ、来年は色々と面白そうな予感がいまちょっとしています。
駄文でしたが、読んでくれた人ありがとうございます m(_ _)m
]]></description>
			<content:encoded><![CDATA[<p>今年はさりとて目立つことはしていないのですが、色々とITや技術に関しては思うことがありました。</p>
<p>2009年を総括すると「コンテンツ」の年であったように思います。<br />
それの筆頭がmixiアプリやfacebookアプリを始めとしたソーシャルゲームであったように思います。<br />
色々と細かいこと言えるんですが、正直私の興味の対象外なのであまり言及しません。<br />
こういってしまうと、正直今年ほどIT的につまらなかった年はないなーと思ったりもします（ぉ</p>
<p>今年感じた感想意見を書いてみたいと思います。</p>
<ul>
<li>だんだんと難しいITに注目が集まってきた（機械学習とか並列計算とか</li>
<li>テーマのはっきりしたサイトがウケル</li>
<li>毎年いってるけど、やっぱりどんどんプログラムかける人は増えている</li>
</ul>
<p>また、関連して、来年はこうなるだろうなということを書いてみます。</p>
<ul>
<li>ソーシャルを超えた 1 to 1</li>
<li>プログラマはメタプログラマへ</li>
</ul>
<p><strong>だんだんと難しいITへ</strong></p>
<p>難しいというと語弊がありますが、単純に言うと「その分野の知見やノウハウ」が試される時代へと変わってきました。<br />
わかりやすく具体的に言うと「mapreduce(Hadoop)」や「機械学習」などがそれに当たるでしょうか。<br />
ここ数年こういった事をテーマとした勉強会や読書会が多かったように思います。</p>
<p>今までも大規模サイトを扱う上でのノウハウなどは普通にあったわけですが、より数学やアルゴリズムに対して焦点が当たるようになったと思います。<br />
こうした、map reduceや機械学習といったものは、教科書通りに実装すれば確かにうごくものです。<br />
しかし、必ずしも望んだ結果がでるとは限りません。精度が悪かったり計算に時間がかかりすぎたりすることもあります。<br />
このとき個別の事情に合わせてチューニングするテクニックがあります。<br />
こうしたチューニングテクニックやノウハウを持ってる人材が今年求められ始めたような気がします。</p>
<p><strong>テーマのはっきりしたサイトがウケル</strong></p>
<p>具体的に言えば cookpad や pixiv などでしょうか。<br />
「cookpadにいけばレシピが見つかる」「pixivにいけばイラストが見れる」こういうブランディングが大変効果的であることがはっきりと見えてきました。</p>
<p>これに気づいたのは、彼女にあげたPCの使い方を見ていたときです。<br />
彼女は、「今日は餃子が食べたい」といってPCを開き食べログを見ます。「鍋にしよう」といってPCを開きcookpadを見ます。<br />
彼女にとっては、PCは本や辞書と一緒なのです。使わないときは棚にしまっておいて、「鍋のレシピをみたいなー」と思ってPCを開くわけです。</p>
<p>携帯ゲームのメインターゲットであるような中高生は24時間携帯触っているかもしれないですし、私みたいなプログラミングばかりしてるような人種は24時間PCの前にいるでしょうが、ほとんど大多数の人はそんな状況にはありません。<br />
想像に固くはないと思いますが、ずっとtwitterが垂れ流されてたりとか、skypeやメッセでガンガン連絡がくるような生活をしている人は大変稀です。<br />
ほとんどのひとは、日中営業で外まわっていたり、買い物していたり、子供の送り迎えをしているわけです。<br />
そんな人達がダラダラネットを見てるなんてことは基本的にはないでしょう。</p>
<p>結局そうした大多数の人達は、どうやってwebサイトを見るのか。<br />
答えは至極当たり前で、「必要なときにPCを開き、必要なwebサイトを見る」です。<br />
ネットニュースとかにも興味がない大多数の彼女ら / 彼らにとっては、テーマがはっきりしておりそれが必要とされることが重要なのです。</p>
<p>すごく当たり前なことなのですが、実際目の当たりにして目が覚めた気分でした。</p>
<p><strong>毎年いってるけど、やっぱりどんどんプログラムかける人は増えている</strong></p>
<p>某社でコードを書いているわけですが、インターン生が何組かきました。<br />
PHPもSQLも書いたことがないという20歳にも満たない人たちが一週間でそれらを覚えて画像掲示板を作ったりしてました。<br />
セキュリティとか、コードが汚いとか、細かいことはたくさん言えますが、立派に動いています。（それどころかハーディ君のセンスにはみんな驚愕</p>
<p>（別にプログラミングがそれほど難しいと感じたことはないのですが）正直プログラム書くだけならそんなものです。<br />
正直いままでは、サーバが高いだとかPCが高いだとか本が高いだとかモテないだとか、そういう（中高生にはキツイ？）参入障壁が多少なりともあったわけですが、もうそんなのはありません。<br />
やっぱりこれからは、どんどんプログラムかける人たちが増えていくんだなーと感じました。</p>
<p><strong>今年のまとめ：</strong></p>
<p>と、いう感じで、結局は毎年思ってることでもあるんですが、もう「プログラムが書ける」とかいう基準がすでにゴミ化してるんですよね。</p>
<p>むしろ、技術者としては「経験」「ノウハウ」が求められるようになっていっています。<br />
またウェブのマーケティングとしては、いかにユーザの日常に入り込むかが求められています。じゃないとwebサイトなんて開いてもらえません。彼女ら / 彼らは、PCを開いてすらいないのですから。</p>
<p>というわけで、こっからはちょっとした予言？</p>
<p><strong>ソーシャルを超えた 1 to 1</strong></p>
<p>個人的な見解を言えば、webはもともとソーシャルでした。<br />
パソコン通信なんてものも含めて考えれば、地域ごとのホストでオフ会するとかよくありましたし、掲示板作って身近なひとと連絡とるというのがデフォルトだったように思います。<br />
（私も、KCLという茨城のパソコン通信のオフ会に小学校の頃いったり、高校の友達と掲示板とかやってました）<br />
もともとあるコミュニティを前提としたソーシャルと言えるかもしれません。<br />
時期的には前後しますが、mixiやgreeもどちらかというとこの種のサイトであるように思います。</p>
<p>yahoo / googleなどの検索エンジンの登場があって、はじめて1 to 1のつながりというものができました。<br />
友達のウェブや紹介無しに、ダイレクトに必要な情報にアクセス出来るようになったのは、大変革命的なことでした。</p>
<p>それが、今またソーシャルに戻ってきました。<br />
巨大掲示板を始めとして、OKWebや食べログやcookpadなど多くのサイトが生まれました。<br />
これは、共通の話題やテーマを提供することで、知らない人同士でコミュニティを形成させるというソーシャルの形です。</p>
<p>そして、私は再び 1 to 1への革命が起きると考えています。<br />
検索エンジンは、必要な情報へのダイレクトアクセスの方法を提供しました。CGM / UGMサイトはそのサイト内限定で知らない人へのダイレクトアクセスの方法を提供しました。<br />
ひょっとしたら、特定のサイトに閉じずに、特定の知らない誰かにダイレクトでアクセスするような 1 to 1が次世代のあたらしいサービスになるのかもしれないと考えています。</p>
<p><strong>プログラマはメタプログラマへ</strong></p>
<p>すごく簡単に言うと、フレームワークを作るエンジニアという感じでしょうか。<br />
先程「プログラミングなんて誰もでもできる」といったことへの答えのひとつがこれであるように思います。</p>
<p>Gaucheで有名な史郎さんがこの前講義で言っていた言葉でもあります。</p>
<p>プログラムは書くだけなら誰でもできますが、可読性や保守性を考えたコードを書くことはそれほど簡単ではありません。<br />
これをLisperである史郎さんはマクロで拡張しまくってやるようですが、普通のphpやrubyでもこれは可能です。<br />
適度な抽象化とカプセル化を行うことで、割と簡単にコードはすっきりします。</p>
<p>確かに、最初からすべての可能性を盛り込んで抽象化を行うことは困難です。が、ウェブサイトであればMVCの分離という程度の抽象化は誰でもやるべきだと思いますし、データアクセスの抽象化はどんなプログラミングであっても必須であるように思います。</p>
<p>よく、「綺麗なコードだからといっても意味がない」というはなしもよくききます。<br />
綺麗であることに時間をかけるよりは、さっさと完成して動いた方が嬉しいという話ですね。<br />
ただ、これは一人のスーパーエンジニアが全部どうにかするということを前提とした発想であり、早々に破綻します。</p>
<p>そのスーパーエンジニアがやめてしまったらどうするんですか？そのシステムの保守は？運用は？<br />
そのエンジニアがインフルエンザにかかったら、サイトの更新を止めちゃうんでしょうか？<br />
そういうわけにはいかないでしょう。</p>
<p>システムの規模が大きくなればなるほど、早々に他人にコードを見せたりいじったりしてもらわないといけない事態が発生します。<br />
それにスーパーエンジニアには、スーパーなことをしていただかないとしょうがない（給料高いだろうし）ので、細かい修正はスーパーじゃない人にしてもらうというのが健全というものではないでしょうか。</p>
<p>これからのプログラマ / エンジニアは、コードを書くだけではなくプロジェクト全体を最適化することも考え、それをコードに反映することができる。<br />
こういう能力が付加価値として必要なんではないでしょうかと思います。</p>
<p><strong>まとめ：予言</strong></p>
<p>人と人とをダイレクトに繋ぐ仕組みというのがあれば流行る気がする。</p>
<p>プログラマはメタプログラマになっていく</p>
<p><strong>まとめ：全体</strong></p>
<p>どうも今年は自分がボーッとしてたのもあるのでしょうが、あまりITサービスで面白いものはでなかったように思います。</p>
<p>sekai cameraやソーシャルゲームは大いに盛り上がってましたが、もともとジオタグ関連には否定的なのと、ゲームに興味がないのと、儲かってもなんかしれてそうというのでいまいちでした。<br />
(yelpとかの話もされたことがあるのですが、yelpとその場に行かないとコメントが見れないseka cameraを単純に比較できるのはなぜなのか最期までよくわからなかった)</p>
<p>来年の目標というよりは、個人的な願望として、もっと全体のことを考えて最適化するようなことをしていきたいというのもありメタプログラマという話をしてみました。</p>
<p>また、ソーシャルは大いに結構だと思うのですが、インターネットの醍醐味は全く知らない何か/誰かを発掘出来ることであると思っている点から、知らない誰かへのダイレクトアクセスが今後なにか起こるのではないかなと言ってみました。</p>
<p>何はともあれ、来年は色々と面白そうな予感がいまちょっとしています。</p>
<p>駄文でしたが、読んでくれた人ありがとうございます m(_ _)m</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gijutsuya.jp/harajune/2009/12/31/2009-it-programing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>o(np)のdiffアルゴリズム（貼っただけ</title>
		<link>http://blog.gijutsuya.jp/harajune/2009/10/12/onp-diff-algorithm-no-explaination/</link>
		<comments>http://blog.gijutsuya.jp/harajune/2009/10/12/onp-diff-algorithm-no-explaination/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 14:55:48 +0000</pubDate>
		<dc:creator>harajune</dc:creator>
				<category><![CDATA[雑記]]></category>

		<guid isPermaLink="false">http://blog.gijutsuya.jp/harajune/?p=1041</guid>
		<description><![CDATA[o(np)のdiffアルゴリズムを作りました。
元ネタはこの辺。
An O(NP) sequence comparison algorithm
なんで車輪の再発明したかというと、既存のライブラリだと挙動がわからない上に、使い勝手がいまいちだからです。
自分で全部書けば、自由自在（ぉ
とりあえずリファクタリングの余地は多々ある感じですが。
一般的な意味でのdiffと違うところと言えば、追加／削除のみしか考えておらず、「置換」がありません。
けど、アルゴリズム上「置換」に当たる場合は「追加→削除」または「削除→追加」のいずれかの順番でSESの中に現れるので、その場合を「置換」と処理すればよいかと思います。
使い方とかは暇があったら書く。
このあたりを参考にさせてもらいました。日本語の解説ではこれが一番わかりがよく正確だと思います。
diff(1)
PLAIN TEXT
CODE:




&#60;?php


class DiffModel&#123;


&#160; &#160; private $flip = false;


&#160; &#160; private $arr1 = null;


&#160; &#160; private $arr2 = null;


&#160; &#160; private $size1 = null;


&#160; &#160; private $size2 = null;


&#160; &#160; private $ses = null;


&#160;


&#160; &#160; private $patharr=null;


&#160; &#160; const SAME=0;


&#160; &#160; const ADD=1;


&#160; &#160; const DEL=2;


&#160;


&#160; &#160; public function __construct&#40;$article1="", $article2=""&#41;&#123;


&#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>o(np)のdiffアルゴリズムを作りました。<br />
元ネタはこの辺。<br />
<a href="http://portal.acm.org/citation.cfm?id=96223" target="_blank">An O(NP) sequence comparison algorithm</a></p>
<p>なんで車輪の再発明したかというと、既存のライブラリだと挙動がわからない上に、使い勝手がいまいちだからです。<br />
自分で全部書けば、自由自在（ぉ<br />
とりあえずリファクタリングの余地は多々ある感じですが。</p>
<p>一般的な意味でのdiffと違うところと言えば、追加／削除のみしか考えておらず、「置換」がありません。<br />
けど、アルゴリズム上「置換」に当たる場合は「追加→削除」または「削除→追加」のいずれかの順番でSESの中に現れるので、その場合を「置換」と処理すればよいかと思います。</p>
<p>使い方とかは暇があったら書く。</p>
<p>このあたりを参考にさせてもらいました。日本語の解説ではこれが一番わかりがよく正確だと思います。<br />
<a href="http://www.slash-zero.jp/archives/program/466" target="_blank">diff(1)</a></p>
<div class="igBar"><span id="lcode-6"><a href="#" onclick="javascript:showPlainTxt('code-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-6">
<div class="code">
<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;">&lt;?php</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">class DiffModel<span style="color:#006600; font-weight:bold;">&#123;</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; &nbsp; private $flip = false;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; private $arr1 = null;</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; &nbsp; private $arr2 = null;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; private $size1 = null;</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; &nbsp; private $size2 = null;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; private $ses = null;</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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; private $patharr=null;</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; &nbsp; const SAME=<span style="color:#800000;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; const ADD=<span style="color:#800000;color:#800000;">1</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; &nbsp; const DEL=<span style="color:#800000;color:#800000;">2</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; public function __construct<span style="color:#006600; font-weight:bold;">&#40;</span>$article1=<span style="color:#CC0000;">""</span>, $article2=<span style="color:#CC0000;">""</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; if<span style="color:#006600; font-weight:bold;">&#40;</span>is_array<span style="color:#006600; font-weight:bold;">&#40;</span>$article1<span style="color:#006600; font-weight:bold;">&#41;</span> and is_array<span style="color:#006600; font-weight:bold;">&#40;</span>$article2<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">setArray</span><span style="color:#006600; font-weight:bold;">&#40;</span>$article1, $article2<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; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>else<span style="color:#006600; font-weight:bold;">&#123;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">setArticles</span><span style="color:#006600; font-weight:bold;">&#40;</span>$article1, $article2<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; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</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; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; public function setArticles<span style="color:#006600; font-weight:bold;">&#40;</span>$article1, $article2<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; if<span style="color:#006600; font-weight:bold;">&#40;</span>strlen<span style="color:#006600; font-weight:bold;">&#40;</span>$article1<span style="color:#006600; font-weight:bold;">&#41;</span>&gt; strlen<span style="color:#006600; font-weight:bold;">&#40;</span>$article2<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">arr1</span> = empty<span style="color:#006600; font-weight:bold;">&#40;</span>$article1<span style="color:#006600; font-weight:bold;">&#41;</span> ? array<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> : mb_str_split<span style="color:#006600; font-weight:bold;">&#40;</span>$article1<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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">arr2</span> = empty<span style="color:#006600; font-weight:bold;">&#40;</span>$article2<span style="color:#006600; font-weight:bold;">&#41;</span> ? array<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> : mb_str_split<span style="color:#006600; font-weight:bold;">&#40;</span>$article2<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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">size1</span> = count<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">arr1</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">size2</span> = count<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">arr2</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">flip</span> = true;</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; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>else<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">arr1</span> = empty<span style="color:#006600; font-weight:bold;">&#40;</span>$article2<span style="color:#006600; font-weight:bold;">&#41;</span> ? array<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> : mb_str_split<span style="color:#006600; font-weight:bold;">&#40;</span>$article2<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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">arr2</span> = empty<span style="color:#006600; font-weight:bold;">&#40;</span>$article1<span style="color:#006600; font-weight:bold;">&#41;</span> ? array<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> : mb_str_split<span style="color:#006600; font-weight:bold;">&#40;</span>$article1<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;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">size1</span> = count<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">arr1</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">size2</span> = count<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">arr2</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">flip</span> = false;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</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; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; public function setArray<span style="color:#006600; font-weight:bold;">&#40;</span>$arr1, $arr2<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; if<span style="color:#006600; font-weight:bold;">&#40;</span>count<span style="color:#006600; font-weight:bold;">&#40;</span>$arr1<span style="color:#006600; font-weight:bold;">&#41;</span>&gt; count<span style="color:#006600; font-weight:bold;">&#40;</span>$arr2<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">arr1</span> = $arr1;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">arr2</span> = $arr2;</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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">size1</span> = count<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">arr1</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">size2</span> = count<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">arr2</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">flip</span> = true;</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; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>else<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">arr1</span> = $arr2;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">arr2</span> = $arr1;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">size1</span> = count<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">arr1</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">size2</span> = count<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">arr2</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">flip</span> = false;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public function diff<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; $offset = $this-&gt;<span style="">size2</span> + <span style="color:#800000;color:#800000;">1</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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">patharr</span> = array<span style="color:#006600; font-weight:bold;">&#40;</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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; $fp = array_fill<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">0</span>, $this-&gt;<span style="">size1</span> + $this-&gt;<span style="">size2</span> + <span style="color:#800000;color:#800000;">3</span>, -<span style="color:#800000;color:#800000;">1</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; &nbsp; &nbsp; &nbsp; $delta = $this-&gt;<span style="">size1</span> - $this-&gt;<span style="">size2</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; &nbsp; &nbsp; $p=<span style="color:#800000;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; for<span style="color:#006600; font-weight:bold;">&#40;</span>; $fp<span style="color:#006600; font-weight:bold;">&#91;</span>$delta + $offset<span style="color:#006600; font-weight:bold;">&#93;</span> &lt;$this-&gt;<span style="">size1</span>; $p++<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for<span style="color:#006600; font-weight:bold;">&#40;</span>$k = -$p; $k &lt;$delta; $k++<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $fp<span style="color:#006600; font-weight:bold;">&#91;</span>$k + $offset<span style="color:#006600; font-weight:bold;">&#93;</span> = $this-&gt;<span style="">snake</span><span style="color:#006600; font-weight:bold;">&#40;</span>$k, $offset, $fp<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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for<span style="color:#006600; font-weight:bold;">&#40;</span>$k = $delta + $p; $k&gt;= $delta; $k--<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $fp<span style="color:#006600; font-weight:bold;">&#91;</span>$k + $offset<span style="color:#006600; font-weight:bold;">&#93;</span> = $this-&gt;<span style="">snake</span><span style="color:#006600; font-weight:bold;">&#40;</span>$k, $offset, $fp<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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; &nbsp; &nbsp; return $delta + <span style="color:#800000;color:#800000;">2</span>*<span style="color:#006600; font-weight:bold;">&#40;</span>$p - <span style="color:#800000;color:#800000;">1</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; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public function getDiff<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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; &nbsp; &nbsp; &nbsp; $ind = $this-&gt;<span style="">size2</span> + $this-&gt;<span style="">size1</span>*<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">size2</span>+<span style="color:#800000;color:#800000;">1</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; &nbsp; &nbsp; &nbsp; $item = array<span style="color:#006600; font-weight:bold;">&#40;</span>-<span style="color:#800000;color:#800000;">1</span>, $this-&gt;<span style="">size2</span>, $this-&gt;<span style="">size1</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; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">ses</span> = array<span style="color:#006600; font-weight:bold;">&#40;</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; &nbsp; &nbsp; &nbsp; do<span style="color:#006600; font-weight:bold;">&#123;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span>$ind<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case <span style="color:#006600; font-weight:bold;">&#40;</span>self::<span style="">ADD</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if<span style="color:#006600; font-weight:bold;">&#40;</span>$item<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span> != $this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span>$ind<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">ses</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = array<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">flip</span> ? self::<span style="">ADD</span> : self::<span style="">DEL</span>, $this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span>$ind<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>, $item<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span> - $this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span>$ind<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>else<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">ses</span><span style="color:#006600; font-weight:bold;">&#91;</span>count<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">ses</span><span style="color:#006600; font-weight:bold;">&#41;</span>-<span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span> = $this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span>$ind<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">ses</span><span style="color:#006600; font-weight:bold;">&#91;</span>count<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">ses</span><span style="color:#006600; font-weight:bold;">&#41;</span>-<span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span> += $item<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span> - $this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span>$ind<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//echo sprintf(&quot;add %3d-%3d %s\n&quot;, $this-&gt;patharr[$ind][1], $item[1], mb_substr($this-&gt;article2, $this-&gt;patharr[$ind][1], $item[1] - $this-&gt;patharr[$ind][1], &quot;utf-8&quot;));</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case <span style="color:#006600; font-weight:bold;">&#40;</span>self::<span style="">DEL</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if<span style="color:#006600; font-weight:bold;">&#40;</span>$item<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span> != $this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span>$ind<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">ses</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = array<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">flip</span> ? self::<span style="">DEL</span> : self::<span style="">ADD</span>, $this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span>$ind<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span>, $item<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span> - $this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span>$ind<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#93;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>else<span style="color:#006600; font-weight:bold;">&#123;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">ses</span><span style="color:#006600; font-weight:bold;">&#91;</span>count<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">ses</span><span style="color:#006600; font-weight:bold;">&#41;</span>-<span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span> = $this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span>$ind<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">ses</span><span style="color:#006600; font-weight:bold;">&#91;</span>count<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">ses</span><span style="color:#006600; font-weight:bold;">&#41;</span>-<span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span> += $item<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span> - $this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span>$ind<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#93;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//echo sprintf(&quot;del %3d-%3d %s\n&quot;, $this-&gt;patharr[$ind][2], $item[2], mb_substr($this-&gt;article1, $this-&gt;patharr[$ind][2], $item[2] - $this-&gt;patharr[$ind][2], &quot;utf-8&quot;));</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case <span style="color:#006600; font-weight:bold;">&#40;</span>self::<span style="">SAME</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if<span style="color:#006600; font-weight:bold;">&#40;</span>$item<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span> != $this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span>$ind<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">ses</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = array<span style="color:#006600; font-weight:bold;">&#40;</span>self::<span style="">SAME</span>, $this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span>$ind<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>, $item<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span> - $this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span>$ind<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>else<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">ses</span><span style="color:#006600; font-weight:bold;">&#91;</span>count<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">ses</span><span style="color:#006600; font-weight:bold;">&#41;</span>-<span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span> = $this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span>$ind<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">ses</span><span style="color:#006600; font-weight:bold;">&#91;</span>count<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">ses</span><span style="color:#006600; font-weight:bold;">&#41;</span>-<span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span> += $item<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span> - $this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span>$ind<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//echo sprintf(&quot;sam %3d-%3d %s\n&quot;, $this-&gt;patharr[$ind][1], $item[1], mb_substr($this-&gt;article2, $this-&gt;patharr[$ind][1], $item[1] - $this-&gt;patharr[$ind][1], &quot;utf-8&quot;));</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $item = $this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span>$ind<span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ind = $this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span>$ind<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span> + $this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span>$ind<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span>*<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">size2</span>+<span style="color:#800000;color:#800000;">1</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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>while<span style="color:#006600; font-weight:bold;">&#40;</span>$ind&gt; <span style="color:#800000;color:#800000;">0</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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">ses</span> = array_reverse<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">ses</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; &nbsp; &nbsp; &nbsp; return $this-&gt;<span style="">ses</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; private function snake<span style="color:#006600; font-weight:bold;">&#40;</span>$k, $offset, &amp;$fp<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; $y=<span style="color:#800000;color:#800000;">0</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; &nbsp; &nbsp; &nbsp; if<span style="color:#006600; font-weight:bold;">&#40;</span>$fp<span style="color:#006600; font-weight:bold;">&#91;</span>$k-<span style="color:#800000;color:#800000;">1</span> + $offset<span style="color:#006600; font-weight:bold;">&#93;</span> + <span style="color:#800000;color:#800000;">1</span>&gt; $fp<span style="color:#006600; font-weight:bold;">&#91;</span>$k+<span style="color:#800000;color:#800000;">1</span>+$offset<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $y = $fp<span style="color:#006600; font-weight:bold;">&#91;</span>$k-<span style="color:#800000;color:#800000;">1</span> + $offset<span style="color:#006600; font-weight:bold;">&#93;</span> + <span style="color:#800000;color:#800000;">1</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//$this-&gt;patharr[($y-$k) + $y*($this-&gt;size2+1)] = array($y-$k,$y-1);</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#40;</span>$y-$k<span style="color:#006600; font-weight:bold;">&#41;</span> + $y*<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">size2</span>+<span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = array<span style="color:#006600; font-weight:bold;">&#40;</span>self::<span style="">DEL</span>, $y-$k,$y-<span style="color:#800000;color:#800000;">1</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; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>else<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $y = $fp<span style="color:#006600; font-weight:bold;">&#91;</span>$k+<span style="color:#800000;color:#800000;">1</span> + $offset<span style="color:#006600; font-weight:bold;">&#93;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#40;</span>$y-$k<span style="color:#006600; font-weight:bold;">&#41;</span> + $y*<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">size2</span>+<span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = array<span style="color:#006600; font-weight:bold;">&#40;</span>self::<span style="">ADD</span>, $y-$k-<span style="color:#800000;color:#800000;">1</span>, $y<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; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; $x = $y-$k;</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; &nbsp; &nbsp; &nbsp; $sx = $x;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; $sy = $y;</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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; while<span style="color:#006600; font-weight:bold;">&#40;</span>$x &lt;$this-&gt;<span style="">size2</span> and $y &lt;$this-&gt;<span style="">size1</span> and $this-&gt;<span style="">arr2</span><span style="color:#006600; font-weight:bold;">&#91;</span>$x<span style="color:#006600; font-weight:bold;">&#93;</span> == $this-&gt;<span style="">arr1</span><span style="color:#006600; font-weight:bold;">&#91;</span>$y<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $x++;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $y++;</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; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; &nbsp; &nbsp; if<span style="color:#006600; font-weight:bold;">&#40;</span>!<span style="color:#006600; font-weight:bold;">&#40;</span>$x == $sx and $y == $sy<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span>$this-&gt;<span style="">patharr</span><span style="color:#006600; font-weight:bold;">&#91;</span>$x+$y*<span style="color:#006600; font-weight:bold;">&#40;</span>$this-&gt;<span style="">size2</span>+<span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = array<span style="color:#006600; font-weight:bold;">&#40;</span>self::<span style="">SAME</span>, $sx,$sy<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;</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; &nbsp; &nbsp; &nbsp; return $y;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</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;">?&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gijutsuya.jp/harajune/2009/10/12/onp-diff-algorithm-no-explaination/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JavaScriptで文字列型から整数型への変換速度比較(追試</title>
		<link>http://blog.gijutsuya.jp/harajune/2009/10/07/javascript-speed-number-string/</link>
		<comments>http://blog.gijutsuya.jp/harajune/2009/10/07/javascript-speed-number-string/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 11:59:12 +0000</pubDate>
		<dc:creator>harajune</dc:creator>
				<category><![CDATA[雑記]]></category>

		<guid isPermaLink="false">http://blog.gijutsuya.jp/harajune/?p=1037</guid>
		<description><![CDATA[JavaScriptで文字列型から整数型への変換速度比較
http://kur.jp/2009/10/06/stringtoint-by-javascript/
というのがあって、なんかコードを見てたらなんか思うところがあったので追試してみた。
結果から言うと、だいたい傾向は一緒だった。IE用の回避コードを入れてみて気づいたけど、実行順序によって速さが変わるかもしれない。(一度読み込んだ関数は二回目は若干速い？
PLAIN TEXT
CODE:




&#60;script type="text/javascript"&#62;


&#160; &#160; var randomnums = new Array&#40;1000000&#41;;


&#160; &#160; for&#40;i=0; i&#60;1000000; i++&#41;&#123;


&#160; &#160; &#160; &#160; randomnums&#91;i&#93; = String&#40;Math.round&#40;Math.random&#40;&#41; * 100&#41;&#41;;


&#160; &#160; &#125;


&#160;


function warmup&#40;&#41;&#123;


&#160; &#160; for&#40;i=0; i&#60;1000000; i++&#41;&#123;


&#160; &#160; &#160; &#160; randomnums&#91;i&#93;;


&#160; &#160; &#125;


&#125;


function useSub&#40;&#41;&#123;


&#160; &#160; var startTime = new Date&#40;&#41;;


&#160; &#160; for&#40;var i = 0; i &#60;1000000;i++&#41;&#123;


&#160; &#160; &#160; &#160; randomnums&#91;i&#93; - 0;


&#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>JavaScriptで文字列型から整数型への変換速度比較<br />
<a href="http://kur.jp/2009/10/06/stringtoint-by-javascript/">http://kur.jp/2009/10/06/stringtoint-by-javascript/</a><br />
というのがあって、なんかコードを見てたらなんか思うところがあったので追試してみた。<br />
結果から言うと、だいたい傾向は一緒だった。IE用の回避コードを入れてみて気づいたけど、実行順序によって速さが変わるかもしれない。(一度読み込んだ関数は二回目は若干速い？</p>
<div class="igBar"><span id="lcode-8"><a href="#" onclick="javascript:showPlainTxt('code-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-8">
<div class="code">
<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;">&lt;script type=<span style="color:#CC0000;">"text/javascript"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; var randomnums = new Array<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#800000;color:#800000;">1000000</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; &nbsp; for<span style="color:#006600; font-weight:bold;">&#40;</span>i=<span style="color:#800000;color:#800000;">0</span>; i&lt;<span style="color:#800000;color:#800000;">1000000</span>; i++<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; randomnums<span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span> = String<span style="color:#006600; font-weight:bold;">&#40;</span>Math.<span style="">round</span><span style="color:#006600; font-weight:bold;">&#40;</span>Math.<span style="">random</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> * <span style="color:#800000;color:#800000;">100</span><span style="color:#006600; font-weight:bold;">&#41;</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; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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;">function warmup<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; for<span style="color:#006600; font-weight:bold;">&#40;</span>i=<span style="color:#800000;color:#800000;">0</span>; i&lt;<span style="color:#800000;color:#800000;">1000000</span>; i++<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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; &nbsp; &nbsp; &nbsp; randomnums<span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</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:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">function useSub<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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; &nbsp; var startTime = new Date<span style="color:#006600; font-weight:bold;">&#40;</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; &nbsp; for<span style="color:#006600; font-weight:bold;">&#40;</span>var i = <span style="color:#800000;color:#800000;">0</span>; i &lt;<span style="color:#800000;color:#800000;">1000000</span>;i++<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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; &nbsp; &nbsp; &nbsp; randomnums<span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span> - <span style="color:#800000;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</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; &nbsp; document.<span style="">write</span><span style="color:#006600; font-weight:bold;">&#40;</span>new Date<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> - startTime<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;"><span style="color:#006600; font-weight:bold;">&#125;</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;">function useDiv<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; var startTime = new Date<span style="color:#006600; font-weight:bold;">&#40;</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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; for<span style="color:#006600; font-weight:bold;">&#40;</span>var i = <span style="color:#800000;color:#800000;">0</span>; i &lt;<span style="color:#800000;color:#800000;">1000000</span>;i++<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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; &nbsp; &nbsp; &nbsp; randomnums<span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span> / <span style="color:#800000;color:#800000;">1</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</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; &nbsp; document.<span style="">write</span><span style="color:#006600; font-weight:bold;">&#40;</span>new Date<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> - startTime<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;"><span style="color:#006600; font-weight:bold;">&#125;</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;">function useparseInt<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; var startTime = new Date<span style="color:#006600; font-weight:bold;">&#40;</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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; for<span style="color:#006600; font-weight:bold;">&#40;</span>var i = <span style="color:#800000;color:#800000;">0</span>; i &lt;<span style="color:#800000;color:#800000;">1000000</span>;i++<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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; &nbsp; &nbsp; &nbsp; parseInt<span style="color:#006600; font-weight:bold;">&#40;</span>randomnums<span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</span>,<span style="color:#800000;color:#800000;">10</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; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</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; &nbsp; document.<span style="">write</span><span style="color:#006600; font-weight:bold;">&#40;</span>new Date<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> - startTime<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;"><span style="color:#006600; font-weight:bold;">&#125;</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;">function useNumber<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; var startTime = new Date<span style="color:#006600; font-weight:bold;">&#40;</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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; for<span style="color:#006600; font-weight:bold;">&#40;</span>var i = <span style="color:#800000;color:#800000;">0</span>; i &lt;<span style="color:#800000;color:#800000;">1000000</span>;i++<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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; &nbsp; &nbsp; &nbsp; Number<span style="color:#006600; font-weight:bold;">&#40;</span>randomnums<span style="color:#006600; font-weight:bold;">&#91;</span>i<span style="color:#006600; font-weight:bold;">&#93;</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; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</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; &nbsp; document.<span style="">write</span><span style="color:#006600; font-weight:bold;">&#40;</span>new Date<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> - startTime<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;"><span style="color:#006600; font-weight:bold;">&#125;</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:#FF9933; font-style:italic;">//IEがおそすぎて変なalertを出すので１回分はダミー</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">warmup<span style="color:#006600; font-weight:bold;">&#40;</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;">useSub<span style="color:#006600; font-weight:bold;">&#40;</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;">document.<span style="">write</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"&lt;br /&gt;"</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;">warmup<span style="color:#006600; font-weight:bold;">&#40;</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;">useSub<span style="color:#006600; font-weight:bold;">&#40;</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;">document.<span style="">write</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"&lt;br /&gt;"</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;">warmup<span style="color:#006600; font-weight:bold;">&#40;</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;">useDiv<span style="color:#006600; font-weight:bold;">&#40;</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;">document.<span style="">write</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"&lt;br /&gt;"</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;">warmup<span style="color:#006600; font-weight:bold;">&#40;</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;">useparseInt<span style="color:#006600; font-weight:bold;">&#40;</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;">document.<span style="">write</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"&lt;br /&gt;"</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;">warmup<span style="color:#006600; font-weight:bold;">&#40;</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;">useNumber<span style="color:#006600; font-weight:bold;">&#40;</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;">&lt;/script&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>結果はこちら</p>
<pre>
firefox
6
6
6
119
274 

IE
801
781
851
2003
1553 

chrome
311
292
299
135
234
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.gijutsuya.jp/harajune/2009/10/07/javascript-speed-number-string/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>screenの次はtmuxらしい。tmuxの優しい育て方。</title>
		<link>http://blog.gijutsuya.jp/harajune/2009/09/18/from_screen_to_tmux/</link>
		<comments>http://blog.gijutsuya.jp/harajune/2009/09/18/from_screen_to_tmux/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 05:28:22 +0000</pubDate>
		<dc:creator>harajune</dc:creator>
				<category><![CDATA[IT]]></category>

		<guid isPermaLink="false">http://blog.gijutsuya.jp/harajune/?p=1032</guid>
		<description><![CDATA[screenには大変なじみがあるのではないかと思いますが、最近windowの縦分割（左右に分ける）をしたくなり、tscreenやscreenのパッチなど色々と考えた末に、tmuxにしてみました。
理由は特にない(^^;;んですが、使ってみた結果tmuxの方が若干見た目に奇麗であるように感じました。
現在最新版はバージョン0.9なのですが、ドキュメントがなくソースを読むしかない（？）ので、軽く使えるコマンドについて言及したいと思います。
とりあえずmacの人はmacportsにあるのでコマンド一発ではいります。
PLAIN TEXT
CODE:




sudo port install tmux 






そして、次は設定ファイルをおきましょう。screenでいうところの.screenrcは、.tmux.confというファイルになります。
私の設定ファイルはこちらをごらんください。
基本的にソースに付属しているscreen-keys.confをもとにしています。
このファイルを.tmux.confにリネームしてホームフォルダに置くだけで、screen風なキーバインドになります。
さて、screen-keys.confだけだとwindowを左右に分割することができないので、以下の設定を書き足してあります。
(他にも書いたんですが、ど忘れ・・・・)
PLAIN TEXT
CODE:




#layout


bind h select-layout even-horizontal


bind v select-layout even-vertical


bind f select-layout active-only 






こうして、tmuxを立ち上げたあとC-a C-Sで画面を分割し、C-a C-hで分割を左右にすることができます。
さて問題はこの「select-layout even-horizontal」というコマンドをどこから見つけてくるかです。ドキュメントがないっぽいので、ソースを見ます。
ビビらなくても大丈夫。大変奇麗に作られてるのですぐに読めると思います。
ソースをここからダウンロードして展開してみてください。
そして、cmd-から始まるファイル名のファイルを探します。これが全部コマンドになっています。バージョン0.9だとこんな感じになっています。
PLAIN TEXT
CODE:




% ls &#124;grep "cmd-"


cmd-attach-session.c


cmd-bind-key.c


cmd-break-pane.c


cmd-choose-session.c


cmd-choose-window.c


cmd-clear-history.c


cmd-clock-mode.c


cmd-command-prompt.c


cmd-confirm-before.c


cmd-copy-buffer.c


cmd-copy-mode.c


cmd-delete-buffer.c


cmd-detach-client.c


cmd-down-pane.c


cmd-find-window.c


cmd-generic.c


cmd-has-session.c


cmd-kill-pane.c


cmd-kill-server.c


cmd-kill-session.c


cmd-kill-window.c


cmd-last-window.c


cmd-link-window.c


cmd-list-buffers.c


cmd-list-clients.c


cmd-list-commands.c


cmd-list-keys.c


cmd-list-sessions.c


cmd-list-windows.c


cmd-list.c


cmd-load-buffer.c


cmd-lock-server.c


cmd-move-window.c


cmd-new-session.c


cmd-new-window.c


cmd-next-layout.c


cmd-next-window.c


cmd-paste-buffer.c


cmd-previous-layout.c


cmd-previous-window.c


cmd-refresh-client.c


cmd-rename-session.c


cmd-rename-window.c


cmd-resize-pane.c


cmd-respawn-window.c


cmd-rotate-window.c


cmd-save-buffer.c


cmd-scroll-mode.c


cmd-select-layout.c


cmd-select-pane.c


cmd-select-prompt.c


cmd-select-window.c


cmd-send-keys.c


cmd-send-prefix.c


cmd-server-info.c


cmd-set-buffer.c


cmd-set-option.c


cmd-set-password.c


cmd-set-window-option.c


cmd-show-buffer.c


cmd-show-options.c


cmd-show-window-options.c


cmd-source-file.c


cmd-split-window.c


cmd-start-server.c


cmd-string.c


cmd-suspend-client.c


cmd-swap-pane.c


cmd-swap-window.c


cmd-switch-client.c


cmd-unbind-key.c


cmd-unlink-window.c


cmd-up-pane.c 






ここから「cmd-」を除いた部分がコマンド名です。機能はだいたいコマンド名見ればわかりますね。
各々のコマンドは引数を取ったりします。それを調べる時はソースを見ます。
たとえばさっきの「select-layout」であれば「cmd-select-layout.c」を見ます。すると、こんな感じのコードが見えるはずです。（一部抜粋）
PLAIN TEXT
CODE:




const struct cmd_entry cmd_select_layout_entry = &#123; 


&#160; &#160; "select-layout", "selectl",


&#160; &#160; CMD_TARGET_WINDOW_USAGE " layout-name",


&#160; &#160; CMD_ARG1,


&#160; &#160; cmd_select_layout_init,


&#160; &#160; cmd_target_parse,


&#160; &#160; cmd_select_layout_exec,


&#160; &#160; cmd_target_send,


&#160; &#160; cmd_target_recv,


&#160; &#160; cmd_target_free,


&#160; &#160; cmd_target_print


&#125;; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.atmarkit.co.jp/flinux/rensai/linuxtips/692usescreen.html">screen</a>には大変なじみがあるのではないかと思いますが、最近windowの縦分割（左右に分ける）をしたくなり、tscreenやscreenのパッチなど色々と考えた末に、<a href="http://tmux.sourceforge.net/">tmux</a>にしてみました。</p>
<p>理由は特にない(^^;;んですが、使ってみた結果tmuxの方が若干見た目に奇麗であるように感じました。</p>
<p>現在最新版はバージョン0.9なのですが、ドキュメントがなくソースを読むしかない（？）ので、軽く使えるコマンドについて言及したいと思います。</p>
<p>とりあえずmacの人はmacportsにあるのでコマンド一発ではいります。</p>
<div class="igBar"><span id="lcode-15"><a href="#" onclick="javascript:showPlainTxt('code-15'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-15">
<div class="code">
<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;">sudo port install tmux </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>そして、次は設定ファイルをおきましょう。screenでいうところの.screenrcは、.tmux.confというファイルになります。<br />
<a href="http://github.com/harajune/dotfiles/blob/master/.tmux.conf">私の設定ファイルはこちら</a>をごらんください。<br />
基本的にソースに付属しているscreen-keys.confをもとにしています。<br />
このファイルを.tmux.confにリネームしてホームフォルダに置くだけで、screen風なキーバインドになります。</p>
<p>さて、screen-keys.confだけだとwindowを左右に分割することができないので、以下の設定を書き足してあります。<br />
(他にも書いたんですが、ど忘れ・・・・)</p>
<div class="igBar"><span id="lcode-16"><a href="#" onclick="javascript:showPlainTxt('code-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-16">
<div class="code">
<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;">#layout</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">bind h select-layout even-horizontal</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;">bind v select-layout even-vertical</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">bind f select-layout active-only </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>こうして、tmuxを立ち上げたあとC-a C-Sで画面を分割し、C-a C-hで分割を左右にすることができます。</p>
<p>さて問題はこの「select-layout even-horizontal」というコマンドをどこから見つけてくるかです。ドキュメントがないっぽいので、ソースを見ます。<br />
ビビらなくても大丈夫。大変奇麗に作られてるのですぐに読めると思います。</p>
<p><a href="http://sourceforge.net/projects/tmux/">ソースをここ</a>からダウンロードして展開してみてください。<br />
そして、cmd-から始まるファイル名のファイルを探します。これが全部コマンドになっています。バージョン0.9だとこんな感じになっています。</p>
<div class="igBar"><span id="lcode-17"><a href="#" onclick="javascript:showPlainTxt('code-17'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-17">
<div class="code">
<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;">% ls |grep <span style="color:#CC0000;">"cmd-"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-attach-session.<span style="">c</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;">cmd-bind-key.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-break-pane.<span style="">c</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;">cmd-choose-session.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-choose-window.<span style="">c</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;">cmd-clear-history.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-clock-mode.<span style="">c</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;">cmd-command-prompt.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-confirm-before.<span style="">c</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;">cmd-copy-buffer.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-copy-mode.<span style="">c</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;">cmd-delete-buffer.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-detach-client.<span style="">c</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;">cmd-down-pane.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-find-window.<span style="">c</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;">cmd-generic.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-has-session.<span style="">c</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;">cmd-kill-pane.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-kill-server.<span style="">c</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;">cmd-kill-session.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-kill-window.<span style="">c</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;">cmd-last-window.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-link-window.<span style="">c</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;">cmd-list-buffers.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-list-clients.<span style="">c</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;">cmd-list-commands.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-list-keys.<span style="">c</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;">cmd-list-sessions.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-list-windows.<span style="">c</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;">cmd-list.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-load-buffer.<span style="">c</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;">cmd-lock-server.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-move-window.<span style="">c</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;">cmd-new-session.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-new-window.<span style="">c</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;">cmd-next-layout.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-next-window.<span style="">c</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;">cmd-paste-buffer.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-previous-layout.<span style="">c</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;">cmd-previous-window.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-refresh-client.<span style="">c</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;">cmd-rename-session.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-rename-window.<span style="">c</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;">cmd-resize-pane.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-respawn-window.<span style="">c</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;">cmd-rotate-window.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-save-buffer.<span style="">c</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;">cmd-scroll-mode.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-select-layout.<span style="">c</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;">cmd-select-pane.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-select-prompt.<span style="">c</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;">cmd-select-window.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-send-keys.<span style="">c</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;">cmd-send-prefix.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-server-info.<span style="">c</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;">cmd-set-buffer.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-set-option.<span style="">c</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;">cmd-set-password.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-set-window-option.<span style="">c</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;">cmd-show-buffer.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-show-options.<span style="">c</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;">cmd-show-window-options.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-source-file.<span style="">c</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;">cmd-split-window.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-start-server.<span style="">c</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;">cmd-string.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-suspend-client.<span style="">c</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;">cmd-swap-pane.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-swap-window.<span style="">c</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;">cmd-switch-client.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-unbind-key.<span style="">c</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;">cmd-unlink-window.<span style="">c</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd-up-pane.<span style="">c</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>ここから「cmd-」を除いた部分がコマンド名です。機能はだいたいコマンド名見ればわかりますね。<br />
各々のコマンドは引数を取ったりします。それを調べる時はソースを見ます。<br />
たとえばさっきの「select-layout」であれば「cmd-select-layout.c」を見ます。すると、こんな感じのコードが見えるはずです。（一部抜粋）</p>
<div class="igBar"><span id="lcode-18"><a href="#" onclick="javascript:showPlainTxt('code-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-18">
<div class="code">
<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;">const struct cmd_entry cmd_select_layout_entry = <span style="color:#006600; font-weight:bold;">&#123;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#CC0000;">"select-layout"</span>, <span style="color:#CC0000;">"selectl"</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; &nbsp; CMD_TARGET_WINDOW_USAGE <span style="color:#CC0000;">" layout-name"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; CMD_ARG1,</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; &nbsp; cmd_select_layout_init,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; cmd_target_parse,</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; &nbsp; cmd_select_layout_exec,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; cmd_target_send,</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; &nbsp; cmd_target_recv,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; cmd_target_free,</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; &nbsp; cmd_target_print</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>細かい説明ははしょりますが、というか理解してないのですが、ここからコマンド名が「select-layout」であり、エイリアスが「selectl」であることが読み取れます。<br />
ちなみにこの書き方はxwindowの拡張であるglxの実装の一つであるcompizのプラグインもこういった書き方になっているので、見慣れておくといいような気もします。</p>
<p>次に、引数ですが次の部分に注目します。</p>
<div class="igBar"><span id="lcode-19"><a href="#" onclick="javascript:showPlainTxt('code-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-19">
<div class="code">
<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;">void</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">cmd_select_layout_init<span style="color:#006600; font-weight:bold;">&#40;</span>struct cmd *self, int key<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:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; struct cmd_target_data&nbsp; *data;</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;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; cmd_target_init<span style="color:#006600; font-weight:bold;">&#40;</span>self, key<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; &nbsp; data = self-&gt;<span style="">data</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; switch <span style="color:#006600; font-weight:bold;">&#40;</span>key<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; case KEYC_ADDESC<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'0'</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; &nbsp; &nbsp; &nbsp; data-&gt;<span style="">arg</span> = xstrdup<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"manual-vertical"</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; &nbsp; &nbsp; &nbsp; break;</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; &nbsp; case KEYC_ADDESC<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'1'</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; &nbsp; &nbsp; &nbsp; data-&gt;<span style="">arg</span> = xstrdup<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"even-horizontal"</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; &nbsp; &nbsp; &nbsp; break;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; case KEYC_ADDESC<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'2'</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; &nbsp; &nbsp; &nbsp; data-&gt;<span style="">arg</span> = xstrdup<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"even-vertical"</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; &nbsp; &nbsp; &nbsp; break;</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; &nbsp; case KEYC_ADDESC<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">'9'</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; &nbsp; &nbsp; &nbsp; data-&gt;<span style="">arg</span> = xstrdup<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"active-only"</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; &nbsp; &nbsp; &nbsp; break;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</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:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>はい。ここで「even-vertical」とか出てきましたね。細かい説明はまたしてもはしょりますが、ここが引数でありそうな事はぱっと見でわかると思います。わかってください。<br />
これをもとにさっきの設定を見てみましょう。</p>
<div class="igBar"><span id="lcode-20"><a href="#" onclick="javascript:showPlainTxt('code-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-20">
<div class="code">
<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;">#layout</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">bind h select-layout even-horizontal</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;">bind v select-layout even-vertical</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">bind f select-layout active-only </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>今まで見てきた通りですね！</p>
<p>じつは、他のコマンドもだいたい似たような感じになっています。それぞれのコマンドは非常にコンパクトにわかりやすく書いてあるので山勘で何とかなるかと思います。</p>
<p>しかし、0.8系と0.9系でコマンドが変わったりしてるようなので、まだちょっと注意がいるかもしれません・・・・</p>
<p>というかんじで、みなさん楽しいtmuxライフをおくりましょう！</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gijutsuya.jp/harajune/2009/09/18/from_screen_to_tmux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>キーワード自動リンクの話</title>
		<link>http://blog.gijutsuya.jp/harajune/2009/09/01/keyword-link/</link>
		<comments>http://blog.gijutsuya.jp/harajune/2009/09/01/keyword-link/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 06:09:47 +0000</pubDate>
		<dc:creator>harajune</dc:creator>
				<category><![CDATA[雑記]]></category>

		<guid isPermaLink="false">http://blog.gijutsuya.jp/harajune/?p=1028</guid>
		<description><![CDATA[キーワード自動リンクの話を某勉強会でしました。その資料を公開します。
自動リンクのためのデータ構造としてTrieを採用し、今回は有名な実装であるsenna, Tx, dartsの比較をしました。
それぞれのライブラリの背景は次の様なデータ構造です。

senna - パトリシア木
Tx - LOUDS
darts - Double Array

今回の実験はとりあえず実装しましたレベルなので、厳密な速度や容量にはなっていない可能生があります。
というのは、それぞれのライブラリを精査したわけではないからです。
またキーワード抽出した結果がそれぞれで若干異なっています。抽出できたキーワードの件数に大きなさや検索にかかる時間に相関が無さそうなので概ね正しいと考えることにしました。
というわけで、ご参考まで。
]]></description>
			<content:encoded><![CDATA[<p>キーワード自動リンクの話を某勉強会でしました。その<a href='http://blog.gijutsuya.jp/harajune/wp-content/uploads/2009/09/autolink20090828.pdf'>資料を公開</a>します。</p>
<p>自動リンクのためのデータ構造としてTrieを採用し、今回は有名な実装であるsenna, Tx, dartsの比較をしました。<br />
それぞれのライブラリの背景は次の様なデータ構造です。</p>
<ul>
<li>senna - パトリシア木</li>
<li>Tx - LOUDS</li>
<li>darts - Double Array</li>
</ul>
<p>今回の実験はとりあえず実装しましたレベルなので、厳密な速度や容量にはなっていない可能生があります。<br />
というのは、それぞれのライブラリを精査したわけではないからです。<br />
またキーワード抽出した結果がそれぞれで若干異なっています。抽出できたキーワードの件数に大きなさや検索にかかる時間に相関が無さそうなので概ね正しいと考えることにしました。</p>
<p>というわけで、ご参考まで。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gijutsuya.jp/harajune/2009/09/01/keyword-link/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Txでdartsのようなtraverseをする関数</title>
		<link>http://blog.gijutsuya.jp/harajune/2009/08/31/tx-darts-traverse/</link>
		<comments>http://blog.gijutsuya.jp/harajune/2009/08/31/tx-darts-traverse/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 10:19:30 +0000</pubDate>
		<dc:creator>harajune</dc:creator>
				<category><![CDATA[雑記]]></category>

		<guid isPermaLink="false">http://blog.gijutsuya.jp/harajune/?p=1025</guid>
		<description><![CDATA[Txでdartsのようなtraverseをする関数を作ってみました。
使い方はdartsのtraverseと同じだと思います。たまたま作ったのでパッチをそのまま貼っておきます。動作は未保証。dartsよりも爆速でふきました。
PLAIN TEXT
CODE:




diff -cb tx-0.13/tx.cpp tx_original/tx.cpp


*** tx-0.13/tx.cpp&#160; 2009-04-13 13:21:14.000000000 +0900


--- tx_original/tx.cpp&#160; 2009-08-27 22:45:25.000000000 +0900


***************


*** 195,200 ****


--- 195,221 ----


&#160; &#160; &#160; return 0;


&#160; &#160; &#125;


&#160; &#160; 


+&#160; &#160;uint tx::traverse&#40;const char* str, size_t&#38; pos&#41; const &#123;


+&#160; &#160; &#160; &#160;uint curPos = 2;


+&#160; &#160; &#160; &#160;uint retId = NOTFOUND;


+&#160; &#160; &#160; &#160;size_t begin = pos;


+&#160; &#160; &#160; &#160;if &#40;terminal.getSize&#40;&#41; [...]]]></description>
			<content:encoded><![CDATA[<p>Txでdartsのようなtraverseをする関数を作ってみました。</p>
<p>使い方はdartsのtraverseと同じだと思います。たまたま作ったのでパッチをそのまま貼っておきます。動作は未保証。dartsよりも爆速でふきました。</p>
<div class="igBar"><span id="lcode-22"><a href="#" onclick="javascript:showPlainTxt('code-22'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-22">
<div class="code">
<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;">diff -cb tx-<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">13</span>/tx.<span style="">cpp</span> tx_original/tx.<span style="">cpp</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">*** tx-<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">13</span>/tx.<span style="">cpp</span>&nbsp; <span style="color:#800000;color:#800000;">2009</span>-<span style="color:#800000;color:#800000;">04</span>-<span style="color:#800000;color:#800000;">13</span> <span style="color:#800000;color:#800000;">13</span>:<span style="color:#800000;color:#800000;">21</span>:<span style="color:#800000;color:#800000;">14</span>.<span style="color:#800000;color:#800000;">000000000</span> +<span style="color:#800000;color:#800000;">0900</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;">--- tx_original/tx.<span style="">cpp</span>&nbsp; <span style="color:#800000;color:#800000;">2009</span>-<span style="color:#800000;color:#800000;">08</span>-<span style="color:#800000;color:#800000;">27</span> <span style="color:#800000;color:#800000;">22</span>:<span style="color:#800000;color:#800000;">45</span>:<span style="color:#800000;color:#800000;">25</span>.<span style="color:#800000;color:#800000;">000000000</span> +<span style="color:#800000;color:#800000;">0900</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">***************</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:#800000;color:#800000;">195</span>,<span style="color:#800000;color:#800000;">200</span> ****</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">--- <span style="color:#800000;color:#800000;">195</span>,<span style="color:#800000;color:#800000;">221</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; &nbsp; &nbsp; return <span style="color:#800000;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</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; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+&nbsp; &nbsp;uint tx::<span style="">traverse</span><span style="color:#006600; font-weight:bold;">&#40;</span>const char* str, size_t&amp; pos<span style="color:#006600; font-weight:bold;">&#41;</span> const <span style="color:#006600; font-weight:bold;">&#123;</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; &nbsp; &nbsp; &nbsp;uint curPos = <span style="color:#800000;color:#800000;">2</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+&nbsp; &nbsp; &nbsp; &nbsp;uint retId = NOTFOUND;</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; &nbsp; &nbsp; &nbsp;size_t begin = pos;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+&nbsp; &nbsp; &nbsp; &nbsp;if <span style="color:#006600; font-weight:bold;">&#40;</span>terminal.<span style="">getSize</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> &lt;= <span style="color:#800000;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span> return retId;</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;">+ </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+&nbsp; &nbsp; &nbsp; &nbsp;for <span style="color:#006600; font-weight:bold;">&#40;</span>size_t i = <span style="color:#800000;color:#800000;">0</span> ; ; i++<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;const uint nodeId = loud.<span style="">rank</span><span style="color:#006600; font-weight:bold;">&#40;</span>curPos-<span style="color:#800000;color:#800000;">1</span>,<span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>-<span style="color:#800000;color:#800000;">1</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if <span style="color:#006600; font-weight:bold;">&#40;</span>terminal.<span style="">getBit</span><span style="color:#006600; font-weight:bold;">&#40;</span>nodeId<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pos = begin + i;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;retId = terminal.<span style="">rank</span><span style="color:#006600; font-weight:bold;">&#40;</span>nodeId,<span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>-<span style="color:#800000;color:#800000;">1</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;uint nextPos = getChild<span style="color:#006600; font-weight:bold;">&#40;</span>curPos,str<span style="color:#006600; font-weight:bold;">&#91;</span>begin + i<span style="color:#006600; font-weight:bold;">&#93;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if <span style="color:#006600; font-weight:bold;">&#40;</span>nextPos == UINT_MAX<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;curPos = nextPos;</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; &nbsp; &nbsp; &nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+&nbsp; &nbsp; &nbsp; &nbsp;return retId;</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; &nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+ </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; &nbsp; uint tx::<span style="">prefixSearch</span><span style="color:#006600; font-weight:bold;">&#40;</span>const char* str, const size_t len, size_t&amp; retLen<span style="color:#006600; font-weight:bold;">&#41;</span> const <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; uint curPos = <span style="color:#800000;color:#800000;">2</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; &nbsp; &nbsp; uint retId = NOTFOUND;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">diff -cb tx-<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">13</span>/tx.<span style="">hpp</span> tx_original/tx.<span style="">hpp</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;">*** tx-<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">13</span>/tx.<span style="">hpp</span>&nbsp; <span style="color:#800000;color:#800000;">2008</span>-<span style="color:#800000;color:#800000;">06</span>-<span style="color:#800000;color:#800000;">03</span> <span style="color:#800000;color:#800000;">21</span>:<span style="color:#800000;color:#800000;">05</span>:<span style="color:#800000;color:#800000;">00</span>.<span style="color:#800000;color:#800000;">000000000</span> +<span style="color:#800000;color:#800000;">0900</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">--- tx_original/tx.<span style="">hpp</span>&nbsp; <span style="color:#800000;color:#800000;">2009</span>-<span style="color:#800000;color:#800000;">08</span>-<span style="color:#800000;color:#800000;">27</span> <span style="color:#800000;color:#800000;">22</span>:<span style="color:#800000;color:#800000;">41</span>:<span style="color:#800000;color:#800000;">04</span>.<span style="color:#800000;color:#800000;">000000000</span> +<span style="color:#800000;color:#800000;">0900</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;">***************</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">*** <span style="color:#800000;color:#800000;">26</span>,<span style="color:#800000;color:#800000;">31</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:#800000;color:#800000;">26</span>,<span style="color:#800000;color:#800000;">32</span> ----</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; int read<span style="color:#006600; font-weight:bold;">&#40;</span>const char* fileName<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; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; uint prefixSearch<span style="color:#006600; font-weight:bold;">&#40;</span>const char* str, const size_t len, size_t&amp; retLen<span style="color:#006600; font-weight:bold;">&#41;</span> const;</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; &nbsp; &nbsp;uint traverse<span style="color:#006600; font-weight:bold;">&#40;</span>const char* str, size_t&amp; pos<span style="color:#006600; font-weight:bold;">&#41;</span> const;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; uint expandSearch<span style="color:#006600; font-weight:bold;">&#40;</span>const char* str, const size_t len, std::<span style="">vector</span>&lt;std::<span style="">string</span>&gt;&amp; ret, const uint limit = <span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> const;</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; &nbsp; &nbsp; uint commonPrefixSearch<span style="color:#006600; font-weight:bold;">&#40;</span>const char* str, const size_t len, std::<span style="">vector</span>&lt;std::<span style="">string</span>&gt;&amp; ret, std::<span style="">vector</span>&lt;uint&gt;&amp; retID,&nbsp; const uint limit = TX_LIMIT_DEFAULT<span style="color:#006600; font-weight:bold;">&#41;</span> const;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; uint commonPrefixSearch<span style="color:#006600; font-weight:bold;">&#40;</span>const char* str, const size_t len, std::<span style="">vector</span>&lt;uint&gt;&amp; retLen, std::<span style="">vector</span>&lt;uint&gt;&amp; retID,&nbsp; const uint limit = TX_LIMIT_DEFAULT<span style="color:#006600; font-weight:bold;">&#41;</span> const;</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;">***************</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">*** <span style="color:#800000;color:#800000;">42</span>,<span style="color:#800000;color:#800000;">48</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; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; static uint NOTFOUND;</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; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">!&nbsp; &nbsp;private:</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; &nbsp; &nbsp; uint getChild<span style="color:#006600; font-weight:bold;">&#40;</span>const uint pos, const char c<span style="color:#006600; font-weight:bold;">&#41;</span> const;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; uint getParent<span style="color:#006600; font-weight:bold;">&#40;</span>const uint pos, char&amp; c<span style="color:#006600; font-weight:bold;">&#41;</span> const;</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; &nbsp; &nbsp; void enumerateAll<span style="color:#006600; font-weight:bold;">&#40;</span>const uint pos, const std::<span style="">string</span> str, std::<span style="">vector</span>&lt;std::<span style="">pair</span>&lt;size_t, std::<span style="">pair</span>&lt;std::<span style="">string</span>, uint&gt;&gt;&gt;&amp; ret<span style="color:#006600; font-weight:bold;">&#41;</span> const; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">--- <span style="color:#800000;color:#800000;">43</span>,<span style="color:#800000;color:#800000;">49</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; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; static uint NOTFOUND;</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; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">! <span style="color:#FF9933; font-style:italic;">//&nbsp; private:</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; &nbsp; &nbsp; uint getChild<span style="color:#006600; font-weight:bold;">&#40;</span>const uint pos, const char c<span style="color:#006600; font-weight:bold;">&#41;</span> const;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; uint getParent<span style="color:#006600; font-weight:bold;">&#40;</span>const uint pos, char&amp; c<span style="color:#006600; font-weight:bold;">&#41;</span> const;</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; &nbsp; &nbsp; void enumerateAll<span style="color:#006600; font-weight:bold;">&#40;</span>const uint pos, const std::<span style="">string</span> str, std::<span style="">vector</span>&lt;std::<span style="">pair</span>&lt;size_t, std::<span style="">pair</span>&lt;std::<span style="">string</span>, uint&gt;&gt;&gt;&amp; ret<span style="color:#006600; font-weight:bold;">&#41;</span> const; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gijutsuya.jp/harajune/2009/08/31/tx-darts-traverse/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
