<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5653284360679726585</id><updated>2024-09-25T14:30:47.215+09:00</updated><category term="R"/><category term="igraph"/><category term="KML"/><category term="android"/><category term="sparql"/><category term="google"/><category term="IIIF"/><category term="cytoscape"/><category term="google earth"/><category term="java"/><category term="mirador"/><category term="mysql"/><category term="php"/><category term="processing"/><category term="xml"/><category term="xslt"/><category term="annotation"/><category term="diary"/><category term="digitalsignature"/><category term="eclipse"/><category term="esxi"/><category term="gmail"/><category term="javascript"/><category term="json"/><category term="lido"/><category term="linux"/><category term="netcommons"/><category term="oai-pmh"/><category term="oaicatmuseum"/><category term="octave"/><category term="opencv"/><category term="openssl"/><category term="openstreetmap"/><category term="osx"/><category term="plotKML"/><category term="poi"/><category term="processing.js"/><category term="spreadsheets"/><category term="timeline"/><category term="utf8"/><category term="visualization"/><category term="zabbix"/><title type='text'>SheepCloud blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>41</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-6054874439651225529</id><published>2016-08-02T01:14:00.000+09:00</published><updated>2016-08-02T01:14:19.697+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="json"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><title type='text'>「履歴情報つきinteger試作」をMySQLで</title><content type='html'>nuko_yokohamaさんの記事「&lt;a href=&quot;http://d.hatena.ne.jp/nuko_yokohama/20160321/1458522965&quot; target=&quot;_blank&quot;&gt;履歴情報つきinteger試作&lt;/a&gt;」が面白い．PostgreSQLのJSON機能を用いてSQLだけで履歴情報を管理している．こうした機能を考えていたので試してみたくなった．JSON機能についてはMySQLでもバージョン5.7からサポートしているらしい．せっかくなのでMySQLのJSON機能の勉強もかねてMySQLでの実装を試みてみた．&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
関数定義&lt;/h2&gt;
「履歴情報つきinteger試作」では色々と関数を定義しているが，ここでは最低限の「create_tt_int」「add_tt_int」「value(実際にはgetValueByUnixTimeとgetValueByNum)」の実装を試みた．&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
履歴つきinteger作成&lt;/h3&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;hiragino kaku gothic pron&amp;quot;; white-space: normal;&quot;&gt;履歴つきinteger作成関数．時間はUNIX_TIMESTAMPで表現する．&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;
DROP FUNCTION IF EXISTS create_tt_int;
delimiter //
CREATE FUNCTION create_tt_int(value integer)
 RETURNS JSON DETERMINISTIC
BEGIN
  DECLARE t INT UNSIGNED;
  set t = UNIX_TIMESTAMP();
 RETURN (SELECT JSON_OBJECT(&#39;header&#39;,JSON_OBJECT(&#39;nums&#39;,1,&#39;newest&#39;,t,&#39;oldest&#39;,t),&#39;values&#39;,JSON_ARRAY(JSON_OBJECT(&#39;value&#39;,value,&#39;timestamp&#39;,t,&#39;num&#39;,1))));
END//
delimiter ;
&lt;/code&gt;
&lt;/pre&gt;
&lt;h3&gt;
履歴つきinteger更新&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;hiragino kaku gothic pron&amp;quot;; white-space: normal;&quot;&gt;履歴つきinteger更新関数．JSON_ARRAYのマージに手間取った．&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;hiragino kaku gothic pron&amp;quot;;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;JSON_MERGEでよかった．&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;hiragino kaku gothic pron&amp;quot;;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
DROP FUNCTION IF EXISTS add_tt_int;
delimiter //
CREATE FUNCTION add_tt_int(src json, value integer)
 RETURNS JSON DETERMINISTIC
BEGIN
 DECLARE t INT UNSIGNED;
 SET t = UNIX_TIMESTAMP();
 RETURN (SELECT JSON_OBJECT(&quot;header&quot;,JSON_OBJECT(&quot;nums&quot;,JSON_EXTRACT(src,&quot;$.header.nums&quot;)+1,&quot;oldest&quot;,JSON_EXTRACT(src,&quot;$.header.oldest&quot;),&quot;newest&quot;,t),&quot;values&quot;,JSON_MERGE(JSON_ARRAY(JSON_OBJECT(&quot;value&quot;,value,&quot;num&quot;,JSON_EXTRACT(src,&quot;$.header.nums&quot;)+1,&quot;timestamp&quot;,t)),JSON_EXTRACT(src,&quot;$.values&quot;))));
END//
delimiter ;
&lt;/code&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
UnixTimeを指定して値を取得&lt;/h3&gt;
&lt;div&gt;
UnixTimeを指定して値を取得．&lt;/div&gt;
&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;
DROP FUNCTION IF EXISTS getValueByUnixTime;
delimiter //
CREATE FUNCTION getValueByUnixTime(src json,t INT UNSIGNED)
 RETURNS JSON DETERMINISTIC
BEGIN
 DECLARE i int;
 DECLARE x int;
 DECLARE t2 JSON;
 DECLARE value JSON;
 IF src-&amp;gt;&#39;$.header.oldest&#39; &amp;gt; t THEN RETURN JSON_OBJECT();
 ELSEIF src-&amp;gt;&#39;$.header.newest&#39; &amp;lt; t THEN RETURN JSON_EXTRACT(src,CONCAT(&quot;$.values[0].value&quot;));
 END IF;
 SET x = src-&amp;gt;&#39;$.header.nums&#39;;
 SET i = 0;
 set value = JSON_OBJECT();
 WHILE i &amp;lt; x DO
  SET t2 = JSON_EXTRACT(src,CONCAT(&quot;$.values[&quot;,i,&quot;].timestamp&quot;));
  IF t2&amp;lt;=t THEN RETURN JSON_EXTRACT(src,CONCAT(&quot;$.values[&quot;,i,&quot;].value&quot;));
  END IF;
  SET i = i + 1;
 END WHILE;
 RETURN value;
END//
delimiter ;
&lt;/code&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;h3&gt;
Numを指定して値を取得 &lt;/h3&gt;
&lt;div&gt;
履歴番号Numを指定して値を取得．&lt;/div&gt;
&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;
DROP FUNCTION IF EXISTS getValueByNum;
delimiter //
CREATE FUNCTION getValueByNum(src json,num INT UNSIGNED)
 RETURNS JSON DETERMINISTIC
BEGIN
 DECLARE i int;
 DECLARE x int;
 DECLARE num2 INT UNSIGNED;
 DECLARE value JSON;
 SET x = src-&amp;gt;&#39;$.header.nums&#39;;
 IF (num &amp;lt; 0 ) THEN RETURN JSON_OBJECT();
 ELSEIF (num &amp;gt; x) THEN RETURN JSON_OBJECT();
 END IF; 
 SET i = 0;
 set value = JSON_OBJECT();
 WHILE i &amp;lt; x DO
  SET num2 = JSON_EXTRACT(src,CONCAT(&quot;$.values[&quot;,i,&quot;].num&quot;));
  IF (num=num2) THEN RETURN JSON_EXTRACT(src,CONCAT(&quot;$.values[&quot;,i,&quot;].value&quot;));
  END IF;
  SET i = i + 1;
 END WHILE;
 RETURN value;
END//
delimiter ;
&lt;/code&gt;
&lt;/pre&gt;
&lt;h2&gt;
使い方

&lt;/h2&gt;
&lt;div&gt;
テーブルを作成，履歴つきintegerを作成．2回ほど更新．&lt;/div&gt;
&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;
DROP TABLE test2;
CREATE TABLE test2 (id INT UNSIGNED, data JSON);
INSERT INTO test2 VALUES (1, create_tt_int(100));
INSERT INTO test2 VALUES (2, create_tt_int(300));
SELECT SLEEP(60);
UPDATE test2 SET data = add_tt_int(data, 200) WHERE id = 1;
UPDATE test2 SET data = add_tt_int(data, 500) WHERE id = 2;
SELECT SLEEP(60);
UPDATE test2 SET data = add_tt_int(data, 300) WHERE id = 1;
UPDATE test2 SET data = add_tt_int(data, 600) WHERE id = 2;
SELECT * FROM test2;
&lt;/code&gt;
&lt;/pre&gt;
中身は以下のとおり．履歴情報がJSON形式で記録されている．
&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;
mysql&amp;gt; select * from test2\G;
*************************** 1. row ***************************
  id: 1
data: {&quot;header&quot;: {&quot;nums&quot;: 3, &quot;newest&quot;: 1470061025, &quot;oldest&quot;: 1470060905}, &quot;values&quot;: [{&quot;num&quot;: 3, &quot;value&quot;: 300, &quot;timestamp&quot;: 1470061025}, {&quot;num&quot;: 2, &quot;value&quot;: 200, &quot;timestamp&quot;: 1470060965}, {&quot;num&quot;: 1, &quot;value&quot;: 100, &quot;timestamp&quot;: 1470060905}]}
*************************** 2. row ***************************
  id: 2
data: {&quot;header&quot;: {&quot;nums&quot;: 3, &quot;newest&quot;: 1470061025, &quot;oldest&quot;: 1470060905}, &quot;values&quot;: [{&quot;num&quot;: 3, &quot;value&quot;: 600, &quot;timestamp&quot;: 1470061025}, {&quot;num&quot;: 2, &quot;value&quot;: 500, &quot;timestamp&quot;: 1470060965}, {&quot;num&quot;: 1, &quot;value&quot;: 300, &quot;timestamp&quot;: 1470060905}]}
2 rows in set (0.00 sec)

ERROR: 
No query specified
&lt;/code&gt;
&lt;/pre&gt;
ここから値を取り出すにはgetValueByUnixTimeを使う．
&lt;pre&gt;&lt;code class=&quot;sql&quot;&gt;
mysql&amp;gt; SELECT getValueByUnixTime(data,UNIX_TIMESTAMP(&#39;2016-08-01 23:15:00&#39;)) AS value FROM test2;
+-------+
| value |
+-------+
| {}    |
| {}    |
+-------+
2 rows in set (0.00 sec)

mysql&amp;gt; SELECT getValueByUnixTime(data,UNIX_TIMESTAMP(&#39;2016-08-01 23:15:05&#39;)) AS value FROM test2;
+-------+
| value |
+-------+
| 100   |
| 300   |
+-------+
2 rows in set (0.00 sec)
mysql&amp;gt; SELECT getValueByUnixTime(data,UNIX_TIMESTAMP(&#39;2016-08-01 23:50:00&#39;)) AS value FROM test2;
+-------+
| value |
+-------+
| 300   |
| 600   |
+-------+
2 rows in set (0.00 sec)
&lt;/code&gt;
&lt;/pre&gt;
ちゃんと履歴から値をとってこれている．
</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/6054874439651225529/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2016/08/integermysql.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/6054874439651225529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/6054874439651225529'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2016/08/integermysql.html' title='「履歴情報つきinteger試作」をMySQLで'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-1106994209667244777</id><published>2016-08-01T22:39:00.001+09:00</published><updated>2016-08-02T00:45:14.915+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IIIF"/><category scheme="http://www.blogger.com/atom/ns#" term="mirador"/><title type='text'>Mirador Viewerを試す</title><content type='html'>Mirador Viewer は International Image Interoperability Framework (IIIF) プロトコルへの完全対応を謳ったオープンソースのイメージビューワ．アノテーション機能も実装されている．&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;http://projectmirador.org/&lt;/li&gt;
&lt;li&gt;https://github.com/IIIF/mirador &amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
Mirador Viewer にはサンプルファイルへのリンクが含まれているので，インストール後すぐにIIIF Viewer としての機能を試すことができる．&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
インストール&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
動作に必要なパッケージをインストールする．&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
&lt;code class=&quot;Bash&quot;&gt;
sudo yum install nodejs
sudo yum install npm
sudo npm install -g grunt-cli
sudo npm install bower -g
&lt;/code&gt;
&lt;/pre&gt;
mirador リポジトリを clone する．

&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;git clone https://github.com/IIIF/mirador.git
&lt;/pre&gt;
&lt;br /&gt;
依存ライブラリをインストールする．

&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;cd mirador/
npm install
bower install
&lt;/pre&gt;
&lt;br /&gt;
ビルドする．


&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;grunt
&lt;/pre&gt;
&lt;br /&gt;
エラーがでなければビルド完了．&lt;br /&gt;
&lt;h2&gt;
&lt;/h2&gt;
&lt;h2&gt;
簡易実行&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
手軽に試したいのであれば grunt server を実行する．

&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;$ grunt server
Running &quot;connect:server&quot; (connect) task
Waiting forever...
Started connect web server on http://localhost:8000
&lt;/pre&gt;
&lt;br /&gt;
web server が起動するので http://localhost:8000 にアクセスする．&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp8g_r3SuH9MmKRRBKsLiIa5HBs9yg5vgHbnoOhqb-_7TQdZeG9EWJwH3lbQcMXrDObsNXzWzSKOfXB9ZlIWUfo1UY1Vv2sPjljQg5E7sStUtPmna0QGaZoZRkbH0P40waqA_r_S4U81fa/s1600/tmp.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;168&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp8g_r3SuH9MmKRRBKsLiIa5HBs9yg5vgHbnoOhqb-_7TQdZeG9EWJwH3lbQcMXrDObsNXzWzSKOfXB9ZlIWUfo1UY1Vv2sPjljQg5E7sStUtPmna0QGaZoZRkbH0P40waqA_r_S4U81fa/s320/tmp.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Mirador Viewer は javascript で書かれているので，web server から見える適当な場所に置いても動作する． &lt;br /&gt;
&lt;br /&gt;
以上．</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/1106994209667244777/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2016/08/mirador-viewer.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/1106994209667244777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/1106994209667244777'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2016/08/mirador-viewer.html' title='Mirador Viewerを試す'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp8g_r3SuH9MmKRRBKsLiIa5HBs9yg5vgHbnoOhqb-_7TQdZeG9EWJwH3lbQcMXrDObsNXzWzSKOfXB9ZlIWUfo1UY1Vv2sPjljQg5E7sStUtPmna0QGaZoZRkbH0P40waqA_r_S4U81fa/s72-c/tmp.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-3531236397638997646</id><published>2016-08-01T22:39:00.000+09:00</published><updated>2016-08-01T22:39:15.765+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="annotation"/><category scheme="http://www.blogger.com/atom/ns#" term="IIIF"/><category scheme="http://www.blogger.com/atom/ns#" term="mirador"/><title type='text'>CATCH-Aを試す</title><content type='html'>&lt;ul&gt;
&lt;li&gt;https://github.com/annotationsatharvard/catcha&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h2&gt;
インストール&lt;/h2&gt;
&lt;br /&gt;
Java 1.7系をインストールし，環境変数 「JAVA_HOME」を設定する．※1.7系でないとgrails関係でこけるので注意&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:plain&quot;&gt;sudo yum install java-1.7.0-openjdk-devel
pathtojava=$(readlink -e $(which javac));export JAVA_HOME=${pathtojava%/*/*}
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Java のバージョンおよび環境変数を確認する．
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:plain&quot;&gt;$ java -version
java version &quot;1.7.0_101&quot;
OpenJDK Runtime Environment (rhel-2.6.6.1.el7_2-x86_64 u101-b00)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)
$ echo $JAVA_HOME
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.101-2.6.6.1.el7_2.x86_64
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
GVM（sdkman）をインストールする．最新のもので問題ない模様．&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;http://sdkman.io/&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;curl -s &quot;https://get.sdkman.io&quot; | bash
source /home/vagrant/.sdkman/bin/sdkman-init.sh 
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
sdkman のバージョンを確認する．
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;$ sdk version
SDKMAN 4.0.37
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
MySQL をインストールする．
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;sudo yum install mariadb-server
&lt;/pre&gt;
&lt;br /&gt;
MySQL のバージョンを確認する．
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;$ mysql --version
mysql  Ver 15.1 Distrib 5.5.47-MariaDB, for Linux (x86_64) using readline 5.1
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
ディレクトリを作成し，catcha リポジトリを clone する．

&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;mkdir Catcha
cd Catcha
git clone https://github.com/annotationsatharvard/catcha.git
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
必要なライブラリも clone する．
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;mkdir annotationframework
cd annotationframework
git clone https://github.com/annotationframework/AfPersistence.git
git clone https://github.com/annotationframework/AfSecurity.git
git clone https://github.com/annotationframework/AfShared.git
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
CATCH-A 用のデータベースおよびデータベースユーザを作成する．
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;sudo mysql -u root -e &#39;create database catch default charset utf8;&#39;
sudo mysql -u root -e &#39;grant all on catch.* to &quot;catch&quot;@&quot;localhost&quot; identified by &quot;catch&quot;;&#39;
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
設定ファイルをコピーする．

&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;cd ../catcha
cp Catch-config.properties catch-config.properties 
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
catch-config.properties を編集する．データベースの設定は以下のあたり．
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;dataSource.url=jdbc:mysql://localhost:3306/catch?useUnicode=yes&amp;amp;characterEncoding=UTF-8&amp;amp;autoReconnect=true
dataSource.username=catch
dataSource.password=catch
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
CATCH-A が使っている grails のバージョン確認する．
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;$ cat application.properties | grep grails
app.grails.version=2.2.5
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
確認したバージョンの grails をインストールする．
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;gvm install grails 2.2.5
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
catcha/grails-app/conf/BuildConfig.groovy を編集する．
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;diff --git a/grails-app/conf/BuildConfig.groovy b/grails-app/conf/BuildConfig.gr
index 0c32ab1..83193e1 100644
--- a/grails-app/conf/BuildConfig.groovy
+++ b/grails-app/conf/BuildConfig.groovy
@@ -74,6 +74,7 @@ grails.project.dependency.resolution = {
         //runtime &quot;org.semweb4j:rdf2go.impl.base:4.6.2&quot;
                //compile &quot;org.openrdf:openrdf-sesame-onejar-osgi:2.1.2&quot;
                //compile &quot;org.openrdf.sesame:sesame-query:2.7.2&quot;
+       compile &quot;com.nimbusds:nimbus-jose-jwt:2.26.1&quot;
     }
 
     plugins {
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
nimbus-jose-jwt は 2.x 系じゃないと動かない．

準備が整ったらプロジェクトをビルド＆実行する．

&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;grails run-app
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
ビルドが無事終了し，以下メッセージが表示されるまで待つ．
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;| Server running. Browse to http://localhost:8080/catch
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
表示されたら http://localhost:8080/catch にアクセスする．
&lt;br /&gt;
&lt;br /&gt;
ユーザ名「admin」，パスワード「password」でログインできる．



</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/3531236397638997646/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2016/08/catch-a.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/3531236397638997646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/3531236397638997646'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2016/08/catch-a.html' title='CATCH-Aを試す'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-3397968771922041485</id><published>2015-05-15T00:50:00.004+09:00</published><updated>2015-05-15T00:53:39.656+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="digitalsignature"/><category scheme="http://www.blogger.com/atom/ns#" term="openssl"/><category scheme="http://www.blogger.com/atom/ns#" term="xml"/><title type='text'>XML文書に電子署名をしてみる</title><content type='html'>いまさらながらXML署名について調べてみた。&lt;br /&gt;
&lt;br /&gt;
感覚的には理解できたけど、実際の処理に興味があったので、特殊なツールを使わずにXML文書に電子署名をしてみる。&lt;br /&gt;
&lt;br /&gt;
目的は、&lt;a href=&quot;https://www.aleksey.com/xmlsec/xmldsig-verifier.html&quot; target=&quot;_blank&quot;&gt;Online XML Digital Signature Verifer&lt;/a&gt;で検証可能なXML署名を作成すること。&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
参照要素の作成&lt;/h2&gt;
まず、署名対象のXML文書のダイジェスト値を求める。&lt;br /&gt;
&lt;br /&gt;
以下が今回の署名対象となるXML文書（target.xml）。かなり、適当なXML文書である。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&lt;br /&gt;
&amp;lt;sample&amp;gt;&lt;br /&gt;
&amp;lt;!-- comment --&amp;gt;&lt;br /&gt;
&amp;lt;msg lang =&quot;ja&quot;&amp;gt;hello&amp;lt;/msg&amp;gt;&lt;br /&gt;
&amp;lt;/sample&amp;gt;&lt;/blockquote&gt;
&lt;br /&gt;
つぎに、このXML文書を正規化(Canonicalization)する。&lt;br /&gt;
&lt;br /&gt;
正規化の手順は、&lt;a href=&quot;http://www.w3.org/TR/xmldsig-core/#sec-c14nAlg&quot;&gt;http://www.w3.org/TR/xmldsig-core/#sec-c14nAlg&lt;/a&gt;にある。&lt;br /&gt;
&lt;br /&gt;
参考：&lt;a href=&quot;http://www.w3.org/TR/xml-c14n11/&quot; target=&quot;_blank&quot;&gt;Canonical XML&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
色々と定義があるようだが、ここではXML宣言とコメント、そして改行コード「\n」を削除する。要素属性の余計な空白も取り除く。&lt;br /&gt;
&lt;br /&gt;
こんな感じ。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ cat target.xml | tr -d &#39;\012&#39; &amp;gt; target_c14n.xml&lt;br /&gt;
$ cat target_c14n.xml&lt;br /&gt;
&amp;lt;sample&amp;gt;&amp;lt;msg lang=&quot;ja&quot;&amp;gt;hello&amp;lt;/msg&amp;gt;&amp;lt;/sample&amp;gt;&lt;/blockquote&gt;
バイナリダンプは以下の通り。&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ hexdump target_c14n.xml&lt;br /&gt;
0000000 3c 73 61 6d 70 6c 65 3e 3c 6d 73 67 20 6c 61 6e&lt;br /&gt;
0000010 67 3d 22 6a 61 22 3e 68 65 6c 6c 6f 3c 2f 6d 73&lt;br /&gt;
0000020 67 3e 3c 2f 73 61 6d 70 6c 65 3e&amp;nbsp;&lt;/blockquote&gt;
正規化できたら、XML文書のダイジェスト値を計算する。&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ openssl dgst -sha1 -binary target_c14n.xml | base64&lt;br /&gt;
21hWqJrA9IIsNLbKwiMH2xrD4R0=&lt;/blockquote&gt;
&lt;br /&gt;
このダイジェスト値を用いてDigestValue要素を定義して、&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;lt;DigestValue&amp;gt;21hWqJrA9IIsNLbKwiMH2xrD4R0=&amp;lt;/DigestValue&amp;gt;&lt;/blockquote&gt;
&lt;br /&gt;
この要素を含めた参照(Reference)要素を作成する。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;lt;Reference URI=&quot;&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;lt;Transforms&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;lt;Transform Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#enveloped-signature&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;lt;/Transforms&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;lt;DigestMethod Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#sha1&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;lt;DigestValue&amp;gt;21hWqJrA9IIsNLbKwiMH2xrD4R0=&amp;lt;/DigestValue&amp;gt;&lt;br /&gt;
&amp;lt;/Reference&amp;gt;&lt;/blockquote&gt;
&amp;lt;Reference URI=&quot;&quot;&amp;gt;は署名対象の参照先を意味しており、envelopedタイプ（署名対象XML文書に署名自体も含む）はURI=&quot;&quot;とかになる模様。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Transform Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#enveloped-signature&quot;/&amp;gt;は作成するXML署名がenvelopedタイプであることを示す。&lt;br /&gt;
&lt;br /&gt;
また、&amp;lt;DigestMethod Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#sha1&quot;/&amp;gt;はダイジェスト値をもとめたときのアルゴリズムを示している。&lt;br /&gt;
&lt;br /&gt;
以上で参照要素が完成した。&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
署名情報要素(SignedInfo)の作成&lt;/h2&gt;
&lt;br /&gt;
署名情報要素(SignedInfo)は、先ほどの参照要素(Reference)に加え、CanonicalizationMethod要素、SignatureMethod要素が必要になる。&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
signedinfo.xml&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;lt;SignedInfo xmlns=&quot;http://www.w3.org/2000/09/xmldsig#&quot;&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;CanonicalizationMethod Algorithm=&quot;http://www.w3.org/2001/10/xml-exc-c14n#&quot;&amp;gt;&amp;lt;/CanonicalizationMethod&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;SignatureMethod Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#rsa-sha1&quot;&amp;gt;&amp;lt;/SignatureMethod&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;Reference URI=&quot;&quot;&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;Transforms&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&amp;lt;Transform Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#enveloped-signature&quot;&amp;gt;&amp;lt;/Transform&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;/Transforms&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;DigestMethod Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#sha1&quot;&amp;gt;&amp;lt;/DigestMethod&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;DigestValue&amp;gt;21hWqJrA9IIsNLbKwiMH2xrD4R0=&amp;lt;/DigestValue&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/Reference&amp;gt;&lt;br /&gt;
&amp;lt;/SignedInfo&amp;gt;&lt;/blockquote&gt;
&lt;br /&gt;
これを正規化する。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ cat signedinfo.xml | tr -d &#39;\012&#39; &amp;gt; signedinfo_c14n.xml&lt;/blockquote&gt;
正規化後は以下のようになる。&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
signedinfo_c14n.xml&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;lt;SignedInfo xmlns=&quot;http://www.w3.org/2000/09/xmldsig#&quot;&amp;gt;&amp;lt;CanonicalizationMethod Algorithm=&quot;http://www.w3.org/2001/10/xml-exc-c14n#&quot;&amp;gt;&amp;lt;/CanonicalizationMethod&amp;gt;&amp;lt;SignatureMethod Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#rsa-sha1&quot;&amp;gt;&amp;lt;/SignatureMethod&amp;gt;&amp;lt;Reference URI=&quot;&quot;&amp;gt;&amp;lt;Transforms&amp;gt;&amp;lt;Transform Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#enveloped-signature&quot;&amp;gt;&amp;lt;/Transform&amp;gt;&amp;lt;/Transforms&amp;gt;&amp;lt;DigestMethod Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#sha1&quot;&amp;gt;&amp;lt;/DigestMethod&amp;gt;&amp;lt;DigestValue&amp;gt;21hWqJrA9IIsNLbKwiMH2xrD4R0=&amp;lt;/DigestValue&amp;gt;&amp;lt;/Reference&amp;gt;&amp;lt;/SignedInfo&amp;gt;&lt;/blockquote&gt;
&lt;br /&gt;
改行コードやEOFも削除する。これで署名情報要素ができた。&lt;br /&gt;
&lt;br /&gt;
バイナリダンプは以下のとおり。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ hexdump signedinfo_c14n.xml&lt;br /&gt;
0000000 3c 53 69 67 6e 65 64 49 6e 66 6f 20 78 6d 6c 6e&lt;br /&gt;
0000010 73 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 77 33&lt;br /&gt;
0000020 2e 6f 72 67 2f 32 30 30 30 2f 30 39 2f 78 6d 6c&lt;br /&gt;
0000030 64 73 69 67 23 22 3e 3c 43 61 6e 6f 6e 69 63 61&lt;br /&gt;
0000040 6c 69 7a 61 74 69 6f 6e 4d 65 74 68 6f 64 20 41&lt;br /&gt;
0000050 6c 67 6f 72 69 74 68 6d 3d 22 68 74 74 70 3a 2f&lt;br /&gt;
0000060 2f 77 77 77 2e 77 33 2e 6f 72 67 2f 32 30 30 31&lt;br /&gt;
0000070 2f 31 30 2f 78 6d 6c 2d 65 78 63 2d 63 31 34 6e&lt;br /&gt;
0000080 23 22 3e 3c 2f 43 61 6e 6f 6e 69 63 61 6c 69 7a&lt;br /&gt;
0000090 61 74 69 6f 6e 4d 65 74 68 6f 64 3e 3c 53 69 67&lt;br /&gt;
00000a0 6e 61 74 75 72 65 4d 65 74 68 6f 64 20 41 6c 67&lt;br /&gt;
00000b0 6f 72 69 74 68 6d 3d 22 68 74 74 70 3a 2f 2f 77&lt;br /&gt;
00000c0 77 77 2e 77 33 2e 6f 72 67 2f 32 30 30 30 2f 30&lt;br /&gt;
00000d0 39 2f 78 6d 6c 64 73 69 67 23 72 73 61 2d 73 68&lt;br /&gt;
00000e0 61 31 22 3e 3c 2f 53 69 67 6e 61 74 75 72 65 4d&lt;br /&gt;
00000f0 65 74 68 6f 64 3e 3c 52 65 66 65 72 65 6e 63 65&lt;br /&gt;
0000100 20 55 52 49 3d 22 22 3e 3c 54 72 61 6e 73 66 6f&lt;br /&gt;
0000110 72 6d 73 3e 3c 54 72 61 6e 73 66 6f 72 6d 20 41&lt;br /&gt;
0000120 6c 67 6f 72 69 74 68 6d 3d 22 68 74 74 70 3a 2f&lt;br /&gt;
0000130 2f 77 77 77 2e 77 33 2e 6f 72 67 2f 32 30 30 30&lt;br /&gt;
0000140 2f 30 39 2f 78 6d 6c 64 73 69 67 23 65 6e 76 65&lt;br /&gt;
0000150 6c 6f 70 65 64 2d 73 69 67 6e 61 74 75 72 65 22&lt;br /&gt;
0000160 3e 3c 2f 54 72 61 6e 73 66 6f 72 6d 3e 3c 2f 54&lt;br /&gt;
0000170 72 61 6e 73 66 6f 72 6d 73 3e 3c 44 69 67 65 73&lt;br /&gt;
0000180 74 4d 65 74 68 6f 64 20 41 6c 67 6f 72 69 74 68&lt;br /&gt;
0000190 6d 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 77 33&lt;br /&gt;
00001a0 2e 6f 72 67 2f 32 30 30 30 2f 30 39 2f 78 6d 6c&lt;br /&gt;
00001b0 64 73 69 67 23 73 68 61 31 22 3e 3c 2f 44 69 67&lt;br /&gt;
00001c0 65 73 74 4d 65 74 68 6f 64 3e 3c 44 69 67 65 73&lt;br /&gt;
00001d0 74 56 61 6c 75 65 3e 32 31 68 57 71 4a 72 41 39&lt;br /&gt;
00001e0 49 49 73 4e 4c 62 4b 77 69 4d 48 32 78 72 44 34&lt;br /&gt;
00001f0 52 30 3d 3c 2f 44 69 67 65 73 74 56 61 6c 75 65&lt;br /&gt;
0000200 3e 3c 2f 52 65 66 65 72 65 6e 63 65 3e 3c 2f 53&lt;br /&gt;
0000210 69 67 6e 65 64 49 6e 66 6f 3e &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
000021a&lt;/blockquote&gt;
&lt;br /&gt;
&lt;h2&gt;
署名準備&lt;/h2&gt;
XML署名に用いる秘密鍵、証明書を作成する。&lt;br /&gt;
&lt;br /&gt;
まず、2048ビット長のRSA秘密鍵を作成する&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ openssl genrsa -out private-key.pem 2048&lt;/blockquote&gt;
秘密鍵の内容を確認する。&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;※秘密鍵は絶対に公開してはならない。意味がなくなるから。今回はあくまで練習のため。&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ openssl rsa -in private-key.pem&lt;br /&gt;
writing RSA key&lt;br /&gt;
-----BEGIN RSA PRIVATE KEY-----&lt;br /&gt;
MIIEogIBAAKCAQEAmlg5wx9jWcdPYB54zH+kIsZ5geFalcawV4cOg1M6n11fDikt&lt;br /&gt;
aViTTY3yPtzjJGVc+coqoARenRqg27NkYj32ofxc0e9k9+dlK0BXl/toBmRenSuR&lt;br /&gt;
xvyO3iVTtN1z3AHZDMpmhj2obs72KzFg+XnNJ47MYBQx3oL6o30wcSNmj/J2vUr1&lt;br /&gt;
Jnex2Z5dn189eXadEsxYKLGmwsO5Ocs0yyYj6ua8i+/CWmLA2fzVdid0tfe+ArTx&lt;br /&gt;
VLqA6jOBdrUMcJw5Dn5VLYObyUndVga47k3++fy299hARvX8CODGhddQeDuhb0iz&lt;br /&gt;
9tiQiImrTRIUyke7Vp1yHCHKzf6E2W2fKLKH/QIDAQABAoIBADPkSbdSjEKZAhTc&lt;br /&gt;
6dxHZdXTSPLj42LL5GnpHHYGu4TtDZJjQcNTZmMCwFlmRm/sLHBHCkG2dmD3nPGA&lt;br /&gt;
xNVK4+reQA7NH/NBNwBtp4WPnw/XGwBYr7BpJVeG0TfT5KopbOIiAopLnJ90scsf&lt;br /&gt;
1OzLiLAuEISVBZc8Dix9YJYJQuhOJPEB4cqFmvag+W71PrmVozpFKWjMhWHtL2Dn&lt;br /&gt;
VEfWEtlv0QyKQdHTtcONnGGvRFTkA5z5iziQ/mh7skP5Ks92VoZTeQlHZTGcEPIr&lt;br /&gt;
9G1/8PUCRAFCZSSn7yVHdzv8MedAKSx4KZk9gvgbYTyOW93sHQH06zl4RQZX0/U+&lt;br /&gt;
VAix5HkCgYEAyucZBC8vOsEbboXMTtZ9LAXdfNyZEt8ev7Nw22B78aeGxWw2F/sn&lt;br /&gt;
PJKKqdgRsm7hbyOeydZQ/mqBQE3Ri6kp1I4qvpQ+aK6XjGIjYYymZgaWE6/uQAJU&lt;br /&gt;
U8fS4TtG7t0BuCfgQ8fsS95g9mg6zMyV+4OM2oqaUWPh6NU0toUInisCgYEAwrwd&lt;br /&gt;
IpJlVNGX6oXlZz/RlL5LjVCgxD1m0wU3vGRXHePjFcTmjgub0Jjr6Kg+WnocdcIk&lt;br /&gt;
rM1YWYPgsjvhN3ucnTD+/Y1kKzcfr3ovtrp8F8QrZTiMxTAZ0S7sJlxYxuD7fgKu&lt;br /&gt;
YVeHKZMybV8qC7wS5EJM4LyXx+DLphyv9Zf0BncCgYAM+BqMPuvY6JD1To4Rl/om&lt;br /&gt;
PzW6DmumXiacAD89dnxVpOyjX9hRThdi8sb0NkBjVF0Keo9ivVUt/ebHEnJLaAOp&lt;br /&gt;
d3DZ/6XBkS9UpM04JgJY0SD0nzEuXDfBpysehGhzSiMa/0mBa5z5+HvgJCdmAcmw&lt;br /&gt;
aucs7OESRL0i4cXdyMEVQwKBgAoqQacVVz7HNhPi62epWCpYiJ8Wz12PCvgG9LLb&lt;br /&gt;
1gRUaf0v6w0NJBQOd3oMljyo1SV8feebTHpXvPnw0D/SLwmxjg30PH9ZAElrqmPy&lt;br /&gt;
dhnTfqRpAEgmy6I0vdT+yw+OnPIl965TIFYWPfKhnhNAvQe3QkYU8iNX46mHI9RB&lt;br /&gt;
G1bfAoGAEaSnaFbUJTDipC2aJldGx+iNAtKu/QTZLS6FPjSewRdMGNBvhxVfygpc&lt;br /&gt;
EBtwbGpSXyysyg3vdDZjWygjLFHnWS1gy+YLZ9A56Ha+cGvazPQ1ZAEes0tjmL6V&lt;br /&gt;
gT/EgCkYcBseVUFROhfkTi/jbvD+kS8tuPB8G1plbfWJ1HCXZRQ=&lt;br /&gt;
-----END RSA PRIVATE KEY-----&lt;/blockquote&gt;
秘密鍵から公開鍵を作成する。(今回は使わないけど)&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ openssl rsa -pubout -in private-key.pem -out public-key.pem&lt;/blockquote&gt;
&lt;br /&gt;
公開鍵の中身を確認する。&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ openssl rsa -pubin -in public-key.pem&lt;br /&gt;
writing RSA key&lt;br /&gt;
-----BEGIN PUBLIC KEY-----&lt;br /&gt;
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmlg5wx9jWcdPYB54zH+k&lt;br /&gt;
IsZ5geFalcawV4cOg1M6n11fDiktaViTTY3yPtzjJGVc+coqoARenRqg27NkYj32&lt;br /&gt;
ofxc0e9k9+dlK0BXl/toBmRenSuRxvyO3iVTtN1z3AHZDMpmhj2obs72KzFg+XnN&lt;br /&gt;
J47MYBQx3oL6o30wcSNmj/J2vUr1Jnex2Z5dn189eXadEsxYKLGmwsO5Ocs0yyYj&lt;br /&gt;
6ua8i+/CWmLA2fzVdid0tfe+ArTxVLqA6jOBdrUMcJw5Dn5VLYObyUndVga47k3+&lt;br /&gt;
+fy299hARvX8CODGhddQeDuhb0iz9tiQiImrTRIUyke7Vp1yHCHKzf6E2W2fKLKH&lt;br /&gt;
/QIDAQAB&lt;br /&gt;
-----END PUBLIC KEY-----&lt;/blockquote&gt;
証明書署名要求(CSR, Certificate Signing Request)を作成する。 &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ openssl req -new -key private-key.pem -out csr.pem -subj &#39;/C=JP/ST=Tokyo/L=Hino/O=Sheepcloud org./OU=Dept/CN=sheepcloud.org&#39;&lt;/blockquote&gt;
&lt;br /&gt;
つぎに、&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://www.aleksey.com/xmlsec/xmldsig-verifier.html&quot; target=&quot;_blank&quot;&gt;Online XML Digital Signature Verifer&lt;/a&gt;から認証局証明書と秘密鍵(passphraseは&quot;secret&quot;)をダウンロードしてくる。検証を成功させるために必要。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ curl -O https://www.aleksey.com/xmlsec/tests/keys-certs/cacert.pem&lt;br /&gt;
$ curl -O https://www.aleksey.com/xmlsec/tests/keys-certs/cakey.pem&lt;/blockquote&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://www.aleksey.com/xmlsec/xmldsig-verifier.html&quot; target=&quot;_blank&quot;&gt;Online XML Digital Signature Verifer&lt;/a&gt;の認証局証明書でCSRを署名する。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ openssl x509 -req -in csr.pem -days 3650 -CA cacert.pem -CAkey cakey.pem -set_serial 123 -out cert.pem&lt;br /&gt;
Signature ok&lt;br /&gt;
subject=/C=JP/ST=Tokyo/L=Hino/O=Sheepcloud org./OU=Dept/CN=sheepcloud.org&lt;br /&gt;
Getting CA Private Key&lt;br /&gt;
Enter pass phrase for cakey.pem:secret&lt;/blockquote&gt;
&lt;h2&gt;
署名&lt;/h2&gt;
&amp;nbsp;作成した秘密鍵で署名情報要素(SignedInfo)に署名し、Base64でエンコードする。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ openssl dgst -sha1 -sign private-key.pem signedinfo_c14n.xml|base64&lt;br /&gt;
FknPmWmHFeI2gSX1FoNokRDr9W26NbOhY6xFxT3AJwi9Rp4uzCzA/ptU+nG5oQOHMFc439NMuZgnf69ttCbPAdjbLoBwbddydFQNKZwDq2BH2h0cKjQcRr++95vF9H9esZ92UlSVK2JPm4xA43NAzvm0APvarkGRM1ZwBKXP+LFeoERV1ZyHQ+eIloyeJBA2lyNtYl0qID9Tbdnk9JH26z7Qq9M3wKc6PzzaYUclAezG61yISRccD0G7WIHOnLyrOSD+QC3+g4W7bffxR1+2FKQmt00qG6zjik5ofVfHTv1ugpKXcLc2p+AesSXpj8EB9yw7xaSOypUr/WAKsJmw1w==&lt;/blockquote&gt;
&amp;nbsp; &lt;br /&gt;
エンコード結果をSignatureValue要素の値にする。 &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;lt;SignatureValue&amp;gt;FknPmWmHFeI2gSX1FoNokRDr9W26NbOhY6xFxT3AJwi9Rp4uzCzA/ptU+nG5oQOHMFc439NMuZgnf69ttCbPAdjbLoBwbddydFQNKZwDq2BH2h0cKjQcRr++95vF9H9esZ92UlSVK2JPm4xA43NAzvm0APvarkGRM1ZwBKXP+LFeoERV1ZyHQ+eIloyeJBA2lyNtYl0qID9Tbdnk9JH26z7Qq9M3wKc6PzzaYUclAezG61yISRccD0G7WIHOnLyrOSD+QC3+g4W7bffxR1+2FKQmt00qG6zjik5ofVfHTv1ugpKXcLc2p+AesSXpj8EB9yw7xaSOypUr/WAKsJmw1w==&amp;lt;/SignatureValue&amp;gt;&lt;/blockquote&gt;
&lt;br /&gt;
署名のバイナリダンプは次のとおり。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ openssl dgst -sha1 -sign private-key.pem signedinfo_c14n.xml|hexdump&lt;br /&gt;
0000000 16 49 cf 99 69 87 15 e2 36 81 25 f5 16 83 68 91&lt;br /&gt;
0000010 10 eb f5 6d ba 35 b3 a1 63 ac 45 c5 3d c0 27 08&lt;br /&gt;
0000020 bd 46 9e 2e cc 2c c0 fe 9b 54 fa 71 b9 a1 03 87&lt;br /&gt;
0000030 30 57 38 df d3 4c b9 98 27 7f af 6d b4 26 cf 01&lt;br /&gt;
0000040 d8 db 2e 80 70 6d d7 72 74 54 0d 29 9c 03 ab 60&lt;br /&gt;
0000050 47 da 1d 1c 2a 34 1c 46 bf be f7 9b c5 f4 7f 5e&lt;br /&gt;
0000060 b1 9f 76 52 54 95 2b 62 4f 9b 8c 40 e3 73 40 ce&lt;br /&gt;
0000070 f9 b4 00 fb da ae 41 91 33 56 70 04 a5 cf f8 b1&lt;br /&gt;
0000080 5e a0 44 55 d5 9c 87 43 e7 88 96 8c 9e 24 10 36&lt;br /&gt;
0000090 97 23 6d 62 5d 2a 20 3f 53 6d d9 e4 f4 91 f6 eb&lt;br /&gt;
00000a0 3e d0 ab d3 37 c0 a7 3a 3f 3c da 61 47 25 01 ec&lt;br /&gt;
00000b0 c6 eb 5c 88 49 17 1c 0f 41 bb 58 81 ce 9c bc ab&lt;br /&gt;
00000c0 39 20 fe 40 2d fe 83 85 bb 6d f7 f1 47 5f b6 14&lt;br /&gt;
00000d0 a4 26 b7 4d 2a 1b ac e3 8a 4e 68 7d 57 c7 4e fd&lt;br /&gt;
00000e0 6e 82 92 97 70 b7 36 a7 e0 1e b1 25 e9 8f c1 01&lt;br /&gt;
00000f0 f7 2c 3b c5 a4 8e ca 95 2b fd 60 0a b0 99 b0 d7&lt;br /&gt;
0000100&lt;/blockquote&gt;
&lt;br /&gt;
証明書からSubject DNを取得し、X509SubjectName要素を定義する。&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ openssl x509 -in cert.pem -text | grep Subject:&lt;br /&gt;
Subject: C=JP, ST=Tokyo, L=Hino, O=Sheepcloud org., OU=Dept, CN=sheepcloud.org&lt;/blockquote&gt;
取得し、&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;lt;X509SubjectName&amp;gt;C=JP, ST=Tokyo, L=Hino, O=Sheepcloud org., OU=Dept, CN=sheepcloud.org&amp;lt;/X509SubjectName&amp;gt;&lt;/blockquote&gt;
定義する。&lt;br /&gt;
&lt;br /&gt;
証明書をX509Certificate要素に設定する。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ openssl x509 -in cert.pem&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIDHjCCAocCAXswDQYJKoZIhvcNAQELBQAwgbwxCzAJBgNVBAYTAlVTMRMwEQYD&lt;br /&gt;
VQQIEwpDYWxpZm9ybmlhMT0wOwYDVQQKEzRYTUwgU2VjdXJpdHkgTGlicmFyeSAo&lt;br /&gt;
aHR0cDovL3d3dy5hbGVrc2V5LmNvbS94bWxzZWMpMR4wHAYDVQQLExVUZXN0IFJv&lt;br /&gt;
b3QgQ2VydGlmaWNhdGUxFjAUBgNVBAMTDUFsZWtzZXkgU2FuaW4xITAfBgkqhkiG&lt;br /&gt;
9w0BCQEWEnhtbHNlY0BhbGVrc2V5LmNvbTAeFw0xNTA1MTMxNTEyMzBaFw0yNTA1&lt;br /&gt;
MTAxNTEyMzBaMG4xCzAJBgNVBAYTAkpQMQ4wDAYDVQQIDAVUb2t5bzENMAsGA1UE&lt;br /&gt;
BwwESGlubzEYMBYGA1UECgwPU2hlZXBjbG91ZCBvcmcuMQ0wCwYDVQQLDAREZXB0&lt;br /&gt;
MRcwFQYDVQQDDA5zaGVlcGNsb3VkLm9yZzCCASIwDQYJKoZIhvcNAQEBBQADggEP&lt;br /&gt;
ADCCAQoCggEBAJpYOcMfY1nHT2AeeMx/pCLGeYHhWpXGsFeHDoNTOp9dXw4pLWlY&lt;br /&gt;
k02N8j7c4yRlXPnKKqAEXp0aoNuzZGI99qH8XNHvZPfnZStAV5f7aAZkXp0rkcb8&lt;br /&gt;
jt4lU7Tdc9wB2QzKZoY9qG7O9isxYPl5zSeOzGAUMd6C+qN9MHEjZo/ydr1K9SZ3&lt;br /&gt;
sdmeXZ9fPXl2nRLMWCixpsLDuTnLNMsmI+rmvIvvwlpiwNn81XYndLX3vgK08VS6&lt;br /&gt;
gOozgXa1DHCcOQ5+VS2Dm8lJ3VYGuO5N/vn8tvfYQEb1/AjgxoXXUHg7oW9Is/bY&lt;br /&gt;
kIiJq00SFMpHu1adchwhys3+hNltnyiyh/0CAwEAATANBgkqhkiG9w0BAQsFAAOB&lt;br /&gt;
gQBrX5gnLIEZFdI7A5ywZpaw5M5PdUR1pKEnKA9ARkPWkNcGC/Is1Qn1DpUHpIE7&lt;br /&gt;
by6zOulby6Grn8j9zfj9XG8ujyzIqtzNJkdyWXROa1BBOxkLu1XnyXYU7LVNi7x3&lt;br /&gt;
5BGZT5SK6MclYIzuoAfTACiume5Jr88GeV/QcsPdWTJ+GQ==&lt;br /&gt;
-----END CERTIFICATE-----&lt;/blockquote&gt;
あとはこれらの情報を以下のXML署名雛形に埋めていく。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&amp;lt;sample&amp;gt;&amp;lt;msg lang=&quot;ja&quot;&amp;gt;hello&amp;lt;/msg&amp;gt;&amp;lt;Signature xmlns=&quot;http://www.w3.org/2000/09/xmldsig#&quot;&amp;gt;&amp;lt;SignedInfo&amp;gt;&amp;lt;CanonicalizationMethod Algorithm=&quot;http://www.w3.org/2001/10/xml-exc-c14n#&quot;/&amp;gt;&amp;lt;SignatureMethod Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#rsa-sha1&quot;/&amp;gt;&amp;lt;Reference URI=&quot;&quot;&amp;gt;&amp;lt;Transforms&amp;gt;&amp;lt;Transform Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#enveloped-signature&quot;/&amp;gt;&amp;lt;/Transforms&amp;gt;&amp;lt;DigestMethod Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#sha1&quot;/&amp;gt;&amp;lt;DigestValue&amp;gt;&amp;lt;/DigestValue&amp;gt;&amp;lt;/Reference&amp;gt;&amp;lt;/SignedInfo&amp;gt;&amp;lt;SignatureValue&amp;gt;&amp;lt;/SignatureValue&amp;gt;&amp;lt;KeyInfo&amp;gt;&amp;lt;X509Data&amp;gt;&amp;lt;X509SubjectName&amp;gt;&amp;lt;/X509SubjectName&amp;gt;&amp;lt;X509Certificate&amp;gt;&amp;lt;/X509Certificate&amp;gt;&amp;lt;/X509Data&amp;gt;&amp;lt;/KeyInfo&amp;gt;&amp;lt;/Signature&amp;gt;&amp;lt;/sample&amp;gt;&lt;/blockquote&gt;
完成したXML署名は以下のとおり。&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&amp;lt;sample&amp;gt;&amp;lt;msg lang=&quot;ja&quot;&amp;gt;hello&amp;lt;/msg&amp;gt;&amp;lt;Signature xmlns=&quot;http://www.w3.org/2000/09/xmldsig#&quot;&amp;gt;&amp;lt;SignedInfo&amp;gt;&amp;lt;CanonicalizationMethod Algorithm=&quot;http://www.w3.org/2001/10/xml-exc-c14n#&quot;/&amp;gt;&amp;lt;SignatureMethod Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#rsa-sha1&quot;/&amp;gt;&amp;lt;Reference URI=&quot;&quot;&amp;gt;&amp;lt;Transforms&amp;gt;&amp;lt;Transform Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#enveloped-signature&quot;/&amp;gt;&amp;lt;/Transforms&amp;gt;&amp;lt;DigestMethod Algorithm=&quot;http://www.w3.org/2000/09/xmldsig#sha1&quot;/&amp;gt;&amp;lt;DigestValue&amp;gt;21hWqJrA9IIsNLbKwiMH2xrD4R0=&amp;lt;/DigestValue&amp;gt;&amp;lt;/Reference&amp;gt;&amp;lt;/SignedInfo&amp;gt;&amp;lt;SignatureValue&amp;gt;FknPmWmHFeI2gSX1FoNokRDr9W26NbOhY6xFxT3AJwi9Rp4uzCzA/ptU+nG5oQOHMFc439NMuZgnf69ttCbPAdjbLoBwbddydFQNKZwDq2BH2h0cKjQcRr++95vF9H9esZ92UlSVK2JPm4xA43NAzvm0APvarkGRM1ZwBKXP+LFeoERV1ZyHQ+eIloyeJBA2lyNtYl0qID9Tbdnk9JH26z7Qq9M3wKc6PzzaYUclAezG61yISRccD0G7WIHOnLyrOSD+QC3+g4W7bffxR1+2FKQmt00qG6zjik5ofVfHTv1ugpKXcLc2p+AesSXpj8EB9yw7xaSOypUr/WAKsJmw1w==&amp;lt;/SignatureValue&amp;gt;&amp;lt;KeyInfo&amp;gt;&amp;lt;X509Data&amp;gt;&amp;lt;X509SubjectName&amp;gt;CN=test,O=Internet Widgits Pty Ltd,ST=Some-State,C=AU&amp;lt;/X509SubjectName&amp;gt;&amp;lt;X509Certificate&amp;gt;MIIDhjCCAu+gAwIBAgIBATANBgkqhkiG9w0BAQsFADCBvDELMAkGA1UEBhMCVVMxEzARBgNVBAgT&lt;br /&gt;
CkNhbGlmb3JuaWExPTA7BgNVBAoTNFhNTCBTZWN1cml0eSBMaWJyYXJ5IChodHRwOi8vd3d3LmFs&lt;br /&gt;
ZWtzZXkuY29tL3htbHNlYykxHjAcBgNVBAsTFVRlc3QgUm9vdCBDZXJ0aWZpY2F0ZTEWMBQGA1UE&lt;br /&gt;
AxMNQWxla3NleSBTYW5pbjEhMB8GCSqGSIb3DQEJARYSeG1sc2VjQGFsZWtzZXkuY29tMB4XDTE1&lt;br /&gt;
MDUxMzA4MzEyMloXDTE2MDUxMjA4MzEyMlowVDELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUt&lt;br /&gt;
U3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDENMAsGA1UEAwwEdGVzdDCC&lt;br /&gt;
ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJpYOcMfY1nHT2AeeMx/pCLGeYHhWpXGsFeH&lt;br /&gt;
DoNTOp9dXw4pLWlYk02N8j7c4yRlXPnKKqAEXp0aoNuzZGI99qH8XNHvZPfnZStAV5f7aAZkXp0r&lt;br /&gt;
kcb8jt4lU7Tdc9wB2QzKZoY9qG7O9isxYPl5zSeOzGAUMd6C+qN9MHEjZo/ydr1K9SZ3sdmeXZ9f&lt;br /&gt;
PXl2nRLMWCixpsLDuTnLNMsmI+rmvIvvwlpiwNn81XYndLX3vgK08VS6gOozgXa1DHCcOQ5+VS2D&lt;br /&gt;
m8lJ3VYGuO5N/vn8tvfYQEb1/AjgxoXXUHg7oW9Is/bYkIiJq00SFMpHu1adchwhys3+hNltnyiy&lt;br /&gt;
h/0CAwEAAaN7MHkwCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQg&lt;br /&gt;
Q2VydGlmaWNhdGUwHQYDVR0OBBYEFMx99EfHBvUhCn6Q+ByacE1jkXVQMB8GA1UdIwQYMBaAFNpG&lt;br /&gt;
6Wvmr9M9quUhS1LtymYo4P6FMA0GCSqGSIb3DQEBCwUAA4GBAEdZ6Bidq3ZGURdRkCiU+rKYpQx/&lt;br /&gt;
HkW/ibIbrIZowaAIcqC8AkmLB4nrPX+DODU6huiwzPrTk4JyHwEnHhtJRJh3cknAwVTDz6slbEpa&lt;br /&gt;
eT7Biv5klcoOAljRF3NZKwVJGqDZMEPdK0ofGhp6i5JlZ7dwzXir57+JVGxwhyRikl/u&amp;lt;/X509Certificate&amp;gt;&amp;lt;/X509Data&amp;gt;&amp;lt;/KeyInfo&amp;gt;&amp;lt;/Signature&amp;gt;&amp;lt;/sample&amp;gt;&lt;/blockquote&gt;
&lt;h2&gt;
検証&lt;/h2&gt;
&lt;a href=&quot;https://www.aleksey.com/xmlsec/xmldsig-verifier.html&quot; target=&quot;_blank&quot;&gt;Online XML Digital Signature Verifer&lt;/a&gt;で検証する。&lt;br /&gt;
&lt;br /&gt;
無事、検証終了。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
RESULT: Signature is OK&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
= VERIFICATION CONTEXT&lt;br /&gt;
== Status: succeeded&lt;br /&gt;
== flags: 0x00000000&lt;br /&gt;
== flags2: 0x00000000&lt;br /&gt;
== Key Info Read Ctx:&lt;br /&gt;
= KEY INFO READ CONTEXT&lt;br /&gt;
== flags: 0x00000000&lt;br /&gt;
== flags2: 0x00000000&lt;br /&gt;
== enabled key data: all&lt;br /&gt;
== RetrievalMethod level (cur/max): 0/1&lt;br /&gt;
== TRANSFORMS CTX (status=0)&lt;br /&gt;
== flags: 0x00000000&lt;br /&gt;
== flags2: 0x00000000&lt;br /&gt;
== enabled transforms: all&lt;br /&gt;
=== uri: NULL&lt;br /&gt;
=== uri xpointer expr: NULL&lt;br /&gt;
== EncryptedKey level (cur/max): 0/1&lt;br /&gt;
=== KeyReq:&lt;br /&gt;
==== keyId: rsa&lt;br /&gt;
==== keyType: 0x00000001&lt;br /&gt;
==== keyUsage: 0x00000002&lt;br /&gt;
==== keyBitsSize: 0&lt;br /&gt;
=== list size: 0&lt;br /&gt;
== Key Info Write Ctx:&lt;br /&gt;
= KEY INFO WRITE CONTEXT&lt;br /&gt;
== flags: 0x00000000&lt;br /&gt;
== flags2: 0x00000000&lt;br /&gt;
== enabled key data: all&lt;br /&gt;
== RetrievalMethod level (cur/max): 0/1&lt;br /&gt;
== TRANSFORMS CTX (status=0)&lt;br /&gt;
== flags: 0x00000000&lt;br /&gt;
== flags2: 0x00000000&lt;br /&gt;
== enabled transforms: all&lt;br /&gt;
=== uri: NULL&lt;br /&gt;
=== uri xpointer expr: NULL&lt;br /&gt;
== EncryptedKey level (cur/max): 0/1&lt;br /&gt;
=== KeyReq:&lt;br /&gt;
==== keyId: NULL&lt;br /&gt;
==== keyType: 0x00000001&lt;br /&gt;
==== keyUsage: 0xffffffff&lt;br /&gt;
==== keyBitsSize: 0&lt;br /&gt;
=== list size: 0&lt;br /&gt;
== Signature Transform Ctx:&lt;br /&gt;
== TRANSFORMS CTX (status=2)&lt;br /&gt;
== flags: 0x00000000&lt;br /&gt;
== flags2: 0x00000000&lt;br /&gt;
== enabled transforms: all&lt;br /&gt;
=== uri: NULL&lt;br /&gt;
=== uri xpointer expr: NULL&lt;br /&gt;
=== Transform: exc-c14n (href=http://www.w3.org/2001/10/xml-exc-c14n#)&lt;br /&gt;
=== Transform: rsa-sha1 (href=http://www.w3.org/2000/09/xmldsig#rsa-sha1)&lt;br /&gt;
=== Transform: membuf-transform (href=NULL)&lt;br /&gt;
== Signature Method:&lt;br /&gt;
=== Transform: rsa-sha1 (href=http://www.w3.org/2000/09/xmldsig#rsa-sha1)&lt;br /&gt;
== Signature Key:&lt;br /&gt;
== KEY&lt;br /&gt;
=== method: RSAKeyValue&lt;br /&gt;
=== key type: Private&lt;br /&gt;
=== key usage: -1&lt;br /&gt;
=== key not valid before: 1431505882&lt;br /&gt;
=== key not valid after: 1463041882&lt;br /&gt;
=== rsa key: size = 2048&lt;br /&gt;
=== list size: 1&lt;br /&gt;
=== X509 Data:&lt;br /&gt;
==== Key Certificate:&lt;br /&gt;
==== Subject Name: /C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/CN=test&lt;br /&gt;
==== Issuer Name: /C=US/ST=California/O=XML Security Library (http://www.aleksey.com/xmlsec)/OU=Test Root Certificate/CN=Aleksey Sanin/emailAddress=xmlsec@aleksey.com&lt;br /&gt;
==== Issuer Serial: 1&lt;br /&gt;
==== Certificate:&lt;br /&gt;
==== Subject Name: /C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/CN=test&lt;br /&gt;
==== Issuer Name: /C=US/ST=California/O=XML Security Library (http://www.aleksey.com/xmlsec)/OU=Test Root Certificate/CN=Aleksey Sanin/emailAddress=xmlsec@aleksey.com&lt;br /&gt;
==== Issuer Serial: 1&lt;br /&gt;
== SignedInfo References List:&lt;br /&gt;
=== list size: 1&lt;br /&gt;
= REFERENCE VERIFICATION CONTEXT&lt;br /&gt;
== Status: succeeded&lt;br /&gt;
== URI: &quot;&quot;&lt;br /&gt;
== Reference Transform Ctx:&lt;br /&gt;
== TRANSFORMS CTX (status=2)&lt;br /&gt;
== flags: 0x00000000&lt;br /&gt;
== flags2: 0x00000000&lt;br /&gt;
== enabled transforms: all&lt;br /&gt;
=== uri: NULL&lt;br /&gt;
=== uri xpointer expr: NULL&lt;br /&gt;
=== Transform: enveloped-signature (href=http://www.w3.org/2000/09/xmldsig#enveloped-signature)&lt;br /&gt;
=== Transform: c14n (href=http://www.w3.org/TR/2001/REC-xml-c14n-20010315)&lt;br /&gt;
=== Transform: sha1 (href=http://www.w3.org/2000/09/xmldsig#sha1)&lt;br /&gt;
=== Transform: membuf-transform (href=NULL)&lt;br /&gt;
== Digest Method:&lt;br /&gt;
=== Transform: sha1 (href=http://www.w3.org/2000/09/xmldsig#sha1)&lt;br /&gt;
== Manifest References List:&lt;br /&gt;
=== list size: 0&lt;/blockquote&gt;
ポイントはダイジェスト値、署名を行う対象となるXML文書の正規化。&lt;br /&gt;
&lt;br /&gt;
署名前、署名後のXML文書からは改行やEOFを削除する。&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;h3&gt;
参考文献&lt;/h3&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;http://www.w3.org/TR/xmldsig-core/&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;仕様。拾い読みしただけ。ちゃんと読まないと。&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;https://www.aleksey.com/xmlsec/xmldsig-verifier.html&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;XMLSec Cライブラリのサイト。ここのOnline Validatorにはお世話になった。&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;http://www.atmarkit.co.jp/ait/articles/0207/24/news001.html&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;日本語。わかりやすい。&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;http://www.di-mgt.com.au/xmldsig.html&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;一番お世話になったサイト。SignedInfo要素へ署名する際、改行コードやEOFがあるといけないようなのだが、このサイトのバイナリダンプをみるまでそれがわからなかった。&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;http://www.w3.org/TR/xml-c14n11/&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;XML正規化仕様。ちゃんと読んでいない。 &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/3397968771922041485/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2015/05/xml.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/3397968771922041485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/3397968771922041485'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2015/05/xml.html' title='XML文書に電子署名をしてみる'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-49924045354469346</id><published>2014-11-22T23:44:00.000+09:00</published><updated>2014-11-22T23:44:03.691+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="lido"/><category scheme="http://www.blogger.com/atom/ns#" term="oai-pmh"/><category scheme="http://www.blogger.com/atom/ns#" term="oaicatmuseum"/><title type='text'>OAICatMuseum 1.1のインストール</title><content type='html'>LIDO対応のOAI-PMHプロバイダを探していたところOAICatMuseumを見つけたので、試してみた。&lt;br /&gt;
&lt;br /&gt;
OAICatMuseum now supports the LIDO XML Schema&lt;br /&gt;
&lt;a href=&quot;http://hangingtogether.org/?p=1730&quot;&gt;http://hangingtogether.org/?p=1730&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
OAICatMuseum 1.0&lt;br /&gt;
&lt;a href=&quot;http://oclc.org/research/activities/oaicatmuseum.html&quot;&gt;http://oclc.org/research/activities/oaicatmuseum.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
インストール環境&lt;/h2&gt;
インストール環境は以下のとおり。&lt;br /&gt;
&lt;br /&gt;
# cat /etc/redhat-release&lt;br /&gt;
CentOS release 6.6 (Final)&lt;br /&gt;
# yum install tomcat6&lt;br /&gt;
# yum install mysql-connector-java&lt;br /&gt;
# yum install mysql-server&lt;br /&gt;
&lt;br /&gt;
tomcat のバージョンはtomcat6-6.0.24-80&lt;br /&gt;
&lt;br /&gt;
mysqlサーバのバージョンはmysql-server-5.1.73-3&lt;br /&gt;
&lt;br /&gt;
















&lt;br /&gt;
&lt;h2&gt;
インストール&lt;/h2&gt;
OAICatMuseumの&lt;a href=&quot;http://oclc.org/research/activities/oaicatmuseum.html&quot; target=&quot;_blank&quot;&gt;ダウンロードサイト&lt;/a&gt;より、oaicatmuseum_1.1.warとoaicatdb.sqlを取ってくる。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; # curl -o oaicatmuseum_1.1.war http://www.oclc.org/content/dam/research/activities/oaicatmuseum/oaicatmuseum_1.1.war&lt;br /&gt;&amp;nbsp; &amp;nbsp; # curl -o oaicatdb.sql http://www.oclc.org/content/dam/research/activities/oaicatmuseum/oaicatdb.sql&lt;/blockquote&gt;
&amp;nbsp; &lt;br /&gt;
oaicatmuseum_1.1.warをtomcat webappsディレクトリに置く。&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; # cp /usr/local/src/oaicatmuseum_1.1.war /usr/share/tomcat6/webapps/&lt;/blockquote&gt;
&amp;nbsp; &lt;br /&gt;
mysqlにデータベースを作成し、oaicatdb.sqlをインポートする。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; # mysqladmin -u root create oaicatdb&lt;br /&gt;&amp;nbsp; &amp;nbsp; # mysql -u root oaicatdb &amp;lt; /usr/local/src/oaicatdb.sql&lt;br /&gt;&amp;nbsp; &amp;nbsp; # cd /usr/share/tomcat6/webapps/oaicatmuseum_1.1&lt;/blockquote&gt;
&amp;nbsp; &lt;br /&gt;
作成したデータベースにアクセス可能なユーザを用意する。&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; mysql&amp;gt; GRANT SELECT ON oaicatdb.* TO &#39;oaicatdb&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;oaicatdb!&#39;;&lt;/blockquote&gt;
&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
mysql-connector-java.jarをoaicatmuseum_1.1/WEB-INF/lib/にコピーする。&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; # cp /usr/share/java/mysql-connector-java.jar /usr/share/tomcat6/webapps/oaicatmuseum_1.1/WEB-INF/lib/&lt;/blockquote&gt;
&amp;nbsp; &lt;br /&gt;
oaicat.properties.lidoをリネームする。&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; # cp /usr/share/tomcat6/webapps/oaicatmuseum_1.1/WEB-INF/classes/oaicat.properties.lido /usr/share/tomcat6/webapps/oaicatmuseum_1.1/WEB-INF/classes/oaicat.properties&lt;/blockquote&gt;
&amp;nbsp; &lt;br /&gt;
oaicat.propertiesのデータベース設定を修正する。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; # vi /usr/share/tomcat6/webapps/oaicatmuseum_1.1/WEB-INF/classes/oaicat.properties&lt;br /&gt;&amp;nbsp; &amp;nbsp; JDBCLimitedOAICatalog.jdbcDriverName=com.mysql.jdbc.Driver&lt;br /&gt;&amp;nbsp; &amp;nbsp; JDBCLimitedOAICatalog.jdbcURL=jdbc:mysql://localhost:3306/oaicatdb&lt;br /&gt;&amp;nbsp; &amp;nbsp; JDBCLimitedOAICatalog.jdbcLogin=oaicatdb&lt;br /&gt;&amp;nbsp; &amp;nbsp; JDBCLimitedOAICatalog.jdbcPasswd=oaicatdb!&lt;br /&gt;&amp;nbsp; &amp;nbsp; JDBCLimitedOAICatalog.isPersistentConnection=true&lt;/blockquote&gt;
&lt;br /&gt;
tomcatを(再)起動する。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; /etc/init.d/tomcat6 start&lt;/blockquote&gt;
&amp;nbsp; &lt;br /&gt;
あとは以下URLにアクセスするだけ。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; http://host:8080/oaicatmuseum_1.1/&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
GetReord URLの例。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; http://host:8080/oaicatmuseum_1.1/OAIHandler?verb=GetRecord&amp;amp;identifier=oai:oaicat.oclc.org:oai/1&amp;amp;metadataPrefix=lido&lt;/blockquote&gt;
&lt;br /&gt;
&lt;h2&gt;
結果&lt;/h2&gt;
&lt;br /&gt;
基本は上記手順でLIDO XMLを出力できるはずなのだが、なぜかCDWA LITE形式で出力されてきた。&lt;br /&gt;
&lt;br /&gt;
設定が他にあるのかもしれないが、ドキュメントにはとくに記されていなかったので、直接oaicatdb.sqlを書き換えてLIDO XMLを出力できるようにした。&lt;br /&gt;
&lt;br /&gt;
コンテンツとしてはwww.lido-schema.orgのexamplesを利用した。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;http://www.lido-schema.org/documents/examples/LIDO-Example_FMobj00154983-LaPrimavera.xml&lt;/li&gt;
&lt;li&gt;http://www.lido-schema.org/documents/examples/LIDO-Example_FMobj20344012-Fontana_del_Moro.xml&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
修正後のファイルはこちら。単に格納するXMLファイルをLIDOのものにしただけ。5レコードあるが内容は重複している（サンプルが2種類しかないため）。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://goo.gl/0fFmnS&quot;&gt;http://goo.gl/0fFmnS&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
これをインポートして、&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; mysql -u root oaicatdb &amp;lt; /usr/local/src/oaicatdb2.sql&lt;/blockquote&gt;
&amp;nbsp; &lt;br /&gt;
再度GetReord URLにアクセスすると無事LIDO XMLが出力されてきた。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; http://host:8080/oaicatmuseum_1.1/OAIHandler?verb=GetRecord&amp;amp;identifier=oai:oaicat.oclc.org:oai/1&amp;amp;metadataPrefix=lido&lt;/blockquote&gt;
&lt;div&gt;
これでLIDOハーベスタの試験ができる。&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/49924045354469346/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2014/11/oaicatmuseum-11.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/49924045354469346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/49924045354469346'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2014/11/oaicatmuseum-11.html' title='OAICatMuseum 1.1のインストール'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-3194988055347762801</id><published>2014-11-22T22:58:00.000+09:00</published><updated>2016-08-02T00:47:52.587+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="google earth"/><category scheme="http://www.blogger.com/atom/ns#" term="KML"/><category scheme="http://www.blogger.com/atom/ns#" term="plotKML"/><category scheme="http://www.blogger.com/atom/ns#" term="R"/><category scheme="http://www.blogger.com/atom/ns#" term="visualization"/><title type='text'>plotKMLのメモ</title><content type='html'>plotKML(http://plotkml.r-forge.r-project.org/)が面白い。&lt;br /&gt;
&lt;br /&gt;
RでKMLを処理するためのパッケージ、簡単にKMLを生成できてしまう。&lt;br /&gt;
&lt;br /&gt;
たとえば、こんな感じの可視化が簡単にできる。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1d_BIV8GEZDPsNA7x60I6uwzB2pSM858BCiSVlhDGbFn-EBEoIlnz_wLFb_fT-03u9mhhlebaYSs34KyZz0kC7shoTzg3dqotTT8AN48c5S3A34-iSLogRAk1Ybt48w_g02kM1fj1Jh94/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2014-05-23+3.12.09.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;281&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1d_BIV8GEZDPsNA7x60I6uwzB2pSM858BCiSVlhDGbFn-EBEoIlnz_wLFb_fT-03u9mhhlebaYSs34KyZz0kC7shoTzg3dqotTT8AN48c5S3A34-iSLogRAk1Ybt48w_g02kM1fj1Jh94/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2014-05-23+3.12.09.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Rスクリプトはこんな感じ。&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
&lt;code&gt;
library(maptools)
library(plotKML)
shp&lt;-readShapePoly(&quot;h22ka18207.shp&quot;)
proj4string(shp) &lt;- CRS(&quot;+proj=longlat +datum=WGS84&quot;)
z&lt;-shp@data$JINKOz[z==0&lt;-1
kml(shp,labels=iconv(shp@data$MOJI,to=&quot;UTF8&quot;,from=&quot;SJIS&quot;),altitude=z,colour=&quot;#ff00ff&quot;,alpha=0.75,plot.lab=TRUE)
&lt;/code&gt;
&lt;/pre&gt;

&lt;br /&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
Shapefileはe-Statからダウンロードしてきたもの使った。&lt;br /&gt;
&lt;br /&gt;
バブルチャートっぽく表示する場合はこんな感じ。&lt;br /&gt;
&lt;pre&gt;
&lt;code&gt;
data &lt;- data.frame(x=shp@data$X_CODE,y=shp@data$Y_CODE,id=shp@data$KEY_CODE,label=iconv(shp@data$MOJI,to=&quot;UTF8&quot;,from=&quot;SJIS&quot;),jinko=shp@data$JINKO)
coordinates(data) &lt;- ~x+y
proj4string(data)&lt;-CRS(&quot;+proj=longlat +datum=WGS84&quot;)
kml(data,shape=&quot;http://maps.google.com/mapfiles/kml/pal2/icon18.png&quot;,color=&quot;#ff0000&quot;,size=jinko,labels=label)
&lt;/code&gt;
&lt;/pre&gt;

&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB3KsOflfOdYQWLGdAGi_T98eUXbv63ugdgUpvm4mLgNZchazcuSDDKHzMP57-Bq6jkDWL6PTplP3AqFzHQVk9BsNRDwVJKWzcSjWKVt_X6uOvqyY_rMfxeNrx1lsOHtnLAiTRUshxfUAt/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2014-05-23+3.31.39.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;281&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB3KsOflfOdYQWLGdAGi_T98eUXbv63ugdgUpvm4mLgNZchazcuSDDKHzMP57-Bq6jkDWL6PTplP3AqFzHQVk9BsNRDwVJKWzcSjWKVt_X6uOvqyY_rMfxeNrx1lsOHtnLAiTRUshxfUAt/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2014-05-23+3.31.39.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
公式ページをみるとアニメーションにも対応してる模様。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
KMLを書き起こすのは面倒だけど、これなら簡単。&lt;br /&gt;
&lt;br /&gt;
何かの時に役立つかもしれない。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/3194988055347762801/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2014/11/plotkml.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/3194988055347762801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/3194988055347762801'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2014/11/plotkml.html' title='plotKMLのメモ'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1d_BIV8GEZDPsNA7x60I6uwzB2pSM858BCiSVlhDGbFn-EBEoIlnz_wLFb_fT-03u9mhhlebaYSs34KyZz0kC7shoTzg3dqotTT8AN48c5S3A34-iSLogRAk1Ybt48w_g02kM1fj1Jh94/s72-c/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2014-05-23+3.12.09.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-2294565346241951855</id><published>2013-11-13T21:59:00.001+09:00</published><updated>2013-11-13T21:59:51.823+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="google"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="KML"/><title type='text'>WebGL Globeを利用した可視化実験</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;http://www.chromeexperiments.com/globe&quot; target=&quot;_blank&quot;&gt;&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;56243ad8-0ba6-4391-88df-594c95ca239a&quot; ginger_sofatware_uiphraseguid=&quot;8a93cf43-9b80-401f-830e-56ae1c48f0a8&quot; grcontextid=&quot;WebGL:0&quot;&gt;WebGL&lt;/span&gt; Globe&lt;/a&gt;はgoogleが作ったオープンソースの地理情報可視化プラットフォーム&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
本気で頑張ると&lt;a href=&quot;http://workshop.chromeexperiments.com/projects/armsglobe/&quot; target=&quot;_blank&quot;&gt;こんなもの&lt;/a&gt;も作れるらしい&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
とりあえず練習がてら、USGSのGeoJSONを可視化してみる。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
ベースはwebgl globeのindex.html。&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;762415b4-6e26-4e5a-87c4-e218f5200908&quot; ginger_sofatware_uiphraseguid=&quot;3f73ea78-4944-41f7-87c2-3ec9c52acb41&quot; grcontextid=&quot;if:0&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;d8d192de-8057-4b7f-80cf-087e7b55e075&quot; ginger_sofatware_uiphraseguid=&quot;3f73ea78-4944-41f7-87c2-3ec9c52acb41&quot; grcontextid=&quot;(:1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;774b0633-af23-4b11-bbf5-a2351d7c29da&quot; ginger_sofatware_uiphraseguid=&quot;3f73ea78-4944-41f7-87c2-3ec9c52acb41&quot; grcontextid=&quot;!:2&quot;&gt;!&lt;/span&gt;Detector&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;29926a32-8dbb-4480-a806-73f848396473&quot; ginger_sofatware_uiphraseguid=&quot;3f73ea78-4944-41f7-87c2-3ec9c52acb41&quot; grcontextid=&quot;.:3&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;eb010cd1-39a2-4a42-82d0-2cdbf8de786e&quot; ginger_sofatware_uiphraseguid=&quot;3f73ea78-4944-41f7-87c2-3ec9c52acb41&quot; grcontextid=&quot;webgl:4&quot;&gt;webgl&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;9b2997f4-07e4-44ac-a58a-219589bc2c3b&quot; ginger_sofatware_uiphraseguid=&quot;3f73ea78-4944-41f7-87c2-3ec9c52acb41&quot; grcontextid=&quot;):5&quot;&gt;)&lt;/span&gt;{&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Detector&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;38729749-a087-4cb0-8b79-44f3feec05fa&quot; ginger_sofatware_uiphraseguid=&quot;b2a8eb81-d952-4a66-8dbb-39a432c344e8&quot; grcontextid=&quot;.:0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;156e03d6-9e50-4454-ab40-f1ea99ed6cfd&quot; ginger_sofatware_uiphraseguid=&quot;b2a8eb81-d952-4a66-8dbb-39a432c344e8&quot; grcontextid=&quot;addGetWebGLMessage:1&quot;&gt;addGetWebGLMessage&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;d2fe80da-1fa4-427a-9af1-f492cc77bcb3&quot; ginger_sofatware_uiphraseguid=&quot;b2a8eb81-d952-4a66-8dbb-39a432c344e8&quot; grcontextid=&quot;(:2&quot;&gt;(&lt;/span&gt;);&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;}&amp;nbsp;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;7a1e22ca-2222-47a2-8d96-31f8720c62e0&quot; ginger_sofatware_uiphraseguid=&quot;cca21f44-9211-45ca-a117-92435e8f2021&quot; grcontextid=&quot;else:0&quot;&gt;else&lt;/span&gt;&amp;nbsp;{&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;4629d172-d484-422b-88e5-3fc3271c1a66&quot; ginger_sofatware_uiphraseguid=&quot;1fb286f0-a0c8-4c4e-a87c-372768b6e5a2&quot; grcontextid=&quot;var:0&quot;&gt;var&lt;/span&gt;&amp;nbsp;container = document&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;c4128758-522b-40ad-b1c2-c25b5a09d148&quot; ginger_sofatware_uiphraseguid=&quot;1fb286f0-a0c8-4c4e-a87c-372768b6e5a2&quot; grcontextid=&quot;.:1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;8fa1e6f3-455b-46dc-96e2-c1535eaae6c6&quot; ginger_sofatware_uiphraseguid=&quot;1fb286f0-a0c8-4c4e-a87c-372768b6e5a2&quot; grcontextid=&quot;getElementById:2&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;f8d79e8a-cab0-44cd-8598-4f0143074282&quot; ginger_sofatware_uiphraseguid=&quot;1fb286f0-a0c8-4c4e-a87c-372768b6e5a2&quot; grcontextid=&quot;(:3&quot;&gt;(&lt;/span&gt;&#39;container&#39;)&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;43073e63-fb93-475d-a255-b8ce47e3102e&quot; ginger_sofatware_uiphraseguid=&quot;d683acfb-7a66-41a7-908f-651461077b0b&quot; grcontextid=&quot;;:12&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;55e89093-fed7-4deb-8a14-5caf407e320f&quot; ginger_sofatware_uiphraseguid=&quot;d683acfb-7a66-41a7-908f-651461077b0b&quot; grcontextid=&quot;var:13&quot;&gt;var&lt;/span&gt; globe = DAT&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;a8e4228e-8fcb-4e3c-9f1c-d487c61b8c9c&quot; ginger_sofatware_uiphraseguid=&quot;d683acfb-7a66-41a7-908f-651461077b0b&quot; grcontextid=&quot;.:14&quot;&gt;.&lt;/span&gt;Globe&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;4fbe7e00-852f-4bd0-a9c2-c00032eb0098&quot; ginger_sofatware_uiphraseguid=&quot;d683acfb-7a66-41a7-908f-651461077b0b&quot; grcontextid=&quot;(:15&quot;&gt;(&lt;/span&gt;document&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;4de57894-379c-4185-8886-8c0454a062ad&quot; ginger_sofatware_uiphraseguid=&quot;d683acfb-7a66-41a7-908f-651461077b0b&quot; grcontextid=&quot;.:16&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;3a993495-c8e6-483b-99e2-26fd1695ea28&quot; ginger_sofatware_uiphraseguid=&quot;d683acfb-7a66-41a7-908f-651461077b0b&quot; grcontextid=&quot;getElementById:17&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;f0ab8bf1-7ec2-4893-9065-143132d5c8b6&quot; ginger_sofatware_uiphraseguid=&quot;d683acfb-7a66-41a7-908f-651461077b0b&quot; grcontextid=&quot;(:18&quot;&gt;(&lt;/span&gt;‘container&#39;), function&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;6392667c-c433-4cf1-9b67-2b907176e243&quot; ginger_sofatware_uiphraseguid=&quot;d683acfb-7a66-41a7-908f-651461077b0b&quot; grcontextid=&quot;(:19&quot;&gt;(&lt;/span&gt;label) {return new THREE&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;58566981-4194-42b8-8f49-7174959e8b1d&quot; ginger_sofatware_uiphraseguid=&quot;d683acfb-7a66-41a7-908f-651461077b0b&quot; grcontextid=&quot;.:20&quot;&gt;.&lt;/span&gt;Color&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;e58068ed-127b-4a68-8533-946d2d662e46&quot; ginger_sofatware_uiphraseguid=&quot;d683acfb-7a66-41a7-908f-651461077b0b&quot; grcontextid=&quot;(:21&quot;&gt;(&lt;/span&gt;[0x87e7b0,0x87e7b0,0x87e7b0,0x87e7b0,0xcbf299,0xfcd1d1,0xff2800,0x9a0079&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;3ee4c2bc-6e36-4a15-b296-daa23f4fe5a7&quot; ginger_sofatware_uiphraseguid=&quot;d683acfb-7a66-41a7-908f-651461077b0b&quot; grcontextid=&quot;]:22&quot;&gt;]&lt;/span&gt;[label]);})&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;4b9f32ee-757e-454e-a9a3-d2800fd5deed&quot; ginger_sofatware_uiphraseguid=&quot;d683acfb-7a66-41a7-908f-651461077b0b&quot; grcontextid=&quot;;:23&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;f9fa5d1b-30c2-4dd2-869a-e937fcd7e9e4&quot; ginger_sofatware_uiphraseguid=&quot;592e8294-c2ae-421d-bc73-5ee670c73b74&quot; grcontextid=&quot;var:0&quot;&gt;var&lt;/span&gt;&amp;nbsp;script = document&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;85c1b022-c95f-401f-beb5-16aeb3e08ef8&quot; ginger_sofatware_uiphraseguid=&quot;592e8294-c2ae-421d-bc73-5ee670c73b74&quot; grcontextid=&quot;.:1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;2ea4cd3f-2446-4296-8851-31dad61cda3e&quot; ginger_sofatware_uiphraseguid=&quot;592e8294-c2ae-421d-bc73-5ee670c73b74&quot; grcontextid=&quot;createElement:2&quot;&gt;createElement&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;dc918bbe-6539-4ddf-b092-b5be182ef2b7&quot; ginger_sofatware_uiphraseguid=&quot;592e8294-c2ae-421d-bc73-5ee670c73b74&quot; grcontextid=&quot;(:3&quot;&gt;(&lt;/span&gt;&#39;script&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;14f547b8-0cdf-42c2-b5b0-500e9714586d&quot; ginger_sofatware_uiphraseguid=&quot;7dc3e292-7781-411a-b258-13924c939bb9&quot; grcontextid=&quot;script:0&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;2df4d56e-d75d-4130-8575-0c972ae481c6&quot; ginger_sofatware_uiphraseguid=&quot;7dc3e292-7781-411a-b258-13924c939bb9&quot; grcontextid=&quot;.:1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;b70f17b6-0144-493a-94c3-b403672c03b9&quot; ginger_sofatware_uiphraseguid=&quot;7dc3e292-7781-411a-b258-13924c939bb9&quot; grcontextid=&quot;src:2&quot;&gt;src&lt;/span&gt;&amp;nbsp;= &#39;http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_month.geojsonp&#39;;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;f7ecbb8c-792e-451b-9d5c-7921d5185f44&quot; ginger_sofatware_uiphraseguid=&quot;a7484ae7-6e72-42b4-85e1-0904eebd5220&quot; grcontextid=&quot;document:0&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;47f00d56-6775-4e4e-bb96-85f52e90196f&quot; ginger_sofatware_uiphraseguid=&quot;a7484ae7-6e72-42b4-85e1-0904eebd5220&quot; grcontextid=&quot;.:1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;a0323702-c6ab-41a3-bc1f-93d9cd57028f&quot; ginger_sofatware_uiphraseguid=&quot;a7484ae7-6e72-42b4-85e1-0904eebd5220&quot; grcontextid=&quot;getElementsByTagName:2&quot;&gt;getElementsByTagName&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;636489a6-47a2-4b2c-85d3-062925a3ac09&quot; ginger_sofatware_uiphraseguid=&quot;a7484ae7-6e72-42b4-85e1-0904eebd5220&quot; grcontextid=&quot;(:3&quot;&gt;(&lt;/span&gt;&#39;head&#39;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;f4b6ce24-42ea-44d0-9d99-677a6443a421&quot; ginger_sofatware_uiphraseguid=&quot;a7484ae7-6e72-42b4-85e1-0904eebd5220&quot; grcontextid=&quot;):4&quot;&gt;)&lt;/span&gt;[0]&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;d93a900e-1a41-4196-9b79-ac8a6f9fd03f&quot; ginger_sofatware_uiphraseguid=&quot;a7484ae7-6e72-42b4-85e1-0904eebd5220&quot; grcontextid=&quot;.:5&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;b329ad73-559e-41bf-a5c2-8a110760d3c0&quot; ginger_sofatware_uiphraseguid=&quot;a7484ae7-6e72-42b4-85e1-0904eebd5220&quot; grcontextid=&quot;appendChild:6&quot;&gt;appendChild&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;003a854b-9d58-4b25-bd31-d66de2ffd36a&quot; ginger_sofatware_uiphraseguid=&quot;a7484ae7-6e72-42b4-85e1-0904eebd5220&quot; grcontextid=&quot;(:7&quot;&gt;(&lt;/span&gt;script);&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;991b05b4-ce4b-4532-9789-7f0d1fb53bd9&quot; ginger_sofatware_uiphraseguid=&quot;f92106fc-719d-481e-b736-faeaa6abd3c4&quot; grcontextid=&quot;var:0&quot;&gt;var&lt;/span&gt;&amp;nbsp;eqfeed_callback = function&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;fbf5d244-3faa-4270-8dde-57f2dec32bee&quot; ginger_sofatware_uiphraseguid=&quot;f92106fc-719d-481e-b736-faeaa6abd3c4&quot; grcontextid=&quot;(:1&quot;&gt;(&lt;/span&gt;results&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;0bd4a747-db10-42c5-b8eb-ccd2e8fc02a0&quot; ginger_sofatware_uiphraseguid=&quot;f92106fc-719d-481e-b736-faeaa6abd3c4&quot; grcontextid=&quot;):2&quot;&gt;)&lt;/span&gt;{ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;e535f336-93b6-4fd8-b334-2d874f253a1c&quot; ginger_sofatware_uiphraseguid=&quot;2c567883-0506-4aa1-aeac-1d8981a5004d&quot; grcontextid=&quot;var:0&quot;&gt;var&lt;/span&gt;&amp;nbsp;data = new Array&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;faf9ed74-97a1-4a13-a26d-91bb0dda9b06&quot; ginger_sofatware_uiphraseguid=&quot;2c567883-0506-4aa1-aeac-1d8981a5004d&quot; grcontextid=&quot;(:1&quot;&gt;(&lt;/span&gt;)&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;a7704a40-0cea-4b42-abae-f07cb291ad23&quot; ginger_sofatware_uiphraseguid=&quot;15998d44-6205-4e0a-ad11-024023cbb7d4&quot; grcontextid=&quot;;:6&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;69144e4c-458f-48ff-97c7-4474c0d4b570&quot; ginger_sofatware_uiphraseguid=&quot;ed35e906-e64d-4378-90fd-96712f824d9b&quot; grcontextid=&quot;for:0&quot;&gt;for&lt;/span&gt;&amp;nbsp;(&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;29d64caa-f1bf-4506-94b4-f3daa380e49a&quot; ginger_sofatware_uiphraseguid=&quot;ed35e906-e64d-4378-90fd-96712f824d9b&quot; grcontextid=&quot;var:1&quot;&gt;var&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;b192c44e-a2e7-4f48-aa7c-a6b660a4f989&quot; ginger_sofatware_uiphraseguid=&quot;ed35e906-e64d-4378-90fd-96712f824d9b&quot; grcontextid=&quot;i:2&quot;&gt;i&lt;/span&gt;&amp;nbsp;= 0;&amp;nbsp;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;25bbb5f7-2d2d-4c5d-9cb4-89e5c9fe9223&quot; ginger_sofatware_uiphraseguid=&quot;ed35e906-e64d-4378-90fd-96712f824d9b&quot; grcontextid=&quot;i:3&quot;&gt;i&lt;/span&gt;&amp;nbsp;&amp;lt; results&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;537b8e8c-da08-48b5-9137-fbe8bc181461&quot; ginger_sofatware_uiphraseguid=&quot;ed35e906-e64d-4378-90fd-96712f824d9b&quot; grcontextid=&quot;.:4&quot;&gt;.&lt;/span&gt;features&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;38b77dd8-852f-4eeb-9010-9b71f951e5df&quot; ginger_sofatware_uiphraseguid=&quot;ed35e906-e64d-4378-90fd-96712f824d9b&quot; grcontextid=&quot;.:5&quot;&gt;.&lt;/span&gt;length; i++) {&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;1ff60048-13bf-46d5-81e6-2319054f637f&quot; ginger_sofatware_uiphraseguid=&quot;ba47851c-161f-45a9-849a-fdd252840282&quot; grcontextid=&quot;data:0&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;fe81ac77-44c4-437a-9d12-bce6cd8db9d7&quot; ginger_sofatware_uiphraseguid=&quot;ba47851c-161f-45a9-849a-fdd252840282&quot; grcontextid=&quot;.:1&quot;&gt;.&lt;/span&gt;push&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;7b117089-01bd-4f21-a30f-d1dcd9a27ad0&quot; ginger_sofatware_uiphraseguid=&quot;ba47851c-161f-45a9-849a-fdd252840282&quot; grcontextid=&quot;(:2&quot;&gt;(&lt;/span&gt;results&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;e2eed71c-8e3a-442f-b526-3b63392471af&quot; ginger_sofatware_uiphraseguid=&quot;ba47851c-161f-45a9-849a-fdd252840282&quot; grcontextid=&quot;.:3&quot;&gt;.&lt;/span&gt;features&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;7d033b02-ddf3-4481-a8fb-64525af98f70&quot; ginger_sofatware_uiphraseguid=&quot;ba47851c-161f-45a9-849a-fdd252840282&quot; grcontextid=&quot;[:4&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;23540bf6-50c8-4379-a88a-c9c329dba18f&quot; ginger_sofatware_uiphraseguid=&quot;ba47851c-161f-45a9-849a-fdd252840282&quot; grcontextid=&quot;i:5&quot;&gt;i&lt;/span&gt;]&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;e2e0c2e8-656f-46cc-9442-147a65354917&quot; ginger_sofatware_uiphraseguid=&quot;ba47851c-161f-45a9-849a-fdd252840282&quot; grcontextid=&quot;.:6&quot;&gt;.&lt;/span&gt;geometry&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;9a204a6d-4c29-4771-9266-10e01142c7a0&quot; ginger_sofatware_uiphraseguid=&quot;ba47851c-161f-45a9-849a-fdd252840282&quot; grcontextid=&quot;[:7&quot;&gt;[&lt;/span&gt;&#39;coordinates&#39;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;2c0951ef-f114-4124-8bab-e77a1e876f9d&quot; ginger_sofatware_uiphraseguid=&quot;ba47851c-161f-45a9-849a-fdd252840282&quot; grcontextid=&quot;]:8&quot;&gt;]&lt;/span&gt;[0]);&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;4a3f2c58-25ba-4be0-9308-480b860cb393&quot; ginger_sofatware_uiphraseguid=&quot;0c1e0e60-4e35-4203-b4c2-3f2abe870fb2&quot; grcontextid=&quot;data:0&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;28bfe2e6-db31-45f2-9aaa-4b954ee597ab&quot; ginger_sofatware_uiphraseguid=&quot;0c1e0e60-4e35-4203-b4c2-3f2abe870fb2&quot; grcontextid=&quot;.:1&quot;&gt;.&lt;/span&gt;push&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;40b22f7f-bf28-4feb-a9f3-d8d05c99f66e&quot; ginger_sofatware_uiphraseguid=&quot;0c1e0e60-4e35-4203-b4c2-3f2abe870fb2&quot; grcontextid=&quot;(:2&quot;&gt;(&lt;/span&gt;results&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;c4c17f32-9b7f-46f4-87df-125385f2978a&quot; ginger_sofatware_uiphraseguid=&quot;0c1e0e60-4e35-4203-b4c2-3f2abe870fb2&quot; grcontextid=&quot;.:3&quot;&gt;.&lt;/span&gt;features&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;9b950dba-6d93-46fa-9088-52c8cfa04181&quot; ginger_sofatware_uiphraseguid=&quot;0c1e0e60-4e35-4203-b4c2-3f2abe870fb2&quot; grcontextid=&quot;[:4&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;20e155e0-68fd-4898-b2c1-c08cc85450d7&quot; ginger_sofatware_uiphraseguid=&quot;0c1e0e60-4e35-4203-b4c2-3f2abe870fb2&quot; grcontextid=&quot;i:5&quot;&gt;i&lt;/span&gt;]&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;ae481b3d-4b82-4bb0-a4ef-91f3c1fa4821&quot; ginger_sofatware_uiphraseguid=&quot;0c1e0e60-4e35-4203-b4c2-3f2abe870fb2&quot; grcontextid=&quot;.:6&quot;&gt;.&lt;/span&gt;geometry&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;36c44198-8053-4ed0-9e0a-59689f639992&quot; ginger_sofatware_uiphraseguid=&quot;0c1e0e60-4e35-4203-b4c2-3f2abe870fb2&quot; grcontextid=&quot;[:7&quot;&gt;[&lt;/span&gt;&#39;coordinates&#39;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;68663ca6-45b8-4286-8d56-3afc3c3f16f6&quot; ginger_sofatware_uiphraseguid=&quot;0c1e0e60-4e35-4203-b4c2-3f2abe870fb2&quot; grcontextid=&quot;]:8&quot;&gt;]&lt;/span&gt;[1]);&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;data.push(results.features[i].properties[&#39;mag&#39;]/30.0);&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;data.push(Math.floor(results.features[i].properties[&#39;mag&#39;]));&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;3c7b3fcd-e0bf-48b1-bdc4-dd7fb344e801&quot; ginger_sofatware_uiphraseguid=&quot;254da4f4-3879-4e28-a705-5405ef128b6e&quot; grcontextid=&quot;globe:0&quot;&gt;globe&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;e95e43dc-b596-46db-8b7c-bbc636b540a8&quot; ginger_sofatware_uiphraseguid=&quot;254da4f4-3879-4e28-a705-5405ef128b6e&quot; grcontextid=&quot;.:1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;2be23bee-a9f2-41ca-8b14-30d5fda838ac&quot; ginger_sofatware_uiphraseguid=&quot;254da4f4-3879-4e28-a705-5405ef128b6e&quot; grcontextid=&quot;addData:2&quot;&gt;addData&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;f333523c-55c6-4783-a084-368111ef3aa7&quot; ginger_sofatware_uiphraseguid=&quot;254da4f4-3879-4e28-a705-5405ef128b6e&quot; grcontextid=&quot;(:3&quot;&gt;(&lt;/span&gt;data, {format: &#39;legend&#39;, name: &#39;earthquakes&#39;, animated: fa&lt;/span&gt;lse});&lt;br /&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;45b41c01-7c71-46cb-b22c-f41d40df46a4&quot; ginger_sofatware_uiphraseguid=&quot;46e3cbf3-ce10-4bed-9b8d-4f37e37f625b&quot; grcontextid=&quot;globe:0&quot;&gt;globe&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;f7341314-f045-44ed-892f-a4decdc40430&quot; ginger_sofatware_uiphraseguid=&quot;46e3cbf3-ce10-4bed-9b8d-4f37e37f625b&quot; grcontextid=&quot;.:1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;08f510ab-d81f-4378-b0f0-1f014e091f14&quot; ginger_sofatware_uiphraseguid=&quot;810068a6-6443-4610-bd60-cacafc99d974&quot; grcontextid=&quot;createPoints:2&quot;&gt;createPoints&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;39c1e413-b3b8-4c7d-ae6f-29d21deaf435&quot; ginger_sofatware_uiphraseguid=&quot;46e3cbf3-ce10-4bed-9b8d-4f37e37f625b&quot; grcontextid=&quot;(:3&quot;&gt;(&lt;/span&gt;)&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;76924db1-8c2d-4d1f-9334-a34f5693753a&quot; ginger_sofatware_uiphraseguid=&quot;8cda9bf2-a880-4a27-8102-9a0715d9d200&quot; grcontextid=&quot;;:4&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;0510169c-647e-4751-9ad8-ca8eba295394&quot; ginger_sofatware_uiphraseguid=&quot;7dba1c5c-679a-4758-a094-f3763ee3cb93&quot; grcontextid=&quot;globe:0&quot;&gt;globe&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;6a36e7ff-96df-4a5c-82b7-d67fd85b326f&quot; ginger_sofatware_uiphraseguid=&quot;7dba1c5c-679a-4758-a094-f3763ee3cb93&quot; grcontextid=&quot;.:1&quot;&gt;.&lt;/span&gt;animate&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;bc946621-eb73-4d76-ac2b-571613d8f9eb&quot; ginger_sofatware_uiphraseguid=&quot;7dba1c5c-679a-4758-a094-f3763ee3cb93&quot; grcontextid=&quot;(:2&quot;&gt;(&lt;/span&gt;)&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;27b081f7-6f13-41b9-80e7-100fc537ea65&quot; ginger_sofatware_uiphraseguid=&quot;8cda9bf2-a880-4a27-8102-9a0715d9d200&quot; grcontextid=&quot;;:7&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;aa0685fd-58a5-4068-8242-e4549a8919a4&quot; ginger_sofatware_uiphraseguid=&quot;d895cb9f-e83b-4eae-86f7-d1996795afad&quot; grcontextid=&quot;document:0&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;515cb971-b900-4dd6-81b3-e4a614cb681b&quot; ginger_sofatware_uiphraseguid=&quot;d895cb9f-e83b-4eae-86f7-d1996795afad&quot; grcontextid=&quot;.:1&quot;&gt;.&lt;/span&gt;body&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;82917b1f-2e9a-492e-9c59-9fe2f16df57a&quot; ginger_sofatware_uiphraseguid=&quot;d895cb9f-e83b-4eae-86f7-d1996795afad&quot; grcontextid=&quot;.:2&quot;&gt;.&lt;/span&gt;style&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;39fb57e7-df18-41ae-86ca-305e2356ec40&quot; ginger_sofatware_uiphraseguid=&quot;d895cb9f-e83b-4eae-86f7-d1996795afad&quot; grcontextid=&quot;.:3&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;087e09ed-afeb-4182-a36e-a13a994a52ef&quot; ginger_sofatware_uiphraseguid=&quot;d895cb9f-e83b-4eae-86f7-d1996795afad&quot; grcontextid=&quot;backgroundImage:4&quot;&gt;backgroundImage&lt;/span&gt;&amp;nbsp;= &#39;none&#39;; // remove loading&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;};&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;}&lt;/span&gt;&lt;/blockquote&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
こんな感じ。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFplfXldCbsrbdCWeNLS3xvWMJAwNhyB13bXtnzX3RoXtrxObYMb1Uiw4K5FJFgY6wE4zBgXX3r1PsLrPCf6Ha7PT60qiXApD_G0f4TJFtCPLZnxAPkFzIbPJiQTbJVF6f78IuuP3Vky54/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-11-13+1.51.47.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;285&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFplfXldCbsrbdCWeNLS3xvWMJAwNhyB13bXtnzX3RoXtrxObYMb1Uiw4K5FJFgY6wE4zBgXX3r1PsLrPCf6Ha7PT60qiXApD_G0f4TJFtCPLZnxAPkFzIbPJiQTbJVF6f78IuuP3Vky54/s400/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-11-13+1.51.47.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
いろいろと試してみよう！&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/2294565346241951855/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2013/11/webgl-globe.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/2294565346241951855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/2294565346241951855'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2013/11/webgl-globe.html' title='WebGL Globeを利用した可視化実験'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFplfXldCbsrbdCWeNLS3xvWMJAwNhyB13bXtnzX3RoXtrxObYMb1Uiw4K5FJFgY6wE4zBgXX3r1PsLrPCf6Ha7PT60qiXApD_G0f4TJFtCPLZnxAPkFzIbPJiQTbJVF6f78IuuP3Vky54/s72-c/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-11-13+1.51.47.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-4078254959162774946</id><published>2013-11-10T23:55:00.002+09:00</published><updated>2013-11-10T23:58:01.723+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="KML"/><category scheme="http://www.blogger.com/atom/ns#" term="R"/><category scheme="http://www.blogger.com/atom/ns#" term="sparql"/><title type='text'>RでSPARQL、結果はKML</title><content type='html'>RでSPARQLが使えないかと検索してみたら、あった。&lt;br /&gt;
&lt;br /&gt;
パッケージ名はそのままのSPARQL。&lt;br /&gt;
&lt;br /&gt;
さっそく、dbpedia.orgのEndpointを使ってテストしてみた。&lt;br /&gt;
&lt;br /&gt;
クエリは以前に使った日本の都道府県の人口を検索するもの。&lt;br /&gt;
&lt;br /&gt;
せっかくなので、検索結果はKMLで出力する。&lt;br /&gt;
&lt;br /&gt;
Google Earthで表示してみると、こんな感じ。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjisL1cUHT7azR_p_OdK0ZAkkQ1GkhVatn5fF7hKTn98QD-tje0y0zMGrONgi8_gF2KzLWamjBArUjcQhs3QAGiyU2ES1jnTsD2AUnU18DAHMunSD5inVmtRNw33W_kz0O8RG48Yhr4-VY6/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-11-08+7.30.32.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;273&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjisL1cUHT7azR_p_OdK0ZAkkQ1GkhVatn5fF7hKTn98QD-tje0y0zMGrONgi8_gF2KzLWamjBArUjcQhs3QAGiyU2ES1jnTsD2AUnU18DAHMunSD5inVmtRNw33W_kz0O8RG48Yhr4-VY6/s400/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-11-08+7.30.32.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
ちょっとデータのウェブを使っている感じがある。&lt;br /&gt;
&lt;br /&gt;
昨今のオープンデータをSPARQLで探してこれるようにすると、面白いかもしれない。(read.csv等で読みこめばいいのだけど、ファイル自体を探してこないといけない)&lt;br /&gt;
&lt;br /&gt;
むかしExcelをRDFに変換して、SPARQLで検索、グラフで表示ということをやっていたけど、あの苦労が嘘のよう。&lt;br /&gt;
&lt;br /&gt;
以下はRのソース。&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;5134b921-c699-4bd2-a66e-ba233edd1279&quot; ginger_sofatware_uiphraseguid=&quot;3dfe4f9e-198f-48a0-a9d0-7952151fd55a&quot; grcontextid=&quot;library:0&quot;&gt;library&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;f937b5d3-9b4f-4363-80b4-1009b87279f5&quot; ginger_sofatware_uiphraseguid=&quot;3dfe4f9e-198f-48a0-a9d0-7952151fd55a&quot; grcontextid=&quot;(:1&quot;&gt;(&lt;/span&gt;SPARQL)&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;951cc2f5-b1b8-490f-86a9-b43e7399e7e1&quot; ginger_sofatware_uiphraseguid=&quot;eddfda4c-4f81-49f5-9a8c-21a9fa7730f9&quot; grcontextid=&quot;library:0&quot;&gt;library&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;d3c42cfa-52eb-41d0-8507-734242d35a4c&quot; ginger_sofatware_uiphraseguid=&quot;eddfda4c-4f81-49f5-9a8c-21a9fa7730f9&quot; grcontextid=&quot;(:1&quot;&gt;(&lt;/span&gt;&quot;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;5010642a-0613-45b6-bd2f-c96806cda4b7&quot; ginger_sofatware_uiphraseguid=&quot;eddfda4c-4f81-49f5-9a8c-21a9fa7730f9&quot; grcontextid=&quot;sp:2&quot;&gt;sp&lt;/span&gt;&quot;)&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;ca274161-ae3e-4e3e-9c43-9ae32695f1fe&quot; ginger_sofatware_uiphraseguid=&quot;9029b8bc-586c-4084-b839-20a69268ac47&quot; grcontextid=&quot;library:0&quot;&gt;library&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;f05305db-38ac-40a5-a917-bd5226d3e7bd&quot; ginger_sofatware_uiphraseguid=&quot;9029b8bc-586c-4084-b839-20a69268ac47&quot; grcontextid=&quot;(:1&quot;&gt;(&lt;/span&gt;&quot;&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;53cf366a-2c6e-4b5a-9c1e-d8043792e0c0&quot; ginger_sofatware_uiphraseguid=&quot;9029b8bc-586c-4084-b839-20a69268ac47&quot; grcontextid=&quot;rgdal:2&quot;&gt;rgdal&lt;/span&gt;&quot;)&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;8f7e4e69-fe80-4bd0-ac36-a3cbb21b73a3&quot; ginger_sofatware_uiphraseguid=&quot;6e4901f4-051b-436e-a33a-708ef3939696&quot; grcontextid=&quot;url:0&quot;&gt;url&lt;/span&gt;&amp;lt;-&quot;http://dbpedia.org/sparql&quot;&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;3dd2cca6-9545-4ec7-80ed-1fd5ae3562dd&quot; ginger_sofatware_uiphraseguid=&quot;982ebb35-8baa-47b5-b285-c06a1ffe7c07&quot; grcontextid=&quot;query:0&quot;&gt;query&lt;/span&gt;&amp;lt;-&quot;PREFIX rdf: &amp;lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&amp;gt;&lt;br /&gt;
PREFIX rdfs: &amp;lt;http://www.w3.org/2000/01/rdf-schema#&amp;gt;&lt;br /&gt;
PREFIX wgs84_pos: &amp;lt;http://www.w3.org/2003/01/geo/wgs84_pos#&amp;gt;&lt;br /&gt;
PREFIX dbpedia-owl: &amp;lt;http://dbpedia.org/ontology/&amp;gt;&lt;br /&gt;
PREFIX &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;f655a702-75be-4527-8cb1-29e3110ca737&quot; ginger_sofatware_uiphraseguid=&quot;05f4f283-99e8-42cc-b43a-98a32a2cfa80&quot; grcontextid=&quot;yago:0&quot;&gt;yago&lt;/span&gt;: &amp;lt;http://dbpedia.org/class/yago/&amp;gt;&lt;br /&gt;
SELECT DISTINCT ?&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;ffc2cb1b-9495-4c51-8dbc-4cbc54210f3b&quot; ginger_sofatware_uiphraseguid=&quot;6b887ce0-981d-4660-8f2c-bc846004b0a3&quot; grcontextid=&quot;title:0&quot;&gt;title&lt;/span&gt; ?&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;6d1dafdf-0145-4d36-8866-332ba3b1c976&quot; ginger_sofatware_uiphraseguid=&quot;6b887ce0-981d-4660-8f2c-bc846004b0a3&quot; grcontextid=&quot;lat:1&quot;&gt;lat&lt;/span&gt; ?&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;c7b87cda-4ff2-4a82-8785-2478853345ae&quot; ginger_sofatware_uiphraseguid=&quot;6b887ce0-981d-4660-8f2c-bc846004b0a3&quot; grcontextid=&quot;lon:2&quot;&gt;lon&lt;/span&gt; ?populationTotal where&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;0dd32a81-82af-4f86-a458-4d62d147788a&quot; ginger_sofatware_uiphraseguid=&quot;6b887ce0-981d-4660-8f2c-bc846004b0a3&quot; grcontextid=&quot;{:4&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;5dc5d0f3-6e66-4039-988b-d37d45756602&quot; ginger_sofatware_uiphraseguid=&quot;e6f8b3a0-a2e7-4124-84ad-eb0478e8187e&quot; grcontextid=&quot;?:0&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;4f547b11-7e66-4f74-aa28-b0cdc6da7148&quot; ginger_sofatware_uiphraseguid=&quot;e6f8b3a0-a2e7-4124-84ad-eb0478e8187e&quot; grcontextid=&quot;s:1&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;2100ad22-330b-490e-bf8b-6502c3b12fe9&quot; ginger_sofatware_uiphraseguid=&quot;e6f8b3a0-a2e7-4124-84ad-eb0478e8187e&quot; grcontextid=&quot;rdf:2&quot;&gt;rdf&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;3dd1f78c-424a-4848-b543-d9dd5229d258&quot; ginger_sofatware_uiphraseguid=&quot;e6f8b3a0-a2e7-4124-84ad-eb0478e8187e&quot; grcontextid=&quot;::3&quot;&gt;:&lt;/span&gt;type &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;6bc5a382-81aa-4d80-817d-813f4bf7db3a&quot; ginger_sofatware_uiphraseguid=&quot;e6f8b3a0-a2e7-4124-84ad-eb0478e8187e&quot; grcontextid=&quot;yago:4&quot;&gt;yago&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;609458c8-29ce-40ca-95fe-d985ef337d5c&quot; ginger_sofatware_uiphraseguid=&quot;e6f8b3a0-a2e7-4124-84ad-eb0478e8187e&quot; grcontextid=&quot;::5&quot;&gt;:&lt;/span&gt;PrefecturesOfJapan .&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;c89bfe67-ea47-4648-afc1-81e59986fd99&quot; ginger_sofatware_uiphraseguid=&quot;8f3b2b04-bbe5-493f-8892-70ecd97b7300&quot; grcontextid=&quot;?:0&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;64bcad4a-5234-46d2-9164-11610009105f&quot; ginger_sofatware_uiphraseguid=&quot;8f3b2b04-bbe5-493f-8892-70ecd97b7300&quot; grcontextid=&quot;s:1&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;3296d65c-31d9-432b-907c-5acbbeac5162&quot; ginger_sofatware_uiphraseguid=&quot;8f3b2b04-bbe5-493f-8892-70ecd97b7300&quot; grcontextid=&quot;rdfs:2&quot;&gt;rdfs&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;6fffcb9a-b8fc-449c-8dcb-4f46c7998922&quot; ginger_sofatware_uiphraseguid=&quot;8f3b2b04-bbe5-493f-8892-70ecd97b7300&quot; grcontextid=&quot;::3&quot;&gt;:&lt;/span&gt;label ?&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;8f007e76-81ae-4475-93c0-aa31f52f3c03&quot; ginger_sofatware_uiphraseguid=&quot;8f3b2b04-bbe5-493f-8892-70ecd97b7300&quot; grcontextid=&quot;title:4&quot;&gt;title&lt;/span&gt; .&lt;br /&gt;
? S dbpedia-owl: populationTotal ?populationTotal .&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;af425cf3-c462-49bc-b112-7e5861c14ed8&quot; ginger_sofatware_uiphraseguid=&quot;c3d649f6-b7e7-4f8c-ab2a-0bcaf3cc8f19&quot; grcontextid=&quot;?:0&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;15b75fd5-26a5-499c-a3bc-27da3544addb&quot; ginger_sofatware_uiphraseguid=&quot;c3d649f6-b7e7-4f8c-ab2a-0bcaf3cc8f19&quot; grcontextid=&quot;s:1&quot;&gt;s&lt;/span&gt; wgs84_pos&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;8f107bec-b9f9-4d49-8772-779356ddb3ab&quot; ginger_sofatware_uiphraseguid=&quot;c3d649f6-b7e7-4f8c-ab2a-0bcaf3cc8f19&quot; grcontextid=&quot;::2&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;8eb0cbb0-2be3-4a14-bb85-fcba4d2e61f7&quot; ginger_sofatware_uiphraseguid=&quot;c3d649f6-b7e7-4f8c-ab2a-0bcaf3cc8f19&quot; grcontextid=&quot;lat:3&quot;&gt;lat&lt;/span&gt; ?&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;01a53e3d-df78-48f6-9908-3429727da21e&quot; ginger_sofatware_uiphraseguid=&quot;c3d649f6-b7e7-4f8c-ab2a-0bcaf3cc8f19&quot; grcontextid=&quot;lat:4&quot;&gt;lat&lt;/span&gt; .&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;8f551272-4109-4680-b399-c50af875888e&quot; ginger_sofatware_uiphraseguid=&quot;295df90f-ef25-44f1-96d9-92f7c8469fd7&quot; grcontextid=&quot;?:0&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;bcfc1c8a-b819-4c11-b981-cf978d91bf16&quot; ginger_sofatware_uiphraseguid=&quot;295df90f-ef25-44f1-96d9-92f7c8469fd7&quot; grcontextid=&quot;s:1&quot;&gt;s&lt;/span&gt; wgs84_pos&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;ba8c740f-ef98-472f-894f-2dc777f2d981&quot; ginger_sofatware_uiphraseguid=&quot;295df90f-ef25-44f1-96d9-92f7c8469fd7&quot; grcontextid=&quot;::2&quot;&gt;:&lt;/span&gt;long ?&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;ef08cb33-9ed8-4731-97ef-0b30f1d08e98&quot; ginger_sofatware_uiphraseguid=&quot;295df90f-ef25-44f1-96d9-92f7c8469fd7&quot; grcontextid=&quot;lon:3&quot;&gt;lon&lt;/span&gt; .&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;63cd85d8-f943-4b6b-b361-62538ee1383e&quot; ginger_sofatware_uiphraseguid=&quot;bd61e5d9-f8d6-460c-9f39-83d984098096&quot; grcontextid=&quot;filter:0&quot;&gt;filter&lt;/span&gt; langMatches(lang(?title),\&quot;en\&quot;) .&lt;br /&gt;
}&quot;&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;1d9c60b4-d52b-42e6-839a-d2bee86ecbbd&quot; ginger_sofatware_uiphraseguid=&quot;a163b855-b130-494a-b346-ef6b71e270d4&quot; grcontextid=&quot;res:0&quot;&gt;res&lt;/span&gt;&amp;lt;-SPARQL&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;1a95c246-0281-4e80-9003-23a1f9b367a3&quot; ginger_sofatware_uiphraseguid=&quot;a163b855-b130-494a-b346-ef6b71e270d4&quot; grcontextid=&quot;(:1&quot;&gt;(&lt;/span&gt;url&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;db624313-d132-4a14-bb33-7f5a6e911296&quot; ginger_sofatware_uiphraseguid=&quot;a163b855-b130-494a-b346-ef6b71e270d4&quot; grcontextid=&quot;,:2&quot;&gt;,&lt;/span&gt;query)&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;59afe5f9-3def-41bf-9e1a-724818b946de&quot; ginger_sofatware_uiphraseguid=&quot;742118e9-d64e-477e-8fe5-8f5524846b65&quot; grcontextid=&quot;d:0&quot;&gt;d&lt;/span&gt;&amp;lt;-res$result&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;e0110931-3c37-4fdc-bad9-4c7365d6991c&quot; ginger_sofatware_uiphraseguid=&quot;e8bd4157-73da-494e-a384-847191b3fe03&quot; grcontextid=&quot;coordinates:0&quot;&gt;coordinates&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;4e010cf9-ae6a-4fe2-a39a-ada35c25fbfb&quot; ginger_sofatware_uiphraseguid=&quot;e8bd4157-73da-494e-a384-847191b3fe03&quot; grcontextid=&quot;(:1&quot;&gt;(&lt;/span&gt;d)&amp;lt;-c&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;bfa418d6-999f-4847-8bfe-16ab4af0ee77&quot; ginger_sofatware_uiphraseguid=&quot;e8bd4157-73da-494e-a384-847191b3fe03&quot; grcontextid=&quot;(:2&quot;&gt;(&lt;/span&gt;&#39;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;9bd9dddf-0074-43eb-896f-09620d0aea81&quot; ginger_sofatware_uiphraseguid=&quot;e8bd4157-73da-494e-a384-847191b3fe03&quot; grcontextid=&quot;lon:3&quot;&gt;lon&lt;/span&gt;&#39;,&#39;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;b4371ff5-4a53-45d5-9aed-097ca54ee9c6&quot; ginger_sofatware_uiphraseguid=&quot;e8bd4157-73da-494e-a384-847191b3fe03&quot; grcontextid=&quot;lat:4&quot;&gt;lat&lt;/span&gt;&#39;)&lt;br /&gt;
proj4string&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;caf12f3e-0f1e-47a3-bb9e-9df6b27605ce&quot; ginger_sofatware_uiphraseguid=&quot;0ada1eba-85e0-4cc5-9c38-367980622236&quot; grcontextid=&quot;(:0&quot;&gt;(&lt;/span&gt;d)&amp;lt;-CRS&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;5cd17efc-ee83-48e5-abb2-52b337239d55&quot; ginger_sofatware_uiphraseguid=&quot;0ada1eba-85e0-4cc5-9c38-367980622236&quot; grcontextid=&quot;(:1&quot;&gt;(&lt;/span&gt;&quot;+init=epsg&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;8d023656-15f0-4983-9126-bdc93f8c8a75&quot; ginger_sofatware_uiphraseguid=&quot;0ada1eba-85e0-4cc5-9c38-367980622236&quot; grcontextid=&quot;::2&quot;&gt;:&lt;/span&gt;2451&quot;)&lt;br /&gt;
writeOGR(d, dsn=&quot;hoge.kml&quot;, layer=&quot;sample&quot;, driver=&quot;KML&quot;)&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/4078254959162774946/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2013/11/rsparqlkml.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/4078254959162774946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/4078254959162774946'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2013/11/rsparqlkml.html' title='RでSPARQL、結果はKML'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjisL1cUHT7azR_p_OdK0ZAkkQ1GkhVatn5fF7hKTn98QD-tje0y0zMGrONgi8_gF2KzLWamjBArUjcQhs3QAGiyU2ES1jnTsD2AUnU18DAHMunSD5inVmtRNw33W_kz0O8RG48Yhr4-VY6/s72-c/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-11-08+7.30.32.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-503505929933242968</id><published>2013-09-29T00:14:00.001+09:00</published><updated>2013-09-29T00:14:25.916+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="esxi"/><title type='text'>ESXiでゲストOSのスナップショットを利用する</title><content type='html'>&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;6188e8c4-6bfa-45b6-8d34-8631d24e3278&quot; ginger_sofatware_uiphraseguid=&quot;9ec9b6e7-6ecc-4d7c-adf7-12d0a38d8e92&quot; grcontextid=&quot;VMWare:0&quot;&gt;VMWare&lt;/span&gt; ESXではゲストOSのスナップショットを作成したり、復帰させたりが簡単にできる。&lt;br /&gt;
&lt;br /&gt;
大きなシステム変更をする場合は、スナップショットを作成しておくと、安心して作業することができる。&lt;br /&gt;
&lt;br /&gt;
以下、スナップショットの利用方法。&lt;br /&gt;
&lt;br /&gt;
バージョンは以下のとおり。&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;~ # &lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;05d09293-32cf-40e5-86c3-98278f94b236&quot; ginger_sofatware_uiphraseguid=&quot;69e218c0-31bf-43dd-91a1-048116b4161f&quot; grcontextid=&quot;esxcli:0&quot;&gt;esxcli&lt;/span&gt; system version get&lt;br /&gt;&amp;nbsp; &amp;nbsp;Product: VMware ESXi&lt;br /&gt;&amp;nbsp; &amp;nbsp;Version: 5.1.0&lt;br /&gt;&amp;nbsp; &amp;nbsp;Build: Releasebuild-799733&lt;br /&gt;&amp;nbsp; &amp;nbsp;Update: 0&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
まずは、ゲストOSのvmidを確認する。&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;~ # vim-cmd vmsvc/&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;e84970b1-f87b-4c68-9368-fe679e66e569&quot; ginger_sofatware_uiphraseguid=&quot;ba617dce-03fd-4993-a7fa-996c412dc98a&quot; grcontextid=&quot;getallvms:0&quot;&gt;getallvms&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;207308ce-fe83-4559-9b61-ea16012f52aa&quot; ginger_sofatware_uiphraseguid=&quot;b932dcb6-ff49-4134-8739-25539ec988cf&quot; grcontextid=&quot;Vmid:0&quot;&gt;Vmid&lt;/span&gt; &amp;nbsp; &amp;nbsp; Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;File &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Guest OS &amp;nbsp; &amp;nbsp; &amp;nbsp;Version &amp;nbsp; Annotation&lt;br /&gt;16 &amp;nbsp; &amp;nbsp; ssh &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[datastore1] ssh/ssh.vmx &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rhel6Guest &amp;nbsp; &amp;nbsp; &amp;nbsp;vmx-07 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;32 &amp;nbsp; &amp;nbsp; www &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[datastore1] www/www.vmx &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rhel6_64Guest &amp;nbsp; vmx-07 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;48 &amp;nbsp; &amp;nbsp; db &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [datastore1] db/db.vmx &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rhel6_64Guest &amp;nbsp; vmx-07 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;64 &amp;nbsp; &amp;nbsp; rdfstore &amp;nbsp; [datastore1] rdfstore/rdfstore.vmx &amp;nbsp; rhel6_64Guest &amp;nbsp; vmx-07 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;80 &amp;nbsp; &amp;nbsp; ubuntu &amp;nbsp; &amp;nbsp; [datastore1] ubuntu/ubuntu.vmx &amp;nbsp; &amp;nbsp; &amp;nbsp; ubuntuGuest &amp;nbsp; &amp;nbsp; vmx-07 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;81 &amp;nbsp; &amp;nbsp; db2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[datastore1] db2/db2.vmx &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; centos64Guest &amp;nbsp; vmx-09&amp;nbsp;&lt;/span&gt;&lt;/blockquote&gt;
ゲストOSのスナップショットを作成するコマンド。&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;ad1c018a-fd79-4ba5-94a7-c8f830327f02&quot; ginger_sofatware_uiphraseguid=&quot;2cb50a04-5651-4d81-8ec3-7bbfed055347&quot; grcontextid=&quot;vim:0&quot;&gt;vim&lt;/span&gt;-cmd vmsvc/snapshot&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;0716db5f-8f62-4097-a6d8-c37940814036&quot; ginger_sofatware_uiphraseguid=&quot;2cb50a04-5651-4d81-8ec3-7bbfed055347&quot; grcontextid=&quot;.:1&quot;&gt;.&lt;/span&gt;create&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;~ # vim-cmd vmsvc/snapshot&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;39a628e7-8488-4e1f-8f4a-0a2129b6ac31&quot; ginger_sofatware_uiphraseguid=&quot;b5311cb0-2fcb-4471-890e-a738ba7e20f7&quot; grcontextid=&quot;.:0&quot;&gt;.&lt;/span&gt;create&lt;br /&gt;Insufficient arguments.&lt;br /&gt;Usage: snapshot.create vmid [snapshotName] [snapshotDescription] [includeMemory] [quiesced]&lt;br /&gt;Creates a snapshot for the &lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;19efb722-5c8b-4201-b042-929dadb58525&quot; ginger_sofatware_uiphraseguid=&quot;c52df80b-602d-40af-a4d7-3b549675cb71&quot; grcontextid=&quot;vm:0&quot;&gt;vm&lt;/span&gt;.&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
コマンドではsnapshotNameはオプションだけど省略すると失敗する。&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;~ # vim-cmd vmsvc/snapshot&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;72dde9f8-62a3-415d-b95d-0f530b611c52&quot; ginger_sofatware_uiphraseguid=&quot;f0238e5a-09d2-4770-92be-4e47a7fa1f73&quot; grcontextid=&quot;.:0&quot;&gt;.&lt;/span&gt;create 16&lt;br /&gt;Create Snapshot:&lt;br /&gt;Create snapshot failed&lt;/span&gt;&lt;/blockquote&gt;
なのでsnapshotNameを付けてスナップショットを作成する。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;~ # vim-cmd vmsvc/snapshot.create 16 &quot;ssh&quot;&lt;br /&gt;Create Snapshot:&lt;/span&gt;&lt;/blockquote&gt;
作成したスナップショットを確認する。&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;~ # vim-cmd vmsvc/snapshot&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;01c02ed4-ded6-4fdd-b5b6-e571a244162d&quot; ginger_sofatware_uiphraseguid=&quot;3a84be8c-dc10-4577-85b1-5a9c68db04f3&quot; grcontextid=&quot;.:0&quot;&gt;.&lt;/span&gt;get 16&lt;br /&gt;Get Snapshot:&lt;br /&gt;|-ROOT&lt;br /&gt;--Snapshot Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: ssh&lt;br /&gt;--Snapshot Id &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: 1&lt;br /&gt;--Snapshot Desciption &amp;nbsp;:&lt;br /&gt;--Snapshot Created On &amp;nbsp;: 9/25/2013 5:4:59&lt;br /&gt;--Snapshot State &amp;nbsp; &amp;nbsp; &amp;nbsp; : powered off&lt;/span&gt;&lt;/blockquote&gt;
スナップショットで復元する場合は以下のコマンドを使う。&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;~ # vim-cmd vmsvc/snapshot&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;341a2b14-26a2-4e12-a6e5-f124386360e2&quot; ginger_sofatware_uiphraseguid=&quot;ac5dd71e-228d-4a04-9225-53a42b943f2f&quot; grcontextid=&quot;.:0&quot;&gt;.&lt;/span&gt;revert&lt;br /&gt;Insufficient arguments.&lt;br /&gt;Usage: snapshot&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;0e3be25e-a452-47fb-93b7-91bc6dc8c9ce&quot; ginger_sofatware_uiphraseguid=&quot;93761c76-8bcb-4455-a86b-24ea879c5b5d&quot; grcontextid=&quot;.:0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;b670e44a-fefd-4615-885a-452707aa18ae&quot; ginger_sofatware_uiphraseguid=&quot;93761c76-8bcb-4455-a86b-24ea879c5b5d&quot; grcontextid=&quot;revert:1&quot;&gt;revert&lt;/span&gt; &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;06b80eeb-a1bd-4333-a244-f05e6df34549&quot; ginger_sofatware_uiphraseguid=&quot;93761c76-8bcb-4455-a86b-24ea879c5b5d&quot; grcontextid=&quot;vmid:2&quot;&gt;vmid&lt;/span&gt; &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;6c396451-a850-41d6-a2af-b94e41f9c962&quot; ginger_sofatware_uiphraseguid=&quot;93761c76-8bcb-4455-a86b-24ea879c5b5d&quot; grcontextid=&quot;snapshotId:3&quot;&gt;snapshotId&lt;/span&gt; &lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;ee8a569f-0257-4384-a65f-d4598fd74a02&quot; ginger_sofatware_uiphraseguid=&quot;93761c76-8bcb-4455-a86b-24ea879c5b5d&quot; grcontextid=&quot;suppressPowerOff:4&quot;&gt;suppressPowerOff&lt;/span&gt;&lt;br /&gt;Revert to a snapshot on the &lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;8bc0f980-f1dd-4726-bfd3-e79d2f9db564&quot; ginger_sofatware_uiphraseguid=&quot;ed681782-70bc-43fb-85d3-807ca815c146&quot; grcontextid=&quot;vm:0&quot;&gt;vm&lt;/span&gt;.&lt;/span&gt;&lt;/blockquote&gt;
スナップショットは差分だけとはいえディスク容量は食う。不要になったスナップショットは削除していったほうがいい。&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;~ # vim-cmd vmsvc/snapshot&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;7d1ea23a-aebd-4736-82ed-7d6370b187ee&quot; ginger_sofatware_uiphraseguid=&quot;0d327780-033a-4a1c-b6a7-7bbd98a27ba7&quot; grcontextid=&quot;.:0&quot;&gt;.&lt;/span&gt;remove&lt;br /&gt;Insufficient arguments.&lt;br /&gt;Usage: snapshot&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;788a29f5-b342-4fbd-a453-873b00024ee1&quot; ginger_sofatware_uiphraseguid=&quot;d6d619de-a161-4c76-bc3b-13ba60a5f16d&quot; grcontextid=&quot;.:0&quot;&gt;.&lt;/span&gt;remove &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;c697ff02-6a5e-4682-b499-8b0b479f28f2&quot; ginger_sofatware_uiphraseguid=&quot;d6d619de-a161-4c76-bc3b-13ba60a5f16d&quot; grcontextid=&quot;vmid:1&quot;&gt;vmid&lt;/span&gt; &lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;c83f4bb7-3041-4fd0-8a71-4531fcafdaa5&quot; ginger_sofatware_uiphraseguid=&quot;d6d619de-a161-4c76-bc3b-13ba60a5f16d&quot; grcontextid=&quot;snapshotId:2&quot;&gt;snapshotId&lt;/span&gt; [&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;2ba43970-294c-4c5c-b78a-18e6af137169&quot; ginger_sofatware_uiphraseguid=&quot;d6d619de-a161-4c76-bc3b-13ba60a5f16d&quot; grcontextid=&quot;removeChildren:3&quot;&gt;removeChildren&lt;/span&gt;]&lt;br /&gt;Remove a snapshot on the &lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;40a58a95-0562-4322-a76f-274773dc3515&quot; ginger_sofatware_uiphraseguid=&quot;5770cfd6-9ca5-4d26-911e-25e08e940306&quot; grcontextid=&quot;vm:0&quot;&gt;vm&lt;/span&gt;.&lt;/span&gt;&lt;/blockquote&gt;
スナップショットは階層状に管理される。ツリーにできるかどうかはまだ未確認。&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;~ # vim-cmd vmsvc/snapshot.create 16 &quot;ssh&quot;&lt;br /&gt;Create Snapshot:&lt;br /&gt;~ # vim-cmd vmsvc/snapshot&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;130277ad-b0b6-4121-b18d-eb77d1eb05d2&quot; ginger_sofatware_uiphraseguid=&quot;7d646a5a-12ef-472b-ac2f-0e088e088f25&quot; grcontextid=&quot;.:0&quot;&gt;.&lt;/span&gt;get 16&lt;br /&gt;Get Snapshot:&lt;br /&gt;|-ROOT&lt;br /&gt;--Snapshot Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: ssh&lt;br /&gt;--Snapshot Id &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: 1&lt;br /&gt;--Snapshot Desciption &amp;nbsp;:&lt;br /&gt;--Snapshot Created On &amp;nbsp;: 9/25/2013 5:4:59&lt;br /&gt;--Snapshot State &amp;nbsp; &amp;nbsp; &amp;nbsp; : powered off&lt;br /&gt;--|-CHILD&lt;br /&gt;----Snapshot Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: ssh&lt;br /&gt;----Snapshot Id &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: 2&lt;br /&gt;----Snapshot Desciption &amp;nbsp;:&lt;br /&gt;----Snapshot Created On &amp;nbsp;: 9/27/2013 23:22:10&lt;br /&gt;----Snapshot State &amp;nbsp; &amp;nbsp; &amp;nbsp; : powered off&lt;/span&gt;&lt;/blockquote&gt;
&lt;div&gt;
とりあえず便利な機能なので使ったほうがいい（反省も込めて）。&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/503505929933242968/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2013/09/esxios.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/503505929933242968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/503505929933242968'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2013/09/esxios.html' title='ESXiでゲストOSのスナップショットを利用する'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-7309465066706680628</id><published>2013-08-29T00:21:00.002+09:00</published><updated>2013-08-29T00:21:19.966+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="xml"/><title type='text'>【Eclipse】XMLスキーマを利用したXMLデータの作成</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
EclipseのWeb Tools Platformに付いているXML編集機能を使うと、XMLスキーマを利用したXMLファイルの作成が相当楽になる。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
まずは、ワークスペースに適当なXMLスキーマを読み込んでおく。今回はLIDO XML Schema（http://www.lido-schema.org/schema/v1.0/lido-v1.0.xsd）を利用した。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHf4HhhAM6Jo53sawvg2RtCVDgzC6vHz8QzggZc0W5fFoF-5C0GPrtzvKNYLxzzUvRlSjdQ8GOBwm5KrrlCUS17vaoKkFpEdhgSvPuWApY18-iC470bxTpZnZxp3IQ9-UKT-YlatgOld9D/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.43.07.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;298&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHf4HhhAM6Jo53sawvg2RtCVDgzC6vHz8QzggZc0W5fFoF-5C0GPrtzvKNYLxzzUvRlSjdQ8GOBwm5KrrlCUS17vaoKkFpEdhgSvPuWApY18-iC470bxTpZnZxp3IQ9-UKT-YlatgOld9D/s400/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.43.07.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
次に新規XMLファイルの作成を始める。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
メニューから&lt;b&gt;New&lt;/b&gt;&amp;gt;&lt;b&gt;Other...&lt;/b&gt;を選択して、&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAkjdQRY2Ej1OOaWa3yywV0ilNdnZQ0XF-viQAuQFopTPNHrvtdKa6bRKkNKInaseirbpX7lhJXDVZP6SxZIikc0yBrlZOclrZTlVstQqMs47wbxbwefzGzl7aAi6IVpyvsfzJln2RVVIf/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.43.32.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAkjdQRY2Ej1OOaWa3yywV0ilNdnZQ0XF-viQAuQFopTPNHrvtdKa6bRKkNKInaseirbpX7lhJXDVZP6SxZIikc0yBrlZOclrZTlVstQqMs47wbxbwefzGzl7aAi6IVpyvsfzJln2RVVIf/s400/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.43.32.png&quot; width=&quot;183&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgeLGaG5KOhbr8d1IW4X0fOndBvv97Ev1ZhOTsGr84ff0baEkxQwPv3T_BscuBYPq7D6Jy-S365IDoYL1yyVSm21RULDtHJDWee0dSsNhX050SkLdRiVWWGcsBZv6mW_L9-U-EgfmnbaFC/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.43.43.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgeLGaG5KOhbr8d1IW4X0fOndBvv97Ev1ZhOTsGr84ff0baEkxQwPv3T_BscuBYPq7D6Jy-S365IDoYL1yyVSm21RULDtHJDWee0dSsNhX050SkLdRiVWWGcsBZv6mW_L9-U-EgfmnbaFC/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.43.43.png&quot; width=&quot;184&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;XML&lt;/b&gt;＞&lt;b&gt;XML File&lt;/b&gt;を選択し、&lt;b&gt;Next&amp;gt;&lt;/b&gt;をクリックする。&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkd65EkuVBwp7FvLbHQ0zJ3rC3AZSrxq_P5FLjEFfj0gNptc88lcDSmafJdHH1-w8hhgb__WOca7nigEN3fyMMnKdOEbsyRvLfSarjrtUbz6odhSGrEAchnc1UX4Pq_Ltz-oYHcbL2Awlm/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.43.52.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;295&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkd65EkuVBwp7FvLbHQ0zJ3rC3AZSrxq_P5FLjEFfj0gNptc88lcDSmafJdHH1-w8hhgb__WOca7nigEN3fyMMnKdOEbsyRvLfSarjrtUbz6odhSGrEAchnc1UX4Pq_Ltz-oYHcbL2Awlm/s400/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.43.52.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&amp;nbsp;作成するXMLファイルの名前を決めて&lt;b&gt;Next&amp;gt;&lt;/b&gt;をクリック&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnHtCqIBvq9f9kJfiUtaBQXNOkF6pjJyxJevVmxoiDRGTITJcbMMwZj4rnb8Lqly-xyz1tMAmbdxwmhYfbMJkd_SGlhLVHjw2isf3AvHRI4Ur06fZ5dyvARmOuodk0Y-0XhA7nFeitnzaF/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.44.37.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;318&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnHtCqIBvq9f9kJfiUtaBQXNOkF6pjJyxJevVmxoiDRGTITJcbMMwZj4rnb8Lqly-xyz1tMAmbdxwmhYfbMJkd_SGlhLVHjw2isf3AvHRI4Ur06fZ5dyvARmOuodk0Y-0XhA7nFeitnzaF/s400/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.44.37.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
ここではXMLファイルの作成方法&lt;b&gt;Create XML file from an XML schema file&lt;/b&gt;を選択し、&lt;b&gt;Next&amp;gt;&lt;/b&gt;をクリック&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdHD_pSOrNog5M8f4U1srcK60bPEOhM8Z5MR0wInVAcbxMIE8xa8wSuw9Cr5owntlrIKo44dtI8aLrXDGbQh63AwiUn3eqtTxSueSf2fFPwpY9O1c1ozvlYHcqvRxmsL3wOD5fY-fkymCO/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.44.43.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;318&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdHD_pSOrNog5M8f4U1srcK60bPEOhM8Z5MR0wInVAcbxMIE8xa8wSuw9Cr5owntlrIKo44dtI8aLrXDGbQh63AwiUn3eqtTxSueSf2fFPwpY9O1c1ozvlYHcqvRxmsL3wOD5fY-fkymCO/s400/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.44.43.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;ここではワークスペースから&lt;b&gt;XML schema file&lt;/b&gt;を選択し、&lt;b&gt;Next&amp;gt;&lt;/b&gt;をクリックする。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLH4aSxwCuLGO0sskFcLGaK5bGeWg0R_HJ9W2XNYL9xH77ZK3mBXIN8H-2TdBBZ9ya-g5_-_qT-PgvPoyeMAHFXuAAVBQj3BfDHXDeERzWheeBifG5qZ_bUwdaNyz8LbhowMrY5sztBRZ3/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.44.54.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;318&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLH4aSxwCuLGO0sskFcLGaK5bGeWg0R_HJ9W2XNYL9xH77ZK3mBXIN8H-2TdBBZ9ya-g5_-_qT-PgvPoyeMAHFXuAAVBQj3BfDHXDeERzWheeBifG5qZ_bUwdaNyz8LbhowMrY5sztBRZ3/s400/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.44.54.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;ルート要素を選択し(LIDOの場合はlidoWrap)、&lt;b&gt;Finish&lt;/b&gt;をクリック。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOMpxAGf0AfZMeffQEcDLfOojgvr2QE92Nl2uManmW-7T7E-vWeOIccqhOsWb12FRx4s9Og_ZdiyGHyfqnxrUpxJFEmyxOEWC1QgRpZcRXLIh0p_MxsZ-1JEGU7qDORySwlI_RyQKzaM1c/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.45.08.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;318&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOMpxAGf0AfZMeffQEcDLfOojgvr2QE92Nl2uManmW-7T7E-vWeOIccqhOsWb12FRx4s9Og_ZdiyGHyfqnxrUpxJFEmyxOEWC1QgRpZcRXLIh0p_MxsZ-1JEGU7qDORySwlI_RyQKzaM1c/s400/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.45.08.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
するとrequiredな要素を含んだXMLファイルが作られる。あとは必要な箇所を追記・変更していくようにすればよい。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx_wrTThVAuAAS-cWMhStVpY-WPgLLq8mNNkvGWwP0dfWLavbXMBf8shdafNB0tuwxlYVpJ6b-ksq0_eYqo3Phj7uP8Et_3IB-j6DUqkmFSxuvFw0F651cAYjyrjyjmSRaGCJlKEKJSAhx/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.45.24.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;298&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx_wrTThVAuAAS-cWMhStVpY-WPgLLq8mNNkvGWwP0dfWLavbXMBf8shdafNB0tuwxlYVpJ6b-ksq0_eYqo3Phj7uP8Et_3IB-j6DUqkmFSxuvFw0F651cAYjyrjyjmSRaGCJlKEKJSAhx/s400/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.45.24.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
超簡単。&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
なお、読み込んだxml schemaを利用した入力補完も可能だ。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsHX_et7K8k7p9lPBIebUwFz8pDyEWa1TV63DoHP18FL2uETJhk4qZbHG4iZeEHi9u0kHR5p-uAq84D6bOPrcIF6_w1OtiZQ_6wqM_E764v0TgeFBOUxtunIPPDpbTNMAp0hMMMe2R0zj3/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.45.50.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;298&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsHX_et7K8k7p9lPBIebUwFz8pDyEWa1TV63DoHP18FL2uETJhk4qZbHG4iZeEHi9u0kHR5p-uAq84D6bOPrcIF6_w1OtiZQ_6wqM_E764v0TgeFBOUxtunIPPDpbTNMAp0hMMMe2R0zj3/s400/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.45.50.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
このようにEclipse+WTPを使えば簡単にXMLデータを作ることができる。</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/7309465066706680628/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2013/08/eclipsexmlxml.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/7309465066706680628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/7309465066706680628'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2013/08/eclipsexmlxml.html' title='【Eclipse】XMLスキーマを利用したXMLデータの作成'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHf4HhhAM6Jo53sawvg2RtCVDgzC6vHz8QzggZc0W5fFoF-5C0GPrtzvKNYLxzzUvRlSjdQ8GOBwm5KrrlCUS17vaoKkFpEdhgSvPuWApY18-iC470bxTpZnZxp3IQ9-UKT-YlatgOld9D/s72-c/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-08-28+23.43.07.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-3547834894976727848</id><published>2013-06-22T02:34:00.001+09:00</published><updated>2013-06-22T02:35:54.271+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="R"/><title type='text'>Rでアニメーション</title><content type='html'>&lt;div&gt;
Rの&lt;a href=&quot;http://cran.r-project.org/web/packages/animation/index.html&quot; target=&quot;_blank&quot;&gt;animation&lt;/a&gt;ライブラリを使ってみた．&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
plotで出力した画像をくつけてアニメーションにする．&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
こんな感じ，&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush: text;&quot;&gt;library(animation)
f&amp;lt;-4
wave&amp;lt;-function(n){w&amp;lt;-0;t&amp;lt;-seq(0,1,0.01);for(k in 1:n){w&amp;lt;-w+sin((2*k-1)*2*pi*f*t)/(2*k-1)};w&amp;lt;-4/pi*w}
wave2&amp;lt;-function(x){for(n in 1:x){plot(x=seq(0,1,0.01),y=wave(n),type=&quot;l&quot;,main=paste(&quot;Square wave(n=&quot;,n,&quot;)&quot;),xlab=&quot;Time(sec)&quot;,ylab=&quot;Amplitude&quot;)}}
saveMovie(wave2(30),interval=0.5,moviename=&quot;wave&quot;,movietype=&quot;gif&quot;,outdir=getwd(),width=640,height=480)
&lt;/pre&gt;
&lt;br /&gt;
で，できたアニメーションはこちら．&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFbc5xSlOTW_jra7kbFs9RhXM3UfxkbWgrKPpQ5x3HkXeTq3LtTHeBn3f5mRYqmRrYwmoYjro4mP8PrUyzaIPKBWMiGkLGLO5aaHZJiK0YpUPsPWu_L-mOwAVa9LPfokfvn3jtqEE2q0Mv/s1600/animation.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFbc5xSlOTW_jra7kbFs9RhXM3UfxkbWgrKPpQ5x3HkXeTq3LtTHeBn3f5mRYqmRrYwmoYjro4mP8PrUyzaIPKBWMiGkLGLO5aaHZJiK0YpUPsPWu_L-mOwAVa9LPfokfvn3jtqEE2q0Mv/s320/animation.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
グラフの変化をみせるにはいいツールだね．&lt;/div&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &#39;Hiragino Kaku Gothic Pro&#39;; white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/3547834894976727848/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2013/06/r.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/3547834894976727848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/3547834894976727848'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2013/06/r.html' title='Rでアニメーション'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFbc5xSlOTW_jra7kbFs9RhXM3UfxkbWgrKPpQ5x3HkXeTq3LtTHeBn3f5mRYqmRrYwmoYjro4mP8PrUyzaIPKBWMiGkLGLO5aaHZJiK0YpUPsPWu_L-mOwAVa9LPfokfvn3jtqEE2q0Mv/s72-c/animation.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-7634580007268584940</id><published>2013-05-31T23:34:00.002+09:00</published><updated>2013-05-31T23:37:33.007+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="google earth"/><category scheme="http://www.blogger.com/atom/ns#" term="KML"/><category scheme="http://www.blogger.com/atom/ns#" term="R"/><title type='text'>RでKMLファイルを出力する</title><content type='html'>&lt;div&gt;
RとGoogle Earthを連携させることができるらしい．&lt;br /&gt;
&lt;br /&gt;
検索してみると，縫村氏の「RとGoogle Earth を使った空間情報の可視化」と題した&lt;a href=&quot;https://www.google.co.jp/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CC4QFjAA&amp;amp;url=http%3A%2F%2Fresearchmap.jp%2F%3Faction%3Dmultidatabase_action_main_filedownload%26download_flag%3D1%26upload_id%3D29335%26metadata_id%3D25997&amp;amp;ei=gbWoUem1No-LlAWv64G4DA&amp;amp;usg=AFQjCNFQfXTkG62L5IBzynJyDQZNhCDX_w&amp;amp;sig2=b_cKjFHIAmPK7WOCJ6lllw&amp;amp;bvm=bv.47244034,d.dGI&quot;&gt;スライド資料&lt;/a&gt;を発見．&lt;br /&gt;
&lt;br /&gt;
スライド資料ではRを使って&lt;a href=&quot;http://earthquake.usgs.gov/&quot; target=&quot;_blank&quot;&gt;アメリカ地質調査所(USGS)&lt;/a&gt;の地震動データ（CSV）からKMLファイルを作成するやり方が紹介されていた．&lt;br /&gt;
&lt;br /&gt;
こりゃ面白そうということで早速トライ．&lt;br /&gt;
&lt;br /&gt;
DataFrameをSpatialPointsDataFrameに変換するところでハマったけど，proj4string(qk)&amp;lt;-CRS(&quot;+init=epsg:4326&quot;)とすることで解決．&lt;br /&gt;
&lt;br /&gt;
無事，作成したKMLファイルをGoogle Earthに読み込ませることができました．&lt;br /&gt;
&lt;br /&gt;
ちょっと見にくいけど，地震の発生箇所に目印が表示されています．&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJX8A7MiI0_pg6Zsz4rQgaKQVB9a5pRlQDRTBZHXJA3Gn0RifJhLt2BjAT1k1n6AEPIr2SAunnniICv1EJgK5L3PM13cguBMUiRk82p7zPDAsqSIckg6zcCPaB_u73OCylFJPxawCbWha9/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-05-31+23.26.19.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;271&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJX8A7MiI0_pg6Zsz4rQgaKQVB9a5pRlQDRTBZHXJA3Gn0RifJhLt2BjAT1k1n6AEPIr2SAunnniICv1EJgK5L3PM13cguBMUiRk82p7zPDAsqSIckg6zcCPaB_u73OCylFJPxawCbWha9/s400/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-05-31+23.26.19.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
うーん．こんなことが簡単にできてしまうなんてよい世の中になったものです．&lt;br /&gt;
&lt;br /&gt;
Google Earthの使い方がわかってきました．こりゃ迫力あるわー．&lt;br /&gt;
&lt;br /&gt;
Rのコンソール出力は以下のとおり．&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush: text;&quot;&gt;&amp;gt; library(sp)
&amp;gt; library(rgdal)
&amp;gt; qk&amp;lt;-read.csv(&quot;http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.csv&quot;)
&amp;gt; head(qk)
                      time latitude longitude  depth mag magType nst  gap
1 2013-05-31T13:40:41.000Z  60.6428 -147.5946   3.60 3.4      Ml  NA   NA
2 2013-05-31T13:40:28.000Z  61.5455 -148.6714  28.50 2.9      Ml  NA   NA
3 2013-05-31T13:25:55.190Z -28.2755 -178.6027 262.93 5.2      mb  46 66.0
4 2013-05-31T13:24:51.800Z  33.6878 -119.1308   0.40 3.1      Ml  24 75.6
5 2013-05-31T13:06:50.150Z -20.3071  169.0243  34.03 5.1      mb  57 53.0
6 2013-05-31T11:32:41.100Z  40.1692 -121.1097   0.00 3.1      Md  NA 46.8
       dmin  rms net         id                  updated
1        NA 1.02  ak ak10727802 2013-05-31T13:49:58.971Z
2        NA 1.12  ak ak10727799 2013-05-31T13:48:21.339Z
3 1.1300000 0.94  us usb000hacp 2013-05-31T13:50:51.623Z
4 0.2245788 0.23  ci ci15352009 2013-05-31T13:32:07.619Z
5 2.7200000 1.25  us usb000hacc 2013-05-31T13:42:49.516Z
6 0.2155957 0.38  nc nc72003416 2013-05-31T13:15:16.232Z
&amp;gt; coordinates(qk)&amp;lt;-c(&quot;latitude&quot;,&quot;longitude&quot;)
&amp;gt; class(qk)
[1] &quot;SpatialPointsDataFrame&quot;
attr(,&quot;package&quot;)
[1] &quot;sp&quot;
&amp;gt; summary(qk)
Object of class SpatialPointsDataFrame
Coordinates:
                min      max
longitude -178.6027 169.0243
latitude   -28.2755  66.2616
Is projected: NA 
proj4string : [NA]
Number of points: 33
Data attributes:
                       time        depth             mag       
 2013-05-30T14:09:44.000Z: 1   Min.   :  0.00   Min.   :2.500  
 2013-05-30T14:38:25.650Z: 1   1st Qu.: 10.00   1st Qu.:3.000  
 2013-05-30T14:54:01.000Z: 1   Median : 28.50   Median :3.300  
 2013-05-30T17:46:40.000Z: 1   Mean   : 46.29   Mean   :3.739  
 2013-05-30T18:37:00.620Z: 1   3rd Qu.: 67.70   3rd Qu.:4.600  
 2013-05-30T20:41:29.000Z: 1   Max.   :262.93   Max.   :5.300  
 (Other)                 :27                                   
  magType        nst              gap             dmin         
 mb   :13   Min.   :  5.00   Min.   : 33.0   Min.   : 0.01797  
 mb_Lg: 1   1st Qu.: 16.00   1st Qu.: 75.6   1st Qu.: 0.73033  
 Md   : 6   Median : 28.00   Median :109.0   Median : 1.21000  
 Ml   :12   Mean   : 36.15   Mean   :136.1   Mean   : 3.43408  
 Mw   : 1   3rd Qu.: 46.50   3rd Qu.:174.1   3rd Qu.: 2.47250  
            Max.   :109.00   Max.   :324.0   Max.   :32.25000  
            NA&#39;s   :13       NA&#39;s   :9       NA&#39;s   :9         
      rms         net              id                         updated  
 Min.   :0.1200   ak: 9   ak10726951: 1   2013-05-30T14:22:58.908Z: 1  
 1st Qu.:0.3100   ci: 1   ak10727009: 1   2013-05-30T16:41:03.895Z: 1  
 Median :0.8200   hv: 1   ak10727095: 1   2013-05-30T16:56:39.447Z: 1  
 Mean   :0.7391   nc: 3   ak10727182: 1   2013-05-30T18:00:03.809Z: 1  
 3rd Qu.:1.0200   pr: 5   ak10727211: 1   2013-05-30T20:39:31.117Z: 1  
 Max.   :1.2900   us:14   ak10727538: 1   2013-05-30T22:47:39.888Z: 1  
                          (Other)   :27   (Other)                 :27  
&amp;gt; proj4string(qk)&amp;lt;-CRS(&quot;+init=epsg:4326&quot;)
&amp;gt; summary(qk)
Object of class SpatialPointsDataFrame
Coordinates:
                min      max
longitude -178.6027 169.0243
latitude   -28.2755  66.2616
Is projected: FALSE 
proj4string :
[+init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84
+towgs84=0,0,0]
Number of points: 33
Data attributes:
                       time        depth             mag       
 2013-05-30T14:09:44.000Z: 1   Min.   :  0.00   Min.   :2.500  
 2013-05-30T14:38:25.650Z: 1   1st Qu.: 10.00   1st Qu.:3.000  
 2013-05-30T14:54:01.000Z: 1   Median : 28.50   Median :3.300  
 2013-05-30T17:46:40.000Z: 1   Mean   : 46.29   Mean   :3.739  
 2013-05-30T18:37:00.620Z: 1   3rd Qu.: 67.70   3rd Qu.:4.600  
 2013-05-30T20:41:29.000Z: 1   Max.   :262.93   Max.   :5.300  
 (Other)                 :27                                   
  magType        nst              gap             dmin         
 mb   :13   Min.   :  5.00   Min.   : 33.0   Min.   : 0.01797  
 mb_Lg: 1   1st Qu.: 16.00   1st Qu.: 75.6   1st Qu.: 0.73033  
 Md   : 6   Median : 28.00   Median :109.0   Median : 1.21000  
 Ml   :12   Mean   : 36.15   Mean   :136.1   Mean   : 3.43408  
 Mw   : 1   3rd Qu.: 46.50   3rd Qu.:174.1   3rd Qu.: 2.47250  
            Max.   :109.00   Max.   :324.0   Max.   :32.25000  
            NA&#39;s   :13       NA&#39;s   :9       NA&#39;s   :9         
      rms         net              id                         updated  
 Min.   :0.1200   ak: 9   ak10726951: 1   2013-05-30T14:22:58.908Z: 1  
 1st Qu.:0.3100   ci: 1   ak10727009: 1   2013-05-30T16:41:03.895Z: 1  
 Median :0.8200   hv: 1   ak10727095: 1   2013-05-30T16:56:39.447Z: 1  
 Mean   :0.7391   nc: 3   ak10727182: 1   2013-05-30T18:00:03.809Z: 1  
 3rd Qu.:1.0200   pr: 5   ak10727211: 1   2013-05-30T20:39:31.117Z: 1  
 Max.   :1.2900   us:14   ak10727538: 1   2013-05-30T22:47:39.888Z: 1  
                          (Other)   :27   (Other)                 :27  
&amp;gt; writeOGR(qk, dsn=&quot;qk.kml&quot;, layer=&quot;sample&quot;, driver=&quot;KML&quot;)
&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/7634580007268584940/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2013/05/rkml.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/7634580007268584940'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/7634580007268584940'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2013/05/rkml.html' title='RでKMLファイルを出力する'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJX8A7MiI0_pg6Zsz4rQgaKQVB9a5pRlQDRTBZHXJA3Gn0RifJhLt2BjAT1k1n6AEPIr2SAunnniICv1EJgK5L3PM13cguBMUiRk82p7zPDAsqSIckg6zcCPaB_u73OCylFJPxawCbWha9/s72-c/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-05-31+23.26.19.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-4352654694792066420</id><published>2013-05-03T08:01:00.003+09:00</published><updated>2013-05-03T08:01:44.406+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="osx"/><title type='text'>Javaアプリを.Appとする</title><content type='html'>JavaアプリをMac OS Xの.appにする方法が解ったのでメモ．&lt;br /&gt;
&lt;br /&gt;
結論から書くと，附属ツールの「Jar Bundler.app」を使えばよい．&lt;br /&gt;
&lt;br /&gt;
ツールのインストール場所は以下のとおり．&lt;br /&gt;
&lt;br /&gt;
$ open /usr/share/java/Tools/Jar\ Bundler.app&lt;br /&gt;
&lt;br /&gt;
[Build Information]タブ&lt;br /&gt;
&lt;br /&gt;
main classを選択する．アイコンの変更もここ．&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-5w0_ert27fnIDgKAM_HsjPisqvoMcGFM1r-EdodS3rMEzYWc2Y8IjlsWqpiJOTSyJdh54Sx9_cbWw14WziGc7xsZdnWXiXdYOmGeA4PqIUqgPpt_uSG76iZD5Q_pIGRrEbxMVnfUrW8f/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-05-03+6.27.28.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;299&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-5w0_ert27fnIDgKAM_HsjPisqvoMcGFM1r-EdodS3rMEzYWc2Y8IjlsWqpiJOTSyJdh54Sx9_cbWw14WziGc7xsZdnWXiXdYOmGeA4PqIUqgPpt_uSG76iZD5Q_pIGRrEbxMVnfUrW8f/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-05-03+6.27.28.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;[Classpath and Files]タブ&lt;br /&gt;
&lt;br /&gt;
Classpathの設定を行う．アプリ起動に必要なライブラリはここで追加する．&lt;br /&gt;
&lt;br /&gt;
なお，jarファイル内のMETA-INF/MANIFEST.MFにあるClass-pathは参照しないようなのでライブラリバンドルなjarは展開して，ここのClasspathに追加する．&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVqq8rtbsLH55YYU6X_oeo5C7nq1tfo3IN1y6sHPgEQRPPFQsVLYFOZLGkf3IkVJRCm1E75AfhVOxSgd4ynL3zqKU-oHOFJOZZIJiz8PBIDSB0s2J45-PIxYw19vGmkn_cVCHCft8_h5eo/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-05-03+6.27.33.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;299&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVqq8rtbsLH55YYU6X_oeo5C7nq1tfo3IN1y6sHPgEQRPPFQsVLYFOZLGkf3IkVJRCm1E75AfhVOxSgd4ynL3zqKU-oHOFJOZZIJiz8PBIDSB0s2J45-PIxYw19vGmkn_cVCHCft8_h5eo/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-05-03+6.27.33.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;[Properties]タブ&lt;br /&gt;
&lt;br /&gt;
Heap memoryやvmオプションの指定はここ．&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz0XLoZa9RA0qVdv4AIlPRSiY6HDcURK1K94kCVR48R4biPYFllbyAZOQIEq74fl-o-t_sPmyYcQGpjLiAgKP-Jecf13NDMoa8gs07tOew_7Hehy_FeT62DaZj41FSu5m3g9cNGIr-CGWu/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-05-03+6.27.37.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;299&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz0XLoZa9RA0qVdv4AIlPRSiY6HDcURK1K94kCVR48R4biPYFllbyAZOQIEq74fl-o-t_sPmyYcQGpjLiAgKP-Jecf13NDMoa8gs07tOew_7Hehy_FeT62DaZj41FSu5m3g9cNGIr-CGWu/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-05-03+6.27.37.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
最後に[Create Application...]ボタンをクリックして，.appファイルを生成する．&lt;br /&gt;
&lt;br /&gt;
以上でJavaアプリを.appとすることができる．&lt;br /&gt;
&lt;br /&gt;
Launchpadにも登録できるはずだ．&lt;br /&gt;
&lt;br /&gt;
最近javaの雲行きが怪しいことが気になるけど．&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/4352654694792066420/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2013/05/javaapp.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/4352654694792066420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/4352654694792066420'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2013/05/javaapp.html' title='Javaアプリを.Appとする'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-5w0_ert27fnIDgKAM_HsjPisqvoMcGFM1r-EdodS3rMEzYWc2Y8IjlsWqpiJOTSyJdh54Sx9_cbWw14WziGc7xsZdnWXiXdYOmGeA4PqIUqgPpt_uSG76iZD5Q_pIGRrEbxMVnfUrW8f/s72-c/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2013-05-03+6.27.28.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-8230151135196869478</id><published>2013-04-29T08:40:00.001+09:00</published><updated>2013-04-29T10:01:16.956+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="opencv"/><category scheme="http://www.blogger.com/atom/ns#" term="processing"/><title type='text'>Processing + OpenCV</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Mac OS XのProcessingでOpenCVを使おうとしてちょっと手間取ったのでメモ．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
以下，インストール方法．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;
インストール方法&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
OSのバージョンは以下のとおり．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;pre style=&quot;background-color: aliceblue; border-color: rgb(221, 221, 238) rgb(136, 136, 153) rgb(136, 136, 153) rgb(221, 221, 238); border-style: solid; border-width: 1px; line-height: 14px; margin-left: 1em; margin-right: 2em; padding: 0.5em;&quot;&gt;$ uname -a
Darwin macserver.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64&lt;/pre&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
opencvはportでインストール．バージョンは2.4.5.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;pre style=&quot;background-color: aliceblue; border-color: rgb(221, 221, 238) rgb(136, 136, 153) rgb(136, 136, 153) rgb(221, 221, 238); border-style: solid; border-width: 1px; line-height: 14px; margin-left: 1em; margin-right: 2em; padding: 0.5em;&quot;&gt;$ sudo port install opencv
$ sudo port list | grep opencv
Password:
opencv                         @2.4.5          graphics/opencv&lt;/pre&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
processingにjavacvproライブラリをインストールする．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
ダウンロードは下記URLから&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;http://www.mon-club-elec.fr/pmwiki_reference_lib_javacvPro/pmwiki.php&quot;&gt;http://www.mon-club-elec.fr/pmwiki_reference_lib_javacvPro/pmwiki.php&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
最新バージョンは0.5.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
インストールはシンプル．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
展開したファイルをprocessingのlibrariesディレクトリにコピーする．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;pre style=&quot;background-color: aliceblue; border-color: rgb(221, 221, 238) rgb(136, 136, 153) rgb(136, 136, 153) rgb(221, 221, 238); border-style: solid; border-width: 1px; line-height: 14px; margin-left: 1em; margin-right: 2em; padding: 0.5em;&quot;&gt;$ wget  http://www.mon-club-elec.fr/mes_downloads/javacvPro-0.5.zip
$ unzip javacvPro-0.5.zip
$ mv javacvPro ~/Document/Processing/libraries/
$ cd ~/Documents/Processing/libraries/&lt;/pre&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
ライブラリのインストールはこれで完了だが，このままではopencvのバージョン違いによりエラーとなるので，javacvを入れ替える．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
javacvライブラリ(&lt;a href=&quot;https://code.google.com/p/javacv/&quot;&gt;https://code.google.com/p/javacv/&lt;/a&gt;)をコンパイルする．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;pre style=&quot;background-color: aliceblue; border-color: rgb(221, 221, 238) rgb(136, 136, 153) rgb(136, 136, 153) rgb(221, 221, 238); border-style: solid; border-width: 1px; line-height: 14px; margin-left: 1em; margin-right: 2em; padding: 0.5em;&quot;&gt;$ wget --no-check-certificate https://javacv.googlecode.com/files/javacv-0.5-src.zip
$ unzip javacv-0.5-src.zip
$ cd javacv
$ sudo mvn -X instal&lt;/pre&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
javacvproのライブラリと入れ替える．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;pre style=&quot;background-color: aliceblue; border-color: rgb(221, 221, 238) rgb(136, 136, 153) rgb(136, 136, 153) rgb(221, 221, 238); border-style: solid; border-width: 1px; line-height: 14px; margin-left: 1em; margin-right: 2em; padding: 0.5em;&quot;&gt;$ cd ~/.m2/repository/com/googlecode/javacv/javacv/0.5
$ cp javacv-0.5-macosx-x86_64.jar ~/Documents/Processing/libraries/javacvPro/library/javacv-macosx-x86_64.jar 
$ cp javacv-0.5.jar ~/Documents/Processing/libraries/javacvPro/library/javacv.jar &lt;/pre&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
javacppも入れ替える．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;pre style=&quot;background-color: aliceblue; border-color: rgb(221, 221, 238) rgb(136, 136, 153) rgb(136, 136, 153) rgb(221, 221, 238); border-style: solid; border-width: 1px; line-height: 14px; margin-left: 1em; margin-right: 2em; padding: 0.5em;&quot;&gt;$ cd ~/.m2/repository/com/googlecode/javacpp/javacpp/0.5
$ cp javacpp-0.5.jar ~/Documents/Processing/libraries/javacvPro/library/javacpp.jar &lt;/pre&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
これでjavacvProが動くようになる．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
試しにサンプルを動かしてみる．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
processingを起動し，[File]&amp;gt;[Examples]の順にメニューを開く．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
[Contributed Librarires]の項目に[javacvPro]の項目が表示されるので，適当なものをダブルクリックし，スケッチを実行する．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
ちなみに顔認識用学習データは「/opt/local/share/OpenCV」になるので，顔認識系のサンプルでは学習データのパスを書き換える．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-0GgI0nEpLWP6WhAKyV8HC6cwA7UweJJoac46UmBU7zhHQQYWA0fXBjVxaIiVm3NQ2qoN2v5qF-LM7d99avKknz0Z1D94OZQo0uriWGcVQ2r-wXFXcA5EN3oA8DZJPCrhCA_sP5nkmeb3/s1600/%E7%94%BB%E9%9D%A2%E5%85%B1%E6%9C%89%E3%83%92%E3%82%9A%E3%82%AF%E3%83%81%E3%83%A3+2013%E5%B9%B44%E6%9C%8829%E6%97%A5+1.25.14+JST.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;256&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-0GgI0nEpLWP6WhAKyV8HC6cwA7UweJJoac46UmBU7zhHQQYWA0fXBjVxaIiVm3NQ2qoN2v5qF-LM7d99avKknz0Z1D94OZQo0uriWGcVQ2r-wXFXcA5EN3oA8DZJPCrhCA_sP5nkmeb3/s320/%E7%94%BB%E9%9D%A2%E5%85%B1%E6%9C%89%E3%83%92%E3%82%9A%E3%82%AF%E3%83%81%E3%83%A3+2013%E5%B9%B44%E6%9C%8829%E6%97%A5+1.25.14+JST.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
トラブルシューティング&lt;/h2&gt;
今回，遭遇したエラー．&lt;br /&gt;
&lt;br /&gt;
まずは，processingを64bit modeにしなかった場合のエラー．opencvは64bitライブラリとしてコンパイルされるのでprocessingを32bitモードから64bitモードへと変更しておくこと．&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;/div&gt;
&lt;pre style=&quot;background-color: aliceblue; border-color: rgb(221, 221, 238) rgb(136, 136, 153) rgb(136, 136, 153) rgb(221, 221, 238); border-style: solid; border-width: 1px; line-height: 14px; margin-left: 1em; margin-right: 2em; padding: 0.5em;&quot;&gt;Exception in thread &quot;Animation Thread&quot; java.lang.UnsatisfiedLinkError: no jniopencv_core in  java.library.path
 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1758)
 at java.lang.Runtime.loadLibrary0(Runtime.java:823)
 at java.lang.System.loadLibrary(System.java:1045)
 at com.googlecode.javacpp.Loader.load(Loader.java:358)
 at com.googlecode.javacpp.Loader.load(Loader.java:285)
 at com.googlecode.javacv.cpp.opencv_core.&amp;lt;clinit&amp;gt;(opencv_core.java:129)
 at monclubelec.javacvPro.OpenCV.&amp;lt;clinit&amp;gt;(Unknown Source)
 at javacvpro_exemple_cascade_detect.setup(javacvpro_exemple_cascade_detect.java:45)
 at processing.core.PApplet.handleDraw(PApplet.java:2241)
 at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:243)
 at processing.core.PApplet.run(PApplet.java:2140)
 at java.lang.Thread.run(Thread.java:680)&lt;/pre&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
つぎはjavacvライブラリを入れ替えない場合のエラー．「&lt;span style=&quot;background-color: aliceblue; line-height: 14px;&quot;&gt;libopencv_core.2.3.dylib&lt;/span&gt;」が見つからないといっている．シンボリックリンクを用意するだけでもエラーは回避できたが，今回はライブラリをコンパイルし直した．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;/div&gt;
&lt;pre style=&quot;background-color: aliceblue; border-color: rgb(221, 221, 238) rgb(136, 136, 153) rgb(136, 136, 153) rgb(221, 221, 238); border-style: solid; border-width: 1px; line-height: 14px; margin-left: 1em; margin-right: 2em; padding: 0.5em;&quot;&gt;Exception in thread &quot;Animation Thread&quot; java.lang.UnsatisfiedLinkError:  /private/var/folders/yv/dgfgdbv51slf_rmgt8w497gm0000gn/T/libjniopencv_core395287537304450378.dylib:  Library not loaded: /opt/local/lib/libopencv_core.2.3.dylib   Referenced from:  /private/var/folders/yv/dgfgdbv51slf_rmgt8w497gm0000gn/T/libjniopencv_core395287537304450378.dylib   Reason: image not found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1827)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703)
at java.lang.Runtime.load0(Runtime.java:770)
at java.lang.System.load(System.java:1020)
at com.googlecode.javacpp.Loader.load(Loader.java:352)
at com.googlecode.javacpp.Loader.load(Loader.java:285)
at com.googlecode.javacv.cpp.opencv_core.&amp;lt;clinit&amp;gt;(opencv_core.java:129)
at monclubelec.javacvPro.OpenCV.&amp;lt;clinit&amp;gt;(Unknown Source)
at sketch_130428a.setup(sketch_130428a.java:25)
at processing.core.PApplet.handleDraw(PApplet.java:2117)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:193)
at processing.core.PApplet.run(PApplet.java:2020)
at java.lang.Thread.run(Thread.java:680)&lt;/pre&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/8230151135196869478/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2013/04/processing-opencv.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/8230151135196869478'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/8230151135196869478'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2013/04/processing-opencv.html' title='Processing + OpenCV'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-0GgI0nEpLWP6WhAKyV8HC6cwA7UweJJoac46UmBU7zhHQQYWA0fXBjVxaIiVm3NQ2qoN2v5qF-LM7d99avKknz0Z1D94OZQo0uriWGcVQ2r-wXFXcA5EN3oA8DZJPCrhCA_sP5nkmeb3/s72-c/%E7%94%BB%E9%9D%A2%E5%85%B1%E6%9C%89%E3%83%92%E3%82%9A%E3%82%AF%E3%83%81%E3%83%A3+2013%E5%B9%B44%E6%9C%8829%E6%97%A5+1.25.14+JST.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-6153157474607429559</id><published>2013-03-23T02:05:00.000+09:00</published><updated>2013-03-23T02:05:36.821+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="zabbix"/><title type='text'>Zabbix導入</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
サーバ監視ソフトのZabbix(&lt;a href=&quot;http://www.zabbix.com/jp/&quot;&gt;http://www.zabbix.com/jp/&lt;/a&gt;)を導入してみた．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
エージェントやSNMP等を使って色々と監視できる．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
監視項目はテンプレートを使って色々とカスタマイズできるもよう．&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
参考にしたのは2009年の@ITの記事（&lt;a href=&quot;http://www.atmarkit.co.jp/ait/articles/0908/13/news062.html&quot;&gt;http://www.atmarkit.co.jp/ait/articles/0908/13/news062.html&lt;/a&gt;）．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
もう4年前・・・・．まあ気にしない．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
インストールはPHPのオプション周りで少し手間取ったくらい（--with-jpeg-dir&amp;amp;--with-freetype-dirを--with-gdの前に書く件）で順調に完了．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRCFfceDcxasiiH3sHkvET2ZwM39HX6SNh3pCbBE5L_NEcZ4dW-DhK6cIPyU58MEC1WKKAJKPxB9kkcSehokT78cB4qWUqhYqBN646A392kDXSMn-XuFOlYArX4gPZaeb3b3QuoQRBK9db/s1600/Custom+graphs++refreshed+every+30+sec+.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;275&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRCFfceDcxasiiH3sHkvET2ZwM39HX6SNh3pCbBE5L_NEcZ4dW-DhK6cIPyU58MEC1WKKAJKPxB9kkcSehokT78cB4qWUqhYqBN646A392kDXSMn-XuFOlYArX4gPZaeb3b3QuoQRBK9db/s400/Custom+graphs++refreshed+every+30+sec+.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
マップ機能を使うとちゃんと監視してる感がでてきていい感じ．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicKTRjM-UrHhR38s7PPVkb0vqJ6TFQrASxBVuIGb8u1PAymH6UDSjLNFtB26CYxQa9Z4bOjcEI0zF_2EDm1BIsWfPJaqV-ynakLvnkt3PG-4BObovZ1BJLLcQFynOiufErBbl8y4j66QkB/s1600/Network+maps+%5Brefreshed+every+30+sec%5D.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;361&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicKTRjM-UrHhR38s7PPVkb0vqJ6TFQrASxBVuIGb8u1PAymH6UDSjLNFtB26CYxQa9Z4bOjcEI0zF_2EDm1BIsWfPJaqV-ynakLvnkt3PG-4BObovZ1BJLLcQFynOiufErBbl8y4j66QkB/s400/Network+maps+%5Brefreshed+every+30+sec%5D.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
使いこなせるようになるのはまだ先だけど協力なツールとなりそう．</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/6153157474607429559/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2013/03/zabbix.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/6153157474607429559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/6153157474607429559'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2013/03/zabbix.html' title='Zabbix導入'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRCFfceDcxasiiH3sHkvET2ZwM39HX6SNh3pCbBE5L_NEcZ4dW-DhK6cIPyU58MEC1WKKAJKPxB9kkcSehokT78cB4qWUqhYqBN646A392kDXSMn-XuFOlYArX4gPZaeb3b3QuoQRBK9db/s72-c/Custom+graphs++refreshed+every+30+sec+.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-5287277610041990505</id><published>2013-03-15T23:51:00.001+09:00</published><updated>2013-03-15T23:53:33.318+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="utf8"/><title type='text'>MySQLの文字コードセット「utf8」と「utf8mb4」</title><content type='html'>　MySQLの文字コードセット「utf8」は3バイトまでのサポートで4バイトをサポートするのはMySQLバージョン5.5以降からサポートしている文字コードセット「utf8mb4」であるとのことを今更ながら知りました．&lt;br /&gt;
&lt;br /&gt;
MySQL 5.0 Reference Manual &amp;gt; 10.1.10. Unicode Support&lt;br /&gt;
&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/charset-unicode.html&quot;&gt;http://dev.mysql.com/doc/refman/5.0/en/charset-unicode.html&lt;/a&gt;&lt;br /&gt;
MySQL 5.5 Reference Manual &amp;gt; 10.1.10. Unicode Support&lt;br /&gt;
&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.5/en/charset-unicode.html&quot;&gt;http://dev.mysql.com/doc/refman/5.5/en/charset-unicode.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
簡単なコード（PHP）で動作検証してみました．&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:php&quot;&gt;$conn=mysql_connect(&#39;192.168.0.5:3306&#39;,&#39;admin&#39;,&#39;password&#39;);

if($conn){
    if(mysql_select_db(&#39;test2&#39;,$conn)){
        $res=mysql_query(&#39;SET NAMES utf8&#39;,$conn);        
        if(!$res){
            print(mysql_error().&quot;\n&quot;);
        }
        $res = mysql_query(&quot;DELETE FROM test&quot;);
        if(!$res){
            print(mysql_error().&quot;\n&quot;);
        }
        $str=&quot;𪀚&quot;;
        printf(&quot;%s %d bytes\n&quot;,$str,strlen($str));
        var_dump(bin2hex($str));
        $res = mysql_query(&quot;INSERT INTO test (title) values (&#39;&quot;.$str.&quot;&#39;) &quot;,$conn);
        if(!$res){
            print(mysql_error().&quot;\n&quot;);
        }
        $str2=&quot;田&quot;;
        printf(&quot;%s %d bytes\n&quot;,$str2,strlen($str2));
        var_dump(bin2hex($str2));
        $res = mysql_query(&quot;INSERT INTO test (title) values (&#39;&quot;.$str2.&quot;&#39;) &quot;,$conn);
        if(!$res){
            print(mysql_error().&quot;\n&quot;);
        }
        $res=mysql_query(&#39;SELECT * FROM test&#39;,$conn);
        if($res){
            while($row = mysql_fetch_assoc($res)){
                printf(&quot;%s\n&quot;,$row[&#39;title&#39;]);
            }
            mysql_free_result($res);
        }else{
            print(mysql_error().&quot;\n&quot;);
        }
    }
    mysql_close($conn);
}
&lt;/pre&gt;
&lt;br /&gt;
コードでは２つの漢字「𪀚」(鳥+戎)と「田」をデータベースに登録し，検索表示しています．&lt;br /&gt;
&lt;br /&gt;
MySQL 5.0.87の場合，&lt;br /&gt;
4バイトの文字があってもエラーは表示されません．&lt;br /&gt;
無視されるだけです．&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ php test.php&lt;br /&gt;
𪀚 4 bytes&lt;br /&gt;
string(8) &quot;f0aa809a&quot;&lt;br /&gt;
田 3 bytes&lt;br /&gt;
string(6) &quot;e794b0&quot;&lt;br /&gt;
田&lt;/blockquote&gt;
&lt;br /&gt;
また，当然「utf8mb4」はサポートしていませんので，使用しようとするとエラーとなります．&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ php mysql.php&lt;br /&gt;
Unknown character set: &#39;utf8mb4&#39;&lt;br /&gt;
𪀚 4 bytes&lt;br /&gt;
string(8) &quot;f0aa809a&quot;&lt;br /&gt;
田 3 bytes&lt;br /&gt;
string(6) &quot;e794b0&quot;&lt;br /&gt;
田&lt;/blockquote&gt;
&lt;br /&gt;
MySQL 5.6.10の場合は4バイトの文字「𪀚」をutf８で登録しようとするとエラーとなります．&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ php test.php&lt;br /&gt;
𪀚 4 bytes&lt;br /&gt;
string(8) &quot;f0aa809a&quot;&lt;br /&gt;
Incorrect string value: &#39;\xF0\xAA\x80\x9A&#39; for column &#39;title&#39; at row 1&lt;br /&gt;
田 3 bytes&lt;br /&gt;
string(6) &quot;e794b0&quot;&lt;/blockquote&gt;
&lt;div&gt;
「utf8mb4」を使うと4バイトの文字をちゃんと登録することができます．&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ php test.php&lt;br /&gt;
𪀚 4 bytes&lt;br /&gt;
string(8) &quot;f0aa809a&quot;&lt;br /&gt;
田 3 bytes&lt;br /&gt;
string(6) &quot;e794b0&quot;&lt;br /&gt;
𪀚&lt;br /&gt;
田&lt;/blockquote&gt;
&lt;/div&gt;
&lt;div&gt;
この投稿では文字化けしてるけど．&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
4バイト文字を「utf8mb4」で登録できる事はわかったけど，5.0から5.5に移行するにはSQLの変更も必要そう．インデックスサイズも変更となるし．&lt;br /&gt;
&lt;br /&gt;
取りあえず，そういう問題があることだけは把握しておこう．&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/5287277610041990505/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2013/03/mysqlutf8utf8mb4.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/5287277610041990505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/5287277610041990505'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2013/03/mysqlutf8utf8mb4.html' title='MySQLの文字コードセット「utf8」と「utf8mb4」'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-344265603519308223</id><published>2012-12-17T23:51:00.005+09:00</published><updated>2012-12-17T23:51:58.822+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="processing"/><category scheme="http://www.blogger.com/atom/ns#" term="processing.js"/><title type='text'>Processing.jsを使ってみる</title><content type='html'>遅まきながらProcessingにハマり中．&lt;br /&gt;
&lt;br /&gt;
Androidアプリに変換できるし，&lt;br /&gt;
Processing.jsがあればhtml5環境でもうごく．&lt;br /&gt;
&lt;br /&gt;
まだまだ簡単なことしかできないけど，&lt;br /&gt;
色々と出来そうな感じが素晴らしい．&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:javascript&quot;&gt;int angle;
void setup(){
  frameRate(100);
  size(400,400);
  PFont myFont = createFont(&quot;Osaka&quot;, 32);
  textFont(myFont);
  angle=0;
}

void draw(){
  background(0);
  pushMatrix();
  translate(width/2, height/2);
  angle=angle+5;
  rotate(angle*PI/180);
  text(&quot;おいしい&quot;, 0, 0);
  popMatrix();
  if(angle&amp;gt;360){
    angle=0;
  }
}
&lt;/pre&gt;
これが，こうなる↓
&lt;br /&gt;
&lt;script src=&quot;http://www.ne.jp/asahi/sw/mhrz/lib/processing-1.4.1.min.js&quot;&gt;&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;
window.onload = function(){var canvas = document.getElementByID(&quot;canvas00&quot;);for ( var i = 0; i &lt; canvas.length; i++ ){Processing( canvas[i], canvas[i].previousSibling.textContent );
}};&lt;/script&gt;&lt;body&gt;
&lt;script type=&quot;application/processing&quot;&gt;
int angle;
void setup(){
  frameRate(100);
  size(400,400);
  PFont myFont = createFont(&quot;Osaka&quot;, 32);
  textFont(myFont);
  angle=0;
}

void draw(){
  background(0);
  pushMatrix();
  translate(width/2, height/2);
  angle=angle+5;
  rotate(angle*PI/180);
  text(&quot;おいしい&quot;, 0, 0);
  popMatrix();
  if(angle&gt;360){
    angle=0;
  }
}
&lt;/script&gt;&lt;canvas id=&quot;canvas00&quot;&gt;&lt;/canvas&gt;
&lt;/body&gt;</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/344265603519308223/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2012/12/processingjs.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/344265603519308223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/344265603519308223'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2012/12/processingjs.html' title='Processing.jsを使ってみる'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-4898583835583054917</id><published>2012-12-03T23:57:00.002+09:00</published><updated>2012-12-10T23:25:12.734+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="openstreetmap"/><category scheme="http://www.blogger.com/atom/ns#" term="sparql"/><category scheme="http://www.blogger.com/atom/ns#" term="xslt"/><title type='text'>dbpedia.orgの内容をopenstreetmapに表示する</title><content type='html'>dbpedia.orgの内容をopenstreetmapに表示する実験．&lt;br /&gt;
&lt;br /&gt;
本当はリアルタイムでdbpedia.org endpointに問い合わせられるといいのだけど，&lt;br /&gt;
&lt;br /&gt;
何となく負荷が気になるので&lt;br /&gt;
&lt;br /&gt;
今回は問い合わせ結果をSPARQL Result XML Formatに保存し，&lt;br /&gt;
&lt;br /&gt;
それをopenstreetmapに表示する．&lt;br /&gt;
&lt;br /&gt;
まずはdbpedia.orgへの問い合わせ．&lt;br /&gt;
&lt;br /&gt;
SPARQLクエリは以下のとおり．&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: sql&quot;&gt;
PREFIX rdf: &amp;lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&amp;gt;
PREFIX rdfs: &amp;lt;http://www.w3.org/2000/01/rdf-schema#&amp;gt;
PREFIX wgs84_pos: &amp;lt;http://www.w3.org/2003/01/geo/wgs84_pos#&amp;gt;
PREFIX dbpedia-owl: &amp;lt;http://dbpedia.org/ontology/&amp;gt;
PREFIX yago: &amp;lt;http://dbpedia.org/class/yago/&amp;gt;
select ?lat ?lon ?title ?description ?icon ?iconSize ?iconOffset where{
?s rdf:type yago:PrefecturesOfJapan .
?s rdfs:label ?title .
?s dbpedia-owl:abstract ?description .
?s wgs84_pos:lat ?lat .
?s wgs84_pos:long ?lon .
filter (lang(?title)=&quot;en&quot;) .
filter (lang(?description)=&quot;en&quot;).
optional {
?s &amp;lt;urn:hoge&amp;gt; ?icon .
?s &amp;lt;urn:hoge2&amp;gt; ?iconSize .
?s &amp;lt;urn:hoge3&amp;gt; ?iconOffset .
}
}

&lt;/pre&gt;
&lt;br /&gt;
日本の都道府県を検索しその概要と緯度経度情報を取得するクエリである．&lt;br /&gt;
&lt;br /&gt;
この結果をOpenLayers.Layer.Text()を使って表示する．&lt;br /&gt;
&lt;br /&gt;
OPTIONALはかなり強引・・・&lt;br /&gt;
&lt;br /&gt;
先のクエリをdbpedia.orgのendpointに投げると&lt;a href=&quot;http://www.sheepcloud.org/public/20121202sparqlresult.xml&quot; target=&quot;_blank&quot;&gt;こんな感じ&lt;/a&gt;のSPARQL Result XML Formatが帰ってくる．&lt;br /&gt;
&lt;br /&gt;
これを&lt;a href=&quot;http://my-sheep-cloud.blogspot.jp/2012/12/xsltsparql-query-results-xml.html&quot; target=&quot;_blank&quot;&gt;先のポスト&lt;/a&gt;で作成したXSLでTSVに変換し，&lt;br /&gt;
&lt;br /&gt;
OpenLayers.Layer.Text()で読み込めば完成．&lt;br /&gt;
&lt;br /&gt;
XSLTはphpで実行している．&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;canvas&quot; style=&quot;height: 400px; width: 500px;&quot;&gt;
&lt;script src=&quot;http://www.openlayers.org/api/OpenLayers.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
function init() {
   var map = new OpenLayers.Map(&quot;canvas&quot;);
   var mapnik = new OpenLayers.Layer.OSM();
   map.addLayer(mapnik);
    
   var lonLat = new OpenLayers.LonLat(139.395,35.67133).transform(new OpenLayers.Projection(&quot;EPSG:4326&quot;),new OpenLayers.Projection(&quot;EPSG:900913&quot;));
   map.setCenter(lonLat, 6);

var pois = new OpenLayers.Layer.Text(&quot;My Points&quot;, 
   { 
        location:&quot;http://www.sheepcloud.org/services/xslt-test-srv.php?xml=http://www.sheepcloud.org/public/20121202sparqlresult.xml&amp;xsl=http://www.sheepcloud.org/xsl/result-to-tsv.xsl&quot;
    }
);
map.addLayer(pois);
}
init();
&lt;/script&gt;
&lt;/div&gt;
&lt;br /&gt;
うん．いい感じ．&lt;br /&gt;
&lt;br /&gt;
北海道がないのはクエリにある&lt;br /&gt;
&lt;br /&gt;
?s rdf:type yago:PrefecturesOfJapan .&lt;br /&gt;
&lt;br /&gt;
の所為．&lt;br /&gt;
&lt;br /&gt;
なんでかな．&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/4898583835583054917/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2012/12/dbpediaorgopenstreetmap.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/4898583835583054917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/4898583835583054917'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2012/12/dbpediaorgopenstreetmap.html' title='dbpedia.orgの内容をopenstreetmapに表示する'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-1486727623355703329</id><published>2012-12-02T15:36:00.001+09:00</published><updated>2012-12-10T23:48:59.594+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="sparql"/><category scheme="http://www.blogger.com/atom/ns#" term="xslt"/><title type='text'>XSLTを使ってSPARQL Query Results XML FormatをCSV/TSV形式にする</title><content type='html'>&lt;a href=&quot;http://www.w3.org/TR/rdf-sparql-XMLres/&quot; target=&quot;_blank&quot;&gt;SPARQL Query Results XML Format&lt;/a&gt;にあるXSLTサンプル&lt;a href=&quot;http://www.w3.org/TR/rdf-sparql-XMLres/result-to-html.xsl&quot;&gt;result-to-html.xsl&lt;/a&gt;を少し書き換えてCSV/TSVを出力するようにしてみた．&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&#39;brush:xml;&#39;&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;  
&amp;lt;xsl:stylesheet exclude-result-prefixes=&quot;res xsl&quot; version=&quot;1.0&quot; xmlns:res=&quot;http://www.w3.org/2005/sparql-results#&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&amp;gt;
  &amp;lt;xsl:output encoding=&quot;UTF-8&quot; method=&quot;text&quot;&amp;gt;
    &amp;lt;xsl:template name=&quot;boolean-result&quot;&amp;gt;
      &amp;lt;xsl:value-of select=&quot;res:boolean&quot;&amp;gt;
  &amp;lt;/xsl:value-of&amp;gt;&amp;lt;/xsl:template&amp;gt;
  &amp;lt;xsl:template name=&quot;vb-result&quot;&amp;gt;
   &amp;lt;xsl:for-each select=&quot;res:head/res:variable&quot;&amp;gt;
     &amp;lt;xsl:value-of select=&quot;@name&quot;&amp;gt;
     &amp;lt;xsl:text&amp;gt;,&amp;lt;/xsl:text&amp;gt;
   &amp;lt;/xsl:value-of&amp;gt;&amp;lt;/xsl:for-each&amp;gt;
 &amp;lt;xsl:for-each select=&quot;res:results/res:result&quot;&amp;gt;
&amp;lt;xsl:text&amp;gt;
&amp;lt;/xsl:text&amp;gt;
     &amp;lt;xsl:apply-templates select=&quot;.&quot;&amp;gt;
  &amp;lt;/xsl:apply-templates&amp;gt;&amp;lt;/xsl:for-each&amp;gt;
  &amp;lt;/xsl:template&amp;gt;
  &amp;lt;xsl:template match=&quot;res:result&quot;&amp;gt;
    &amp;lt;xsl:variable name=&quot;current&quot; select=&quot;.&quot;&amp;gt;
    &amp;lt;xsl:for-each select=&quot;//res:head/res:variable&quot;&amp;gt;
      &amp;lt;xsl:variable name=&quot;name&quot; select=&quot;@name&quot;&amp;gt;
 &amp;lt;xsl:choose&amp;gt;
   &amp;lt;xsl:when test=&quot;$current/res:binding[@name=$name]&quot;&amp;gt;
     &amp;lt;xsl:apply-templates select=&quot;$current/res:binding[@name=$name]&quot;&amp;gt;
   &amp;lt;/xsl:apply-templates&amp;gt;&amp;lt;/xsl:when&amp;gt;
   &amp;lt;xsl:otherwise&amp;gt;
   &amp;lt;/xsl:otherwise&amp;gt;
 &amp;lt;/xsl:choose&amp;gt;
 &amp;lt;xsl:text&amp;gt;,&amp;lt;/xsl:text&amp;gt;
    &amp;lt;/xsl:variable&amp;gt;&amp;lt;/xsl:for-each&amp;gt;
  &amp;lt;/xsl:variable&amp;gt;&amp;lt;/xsl:template&amp;gt;
  &amp;lt;xsl:template match=&quot;res:bnode&quot;&amp;gt;
    &amp;lt;xsl:value-of select=&quot;text()&quot;&amp;gt;
  &amp;lt;/xsl:value-of&amp;gt;&amp;lt;/xsl:template&amp;gt;
  &amp;lt;xsl:template match=&quot;res:uri&quot;&amp;gt;
    &amp;lt;xsl:variable name=&quot;uri&quot; select=&quot;text()&quot;&amp;gt;
&amp;lt;xsl:value-of select=&quot;$uri&quot;&amp;gt;
 &amp;lt;/xsl:value-of&amp;gt;&amp;lt;/xsl:variable&amp;gt;&amp;lt;/xsl:template&amp;gt;
  &amp;lt;xsl:template match=&quot;res:literal&quot;&amp;gt;
    &amp;lt;xsl:choose&amp;gt;
&amp;lt;!--
      &amp;lt;xsl:when test=&quot;@datatype&quot;&amp;gt;
 &amp;lt;xsl:value-of select=&quot;text()&quot;/&amp;gt; (datatype &amp;lt;xsl:value-of select=&quot;@datatype&quot;/&amp;gt; )
      &amp;lt;/xsl:when&amp;gt;
      &amp;lt;xsl:when test=&quot;@xml:lang&quot;&amp;gt;
 &amp;lt;xsl:value-of select=&quot;text()&quot;/&amp;gt; @ &amp;lt;xsl:value-of select=&quot;@xml:lang&quot;/&amp;gt;
      &amp;lt;/xsl:when&amp;gt;
      &amp;lt;xsl:when test=&quot;string-length(text()) != 0&quot;&amp;gt;
 &amp;lt;xsl:value-of select=&quot;text()&quot;/&amp;gt;
      &amp;lt;/xsl:when&amp;gt;
      &amp;lt;xsl:when test=&quot;string-length(text()) = 0&quot;&amp;gt;
      &amp;lt;xsl:text&amp;gt;&amp;lt;/xsl:text&amp;gt;
      &amp;lt;/xsl:when&amp;gt;
--&amp;gt;
      &amp;lt;xsl:when test=&quot;string-length(text()) != 0&quot;&amp;gt;
 &amp;lt;xsl:value-of select=&quot;text()&quot;&amp;gt;
      &amp;lt;/xsl:value-of&amp;gt;&amp;lt;/xsl:when&amp;gt;
    &amp;lt;/xsl:choose&amp;gt;
  &amp;lt;/xsl:template&amp;gt;
  &amp;lt;xsl:template match=&quot;res:sparql&quot;&amp;gt;
     &amp;lt;xsl:choose&amp;gt;
   &amp;lt;xsl:when test=&quot;res:boolean&quot;&amp;gt;
     &amp;lt;xsl:call-template name=&quot;boolean-result&quot;&amp;gt;
   &amp;lt;/xsl:call-template&amp;gt;&amp;lt;/xsl:when&amp;gt;
   &amp;lt;xsl:when test=&quot;res:results&quot;&amp;gt;
     &amp;lt;xsl:call-template name=&quot;vb-result&quot;&amp;gt;
   &amp;lt;/xsl:call-template&amp;gt;&amp;lt;/xsl:when&amp;gt;
 &amp;lt;/xsl:choose&amp;gt;
  &amp;lt;/xsl:template&amp;gt;
&amp;lt;/xsl:output&amp;gt;
&amp;lt;/xsl:stylesheet&amp;gt;
&lt;/pre&gt;
TSVを出力する場合は「,」とある箇所をタブに書き換えればよい．&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/1486727623355703329/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2012/12/xsltsparql-query-results-xml.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/1486727623355703329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/1486727623355703329'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2012/12/xsltsparql-query-results-xml.html' title='XSLTを使ってSPARQL Query Results XML FormatをCSV/TSV形式にする'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-6844583075374385491</id><published>2012-11-24T21:40:00.000+09:00</published><updated>2012-11-26T22:01:22.676+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="sparql"/><category scheme="http://www.blogger.com/atom/ns#" term="timeline"/><title type='text'>SPARQL ResultをSIMILE Timeline Widgetで表示する</title><content type='html'>昔からあるツールだけど時系列データの可視化ツール「SIMILE Timeline Widget」はSPARQLによる問い合わせ結果をそのまま表示できるらしい．&lt;br /&gt;
&lt;br /&gt;
さっそく試してみる．&lt;br /&gt;
&lt;br /&gt;
問い合わせは先はdbpedia.org．&lt;br /&gt;
&lt;br /&gt;
SPARQL endpointはhttp://dbpedia.org/sparqlを利用する．&lt;br /&gt;
&lt;br /&gt;
問い合わせ文は以下のとおり．&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
PREFIX rdf: &amp;lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&amp;gt;&lt;br /&gt;
PREFIX rdfs:&amp;lt;http://www.w3.org/2000/01/rdf-schema#&amp;gt;&lt;br /&gt;
PREFIX foaf:&amp;lt;http://xmlns.com/foaf/0.1/&amp;gt;&lt;br /&gt;
PREFIX dbpprop: &amp;lt;http://dbpedia.org/property/&amp;gt;&lt;br /&gt;
select * where {&lt;br /&gt;
?s rdf:type foaf:Person .&lt;br /&gt;
?s rdf:type &amp;lt;http://dbpedia.org/class/yago/PeopleOfMuromachiPeriodJapan&amp;gt; .&lt;br /&gt;
?s rdfs:label &amp;nbsp;?title.&lt;br /&gt;
filter(lang(?title)=&quot;ja&quot;).&lt;br /&gt;
?s rdfs:comment &amp;nbsp;?description.&lt;br /&gt;
filter(lang(?description)=&quot;ja&quot;).&lt;br /&gt;
?s dbpprop:dateOfBirth ?start .&lt;br /&gt;
?s dbpprop:dateOfDeath ?end .&lt;br /&gt;
?s foaf:isPrimaryTopicOf ?link .&lt;br /&gt;
}&lt;/blockquote&gt;
室町時代の日本人の生没年と解説を検索する．&lt;br /&gt;
&lt;br /&gt;
Timelineの方は以下のとおり．&lt;br /&gt;
&lt;br /&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;br /&gt;&lt;/blockquote&gt;
&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;span class=&quot;webkit-html-doctype&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;span class=&quot;webkit-html-tag&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;span class=&quot;webkit-html-tag&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;span class=&quot;webkit-html-tag&quot;&gt;&amp;lt;meta &lt;span class=&quot;webkit-html-attribute-name&quot;&gt;charset&lt;/span&gt;=&quot;&lt;span class=&quot;webkit-html-attribute-value&quot;&gt;utf-8&lt;/span&gt;&quot; /&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;span class=&quot;webkit-html-tag&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Timeline demo&lt;span class=&quot;webkit-html-tag&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;span class=&quot;webkit-html-comment&quot;&gt;&amp;lt;!--[if IE]&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;span class=&quot;webkit-html-comment&quot;&gt;&amp;lt;script src=&quot;http://html5shiv.googlecode.com/svn/trunk/html5.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;span class=&quot;webkit-html-comment&quot;&gt;&amp;lt;![endif]--&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;span class=&quot;webkit-html-tag&quot;&gt;&amp;lt;script &lt;span class=&quot;webkit-html-attribute-name&quot;&gt;src&lt;/span&gt;=&quot;&lt;a class=&quot;webkit-html-attribute-value webkit-html-resource-link&quot; href=&quot;http://www.sheepcloud.org/lod/libs/timeline/api/timeline-api.js&quot; target=&quot;_blank&quot;&gt;libs/timeline/api/timeline-api.js&lt;/a&gt;&quot; &lt;span class=&quot;webkit-html-attribute-name&quot;&gt;type&lt;/span&gt;=&quot;&lt;span class=&quot;webkit-html-attribute-value&quot;&gt;text/javascript&lt;/span&gt;&quot;&amp;gt;&lt;/span&gt;&lt;span class=&quot;webkit-html-tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;span class=&quot;webkit-html-tag&quot;&gt;&amp;lt;script &lt;span class=&quot;webkit-html-attribute-name&quot;&gt;type&lt;/span&gt;=&quot;&lt;span class=&quot;webkit-html-attribute-value&quot;&gt;text/javascript&lt;/span&gt;&quot;&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;var tl;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;function onLoad() {&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;var eventSource = new Timeline.DefaultEventSource();&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;var bandInfos = [&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;Timeline.createBandInfo({&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;eventSource: eventSource,&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;date: &quot;Jun 1 1534 00:00:00&quot;,&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;width:          &quot;80%&quot;,&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;intervalUnit:   Timeline.DateTime.YEAR,&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;intervalPixels: 10&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;}),&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;Timeline.createBandInfo({&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;overview:       true,&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;eventSource: eventSource,&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;date: &quot;Jun 1 1534 00:00:00&quot;,&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;width:          &quot;20%&quot;, &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;intervalUnit:   Timeline.DateTime.YEAR, &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;intervalPixels: 200&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;})&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;];&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;bandInfos[1].syncWith = 0;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;bandInfos[1].highlight = true;  &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;tl = Timeline.create(document.getElementById(&quot;my-timeline&quot;), bandInfos);&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;//var sparql=&quot;/lod/result01.xml&quot;;&lt;br /&gt;
var sparql=&quot;http://dbpedia.org/sparql?query=以降省略&quot;;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;Timeline.loadXML(sparql,function(xml,url){eventSource.loadSPARQL(xml,url);});&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;var resizeTimerID = null;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;function onResize() {&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;if (resizeTimerID == null) {&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;resizeTimerID = window.setTimeout(function() {&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;resizeTimerID = null;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;tl.layout();&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;}, 500);&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;span class=&quot;webkit-html-tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;span class=&quot;webkit-html-tag&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;span class=&quot;webkit-html-tag&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;span class=&quot;webkit-html-tag&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;span class=&quot;webkit-html-tag&quot;&gt;&amp;lt;body &lt;span class=&quot;webkit-html-attribute-name&quot;&gt;onload&lt;/span&gt;=&quot;&lt;span class=&quot;webkit-html-attribute-value&quot;&gt;onLoad();&lt;/span&gt;&quot; &lt;span class=&quot;webkit-html-attribute-name&quot;&gt;onresize&lt;/span&gt;=&quot;&lt;span class=&quot;webkit-html-attribute-value&quot;&gt;onResize();&lt;/span&gt;&quot;&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;span class=&quot;webkit-html-tag&quot;&gt;&amp;lt;div &lt;span class=&quot;webkit-html-attribute-name&quot;&gt;id&lt;/span&gt;=&quot;&lt;span class=&quot;webkit-html-attribute-value&quot;&gt;my-timeline&lt;/span&gt;&quot; &lt;span class=&quot;webkit-html-attribute-name&quot;&gt;style&lt;/span&gt;=&quot;&lt;span class=&quot;webkit-html-attribute-value&quot;&gt;height: 600px; width: 800px; border:1px solid #aaa&lt;/span&gt;&quot;&amp;gt;&lt;/span&gt;&lt;span class=&quot;webkit-html-tag&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;span class=&quot;webkit-html-tag&quot;&gt;&amp;lt;noscript&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;This page uses Javascript to show you a Timeline. Please enable Javascript in your browser to see the full page. Thank you.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;span class=&quot;webkit-html-tag&quot;&gt;&amp;lt;/noscript&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;span class=&quot;webkit-html-tag&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;webkit-line-number&quot;&gt;&lt;/td&gt;&lt;td class=&quot;webkit-line-content&quot;&gt;&lt;span class=&quot;webkit-html-tag&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
結果波以下のとおり．&lt;br /&gt;
&lt;br /&gt;
うーん．こんなことが簡単にできるなんて，&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwZaES0Q4Z-21dcqWyzAti2wiPe1p4nOYPfxB7mV_6bOzDaPmFpN0iyeL6hu6l8PoPLLsC3Aa8whj9oe_RDBAYQFPBz4wrf9VJ56D9tgIa-YQzC_21Whyphenhyphen5wws15Pgn1ZZy-IQwD7xI8y9s/s1600/%25E3%2582%25B9%25E3%2582%25AF%25E3%2583%25AA%25E3%2583%25BC%25E3%2583%25B3%25E3%2582%25B7%25E3%2583%25A7%25E3%2583%2583%25E3%2583%2588+2012-11-24+19.21.54.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwZaES0Q4Z-21dcqWyzAti2wiPe1p4nOYPfxB7mV_6bOzDaPmFpN0iyeL6hu6l8PoPLLsC3Aa8whj9oe_RDBAYQFPBz4wrf9VJ56D9tgIa-YQzC_21Whyphenhyphen5wws15Pgn1ZZy-IQwD7xI8y9s/s1600/%25E3%2582%25B9%25E3%2582%25AF%25E3%2583%25AA%25E3%2583%25BC%25E3%2583%25B3%25E3%2582%25B7%25E3%2583%25A7%25E3%2583%2583%25E3%2583%2588+2012-11-24+19.21.54.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
色々と使えそう．</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/6844583075374385491/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2012/11/sparql-resultsimile-timeline-widget.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/6844583075374385491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/6844583075374385491'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2012/11/sparql-resultsimile-timeline-widget.html' title='SPARQL ResultをSIMILE Timeline Widgetで表示する'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwZaES0Q4Z-21dcqWyzAti2wiPe1p4nOYPfxB7mV_6bOzDaPmFpN0iyeL6hu6l8PoPLLsC3Aa8whj9oe_RDBAYQFPBz4wrf9VJ56D9tgIa-YQzC_21Whyphenhyphen5wws15Pgn1ZZy-IQwD7xI8y9s/s72-c/%25E3%2582%25B9%25E3%2582%25AF%25E3%2583%25AA%25E3%2583%25BC%25E3%2583%25B3%25E3%2582%25B7%25E3%2583%25A7%25E3%2583%2583%25E3%2583%2588+2012-11-24+19.21.54.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-130805725050031521</id><published>2012-11-02T22:15:00.000+09:00</published><updated>2012-11-03T07:08:26.685+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="octave"/><title type='text'>Octaveで波形を描画する</title><content type='html'>Octave(&lt;a href=&quot;http://octave.sourceforge.net/&quot;&gt;http://octave.sourceforge.net/&lt;/a&gt;)を使っても波形を描画できる．&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
というかOctaveの方が向いているらしい．&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
まずは関数の定義．&lt;/div&gt;
&lt;div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
function draw(freq,f,sec) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;nn=1:(freq*sec); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;tt=nn/freq; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;plot(tt,f(1:(freq*sec))); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
endfunction &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
function [f]=cliping(f) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;for i=1:length(f) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; if (f(i) &amp;gt; 1.0) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp;f(i)=1.0; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; elseif (f(i) &amp;lt; -1.0) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp;f(i)=-1.0; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; endif &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;endfor &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
endfunction&amp;nbsp;&lt;/blockquote&gt;
&lt;div&gt;
正弦波&lt;/div&gt;
&lt;div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
fs=44100; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
n=0:fs; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
t=n/fs;&lt;br /&gt;
f1=440; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
s=sin(2*pi*f1*t); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
s=cliping(s); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
draw(fs,s,0.01);&lt;/blockquote&gt;
&lt;/div&gt;
&lt;div&gt;
三角波&lt;/div&gt;
&lt;div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
fs=44100; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
n=0:fs; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
t=n/fs;&lt;br /&gt;
f1=440;&lt;br /&gt;
s=t*0; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
for k=0:10&lt;br /&gt;
s+=(-1)^k*(sin((2*k+1)*2*pi*f1*t)/(2*k+1)^2);&lt;br /&gt;
endfor&lt;br /&gt;
s=8/pi^2*s;&lt;br /&gt;
s=cliping(s);&lt;br /&gt;
draw(fs,s,0.01);&lt;/blockquote&gt;
&lt;/div&gt;
&lt;div&gt;
矩形波&lt;/div&gt;
&lt;div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
fs=44100;&lt;br /&gt;
n=0:fs;&lt;br /&gt;
t=n/fs;&lt;br /&gt;
f1=440; &amp;nbsp; &lt;br /&gt;
s=t*0;&lt;br /&gt;
for k=1:1000&lt;br /&gt;
&amp;nbsp;s+=sin((2*k-1)*pi*f1*t)/(2*k-1);&lt;br /&gt;
endfor&lt;br /&gt;
s=4/pi*s;&lt;br /&gt;
s=cliping(s);&lt;br /&gt;
draw(fs,s,0.01);&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLS5CTFDdMHYj0UqjNaRKjEOOW-rsHOIv9s-bixdkui_s-IcX0nfO6RFoAFzO8PMOyuZA4IegFjf8l-vflvre60xdGLanS4leDKTbw3j1MQ11IEqavFX6bzVDuPuHlw0VYeHKY4bolgGx2/s1600/Figure+1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLS5CTFDdMHYj0UqjNaRKjEOOW-rsHOIv9s-bixdkui_s-IcX0nfO6RFoAFzO8PMOyuZA4IegFjf8l-vflvre60xdGLanS4leDKTbw3j1MQ11IEqavFX6bzVDuPuHlw0VYeHKY4bolgGx2/s1600/Figure+1.png&quot; height=&quot;240&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
ノコギリ波&lt;/div&gt;
&lt;div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
fs=44100;&lt;br /&gt;
n=0:fs;&lt;br /&gt;
t=n/fs;&lt;br /&gt;
f1=440; &amp;nbsp; &lt;br /&gt;
s=t*0;&lt;br /&gt;
for k=1:1000&lt;br /&gt;
&amp;nbsp;s+=sin(2*pi*k*f1*t)/k;&lt;br /&gt;
endfor&lt;br /&gt;
s=2/pi*s;&lt;br /&gt;
s=cliping(s);&lt;br /&gt;
draw(fs,s,0.01);&lt;/blockquote&gt;
&lt;/div&gt;
&lt;div&gt;
さらにoctave-audioをインストールしてあると，下記でサウンド再生も可能．&lt;/div&gt;
&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
sound(s,fs);&lt;/blockquote&gt;
これは素晴らしい．&lt;br /&gt;
&lt;br /&gt;
各種波形の特徴を是非サウンドで感じてみて．&lt;br /&gt;
&lt;br /&gt;
ちなみにMacOSX環境だと下記のエラーが表示されるかもしれない．&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
octave:7&amp;gt; sound(f1,fs);&lt;br /&gt;
ssh: connect to host air.local port 22: Connection refused&lt;br /&gt;
warning: broken pipe -- some output may be lost&lt;br /&gt;
sound_play_utility = ofsndplay -&lt;/blockquote&gt;
&lt;br /&gt;
&amp;nbsp;そんなときはplayerの定義と，&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ vi ~/.octaverc&lt;br /&gt;
global sound_play_utility=&quot;~/bin/octaveplay&quot;;&lt;br /&gt;
$ mkdir ~/bin&lt;br /&gt;
$ vi ~/bin/octaveplay&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
cat &amp;gt; ~/.octave_play.au&lt;br /&gt;
afplay ~/.octave_play.au&lt;br /&gt;
rm -f ~/.octave_play.au&amp;nbsp;&amp;nbsp;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ chmod u+x ~/bin/octaveplay&lt;/blockquote&gt;
sound.mの96行目あたりにislocal=1;を書き込んでlocal modeを強制して．&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp;$ sudo vi /opt/local/share/octave/packages/audio-1.1.4/sound.m&amp;nbsp;&lt;/blockquote&gt;
このファイルの&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp;display=getenv(&quot;DISPLAY&quot;);&lt;br /&gt;
&amp;nbsp;colon = rindex(display,&quot;:&quot;);&lt;br /&gt;
&amp;nbsp;if isempty(display) || colon==1&lt;br /&gt;
&amp;nbsp; &amp;nbsp;islocal = 1;&lt;br /&gt;
&amp;nbsp;else&lt;br /&gt;
&amp;nbsp; &amp;nbsp;if colon, display = display(1:colon-1); endif&lt;br /&gt;
&amp;nbsp; &amp;nbsp;host=getenv(&quot;HOSTNAME&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp;if isempty(host),&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;[status, host] = system(&quot;uname -n&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;## trim newline from end of hostname&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;if !isempty(host), host = host(1:length(host)-1); endif&lt;br /&gt;
&amp;nbsp; &amp;nbsp;endif&lt;br /&gt;
&amp;nbsp; &amp;nbsp;islocal = strcmp(tolower(host),tolower(display));&lt;br /&gt;
&amp;nbsp;endif&lt;/blockquote&gt;
これ以降に&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
islocal=1;&lt;/blockquote&gt;
を追加する．&lt;br /&gt;
&lt;br /&gt;
これでサウンド再生ができるようになる．&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/130805725050031521/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2012/11/octave.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/130805725050031521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/130805725050031521'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2012/11/octave.html' title='Octaveで波形を描画する'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLS5CTFDdMHYj0UqjNaRKjEOOW-rsHOIv9s-bixdkui_s-IcX0nfO6RFoAFzO8PMOyuZA4IegFjf8l-vflvre60xdGLanS4leDKTbw3j1MQ11IEqavFX6bzVDuPuHlw0VYeHKY4bolgGx2/s72-c/Figure+1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-8902657896690686465</id><published>2012-11-01T22:41:00.001+09:00</published><updated>2012-11-01T23:14:51.903+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="R"/><title type='text'>Rで波形を描画する</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Rを使って色々な波形を描画しようと思う．&lt;br /&gt;
&lt;br /&gt;
まずは基本パラメータを設定する．&lt;br /&gt;
&lt;br /&gt;
サンプリング回数は44.1kHz，&lt;br /&gt;
描画する波形の周波数は440Hzとする．&lt;br /&gt;
作成する波形は１秒間とする．&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
freq=44100;&lt;br /&gt;
nn=1:freq;&lt;br /&gt;
tt=nn/freq;&lt;br /&gt;
f1=440;&lt;/blockquote&gt;
&lt;div&gt;
描画用の関数とクリッピング用の関数を定義する．&lt;/div&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
draw&amp;lt;-function(s,sec){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;freq=44100;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;nn=1:(freq*sec);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;tt=nn/freq; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;plot(tt,s[1:(freq*sec)],type=&quot;l&quot;,col=&quot;blue&quot;);&lt;br /&gt;
}&lt;br /&gt;
cliping&amp;lt;-function(s){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;for(i in 1:length(s)){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(s[i] &amp;gt; 1.0 ) s[i]=1.0;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(s[i] &amp;lt; -1.0 ) s[i]=-1.0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;return(s);&lt;br /&gt;
}&lt;/blockquote&gt;
&lt;br /&gt;
これで準備は整った．&lt;br /&gt;
&lt;br /&gt;
まずは正弦波を描画する．&lt;br /&gt;
描画する波形は0.01秒分としている．&lt;br /&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/Sine_wave&quot; rel=&quot;nofollow&quot; style=&quot;background-color: white; color: #a63d21; font-family: verdana, arial, helvetica, sans-serif; font-size: 13.333333015441895px; line-height: 17.33333396911621px; text-decoration: none;&quot;&gt;http://en.wikipedia.org/wiki/Sine_wave&lt;/a&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
s=sin(2*pi*tt*f1);&lt;br /&gt;
s=cliping(s);&lt;br /&gt;
draw(s,0.01);&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYFd-RKiWpueDTeR8C6XmW4rEdOINDslBCvROliOOwfvqH5OTWj8GxCRqt9nrzU3kH4hktpY8d1Ritk2dF-PLgsbmZSq54VmuYmj-QYNNrfagNvEsaKBjPpW98ZKBLAm83cOPwNsygnxEd/s1600/sin.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYFd-RKiWpueDTeR8C6XmW4rEdOINDslBCvROliOOwfvqH5OTWj8GxCRqt9nrzU3kH4hktpY8d1Ritk2dF-PLgsbmZSq54VmuYmj-QYNNrfagNvEsaKBjPpW98ZKBLAm83cOPwNsygnxEd/s1600/sin.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
つぎは三角波．&lt;br /&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/Triangle_wave&quot; rel=&quot;nofollow&quot; style=&quot;background-color: white; color: #a63d21; font-family: verdana, arial, helvetica, sans-serif; font-size: 13.333333015441895px; line-height: 17.33333396911621px; text-decoration: none;&quot;&gt;http://en.wikipedia.org/wiki/Triangle_wave&lt;/a&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
s=tt*0;&lt;br /&gt;
for(k in 0:10){&lt;br /&gt;
s=(-1)^k*(sin((2*k+1)*2*pi*f1*tt)/(2*k+1)^2)+s;&lt;br /&gt;
}&lt;br /&gt;
s=8/pi^2*s;&lt;br /&gt;
s=cliping(s);&lt;br /&gt;
draw(s,0.01);&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimqI2uZeDOSqo5UBq-aTpwTugCd85iSA8JVdjwC7YyD6oPzhzgCJJDaKbzX3Pnxwglh3CaiAtJaiYGGt2qxPdqnbyrBk7j2m-J6owxuT5Tkh_zK0pLBIyz7_3avRkYJmxXdZYY9itqDJKr/s1600/triangle.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimqI2uZeDOSqo5UBq-aTpwTugCd85iSA8JVdjwC7YyD6oPzhzgCJJDaKbzX3Pnxwglh3CaiAtJaiYGGt2qxPdqnbyrBk7j2m-J6owxuT5Tkh_zK0pLBIyz7_3avRkYJmxXdZYY9itqDJKr/s1600/triangle.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
つぎは矩形波．&lt;br /&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/Square_wave&quot; rel=&quot;nofollow&quot; style=&quot;background-color: white; color: #a63d21; font-family: verdana, arial, helvetica, sans-serif; font-size: 13.333333015441895px; line-height: 17.33333396911621px; text-decoration: none;&quot;&gt;http://en.wikipedia.org/wiki/Square_wave&lt;/a&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
s=tt*0;&lt;br /&gt;
for(k in 1:1000){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; s=s+sin((2*k-1)*pi*f1*tt)/(2*k-1);&lt;br /&gt;
}&lt;br /&gt;
s=4/pi*s;&lt;br /&gt;
s=cliping(s);&lt;br /&gt;
draw(s,0.01);&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfCemrVEvmxp2SSt1VbRWEDt80U22ZEUygpVGjlA2uzhI5uIoqTEm_QAQ07XzOtKPFnpFlyR3HP0bttoitgEN9qr3N_xdAij0Mbe2_SRlP9jUjDZfGL8MziMVHSj2JuONB-VVARzKhKZ4E/s1600/square.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfCemrVEvmxp2SSt1VbRWEDt80U22ZEUygpVGjlA2uzhI5uIoqTEm_QAQ07XzOtKPFnpFlyR3HP0bttoitgEN9qr3N_xdAij0Mbe2_SRlP9jUjDZfGL8MziMVHSj2JuONB-VVARzKhKZ4E/s1600/square.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
最後はノコギリ波．&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/Sawtooth_wave&quot; rel=&quot;nofollow&quot; style=&quot;background-color: white; color: #a63d21; font-family: verdana, arial, helvetica, sans-serif; font-size: 13.333333015441895px; line-height: 17.33333396911621px; text-decoration: none;&quot;&gt;http://en.wikipedia.org/wiki/Sawtooth_wave&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
s=tt*0;&lt;br /&gt;
for(k in 1:1000){&lt;br /&gt;
s=s+sin(2*pi*k*f1*tt)/k;&lt;br /&gt;
}&lt;br /&gt;
s=2/pi*s;&lt;br /&gt;
s=cliping(s);&lt;br /&gt;
draw(s,0.01);&lt;/blockquote&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsetXesq7PIy2aNim0iTXOhNvczppkV6RHipJXdJAsvs6TF2NHIJSn1Havf52zlR8Q8n_uCFKJGk9Lqdh7FRvxLGRWG32xLXJjYosxGveIbh0edyqu6Oi7gxHpdAR8bB_H5jeaEm2cQ2ks/s1600/saw.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsetXesq7PIy2aNim0iTXOhNvczppkV6RHipJXdJAsvs6TF2NHIJSn1Havf52zlR8Q8n_uCFKJGk9Lqdh7FRvxLGRWG32xLXJjYosxGveIbh0edyqu6Oi7gxHpdAR8bB_H5jeaEm2cQ2ks/s1600/saw.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
こんなことが簡単にできてしまうのだからRは面白い．&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
波形データは以下で書き出せる．&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
write(s,&quot;wav.txt&quot;,ncolumns=1);&lt;/blockquote&gt;
&lt;div&gt;
書き出したファイルは&lt;a href=&quot;http://www.kk.iij4u.or.jp/~kondo/wave/&quot; target=&quot;_blank&quot;&gt;txt2wav&lt;/a&gt;でwavファイルに変換できる．&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
txt2wav.cのコンパイルは&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ gcc -m32 -o txt2wav txt2wav.c&amp;nbsp;&lt;/blockquote&gt;
&lt;div&gt;
な感じで(64bit環境の場合ね)．&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/8902657896690686465/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2012/11/r.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/8902657896690686465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/8902657896690686465'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2012/11/r.html' title='Rで波形を描画する'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYFd-RKiWpueDTeR8C6XmW4rEdOINDslBCvROliOOwfvqH5OTWj8GxCRqt9nrzU3kH4hktpY8d1Ritk2dF-PLgsbmZSq54VmuYmj-QYNNrfagNvEsaKBjPpW98ZKBLAm83cOPwNsygnxEd/s72-c/sin.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-5442478495534550642</id><published>2012-03-29T00:51:00.004+09:00</published><updated>2012-03-29T00:52:21.150+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><title type='text'>バックアップ＆リストア</title><content type='html'>androidをバックアップする．&lt;br /&gt;
&lt;br /&gt;
$ adb backup -f 20120328.bak -all -apk -shared&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU3NLa8gfpBpGZmTEVGq7-IaaYol7i0gF0wKJ5u274sjEZ8gaMW4c4ND0CxAJeEhsETuYzQA8wBjIukTaLCuhKjzv0yB9Ws0CGwP8upVzlDT6TNl-opbxquuE4LPvLhc-13JuhzC4bGzU7/s1600/device-2012-03-28-224624.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU3NLa8gfpBpGZmTEVGq7-IaaYol7i0gF0wKJ5u274sjEZ8gaMW4c4ND0CxAJeEhsETuYzQA8wBjIukTaLCuhKjzv0yB9Ws0CGwP8upVzlDT6TNl-opbxquuE4LPvLhc-13JuhzC4bGzU7/s320/device-2012-03-28-224624.png&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;$ ls -all -h 20120328.bak&lt;br /&gt;
&amp;nbsp;-rw-r----- &amp;nbsp;1 xxxx &amp;nbsp;staff &amp;nbsp; 462M &amp;nbsp;3 28 22:50 20120328.bak&lt;br /&gt;
&lt;br /&gt;
一応，バックアップファイルはできた．&lt;br /&gt;
&lt;br /&gt;
あとは，どこまでバックアップできているか・・・&lt;br /&gt;
&lt;br /&gt;
一応，現状はこんな感じ．&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEcbg4fLSquei5Mja55WgwrRvFK9RhCIZ4JpP3H68cS2kygFJDsrpbr5GJZsygSPakrN6o52StnhwaqI8Fg06jIYLw4YrCbxDkmW0gLL4MZ-sPOJML8-qXyRMoqBDD8W5xvSyjx6XBdTTI/s1600/device-2012-03-28-230100.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEcbg4fLSquei5Mja55WgwrRvFK9RhCIZ4JpP3H68cS2kygFJDsrpbr5GJZsygSPakrN6o52StnhwaqI8Fg06jIYLw4YrCbxDkmW0gLL4MZ-sPOJML8-qXyRMoqBDD8W5xvSyjx6XBdTTI/s320/device-2012-03-28-230100.png&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
端末をリセットする．&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh77qPX4Pnu4tbHUdkA3xl29hsGJ3DFgVavTUptptXXs5FRRJkLfAXscqGJ1Uj_qe-fiS8FKkOdz6nqmrwRe9P71rkl56G8edWdMm2zH7rdVtUOIx2IhLnutPBh8goKgdqoa1sGAfq2H-gL/s1600/device-2012-03-28-230426.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh77qPX4Pnu4tbHUdkA3xl29hsGJ3DFgVavTUptptXXs5FRRJkLfAXscqGJ1Uj_qe-fiS8FKkOdz6nqmrwRe9P71rkl56G8edWdMm2zH7rdVtUOIx2IhLnutPBh8goKgdqoa1sGAfq2H-gL/s320/device-2012-03-28-230426.png&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
リセット後，&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvvMxgdjxTmQDCYKLPNZEfTj1Zsooxvm766b_K3Ovdte4UAEFjusxlov-AUMx6mdC-IA9SVsFEFICXCnWcOCVgv29KldhRB4qdooG8np1GpiV1xKaEDLsknjEnH8K2BnZ0mNe3AxKp1tBu/s1600/device-2012-03-28-231030.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvvMxgdjxTmQDCYKLPNZEfTj1Zsooxvm766b_K3Ovdte4UAEFjusxlov-AUMx6mdC-IA9SVsFEFICXCnWcOCVgv29KldhRB4qdooG8np1GpiV1xKaEDLsknjEnH8K2BnZ0mNe3AxKp1tBu/s320/device-2012-03-28-231030.png&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
これで戻らなかったらどうしよう．．もっと早めに実験すればよかったかな．&lt;br /&gt;
&lt;br /&gt;
リストア開始．&lt;br /&gt;
&lt;br /&gt;
$ adb restore 20120328.bak&lt;br /&gt;
&lt;br /&gt;
しばらくパスワードが合わずに焦る．．&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi26Z82ZRprMZbWsnBgZwldDQ4JhmDycNagBW9uVV7K1eVAj3RxIvsSCLaN5SSw4uYqcHwPxN6DRZ98zsA7E4vk4V-jLEFwqm44e9PrmKdAnqCkey9j_191DkNQQBtqrS1Ee7IHHur6U92C/s1600/device-2012-03-28-231153.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi26Z82ZRprMZbWsnBgZwldDQ4JhmDycNagBW9uVV7K1eVAj3RxIvsSCLaN5SSw4uYqcHwPxN6DRZ98zsA7E4vk4V-jLEFwqm44e9PrmKdAnqCkey9j_191DkNQQBtqrS1Ee7IHHur6U92C/s320/device-2012-03-28-231153.png&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
リストア開始．&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXLw3_tJMv8F3LB_P7G96NPwCiiYi49AFdO9BmN_CNMpCLLcALczAaR5RHauGyBXVN2Zar5euQk58NAlpZ-qHqFZbbFVQzC6BedYFVeI0bKGmAOgj5JhYFXSJ-_-bPOvxsuC2rR3H9aizA/s1600/device-2012-03-28-233720.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXLw3_tJMv8F3LB_P7G96NPwCiiYi49AFdO9BmN_CNMpCLLcALczAaR5RHauGyBXVN2Zar5euQk58NAlpZ-qHqFZbbFVQzC6BedYFVeI0bKGmAOgj5JhYFXSJ-_-bPOvxsuC2rR3H9aizA/s320/device-2012-03-28-233720.png&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
むう．&lt;br /&gt;
&lt;br /&gt;
プリインストールものがバックアップ出来ていなかったみたい．&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
結局，Y!マーケットと内蔵動画を復元できずに，ゴミが残ってしまった．&lt;br /&gt;
&lt;br /&gt;
なんとか消せないものか．．．&lt;br /&gt;
&lt;br /&gt;
とりあえず今日はここまで．&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/5442478495534550642/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2012/03/blog-post_29.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/5442478495534550642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/5442478495534550642'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2012/03/blog-post_29.html' title='バックアップ＆リストア'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU3NLa8gfpBpGZmTEVGq7-IaaYol7i0gF0wKJ5u274sjEZ8gaMW4c4ND0CxAJeEhsETuYzQA8wBjIukTaLCuhKjzv0yB9Ws0CGwP8upVzlDT6TNl-opbxquuE4LPvLhc-13JuhzC4bGzU7/s72-c/device-2012-03-28-224624.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-7810186944108146073</id><published>2012-03-28T22:26:00.002+09:00</published><updated>2012-03-28T22:26:21.911+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><title type='text'>携帯変更</title><content type='html'>携帯が壊れてしまった．&lt;br /&gt;
&lt;br /&gt;
結構気に入ってたのでかなりショック．&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;text-align: left;&quot;&gt;まだ，割賦残ってたのにさ．&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
ということで機種変更しました．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Sharpの104SHです．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinrbweweqPWn0d7RWmur-7roTktTfCP21WPrTT5jLqbNqaUcVm8FK9QnWRTsdG7wo0p2CkUXFLZ5n5aD0rVkV8TMGsEOMcUhtgaRINMR52Hn0G-EaLS6U2O4uXxgWdxS0sc7cFIl5yjcbN/s1600/device-2012-03-28-220614.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinrbweweqPWn0d7RWmur-7roTktTfCP21WPrTT5jLqbNqaUcVm8FK9QnWRTsdG7wo0p2CkUXFLZ5n5aD0rVkV8TMGsEOMcUhtgaRINMR52Hn0G-EaLS6U2O4uXxgWdxS0sc7cFIl5yjcbN/s320/device-2012-03-28-220614.png&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3smZMswBRsa_1bWTn44WA2Ru1W_4cnI829-Y8Dxrm6QlVOam0D8_Ah1_ug-VNPB4QITS1oe6F1Evcg_6RZ3rLmxiVYd50d8lhGAGh6Xc-Dg8jvZQZvRv9PxgZ1uS9FNgROZnUiEZqtJkj/s1600/device-2012-03-28-221540.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3smZMswBRsa_1bWTn44WA2Ru1W_4cnI829-Y8Dxrm6QlVOam0D8_Ah1_ug-VNPB4QITS1oe6F1Evcg_6RZ3rLmxiVYd50d8lhGAGh6Xc-Dg8jvZQZvRv9PxgZ1uS9FNgROZnUiEZqtJkj/s320/device-2012-03-28-221540.png&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
久々のSharp製．&lt;br /&gt;
&lt;br /&gt;
今のところは特に不具合なく使えている．&lt;br /&gt;
&lt;br /&gt;
というより，さくさく動いて気持ちがいい．&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/7810186944108146073/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2012/03/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/7810186944108146073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/7810186944108146073'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2012/03/blog-post.html' title='携帯変更'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinrbweweqPWn0d7RWmur-7roTktTfCP21WPrTT5jLqbNqaUcVm8FK9QnWRTsdG7wo0p2CkUXFLZ5n5aD0rVkV8TMGsEOMcUhtgaRINMR52Hn0G-EaLS6U2O4uXxgWdxS0sc7cFIl5yjcbN/s72-c/device-2012-03-28-220614.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5653284360679726585.post-8349989760378379139</id><published>2012-02-18T10:44:00.000+09:00</published><updated>2012-02-18T10:44:47.181+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cytoscape"/><title type='text'>Cytoscapeであそぶ</title><content type='html'>&lt;a href=&quot;http://ja.wikipedia.org/wiki/%E8%A4%87%E9%9B%91%E3%83%8D%E3%83%83%E3%83%88%E3%83%AF%E3%83%BC%E3%82%AF&quot; target=&quot;_blank&quot;&gt;wikipediaの複雑ネットワーク&lt;/a&gt;に載っていた&lt;a href=&quot;http://ja.wikipedia.org/wiki/%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB:Ba_model_1000nodes.png&quot; target=&quot;_blank&quot;&gt;ランダムネットワーク&lt;/a&gt;がかっこよくみえたので同じような図をつくってみました．&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
作り方あってるかな・・・&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
キャプション通りにCytoscapeのRandomNetworksプラグインを利用する．&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
プラグインが見当たらない場合は[Manage Plugins]からインストールすること．&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhZVTjSBAcXgrNEvZUEnf6q5fXTEiUchrj2HQ6fW14PH1zuYAlyzUzvubCWHxT7ljWcQPfzyW55EiEIPbJb0WZgqL-ZgisKclBTUaNXM05f-eInDgUuLM-8f-vhnAmaEZjCb6yyMkhlSR/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.01.04.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhZVTjSBAcXgrNEvZUEnf6q5fXTEiUchrj2HQ6fW14PH1zuYAlyzUzvubCWHxT7ljWcQPfzyW55EiEIPbJb0WZgqL-ZgisKclBTUaNXM05f-eInDgUuLM-8f-vhnAmaEZjCb6yyMkhlSR/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.01.04.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
RandomNetworksプラグインを起動する．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
[Plugins]&amp;gt;[Random Networks]&amp;gt;[Generate Random Network]を選択する．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7vURWEM4rljSiM2I3lxuXk125ZYGcdVahhyphenhyphenp28uu3r6OzziceC07WBlpKjI9tcdMgHGQGiuYbHEDOxKGr4-KxmeVPtrs4weX1K4I94muyQk5-5ynexFyYB-Qc-T4mNsORA_duDvzW66Oy/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.02.39.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;153&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7vURWEM4rljSiM2I3lxuXk125ZYGcdVahhyphenhyphenp28uu3r6OzziceC07WBlpKjI9tcdMgHGQGiuYbHEDOxKGr4-KxmeVPtrs4weX1K4I94muyQk5-5ynexFyYB-Qc-T4mNsORA_duDvzW66Oy/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.02.39.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Barabasi-Albert Modelを選択して[Next]．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8YL9_xjS-wBZ6VrEycwQ2kUTCZCIpQDhhKl7iTsdkleSefRsOAygrCb7djUZ0s6mujpe7FeXnwu3KS0oSX9rZ1Fk13rAfqwGP7vqy9iBcbk8RpCGgN38MLjHMQnupse0bUa8BA7E0R8jV/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.02.53.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;255&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8YL9_xjS-wBZ6VrEycwQ2kUTCZCIpQDhhKl7iTsdkleSefRsOAygrCb7djUZ0s6mujpe7FeXnwu3KS0oSX9rZ1Fk13rAfqwGP7vqy9iBcbk8RpCGgN38MLjHMQnupse0bUa8BA7E0R8jV/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.02.53.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
ノード数に「1000」と入力して，[Generate]ボタンをクリック．&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOp3wbebJpzE7j-n3YpdNDbIW0zbc4479ssdERnjHcuivl9TqXLJfwJD5E2-5sdjR4Y7OaHXCTDhnyKtFnE4bM3dSv4cNX0LoZzdpJz72k12T5v-zkl7ADjnd-xCy_8HZ-5pYbQ_pd2Dbp/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.03.09.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;257&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOp3wbebJpzE7j-n3YpdNDbIW0zbc4479ssdERnjHcuivl9TqXLJfwJD5E2-5sdjR4Y7OaHXCTDhnyKtFnE4bM3dSv4cNX0LoZzdpJz72k12T5v-zkl7ADjnd-xCy_8HZ-5pYbQ_pd2Dbp/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.03.09.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
ランダムネットワークが生成された．&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhD2jX_QX5EkkqhVkEI1mj2t00KVhECLWs5t4Z_gBKFby3sj4xSqgWuRtOstKGuKJDLbRqjTzikce0Y9Gg7JRDJrn-OGFSlPeSyTTGU-P-89Ay0SZx0VGSeoJvwqNJd5uWusWeQ-cx2MMmm/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.04.54.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;317&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhD2jX_QX5EkkqhVkEI1mj2t00KVhECLWs5t4Z_gBKFby3sj4xSqgWuRtOstKGuKJDLbRqjTzikce0Y9Gg7JRDJrn-OGFSlPeSyTTGU-P-89Ay0SZx0VGSeoJvwqNJd5uWusWeQ-cx2MMmm/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.04.54.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
適当にレイアウトする．&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWXXQlmGiJ4Swv6SertEvAHrzIAPLVFutRRgD1jgw29UgBl31H1SCCCDN_caMf_yzna8_rJgwdKT_u3xzQF3OaF6Wm6LwYvkQs3Ew4m-OfiknXM-pI7PPwF818wjNRxewZORLb9KOU0BvZ/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.06.56.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWXXQlmGiJ4Swv6SertEvAHrzIAPLVFutRRgD1jgw29UgBl31H1SCCCDN_caMf_yzna8_rJgwdKT_u3xzQF3OaF6Wm6LwYvkQs3Ew4m-OfiknXM-pI7PPwF818wjNRxewZORLb9KOU0BvZ/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.06.56.png&quot; width=&quot;318&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Network Analysisプラグインを起動して，&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiha_mlimbGfXG2Z_dpMeMVder3StdhpU6sbqPG4b1cyi-vhdpWDH2O4Sz_GoGDc3Y0qa27BNbICYpoT3A62z5W1U6w4EzsbFMGLrPiZHepZA5afN-RgX-2kLvxmDP5UPNoGDkKpuWmXTwf/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.07.34.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;215&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiha_mlimbGfXG2Z_dpMeMVder3StdhpU6sbqPG4b1cyi-vhdpWDH2O4Sz_GoGDc3Y0qa27BNbICYpoT3A62z5W1U6w4EzsbFMGLrPiZHepZA5afN-RgX-2kLvxmDP5UPNoGDkKpuWmXTwf/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.07.34.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
ノードサイズを入次数と対応させる．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKcceobENzffeovxvY-6IsdTOgPc4VCMsA6tEMaiZA6hW7ZMs6K1xlzS0M4RTsGImXC5qkOSJRemQKaeuoNchAg_OwyAenyR2N9MgPaZ2U8oL7CM87eo3biMt1Tn3_9_o1ZdcPlqPt7gid/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.08.35.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;135&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKcceobENzffeovxvY-6IsdTOgPc4VCMsA6tEMaiZA6hW7ZMs6K1xlzS0M4RTsGImXC5qkOSJRemQKaeuoNchAg_OwyAenyR2N9MgPaZ2U8oL7CM87eo3biMt1Tn3_9_o1ZdcPlqPt7gid/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.08.35.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
それっぽくなってきた．（ノード数が多いけど）&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjK-OtUcMK_d4T2m05KlRjKh8aVT5OUCAn8UuRq9VIs5ZsuIfFVQdpVCiPwkiyYaUt7v1iPpqa2kgugNhP5OmMK22yHmWvdYG5qZGoZYlr-3fPGe4GXJZxnpoePMTYlSL5xKNU9qKxZObQe/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.09.02.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;303&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjK-OtUcMK_d4T2m05KlRjKh8aVT5OUCAn8UuRq9VIs5ZsuIfFVQdpVCiPwkiyYaUt7v1iPpqa2kgugNhP5OmMK22yHmWvdYG5qZGoZYlr-3fPGe4GXJZxnpoePMTYlSL5xKNU9qKxZObQe/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.09.02.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
あとは色づけして完成．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIyOWXLPYtA8lroX2oun0DKl9P4qRsjT6gnQq3sM5uffwu7S42dM_UywaNJV5CnOOntak4vcViwkZ5Nl1Whaj5Piv_qli_OdlN3metWIZXkGQIxR5qhaoSJSimuAGBnuZBoAA0dc_k7lF2/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.12.33.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;306&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIyOWXLPYtA8lroX2oun0DKl9P4qRsjT6gnQq3sM5uffwu7S42dM_UywaNJV5CnOOntak4vcViwkZ5Nl1Whaj5Piv_qli_OdlN3metWIZXkGQIxR5qhaoSJSimuAGBnuZBoAA0dc_k7lF2/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.12.33.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
部分的に拡大するとこんな感じ．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE0U0a4GMPkvrZJfr4M_HCeDv5Moeg1lBO-VOBK4P_ssI6yFhkMv9iW7Yxu1nMu-IUXDEF_ogvc9_g9RZjcJbkVWcMnZd20_IJpCWQWx-NyP6rDWBQrf9b00hgE6l8s-Eh3VtZEFwKDpH0/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.13.08.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;165&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE0U0a4GMPkvrZJfr4M_HCeDv5Moeg1lBO-VOBK4P_ssI6yFhkMv9iW7Yxu1nMu-IUXDEF_ogvc9_g9RZjcJbkVWcMnZd20_IJpCWQWx-NyP6rDWBQrf9b00hgE6l8s-Eh3VtZEFwKDpH0/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.13.08.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
かっこいいだけじゃなくて，ちゃんと勉強しなきゃね．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
今日は息抜きということで．&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://my-sheep-cloud.blogspot.com/feeds/8349989760378379139/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://my-sheep-cloud.blogspot.com/2012/02/cytoscape.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/8349989760378379139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5653284360679726585/posts/default/8349989760378379139'/><link rel='alternate' type='text/html' href='http://my-sheep-cloud.blogspot.com/2012/02/cytoscape.html' title='Cytoscapeであそぶ'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/15896254428094184488</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfhZVTjSBAcXgrNEvZUEnf6q5fXTEiUchrj2HQ6fW14PH1zuYAlyzUzvubCWHxT7ljWcQPfzyW55EiEIPbJb0WZgqL-ZgisKclBTUaNXM05f-eInDgUuLM-8f-vhnAmaEZjCb6yyMkhlSR/s72-c/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-02-18+10.01.04.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>