<?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-169100485598022363</id><updated>2024-08-29T13:42:33.750+09:00</updated><category term="boot"/><category term="linux"/><category term="rails"/><category term="iOS"/><category term="iPhone"/><category term="mm"/><category term="mac"/><category term="ruby"/><category term="MacPorts"/><category term="Objective-C"/><category term="lockdep"/><category term="ビジネス"/><category term="sched"/><category term="AppID"/><category term="Bundle Identifier"/><category term="GitHub"/><category term="PHP"/><category term="ProvisioningProfile"/><category term="Twitter"/><category term="XCode"/><category term="annotate"/><category term="apache"/><category term="cgroup"/><category term="clockevents"/><category term="codesign fail"/><category term="created_at"/><category term="distribution"/><category term="faker"/><category term="gcc"/><category term="git"/><category term="heroku"/><category term="notifier_chain"/><category term="oauth"/><category term="readline"/><category term="redmine"/><category term="rvm"/><category term="アセンブラ"/><category term="テスティングフレームワーク"/><category term="ビジョン"/><category term="リンカスクリプト"/><category term="リンク"/><category term="企業"/><category term="徒然"/><category term="日記"/><category term="演劇"/><category term="計画"/><category term="証明書"/><title type='text'>maigo@sekai</title><subtitle type='html'>迷子なのは僕じゃない。&#xa;僕じゃないのだ。</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://maigo-lalala.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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>128</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-169100485598022363.post-4664393554965039947</id><published>2014-10-27T23:07:00.001+09:00</published><updated>2014-10-27T23:12:43.978+09:00</updated><title type='text'>外出先で聴いた気になる曲のタイトルの調べ方</title><content type='html'>ふと耳にした気になる曲のタイトルが分からない。&lt;br /&gt;
CMであれば検索すればすぐ出てくるし、その場でスマートフォンを取り出せるのであれば&lt;br /&gt;
Shazamなどで判別できるかもしれない。&lt;br /&gt;
でも後になって、あの時かかってた曲なんだっけな、となることって意外と多いと思う。&lt;br /&gt;
Midomi Soundhoundでは鼻歌検索もできるけども、どうやら私は音痴らしい。。&lt;br /&gt;
&lt;br /&gt;
例えばスポーツジムでかかっていた曲を知りたくなった場合、どう調べるか。&lt;br /&gt;
まずは&lt;a href=&quot;http://music.usen.com/&quot;&gt;有線のサイト&lt;/a&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;
すると今現在流れている曲が出てくるので「NOW PLAYING専用画面へ」という&lt;br /&gt;
リンクをクリックする。&lt;br /&gt;
そうすると上に「日時指定」というのがあるので、調べたい曲が流れていたであろう&lt;br /&gt;
日時を入力して検索する。&lt;br /&gt;
検索結果として指定日時に流れていた曲がずらっと出てくる。&lt;br /&gt;
あとは各曲をiTunesなりYouTubeなりで検索しまくるのだ。&lt;br /&gt;
&lt;br /&gt;
こうして私が見つけた曲はこれでした。&lt;br /&gt;
&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/JDKGWaCglRM&quot; width=&quot;420&quot;&gt;&lt;/iframe&gt;

</content><link rel='replies' type='application/atom+xml' href='http://maigo-lalala.blogspot.com/feeds/4664393554965039947/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2014/10/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/4664393554965039947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/4664393554965039947'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2014/10/blog-post.html' title='外出先で聴いた気になる曲のタイトルの調べ方'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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-169100485598022363.post-1722853030384310770</id><published>2013-08-02T23:09:00.002+09:00</published><updated>2013-08-02T23:10:27.058+09:00</updated><title type='text'>RaspberryPi #10 WebカメラをWeb越しに操作してみよう</title><content type='html'>&lt;a href=&quot;http://maigo-lalala.blogspot.jp/2013/06/raspberrypi-8-web.html&quot;&gt;第8回&lt;/a&gt;にてWebカメラからのキャプチャ画像を定期的にDropboxにアップするようにした。cronで10分周期にセットしたけれども、「今のタイミングのキャプチャが欲しい！」ということもある。この場合はどうするか。&lt;br /&gt;
&lt;br /&gt;
自宅のブロードバンドルータに接続したRaspberryPiには当然グローバルIPアドレスなんてセットしていない。ブロードバンドルータから割り当てられたプライベートIPアドレスにネットワーク越しにアクセスする方法は簡単には実現できそうにない。&lt;br /&gt;
というわけで方法としてはRaspberryPi側から「なんか指示ありませんか？」と定期的にポーリングをしかける方法しかないのだ。&lt;br /&gt;
&lt;br /&gt;
ここではDropboxのフォルダを10秒周期チェックして、「shot」というフォルダがあるとそのタイミングでキャプチャをアップロードする、という仕様にした。&lt;br /&gt;
そのシェルが以下の通り。&lt;br /&gt;
&lt;br /&gt;
#&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;a8ff91f6-4755-4497-a648-32cac2185c18&quot; ginger_sofatware_uiphraseguid=&quot;c3596711-ea0c-404e-a061-a90cf5cab98b&quot; grcontextid=&quot;!:0&quot;&gt;!&lt;/span&gt;/bin/bash&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;a99169af-7adc-4722-a6b4-82435a793543&quot; ginger_sofatware_uiphraseguid=&quot;a828d555-b8da-4e70-af8a-b983278d78d9&quot; grcontextid=&quot;while:0&quot;&gt;while&lt;/span&gt; :&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;5f042f82-a80a-4b0a-a9f0-7a1797550408&quot; ginger_sofatware_uiphraseguid=&quot;500597d5-ddeb-4ef4-956c-961449ae7af7&quot; grcontextid=&quot;do:0&quot;&gt;do&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;44aac0db-8c51-4ee9-8fb1-1f84271480a7&quot; ginger_sofatware_uiphraseguid=&quot;f42c5470-a1e6-487c-80bf-aba15caf126e&quot; grcontextid=&quot;home:0&quot;&gt;home&lt;/span&gt;/pi/Dropbox-Uploader/dropbox_uploader&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;afb2645b-0042-4a18-a288-2adac342ba99&quot; ginger_sofatware_uiphraseguid=&quot;f42c5470-a1e6-487c-80bf-aba15caf126e&quot; grcontextid=&quot;.:1&quot;&gt;.&lt;/span&gt;sh list | &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;2d8fd765-72bd-4d93-9679-a6dfb138a83c&quot; ginger_sofatware_uiphraseguid=&quot;f42c5470-a1e6-487c-80bf-aba15caf126e&quot; grcontextid=&quot;grep:2&quot;&gt;grep&lt;/span&gt; shot&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;2e22c55d-af56-4a72-acfe-84f53bbddc4b&quot; ginger_sofatware_uiphraseguid=&quot;67236165-8daa-4641-9adb-125ea9e12e37&quot; grcontextid=&quot;if:0&quot;&gt;if&lt;/span&gt; [ $? -&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;7e3d3b35-a72d-49fe-8f88-67c77d87ceb2&quot; ginger_sofatware_uiphraseguid=&quot;fbbd2ae8-7411-4e53-9455-0a465d7e24ed&quot; grcontextid=&quot;eq:0&quot;&gt;eq&lt;/span&gt; 0 ] ; then&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fswebcam -d /dev/video0 -p YUYV -D 2 -S 16 -r 640x480 --jpeg 75 /home/pi/shoot.jpg&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;0773c274-b3da-46d4-8137-e82d73fe1a9c&quot; ginger_sofatware_uiphraseguid=&quot;dcf42618-665d-40f7-9ab8-858a8b69be04&quot; grcontextid=&quot;home:0&quot;&gt;home&lt;/span&gt;/pi/Dropbox-Uploader/dropbox_uploader&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;5c4840d8-cf4f-4483-86af-626872a781bb&quot; ginger_sofatware_uiphraseguid=&quot;dcf42618-665d-40f7-9ab8-858a8b69be04&quot; grcontextid=&quot;.:1&quot;&gt;.&lt;/span&gt;sh upload /home/pi/shoot.jpg /shoot.jpg&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;c5e63b69-6010-4cb2-b78c-24dc0d23048f&quot; ginger_sofatware_uiphraseguid=&quot;23edbd26-3c34-4947-9292-5854dc6fc6ed&quot; grcontextid=&quot;home:0&quot;&gt;home&lt;/span&gt;/pi/Dropbox-Uploader/dropbox_uploader&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;fe0abff8-22b2-4589-88f7-c71cd4eada2a&quot; ginger_sofatware_uiphraseguid=&quot;23edbd26-3c34-4947-9292-5854dc6fc6ed&quot; grcontextid=&quot;.:1&quot;&gt;.&lt;/span&gt;sh delete /shot/&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;8877e7ed-c44b-470f-98b6-ef90a6af9fb0&quot; ginger_sofatware_uiphraseguid=&quot;db815362-3f48-45f8-bc6d-31658458c08f&quot; grcontextid=&quot;fi:0&quot;&gt;fi&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;8543362a-b10b-41ea-ab99-6f33b0e16bb1&quot; ginger_sofatware_uiphraseguid=&quot;99790b9d-d343-47bb-a89b-5e18e920200f&quot; grcontextid=&quot;sleep:0&quot;&gt;sleep&lt;/span&gt; 10&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;6bc5cb85-6b0f-4e66-94f9-ce8e0168c987&quot; ginger_sofatware_uiphraseguid=&quot;4f3dccdf-7faa-400c-bcef-e834be8a7f16&quot; grcontextid=&quot;done:0&quot;&gt;done&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
パスやファイル名は適宜読み替えてほしい。&lt;br /&gt;
ここでは10秒周期にしているが、最後のsleepを短くすればよりリアルタイムに近い形で反応できるだろう。Dropboxに怒られるかもしれないが。&lt;br /&gt;
&lt;br /&gt;
で、起動時にこれを起動しておいてもらおう。&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;7dfd80d2-869e-4b0d-97d6-496cfaba8c2d&quot; ginger_sofatware_uiphraseguid=&quot;c242b098-a8a4-4b0d-86fd-878d86e2f002&quot; grcontextid=&quot;sudo:0&quot;&gt;sudo&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;5b8c71f2-985e-48db-a83a-f90af9651e7c&quot; ginger_sofatware_uiphraseguid=&quot;c242b098-a8a4-4b0d-86fd-878d86e2f002&quot; grcontextid=&quot;vi:1&quot;&gt;vi&lt;/span&gt; /etc/&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;6eb49467-6a81-4153-a49a-19f384c21766&quot; ginger_sofatware_uiphraseguid=&quot;c242b098-a8a4-4b0d-86fd-878d86e2f002&quot; grcontextid=&quot;rc:2&quot;&gt;rc&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;15d9fadd-85f1-490a-b168-001d0fb926e8&quot; ginger_sofatware_uiphraseguid=&quot;c242b098-a8a4-4b0d-86fd-878d86e2f002&quot; grcontextid=&quot;.:3&quot;&gt;.&lt;/span&gt;local&lt;br /&gt;
としてrc.localファイルに以下の記述を追加する。尚、ここでは上記作成スクリプトを「manual_shot.sh」としている。&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;0c9e5a9a-9c6c-4349-b714-2205b5527c1a&quot; ginger_sofatware_uiphraseguid=&quot;bcaf7233-eefd-4b98-957b-d4bc7914a6a7&quot; grcontextid=&quot;sudo:0&quot;&gt;sudo&lt;/span&gt; -u pi /home/pi/manual_shot&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;933538a9-a53f-4bbc-bce8-1c088d752a31&quot; ginger_sofatware_uiphraseguid=&quot;bcaf7233-eefd-4b98-957b-d4bc7914a6a7&quot; grcontextid=&quot;.:1&quot;&gt;.&lt;/span&gt;sh &amp;amp;&lt;br /&gt;
&lt;br /&gt;
sudoでユーザpiとして実行していることに注意。&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;793b51bd-7ef5-4f9e-9228-d7024095587f&quot; ginger_sofatware_uiphraseguid=&quot;066b89f0-71ed-4afc-9940-b70a1382a11a&quot; grcontextid=&quot;Dropbox:0&quot;&gt;Dropbox&lt;/span&gt;-Uploaderのセットアップ時にDropboxのAppキーなどを設定したが、実行ユーザが異なると再設定が必要になるので、セットアップを実行したユーザで実行する必要がある。&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://maigo-lalala.blogspot.com/feeds/1722853030384310770/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2013/08/raspberrypi-10-webweb.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/1722853030384310770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/1722853030384310770'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2013/08/raspberrypi-10-webweb.html' title='RaspberryPi #10 WebカメラをWeb越しに操作してみよう'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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-169100485598022363.post-749821626230000524</id><published>2013-07-25T22:39:00.000+09:00</published><updated>2013-07-25T22:39:15.630+09:00</updated><title type='text'>RaspberryPi #9 シャットダウンボタンをつくろう</title><content type='html'>RasberryPiは電源供給源のUSBに接続すれば起動する。&lt;br /&gt;
&lt;div&gt;
終了時はコマンドからshutdownしなくちゃいけない。&lt;/div&gt;
&lt;div&gt;
イヌ用の監視カメラをこしらえて実家に設置したところで、年老いた両親に&lt;/div&gt;
&lt;div&gt;
「リモートでログインしてshutdownコマンドを、、、」&lt;/div&gt;
&lt;div&gt;
などと言えるハズもない。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
というわけで押すとシャットダウンしてくれるボタンを付けてみる。&lt;/div&gt;
&lt;div&gt;
ボタンを長押しして、LEDランプが消えたら電源抜いてOK、というもの。&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/AVvXsEh9WHFvUEWKREJmdz3nPVfA-qd6X2rJ7-BK56dlC46SHzdJsFk3H2NkSuKCJoK_qvVn6fCje-7lI-s3PgY-mNN3zTYPYSgOAPVBnE_3uw2muaUxH1mA3lo2RbEa8OjnJHgIwJ-crTqVdIim/s1600/IMG_0929.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;150&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9WHFvUEWKREJmdz3nPVfA-qd6X2rJ7-BK56dlC46SHzdJsFk3H2NkSuKCJoK_qvVn6fCje-7lI-s3PgY-mNN3zTYPYSgOAPVBnE_3uw2muaUxH1mA3lo2RbEa8OjnJHgIwJ-crTqVdIim/s200/IMG_0929.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
用意するもの。&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;ブレッドボード　１つ&lt;/li&gt;
&lt;li&gt;ジャンパワイヤ　３本&lt;/li&gt;
&lt;li&gt;タクトスイッチ　１つ&lt;/li&gt;
&lt;li&gt;10KΩ抵抗　１つ&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
配線は参考図書「RaspberryPiで遊ぼう！」に掲載されているままなので省略。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
次にRaspberryPi用のGPIOプログラミングライブラリであるwiringPiをインストールする。こちらも本に掲載のままなので省略。たぶんググればある。&lt;/div&gt;
&lt;div&gt;
で、以下のようなプログラムを書く。&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;a91be4e7-181f-42c6-bd00-1c9d212b971e&quot; ginger_sofatware_uiphraseguid=&quot;4b786145-c912-4903-b091-76b12f1254a3&quot; grcontextid=&quot;stdio:0&quot;&gt;stdio&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;3542abf5-bac9-4742-86ba-3e151d318e2e&quot; ginger_sofatware_uiphraseguid=&quot;4b786145-c912-4903-b091-76b12f1254a3&quot; grcontextid=&quot;.:1&quot;&gt;.&lt;/span&gt;h&amp;gt;&lt;br /&gt;
#include &amp;lt;&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;fc03e287-6fbb-41d8-9866-2934528dd7c4&quot; ginger_sofatware_uiphraseguid=&quot;6ad62cb9-a0dc-4519-8eca-736f0febad12&quot; grcontextid=&quot;wiringPi:0&quot;&gt;wiringPi&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;47597e3a-2d65-4139-bbb3-d2daaff54507&quot; ginger_sofatware_uiphraseguid=&quot;6ad62cb9-a0dc-4519-8eca-736f0febad12&quot; grcontextid=&quot;.:1&quot;&gt;.&lt;/span&gt;h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define BTN_PORT 25&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;7756b8c4-57d3-474e-8ecc-df1072fc227e&quot; ginger_sofatware_uiphraseguid=&quot;54d483aa-a823-4948-aa3a-2a2ad6a2e0cd&quot; grcontextid=&quot;int:0&quot;&gt;int&lt;/span&gt; main&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;49a3c132-dff7-4bb3-ba73-043b692aa311&quot; ginger_sofatware_uiphraseguid=&quot;54d483aa-a823-4948-aa3a-2a2ad6a2e0cd&quot; grcontextid=&quot;(:1&quot;&gt;(&lt;/span&gt;void) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;8f52ae2a-70e0-4bfe-8687-75b5db38424e&quot; ginger_sofatware_uiphraseguid=&quot;a0e82093-2215-45cf-b469-91fb9a30895c&quot; grcontextid=&quot;int:0&quot;&gt;int&lt;/span&gt; data = 0;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;f3a8ef3c-7b96-41a3-a7f7-adc99f4441fd&quot; ginger_sofatware_uiphraseguid=&quot;d9a8bb26-4051-41dd-bd6e-b6afb5875187&quot; grcontextid=&quot;int:0&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;133874cc-bc95-4ce5-8772-fe7172bdb918&quot; ginger_sofatware_uiphraseguid=&quot;d9a8bb26-4051-41dd-bd6e-b6afb5875187&quot; grcontextid=&quot;cnt:1&quot;&gt;cnt&lt;/span&gt; = 0;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;852e8f84-d98a-405a-8740-941c3242e30a&quot; ginger_sofatware_uiphraseguid=&quot;2e2e755c-7295-4892-92ce-a30d0a8ad86f&quot; grcontextid=&quot;if:0&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;63c068ea-a01a-49e3-bc94-d9013a563f96&quot; ginger_sofatware_uiphraseguid=&quot;2e2e755c-7295-4892-92ce-a30d0a8ad86f&quot; grcontextid=&quot;(:1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;cad41089-a07c-4b41-9714-a1424d22f305&quot; ginger_sofatware_uiphraseguid=&quot;2e2e755c-7295-4892-92ce-a30d0a8ad86f&quot; grcontextid=&quot;wiringPiSetupGpio:2&quot;&gt;wiringPiSetupGpio&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;910e19c9-71df-4fbc-b1f3-7019cfef3d9e&quot; ginger_sofatware_uiphraseguid=&quot;2e2e755c-7295-4892-92ce-a30d0a8ad86f&quot; grcontextid=&quot;(:3&quot;&gt;(&lt;/span&gt;) == -1) return 1;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;c5a465e4-fa71-463a-a10b-36bafd93d8b8&quot; ginger_sofatware_uiphraseguid=&quot;0623cfff-bdab-41a5-a79a-ac0a757fef0f&quot; grcontextid=&quot;pinMode:0&quot;&gt;pinMode&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;70410ac9-93c6-466e-b218-58939b09eb2c&quot; ginger_sofatware_uiphraseguid=&quot;0623cfff-bdab-41a5-a79a-ac0a757fef0f&quot; grcontextid=&quot;(:1&quot;&gt;(&lt;/span&gt;BTN_PORT, INPUT);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;c2f3c49d-8b57-4443-84a2-6d83c1858e36&quot; ginger_sofatware_uiphraseguid=&quot;ade92b58-2969-4143-8abb-9af66acdec44&quot; grcontextid=&quot;while:0&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;41a54991-080b-46ff-8e1b-47b5b06cb533&quot; ginger_sofatware_uiphraseguid=&quot;ade92b58-2969-4143-8abb-9af66acdec44&quot; grcontextid=&quot;(:1&quot;&gt;(&lt;/span&gt;1) &amp;nbsp;{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;512d009e-e606-49ec-80a1-82712f1353ab&quot; ginger_sofatware_uiphraseguid=&quot;23c6df1f-c998-4128-a596-a1d0a749532a&quot; grcontextid=&quot;data:0&quot;&gt;data&lt;/span&gt; = &lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;5f9fa442-df6f-4c2f-a2cb-afcc2f84055e&quot; ginger_sofatware_uiphraseguid=&quot;23c6df1f-c998-4128-a596-a1d0a749532a&quot; grcontextid=&quot;digitalRead:1&quot;&gt;digitalRead&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;277b381b-0c25-4726-a26e-ce1d7e93bb66&quot; ginger_sofatware_uiphraseguid=&quot;23c6df1f-c998-4128-a596-a1d0a749532a&quot; grcontextid=&quot;(:2&quot;&gt;(&lt;/span&gt;BTN_PORT);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;8b37d383-45c2-4396-9633-deb09d17d9d5&quot; ginger_sofatware_uiphraseguid=&quot;ac737d58-13ac-40d3-8613-ce432682ff65&quot; grcontextid=&quot;if:0&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;5fd337cb-7168-4dba-9108-ec457ebb507a&quot; ginger_sofatware_uiphraseguid=&quot;ac737d58-13ac-40d3-8613-ce432682ff65&quot; grcontextid=&quot;(:1&quot;&gt;(&lt;/span&gt;data == 0) &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;0d528a8a-181a-4668-b25f-357b29d597f2&quot; ginger_sofatware_uiphraseguid=&quot;ac737d58-13ac-40d3-8613-ce432682ff65&quot; grcontextid=&quot;cnt:2&quot;&gt;cnt&lt;/span&gt; = 0;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;d0b03930-9054-4a24-8602-4bf82eff7599&quot; ginger_sofatware_uiphraseguid=&quot;8b61833a-861c-4281-a37b-aa1b2cf0a422&quot; grcontextid=&quot;else:0&quot;&gt;else&lt;/span&gt; cnt++;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;c02077ce-5f4f-452d-9b9f-fbd6078ff75a&quot; ginger_sofatware_uiphraseguid=&quot;f7c47382-76ae-45a6-8c02-329b8f37926a&quot; grcontextid=&quot;if:0&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;1ff16920-62e3-467d-94a8-cbc495827fc9&quot; ginger_sofatware_uiphraseguid=&quot;f7c47382-76ae-45a6-8c02-329b8f37926a&quot; grcontextid=&quot;(:1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;9229e278-2a60-48d6-bf99-91f06ac11c39&quot; ginger_sofatware_uiphraseguid=&quot;f7c47382-76ae-45a6-8c02-329b8f37926a&quot; grcontextid=&quot;cnt:2&quot;&gt;cnt&lt;/span&gt; &amp;gt;= 10) {&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; &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;7ac1bd18-187d-4121-afdd-ed524a8a9370&quot; ginger_sofatware_uiphraseguid=&quot;9d9a489e-8758-4eee-8672-18dc851600e8&quot; grcontextid=&quot;system:0&quot;&gt;system&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;1e3ab4a3-02c5-4b4b-92a3-919762219d8c&quot; ginger_sofatware_uiphraseguid=&quot;9d9a489e-8758-4eee-8672-18dc851600e8&quot; grcontextid=&quot;(:1&quot;&gt;(&lt;/span&gt;&quot;shutdown -h now&quot;);&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; &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;a4f0cc13-8a5e-4773-8303-667a94d61d77&quot; ginger_sofatware_uiphraseguid=&quot;a1b7d0c0-0099-476d-b7d8-d1f289e73f6c&quot; grcontextid=&quot;return:0&quot;&gt;return&lt;/span&gt; 0;&lt;br /&gt;
&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; &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;dbe8049a-0469-45de-96c5-52d2907eef3b&quot; ginger_sofatware_uiphraseguid=&quot;0dec97d7-5f10-402c-be61-72fa7f2ef637&quot; grcontextid=&quot;usleep:0&quot;&gt;usleep&lt;/span&gt;&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;745796cf-e6ae-434c-b27c-5d566a825167&quot; ginger_sofatware_uiphraseguid=&quot;0dec97d7-5f10-402c-be61-72fa7f2ef637&quot; grcontextid=&quot;(:1&quot;&gt;(&lt;/span&gt;300000);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;a759e6c3-9160-4d01-866b-67403483b6dc&quot; ginger_sofatware_uiphraseguid=&quot;7f1893e7-613c-4614-aec4-a16f6934a818&quot; grcontextid=&quot;return:0&quot;&gt;return&lt;/span&gt; 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
300ミリ秒(300000マイクロ秒)ごとにボタンの押下状態をチェックして&lt;/div&gt;
&lt;div&gt;
１０回連続で押された状態(=３秒間の長押し）ならshutdownする、というだけのもの。&lt;br /&gt;
これを書いたら&lt;br /&gt;
&lt;br /&gt;
cc -o off_button off_button.c -lwiringPi&lt;br /&gt;
&lt;br /&gt;
としてコンパイルする。&lt;br /&gt;
ファイル名は適宜読み替えてください。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
そして起動時にデーモンとして起動するように/etc/rc.lodalに以下のような記述を追加する(exit 0の前に追加)。&lt;br /&gt;
&lt;br /&gt;
/&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;5e935014-827e-42c6-b868-191ee9bb8890&quot; ginger_sofatware_uiphraseguid=&quot;bd884f25-f4cd-434e-a435-2ca19db22f80&quot; grcontextid=&quot;home:0&quot;&gt;home&lt;/span&gt;/pi/off_button &amp;amp;&lt;br /&gt;
&lt;br /&gt;
とすれば起動時に先ほどのプログラムがデーモンとして起動するので&lt;br /&gt;
いつでもボタンを押せばシャットダウンしてくれるのだ。&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&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://maigo-lalala.blogspot.com/feeds/749821626230000524/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2013/07/raspberrypi-9.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/749821626230000524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/749821626230000524'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2013/07/raspberrypi-9.html' title='RaspberryPi #9 シャットダウンボタンをつくろう'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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/AVvXsEh9WHFvUEWKREJmdz3nPVfA-qd6X2rJ7-BK56dlC46SHzdJsFk3H2NkSuKCJoK_qvVn6fCje-7lI-s3PgY-mNN3zTYPYSgOAPVBnE_3uw2muaUxH1mA3lo2RbEa8OjnJHgIwJ-crTqVdIim/s72-c/IMG_0929.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-169100485598022363.post-1007612113603225129</id><published>2013-06-30T22:11:00.000+09:00</published><updated>2013-06-30T22:11:33.805+09:00</updated><title type='text'>RaspberryPi #8 Webカメラで静止画</title><content type='html'>監視カメラとしてセットして、Ustream経由で外出先からスマホで確認しよう！&lt;br /&gt;
と思ったのだけどスマホのUstreamが尋常じゃない重さで使えない。&lt;br /&gt;
というわけで静止画を定期的にキャプチャしてドロップボックスに定期的にアップロードする、という作戦にするのだ。&lt;br /&gt;
&lt;br /&gt;
静止画のキャプチャにはfswebcamを使う。&lt;br /&gt;
設定方法など、&lt;a href=&quot;http://linux.yebisu.jp/memo/800&quot;&gt;こちら&lt;/a&gt;を参考にしました。&lt;br /&gt;
&lt;br /&gt;
一方、DropboxはというとARM版がないのでDropbox-Uploaderというツールを使う。&lt;br /&gt;
&lt;a href=&quot;http://daisukeblog.com/?p=2067&quot;&gt;こちら&lt;/a&gt;を参考にしました。&lt;br /&gt;
次にfswebcamでキャプチャして、Dropbox-Uploaderでアップロードするスクリプトを用意する。&lt;br /&gt;
&lt;br /&gt;
#&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;2a47e9e3-ee51-4eeb-b69f-602d3ad10313&quot; ginger_sofatware_uiphraseguid=&quot;db0661bd-6586-4efc-9e63-55f702260965&quot; grcontextid=&quot;!:0&quot;&gt;!&lt;/span&gt;/bin/bash&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;1aeaffa7-1499-45d9-b850-bd9086887f7f&quot; ginger_sofatware_uiphraseguid=&quot;28e6fda2-a699-488d-a68a-5bda40e8202a&quot; grcontextid=&quot;fswebcam:0&quot;&gt;fswebcam&lt;/span&gt;&amp;nbsp;-d /dev/video0 -p YUYV -D 2 -S 16 -r 640x480 --&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;98b846c8-6a68-4ac0-8eba-c12d3aed8059&quot; ginger_sofatware_uiphraseguid=&quot;28e6fda2-a699-488d-a68a-5bda40e8202a&quot; grcontextid=&quot;jpeg:1&quot;&gt;jpeg&lt;/span&gt; 75 ./capture.jpg&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;deb5c7d1-aea6-4388-91f8-99f1d3d5f58e&quot; ginger_sofatware_uiphraseguid=&quot;327fda96-154c-40dd-b06d-f89551e11e3b&quot; grcontextid=&quot;Dropbox:0&quot;&gt;Dropbox&lt;/span&gt;-Uploader/dropbox_uploader&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;5a0e66c8-cd82-4a6d-83d7-ff66f8f18700&quot; ginger_sofatware_uiphraseguid=&quot;327fda96-154c-40dd-b06d-f89551e11e3b&quot; grcontextid=&quot;.:1&quot;&gt;.&lt;/span&gt;sh upload capture.jpg /capture.jpg&lt;br /&gt;
&lt;br /&gt;
パスの部分は適宜読み替えてください。&lt;br /&gt;
このスクリプトだとDropboxにアップロードするたびにcapture.jpgを上書きすることになるので、それが嫌な場合は連番を振るとか、時刻にするとかしないといけない。&lt;br /&gt;
最後にcronをセットする。&lt;br /&gt;
&lt;br /&gt;
*/10 * * * * /home/pi/capture&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;7c6ff995-a071-411a-9bf9-01719e0a4a3a&quot; ginger_sofatware_uiphraseguid=&quot;e2feddd5-f2c4-43dd-a517-468885a533f9&quot; grcontextid=&quot;.:0&quot;&gt;.&lt;/span&gt;sh&lt;br /&gt;
&lt;br /&gt;
capture.shというのが先ほどつくったシェルだ。&lt;br /&gt;
ここでは10分おきに動くようにしている。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://maigo-lalala.blogspot.com/feeds/1007612113603225129/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2013/06/raspberrypi-8-web.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/1007612113603225129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/1007612113603225129'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2013/06/raspberrypi-8-web.html' title='RaspberryPi #8 Webカメラで静止画'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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-169100485598022363.post-553765007799118522</id><published>2013-06-25T22:14:00.001+09:00</published><updated>2013-06-25T22:20:26.409+09:00</updated><title type='text'>RaspberryPi #7 Firefox OSの画面を大きくしてみる</title><content type='html'>&lt;span class=&quot;GingerNoCheckStart&quot;&gt;&lt;/span&gt;昨日、RaspberryPi上でFirefoxOSが動作したものの&lt;br /&gt;
画面の左下にチョロッと出ているだけなので大きくしてみましょう。&lt;br /&gt;
&lt;br /&gt;
起動時に&lt;br /&gt;
&lt;pre class=&quot;language-html&quot; style=&quot;-webkit-hyphens: none; background-color: #f5f2f0; border: 1px dotted rgb(203, 200, 185); direction: ltr; font-family: Consolas, Monaco, &#39;Andale Mono&#39;, monospace; font-size: 14px; line-height: 1.5em; margin-bottom: 0.5em; margin-top: 0.5em; overflow: auto; padding: 1em; tab-size: 4; text-shadow: white 0px 1px;&quot;&gt;&lt;i style=&quot;background-color: #f3f3f3;&quot;&gt;--screen=&lt;width&gt;x&lt;height&gt;&lt;/height&gt;&lt;/width&gt;&lt;/i&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/AVvXsEhM3KaS-zb6dgAEm-Pd-90HN37T3QL8ZwW_TFSROxA1_4kyAuJpTl_ZH2ZSeNe6bwUV0IuLtZOFpXQ8-A4I5J8e-YE4vQ8sYBI5hAZFjHsP0AkSL2c1Zgn3r8ePHAHQrb3MnKk8Gahlx3cd/s1600/IMG_0883.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;150&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM3KaS-zb6dgAEm-Pd-90HN37T3QL8ZwW_TFSROxA1_4kyAuJpTl_ZH2ZSeNe6bwUV0IuLtZOFpXQ8-A4I5J8e-YE4vQ8sYBI5hAZFjHsP0AkSL2c1Zgn3r8ePHAHQrb3MnKk8Gahlx3cd/s200/IMG_0883.JPG&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
上の方、はみだしてるけど。&lt;br /&gt;
こちらは1366x768を指定した場合。&lt;br /&gt;
このサイズにするとマウスポインタがダニのような大きさで操作が困難なのだ。&amp;nbsp;
&lt;br /&gt;
&lt;br /&gt;
昨日は参考サイトの情報をたどっただけだったので、そもそも何をしたんだ？&lt;br /&gt;
というところを把握していなかったので自分なりに調べてみる。&lt;br /&gt;
&lt;br /&gt;
まず「b2g」というのはFirefoxOSの別名で「boot to gecko」のコト。&lt;br /&gt;
最初にダウンロードしたのがB2GのデスクトップクライアントをRaspberryPi向けにビルドしたもの。&lt;br /&gt;
&lt;br /&gt;
たぶん。&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;これだけでも起動はするのだけど空のスクリーンが表示される。&lt;br /&gt;
なのでシステムアプリの指定やら何やら必要で（&lt;a href=&quot;https://developer.mozilla.org/ja/docs/Mozilla/Boot_to_Gecko/Using_the_B2G_desktop_client&quot;&gt;こちらの「プロファイルを生成する」を参照&lt;/a&gt;）、それも一緒にダウンロードして起動時に指定してました。&amp;nbsp;
&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://maigo-lalala.blogspot.com/feeds/553765007799118522/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2013/06/raspberrypi-7-firefox-os.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/553765007799118522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/553765007799118522'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2013/06/raspberrypi-7-firefox-os.html' title='RaspberryPi #7 Firefox OSの画面を大きくしてみる'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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/AVvXsEhM3KaS-zb6dgAEm-Pd-90HN37T3QL8ZwW_TFSROxA1_4kyAuJpTl_ZH2ZSeNe6bwUV0IuLtZOFpXQ8-A4I5J8e-YE4vQ8sYBI5hAZFjHsP0AkSL2c1Zgn3r8ePHAHQrb3MnKk8Gahlx3cd/s72-c/IMG_0883.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-169100485598022363.post-242689037838237155</id><published>2013-06-24T22:54:00.004+09:00</published><updated>2013-06-24T22:54:23.731+09:00</updated><title type='text'>RaspberryPi#6 firefox osを入れてみる</title><content type='html'>下記サイトの情報を参考にRaspberryPiでFirefoxOSを動かしてみようと思ったのだ。&lt;br /&gt;
&lt;a href=&quot;http://www.philipp-wagner.com/ffos-for-rpi/manual/index.html&quot;&gt;http://www.philipp-wagner.com/ffos-for-rpi/manual/index.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
手元のMacのディスク容量が怪しいのでコンパイルはせずにビルド済みのイメージファイルをSDカードに書き込んでみた。&lt;br /&gt;
んが、動かない。&lt;br /&gt;
電源を入れてもウンともスンとも言わない。&lt;br /&gt;
むむぅ&lt;br /&gt;
&lt;br /&gt;
さくっと諦めて&lt;a href=&quot;http://www.slideshare.net/EnsekiTT/moz-pi-e-23175770&quot;&gt;こちら&lt;/a&gt;の情報を参考にすることにする。&lt;br /&gt;
こちらの手順はまずは普通にRaspbianのSDカードで起動して、FirefoxOSをダウンロードしてきて動かそう、というもの。&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/AVvXsEgDd81lMTUybiSMcWF5xg5l1svSVOg3IyHrD-uACwM3RF_nB-jjYFbDgqjRSoRbAd1U3Kwqs45PNfU2BvVCdBeaTM6lMvHttBH5AVvWi33DPzMxlZ9yVc7BZ9zp_jDjysbDQ9Yn_wTUIcPk/s1600/IMG_0882.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;150&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDd81lMTUybiSMcWF5xg5l1svSVOg3IyHrD-uACwM3RF_nB-jjYFbDgqjRSoRbAd1U3Kwqs45PNfU2BvVCdBeaTM6lMvHttBH5AVvWi33DPzMxlZ9yVc7BZ9zp_jDjysbDQ9Yn_wTUIcPk/s200/IMG_0882.JPG&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
こんな感じになります。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://maigo-lalala.blogspot.com/feeds/242689037838237155/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2013/06/raspberrypi6-firefox-os.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/242689037838237155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/242689037838237155'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2013/06/raspberrypi6-firefox-os.html' title='RaspberryPi#6 firefox osを入れてみる'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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/AVvXsEgDd81lMTUybiSMcWF5xg5l1svSVOg3IyHrD-uACwM3RF_nB-jjYFbDgqjRSoRbAd1U3Kwqs45PNfU2BvVCdBeaTM6lMvHttBH5AVvWi33DPzMxlZ9yVc7BZ9zp_jDjysbDQ9Yn_wTUIcPk/s72-c/IMG_0882.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-169100485598022363.post-167098924027175534</id><published>2013-06-21T00:24:00.001+09:00</published><updated>2013-06-21T00:24:41.921+09:00</updated><title type='text'>RaspberryPi#5 Webカメラ接続</title><content type='html'>カメラが届いたので繋いでみる。&lt;br /&gt;
ちなみに買ったのはELECOM UCAM-DLA200H。&lt;br /&gt;
RaspberryPiを起動してUSBカメラを差し込む。&lt;br /&gt;
/var/log/messageを見て認識していることを確認。&lt;br /&gt;
&lt;br /&gt;
本の通りに「uvccapture」「uvcdynctrl」「guvcview」をインストール。&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;0de5fb6f-b07d-4294-b7d6-57ae2cd111ca&quot; ginger_sofatware_uiphraseguid=&quot;21322c03-d31b-40ba-8dd6-05564b8455c4&quot; grcontextid=&quot;sudo:0&quot;&gt;sudo&lt;/span&gt; apt-get install &lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;40765519-54a5-47e1-af87-70af977ac501&quot; ginger_sofatware_uiphraseguid=&quot;21322c03-d31b-40ba-8dd6-05564b8455c4&quot; grcontextid=&quot;uvccapture:1&quot;&gt;uvccapture&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;c6eb0b6d-6bf4-450c-b0a1-4c603b7b1d59&quot; ginger_sofatware_uiphraseguid=&quot;21322c03-d31b-40ba-8dd6-05564b8455c4&quot; grcontextid=&quot;uvcdynctrl:2&quot;&gt;uvcdynctrl&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;af24e6ee-419c-41ab-b992-6822e4a5c2b9&quot; ginger_sofatware_uiphraseguid=&quot;21322c03-d31b-40ba-8dd6-05564b8455c4&quot; grcontextid=&quot;guvcview:3&quot;&gt;guvcview&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Xをたちあげてメニューから先ほどインストールしたguvcviewを起動する。&lt;br /&gt;
しばらくするとカメラの映像が表示される。&lt;br /&gt;
感動。&lt;br /&gt;
&lt;br /&gt;
USTREAMへの配信も一瞬できたけれど、しばらくすると落ちてしまう。&lt;br /&gt;
消費電力の関係かもしれない。&lt;br /&gt;
セルフパワーのUSBハブを買わないといけないのか。。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://maigo-lalala.blogspot.com/feeds/167098924027175534/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2013/06/raspberrypi5-web.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/167098924027175534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/167098924027175534'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2013/06/raspberrypi5-web.html' title='RaspberryPi#5 Webカメラ接続'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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-169100485598022363.post-4857162013664003555</id><published>2013-06-19T00:11:00.002+09:00</published><updated>2013-06-19T00:11:55.617+09:00</updated><title type='text'>RaspberryPi #4 DLNA</title><content type='html'>今日も本に沿って１章だけ。&lt;br /&gt;
DLNAサーバをRaspberryPiにインストールして、DLNAクライアントのiPhoneアプリをインストールしてアクセスする。&lt;br /&gt;
昨日テレビで見た動画をiPhoneで見る。&lt;br /&gt;
ちょっと嬉しい。&lt;br /&gt;
&lt;br /&gt;
RaspberryPiでカメラを使いたいのだけど、公式のカメラはちょっと高いし、届くのに時間がかかりそうなので、書籍内で動いたと書いてある「UCAM-DLA200H」を注文。&lt;br /&gt;
1500円くらい。&lt;br /&gt;
&lt;br /&gt;
部屋にまた新たなAmazonのダンボールが増える。。&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://maigo-lalala.blogspot.com/feeds/4857162013664003555/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2013/06/raspberrypi-4-dlna.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/4857162013664003555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/4857162013664003555'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2013/06/raspberrypi-4-dlna.html' title='RaspberryPi #4 DLNA'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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-169100485598022363.post-938983682406072448</id><published>2013-06-18T07:28:00.000+09:00</published><updated>2013-06-18T07:28:43.513+09:00</updated><title type='text'>RaspberryPi #3 ネットワークと動画再生</title><content type='html'>今日も本に沿ってRaspberryPiを触る。&lt;br /&gt;
Macからsshで入ったり、ファイル送ったり。&lt;br /&gt;
結局のところLinuxなので普通に出来そうなことはできてしまう。&lt;br /&gt;
&lt;br /&gt;
動画はomxplayerというプレーヤが最初から入っているのでこれを使って再生する。&lt;br /&gt;
HDMIケーブルでテレビとつないでいるので、小さなRaspberryPiからキレイな映像をテレビで再生している姿はなかなか感動的。&lt;br /&gt;
&lt;br /&gt;
今日はこれだけ。</content><link rel='replies' type='application/atom+xml' href='http://maigo-lalala.blogspot.com/feeds/938983682406072448/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2013/06/raspberrypi-3.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/938983682406072448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/938983682406072448'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2013/06/raspberrypi-3.html' title='RaspberryPi #3 ネットワークと動画再生'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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-169100485598022363.post-8298202724038902906</id><published>2013-06-14T21:49:00.002+09:00</published><updated>2013-06-14T21:49:12.277+09:00</updated><title type='text'>RaspberryPi#2 起動する</title><content type='html'>SDカードリーダーが届いた。&lt;br /&gt;
&lt;br /&gt;
参考書は「&lt;a href=&quot;http://www.amazon.co.jp/Raspberry-Pi%E3%81%A7%E9%81%8A%E3%81%BC%E3%81%86-%E6%9E%97-%E5%92%8C%E5%AD%9D/dp/4899773528&quot;&gt;Raspberry Piで遊ぼう！&lt;/a&gt;」です。&lt;br /&gt;
本に書いてあるとおり下記アドレスに置いてある「RPi-&lt;span class=&quot;GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;19f19006-7cfd-4713-92b9-0f042c6002e3&quot; ginger_sofatware_uiphraseguid=&quot;c3314b31-40f6-4671-8ab3-f5d7e69fd530&quot; grcontextid=&quot;sd:0&quot;&gt;sd&lt;/span&gt; card builder」を使って書き込む。&lt;br /&gt;
http://alltheware.wordpress.com/2012/12/11/easiest-way-sd-card-setup/&lt;br /&gt;
&lt;br /&gt;
ちゃんとSDカード挿しているのに「挿してますか？」みたいなメッセージが出るので疑問だけれども、よく読むと「挿してなかったら挿してね」というメッセージなので「continue」を押していけば大丈夫。&lt;br /&gt;
書き込み先を選ぶときにPCのドライブにまでチェックがついているので気をつけて、SDカードのみにチェックが入っているようにする。&lt;br /&gt;
&lt;br /&gt;
書き込みを終えたらSDカードをRasberryPiに差し込んで、HDMIケーブルをつないで、マウスとキーボードをつないで、電源をONする（コンセントに差す）。&lt;br /&gt;
&lt;br /&gt;
どうやら書籍が書かれた時期とバージョンが変わっているようでメニューが違っているのでちょっと戸惑うのだけど、Overscanやsshは「8 Advanced Options」に、日本語関係は「4 Internationalisation Options」にある。&lt;br /&gt;
&lt;br /&gt;
ここではSDカードの使用領域拡張、ロケールの設定、SSHを有効化（デフォルトでなっているような気がする）した。&lt;br /&gt;
これでリブートするとコマンドラインのLinuxが起動する。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://maigo-lalala.blogspot.com/feeds/8298202724038902906/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2013/06/raspberrypi2.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/8298202724038902906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/8298202724038902906'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2013/06/raspberrypi2.html' title='RaspberryPi#2 起動する'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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-169100485598022363.post-4784992744558052518</id><published>2013-06-14T00:10:00.000+09:00</published><updated>2013-06-14T00:10:24.916+09:00</updated><title type='text'>RaspberryPiを買ったのだ</title><content type='html'>&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/AVvXsEiYgS6C8qn3MiHROoO98wsiPUDh9B3ReIVbvxI5Kh_ccccbzT8QDFRu83dN6rltKqWiVAkYDXfTt6G3XERY_JP3mC5Arqo0gPN3tPgxKjAAY6MQ-zuQvA6eGaBhCDQ_6c95GrusaHau2bo7/s1600/IMG_0881.JPG&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; height=&quot;150&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYgS6C8qn3MiHROoO98wsiPUDh9B3ReIVbvxI5Kh_ccccbzT8QDFRu83dN6rltKqWiVAkYDXfTt6G3XERY_JP3mC5Arqo0gPN3tPgxKjAAY6MQ-zuQvA6eGaBhCDQ_6c95GrusaHau2bo7/s200/IMG_0881.JPG&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
ふとRasberryPiを買ってみた。&lt;br /&gt;
参考書もついでに買った。&lt;br /&gt;
SDカードも必要だそうだから買った。&lt;br /&gt;
16GBのclass10。&lt;br /&gt;
電源はKindleに付属していたマイクロUSB経由でiPhoneの充電器に差し込めばいけるんじゃないだろうか。&lt;br /&gt;
とりあえずランプはついた。&lt;br /&gt;
HDMIケーブルはプレステにつないであるものを使おう。&lt;br /&gt;
USBマウスはある。&lt;br /&gt;
キーボードがない。&lt;br /&gt;
ノートPCしかない。&lt;br /&gt;
だから買おう。&lt;br /&gt;
&lt;br /&gt;
公式サイトのダウンロードページからRasberry用のディストリビューションである&lt;br /&gt;
&lt;span class=&quot;GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct&quot; ginger_sofatware_markguid=&quot;11db5e46-e389-4c2d-8be7-727ee11c5255&quot; ginger_sofatware_uiphraseguid=&quot;d7ba7c3a-ad82-48fb-8fbc-b8501fcab3fd&quot; grcontextid=&quot;Raspbian:0&quot;&gt;Raspbian&lt;/span&gt; Wheezyをダウンロードする。&lt;br /&gt;
&lt;br /&gt;
http://www.raspberrypi.org/downloads&lt;br /&gt;
&lt;br /&gt;
これをSDカードに書き込めばOK。&lt;br /&gt;
SDカードリーダーが無かった。。&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://maigo-lalala.blogspot.com/feeds/4784992744558052518/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2013/06/raspberrypi.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/4784992744558052518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/4784992744558052518'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2013/06/raspberrypi.html' title='RaspberryPiを買ったのだ'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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/AVvXsEiYgS6C8qn3MiHROoO98wsiPUDh9B3ReIVbvxI5Kh_ccccbzT8QDFRu83dN6rltKqWiVAkYDXfTt6G3XERY_JP3mC5Arqo0gPN3tPgxKjAAY6MQ-zuQvA6eGaBhCDQ_6c95GrusaHau2bo7/s72-c/IMG_0881.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-169100485598022363.post-6866428306483811444</id><published>2012-01-17T23:51:00.002+09:00</published><updated>2012-01-18T00:05:02.155+09:00</updated><title type='text'>rubyの諸々が最新になっている環境にRedmineとBacklogを入れてみる</title><content type='html'>CentOSに入っているrubyは古いのでさくっとアップデートしたのです。&lt;br /&gt;railsも最新をインストールしてやりましたよ。&lt;br /&gt;その後でredmineを入れたやろうと、でも困った。&lt;br /&gt;redmineはもうrails3に対応する気はないらしい。&lt;br /&gt;&lt;br /&gt;でもRedmineを動かすだけなら難しくない。&lt;br /&gt;&lt;a href=&quot;http://bitnami.org/&quot;&gt;BitNami&lt;/a&gt;にアクセスしてDownloadを選択してRedmineを選ぶとbitnami～.installer.binというファイルがダウンロードされる。&lt;div&gt;これに実行権をあたえて動かせばOK。&lt;/div&gt;&lt;div&gt;/opt/redmine-x.x.x(xはバージョン）ができるので移動します。&lt;/div&gt;&lt;div&gt;そこで./ctlscript.sh start　として「localhost:8080」にアクセスしてやれば動く。&lt;/div&gt;&lt;div&gt;ポート番号はインストール時に指定した値で。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;で注意しなくちゃいけないのはプラグインのインストール。&lt;/div&gt;&lt;div&gt;ここではBacklogをインストールするケースなのだけど、まずはさきの&lt;/div&gt;&lt;div&gt;/opt/redmineインストール先/apps/redmine/vendor　に移動します。&lt;/div&gt;&lt;div&gt;ここでBacklogの手順にしたがい、gitで落としてgemやrakeなど必要なコマンドを&lt;/div&gt;&lt;div&gt;打っていくのだけど、ここで使うgemやrakeは全てこのRedmineのパッケージの中のものを利用すること。&lt;/div&gt;&lt;div&gt;つまり&lt;/div&gt;&lt;div&gt;「/opt/redmine-x.x.x/ruby/bin/gem」を使わないと失敗します。&lt;/div&gt;&lt;div&gt;ハマります。&lt;/div&gt;&lt;div&gt;rakeも同様。&lt;/div&gt;&lt;div&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;</content><link rel='replies' type='application/atom+xml' href='http://maigo-lalala.blogspot.com/feeds/6866428306483811444/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2012/01/rubyredminebacklog.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/6866428306483811444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/6866428306483811444'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2012/01/rubyredminebacklog.html' title='rubyの諸々が最新になっている環境にRedmineとBacklogを入れてみる'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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-169100485598022363.post-5833735490801646179</id><published>2012-01-15T21:41:00.002+09:00</published><updated>2012-01-15T21:45:03.704+09:00</updated><title type='text'>CentOSにDropboxを入れたらyumが動かない</title><content type='html'>なぜだ！？&lt;br /&gt;なにをやっても&lt;br /&gt;http://linux.dropbox.com/fedora/6/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - &quot;The requested URL returned error: 404&quot;&lt;br /&gt;なんて怒られる。&lt;br /&gt;&lt;br /&gt;というわけで「/etc/yum.repos.d/」以下をしてみる。&lt;br /&gt;&lt;br /&gt;-rw-r--r--. 1 root root 1926 12月  9 12:05 2011 CentOS-Base.repo&lt;br /&gt;-rw-r--r--. 1 root root  637 12月  9 12:05 2011 CentOS-Debuginfo.repo&lt;br /&gt;-rw-r--r--. 1 root root  626 12月  9 12:05 2011 CentOS-Media.repo&lt;br /&gt;-rw-r--r--. 1 root root  145  1月 12 23:34 2012 dropbox.repo&lt;br /&gt;-rw-r--r--. 1 root root  116  1月 14 09:59 2012 google-chrome.repo&lt;br /&gt;-rw-r--r--. 1 root root  258  1月 14 01:03 2012 home:sawaa.repo&lt;br /&gt;-rw-r--r--. 1 root root  739 11月 13 12:55 2010 mirrors-rpmforge&lt;br /&gt;-rw-r--r--. 1 root root  717 11月 13 12:55 2010 mirrors-rpmforge-extras&lt;br /&gt;-rw-r--r--. 1 root root  728 11月 13 12:55 2010 mirrors-rpmforge-testing&lt;br /&gt;-rw-r--r--. 1 root root 1113 11月 13 12:55 2010 rpmforge.repo&lt;br /&gt;&lt;br /&gt;ropboxが悪さしているようなので、この「dropbox.repo」をどこかに避けてやりました。&lt;br /&gt;そしたらyumがちゃんと動くようになりましたとさ。。</content><link rel='replies' type='application/atom+xml' href='http://maigo-lalala.blogspot.com/feeds/5833735490801646179/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2012/01/centosdropboxyum.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/5833735490801646179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/5833735490801646179'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2012/01/centosdropboxyum.html' title='CentOSにDropboxを入れたらyumが動かない'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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-169100485598022363.post-272158767928232594</id><published>2011-12-27T00:06:00.000+09:00</published><updated>2011-12-27T00:07:01.607+09:00</updated><title type='text'>Railsのソースを読んでみる#4  modelの生成部分</title><content type='html'>今回みるのはrailtiesの「rails/commands.rb」なのだ。&lt;br /&gt;&lt;br /&gt;これは受け取ったコマンドに応じたcase文がつらつらと続いているのだけれど、&lt;br /&gt;まずは「rails g model User name:string email:string」とした場合を想定してみましょう。&lt;br /&gt;&lt;br /&gt;コマンドにg(generate)を指定した場合はcommands.rbの28行目の&lt;br /&gt;&lt;br /&gt;28     require &quot;rails/commands/#{command}&quot;&lt;br /&gt;&lt;br /&gt;が実行されて「rails/commands/generate」が読み込まれます。&lt;br /&gt;で、そのgenerate.rbの中身が以下の通り。&lt;br /&gt;&lt;br /&gt;  1 require &#39;rails/generators&#39;&lt;br /&gt;  2 require &#39;active_support/core_ext/object/inclusion&#39;&lt;br /&gt;  3 &lt;br /&gt;  4 Rails::Generators.configure!&lt;br /&gt;  5 &lt;br /&gt;  6 if ARGV.first.in?([nil, &quot;-h&quot;, &quot;--help&quot;])&lt;br /&gt;  7   Rails::Generators.help &#39;generate&#39;&lt;br /&gt;  8   exit&lt;br /&gt;  9 end&lt;br /&gt; 10 &lt;br /&gt; 11 name = ARGV.shift&lt;br /&gt; 12 Rails::Generators.invoke name, ARGV, :behavior =&gt; :invoke, :destination_root =&gt; Rails.root&lt;br /&gt;&lt;br /&gt;これだけ。&lt;br /&gt;先の例で言うと11行目で変数nameに「model」が格納された状態で&lt;br /&gt;Rails::Generators.invoke　が呼び出されています。&lt;br /&gt;そのメソッドの在処は1つ上の階層の「rails/generators.rb」です。&lt;br /&gt;&lt;br /&gt;164     def self.invoke(namespace, args=ARGV, config={})&lt;br /&gt;165       names = namespace.to_s.split(&#39;:&#39;)&lt;br /&gt;166       if klass = find_by_namespace(names.pop, names.any? &amp;&amp; names.join(&#39;:&#39;))&lt;br /&gt;167         args &lt;&lt; &quot;--help&quot; if args.empty? &amp;&amp; klass.arguments.any? { |a| a.required? }&lt;br /&gt;168         klass.start(args, config)&lt;br /&gt;169       else&lt;br /&gt;170         puts &quot;Could not find generator #{namespace}.&quot;&lt;br /&gt;171       end&lt;br /&gt;172     end&lt;br /&gt;&lt;br /&gt;166行目でfind_by_namespace(&quot;model&quot;)で呼び出します。&lt;br /&gt;この呼び出しの結果、「Rails::Generators::ModelGenerator」が帰ってきます。&lt;br /&gt;というわけで168行目にて「Rails::Generators::ModelGenerator」のstartを呼んでいます。&lt;br /&gt;このstartメソッドはどこにあるのだろうか、というわけで「rails console」を立ち上げて聞いてみましょう。&lt;br /&gt;&lt;br /&gt;require &#39;rails/generators&#39;&lt;br /&gt;require &#39;rails/generators/rails/model/model_generators&#39;&lt;br /&gt;Rails::Generators::ModelGenerator.ancestors&lt;br /&gt;&lt;br /&gt;上記を実行するとこんな結果が返ってきます。&lt;br /&gt;&lt;br /&gt;[Rails::Generators::ModelGenerator, Rails::Generators::NamedBase, Rails::Generators::Base, Rails::Generators::Actions, Thor::Actions, Thor::Group, Thor::Shell, Thor::Invocation, Thor::Base, Object, PP::ObjectMixin, ActiveSupport::Dependencies::Loadable, JSON::Ext::Generator::GeneratorMethods::Object, Kernel, BasicObject] &lt;br /&gt;&lt;br /&gt;今いるrailtiesの中ではgrepしても該当のstartメソッドが無さそうなので「Thor」と呼ばれるモジュールにありそうです。&lt;br /&gt;そもそも「Thor」とは何ぞや。&lt;br /&gt;次回はそこら辺りを調べてみましょう。</content><link rel='replies' type='application/atom+xml' href='http://maigo-lalala.blogspot.com/feeds/272158767928232594/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2011/12/rails4-model.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/272158767928232594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/272158767928232594'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2011/12/rails4-model.html' title='Railsのソースを読んでみる#4  modelの生成部分'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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-169100485598022363.post-3377316748298524690</id><published>2011-12-17T17:31:00.001+09:00</published><updated>2011-12-17T17:32:55.098+09:00</updated><title type='text'>Railsのソースを読んでみる#3 もう１つのrails</title><content type='html'>今回は「rails new ****」として出来たディレクトリの「アプリ名/script/rails」を見て行きましょう。&lt;br /&gt;ちなみちRails3.1.3です。&lt;br /&gt;&lt;br /&gt;  1 #!/usr/bin/env ruby&lt;br /&gt;  2 # This command will automatically be run when you run &quot;rails&quot; with Rails 3 gems installed from the root of your application.&lt;br /&gt;  3 APP_PATH = File.expand_path(&#39;../../config/application&#39;,  __FILE__)&lt;br /&gt;  4 require File.expand_path(&#39;../../config/boot&#39;,  __FILE__)&lt;br /&gt;  5 require &#39;rails/commands&#39;&lt;br /&gt;&lt;br /&gt;3行目では「アプリ名/config/application」というパスをAPP_PATHに格納しています。&lt;br /&gt;そして「アプリ名/config/boot.rb」を読み込み、「rails/commands」（こちらはrailtieの方）を読み込んでいます。&lt;br /&gt;&lt;br /&gt;まずは「boot.rb」&lt;br /&gt;&lt;br /&gt;  1 require &#39;rubygems&#39;&lt;br /&gt;  2 &lt;br /&gt;  3 # Set up gems listed in the Gemfile.&lt;br /&gt;  4 ENV[&#39;BUNDLE_GEMFILE&#39;] ||= File.expand_path(&#39;../../Gemfile&#39;, __FILE__)&lt;br /&gt;  5 &lt;br /&gt;  6 require &#39;bundler/setup&#39; if File.exists?(ENV[&#39;BUNDLE_GEMFILE&#39;])&lt;br /&gt;&lt;br /&gt;ここでは環境変数「BUNDLE_GEMFILE」に「アプリ名/Gemfile」を格納しています。&lt;br /&gt;そして「bundler/setup」を読み込みます。&lt;br /&gt;ここでやっているのはファイル名から分かるとうりGemfileで定義した各種モジュールを読み込んでいます。&lt;br /&gt;bundler/setup.rb にて「Bundler.setup」をコールします。これは１つうえの階層の「bundler.rb」にあります。&lt;br /&gt;こちらを読んでいきましょう。&lt;br /&gt;&lt;br /&gt;101     def setup(*groups)&lt;br /&gt;102       # Just return if all groups are already loaded&lt;br /&gt;103       return @setup if defined?(@setup)&lt;br /&gt;104 &lt;br /&gt;105       if groups.empty?&lt;br /&gt;106         # Load all groups, but only once&lt;br /&gt;107         @setup = load.setup&lt;br /&gt;108       else&lt;br /&gt;109         @completed_groups ||= []&lt;br /&gt;110         # Figure out which groups haven&#39;t been loaded yet&lt;br /&gt;111         unloaded = groups - @completed_groups&lt;br /&gt;112         # Record groups that are now loaded&lt;br /&gt;113         @completed_groups = groups&lt;br /&gt;114         # Load any groups that are not yet loaded&lt;br /&gt;115         unloaded.any? ? load.setup(*unloaded) : load&lt;br /&gt;116       end&lt;br /&gt;117     end&lt;br /&gt;&lt;br /&gt;この時点ではgroupsは指定しないし@setupも空なので107行目が実行されます。&lt;br /&gt;loadというのはRuntimeクラスのインスタンスを返してくるメソッドで、そのsetupメソッドを呼んでいます。&lt;br /&gt;そのRuntimeというのはどっから来るんだ、というと同ファイルのもっと上の方にあります。&lt;br /&gt;&lt;br /&gt; 18   autoload :Definition,          &#39;bundler/definition&#39;&lt;br /&gt; 19   autoload :Dependency,          &#39;bundler/dependency&#39;&lt;br /&gt; 20   autoload :Dsl,                 &#39;bundler/dsl&#39;&lt;br /&gt; 21   autoload :Environment,         &#39;bundler/environment&#39;&lt;br /&gt; 22   autoload :GemHelper,           &#39;bundler/gem_helper&#39;&lt;br /&gt; 23   autoload :Graph,               &#39;bundler/graph&#39;&lt;br /&gt; 24   autoload :Index,               &#39;bundler/index&#39;&lt;br /&gt; 25   autoload :Installer,           &#39;bundler/installer&#39;&lt;br /&gt; 26   autoload :LazySpecification,   &#39;bundler/lazy_specification&#39;&lt;br /&gt; 27   autoload :LockfileParser,      &#39;bundler/lockfile_parser&#39;&lt;br /&gt; 28   autoload :RemoteSpecification, &#39;bundler/remote_specification&#39;&lt;br /&gt; 29   autoload :Resolver,            &#39;bundler/resolver&#39;&lt;br /&gt; 30   autoload :Runtime,             &#39;bundler/runtime&#39;&lt;br /&gt; 31   autoload :Settings,            &#39;bundler/settings&#39;&lt;br /&gt; 32   autoload :SharedHelpers,       &#39;bundler/shared_helpers&#39;&lt;br /&gt; 33   autoload :SpecSet,             &#39;bundler/spec_set&#39;&lt;br /&gt; 34   autoload :Source,              &#39;bundler/source&#39;&lt;br /&gt; 35   autoload :Specification,       &#39;bundler/shared_helpers&#39;&lt;br /&gt; 36   autoload :UI,                  &#39;bundler/ui&#39;&lt;br /&gt;&lt;br /&gt;autoloadというのは最初の引数に指定した名前を参照したタイミングでrequireするメソッドです。&lt;br /&gt;なので「Runtime.new」とされた時点で30行目の「bundler/runtime」が読み込まれます。&lt;br /&gt;この中ではGemfileで指定しているファイルを順次ロードしているだけなので詳細はパス。&lt;br /&gt;&lt;br /&gt;「rails/commands」の方は次回見てみるのだ。</content><link rel='replies' type='application/atom+xml' href='http://maigo-lalala.blogspot.com/feeds/3377316748298524690/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2011/12/rails3-rails.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/3377316748298524690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/3377316748298524690'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2011/12/rails3-rails.html' title='Railsのソースを読んでみる#3 もう１つのrails'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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-169100485598022363.post-3516270257053246210</id><published>2011-12-11T20:48:00.002+09:00</published><updated>2011-12-11T20:51:10.382+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><title type='text'>Railsのソースを読んでみる#2 railtie入り口</title><content type='html'>今回からはrailsのコアである「railties」のソースを追いかけてみるのだ。&lt;br /&gt;「railties-3.1.0/lib/rails/cli.rb」を追いかける。&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt; 1 require &#39;rbconfig&#39;&lt;br /&gt; 2 require &#39;rails/script_rails_loader&#39;&lt;br /&gt; 3&lt;br /&gt; 4 # If we are inside a Rails application this method performs an exec and thus&lt;br /&gt; 5 # the rest of this script is not run.&lt;br /&gt; 6 Rails::ScriptRailsLoader.exec_script_rails!&lt;br /&gt; 7&lt;br /&gt; 8 require &#39;rails/ruby_version_check&#39;&lt;br /&gt; 9 Signal.trap(&quot;INT&quot;) { puts; exit(1) }&lt;br /&gt;10&lt;br /&gt;11 if ARGV.first == &#39;plugin&#39;&lt;br /&gt;12   ARGV.shift&lt;br /&gt;13   require &#39;rails/commands/plugin_new&#39;&lt;br /&gt;14 else&lt;br /&gt;15   require &#39;rails/commands/application&#39;&lt;br /&gt;16 end&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;まず「rbconfig」と「rails/script_rails_loader」を読み込んでいます。&lt;br /&gt;６行目では「script/rails」が存在すれば、つまり「rails new」でアプリケーションを生成した状態で&lt;br /&gt;実行した場合はそちらのrailsコマンドを実行します。&lt;br /&gt;&lt;br /&gt;8,9行目ではrailsを動かせるrubyのバージョンであるかチェックしています。&lt;br /&gt;&lt;br /&gt;11行目以降では「rails plugin」と指定した場合は「rails/commands/plugin_new」を、&lt;br /&gt;それ以外は「application/commands/application」を読み込んでいます。&lt;br /&gt;「rails plugin new Hoge」とすればプラグイン開発用の雛形が生成されるのだ。&lt;br /&gt;&lt;br /&gt;１１行目以降の部分はrailsアプリを新たに作成する場合に実行されるコードです。&lt;br /&gt;そちらはちょっとパスするとして、生成したあとの「script/rails」を読んでいきましょう。&lt;br /&gt;それは次回。</content><link rel='replies' type='application/atom+xml' href='http://maigo-lalala.blogspot.com/feeds/3516270257053246210/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2011/12/rails2-railtie.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/3516270257053246210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/3516270257053246210'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2011/12/rails2-railtie.html' title='Railsのソースを読んでみる#2 railtie入り口'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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-169100485598022363.post-7079985770137710317</id><published>2011-12-09T23:44:00.003+09:00</published><updated>2011-12-09T23:48:18.119+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><title type='text'>Railsのソースを読んでみる#1 railsコマンド</title><content type='html'>「メタプログラミングRuby」という書籍を読んだのだけど、一刻も早く実践しなければ全力で記憶から消え去りそうな気配がありすぎるので何かつくろうと思ったのだけど何も思い浮かばないのでRailsのソースでも見てみようか、と思い立ったのだ。&lt;br /&gt;&lt;br /&gt;Linuxカーネルのソース読書を数年前に断念した前科があるけれど、いいの。&lt;br /&gt;今回は最初から全部読む気ないから。&lt;br /&gt;ピックアップ的に気になるところを読んでみよう。&lt;br /&gt;&lt;br /&gt;Railsのソースは普通にインストールすれば&lt;br /&gt;/usr/lib/ruby/gems/1.8/gems&lt;br /&gt;にある（Macの場合）。&lt;br /&gt;上記はRuby1.8の例なので適宜読み替えてください。&lt;br /&gt;&lt;br /&gt;でもrvmなんかを使っていると場所が変わっているので、rvmで目的のverに切り替えてから「which rails」とすれば実行パスが出てくるので、その周辺にたぶんあります。&lt;br /&gt;&lt;br /&gt;私の例では以下のパスでした。&lt;br /&gt;~/.rvm/gems/ruby-1.9.2-p290/gems&lt;br /&gt;&lt;br /&gt;でもどっから見たらいいのかよう分からん。&lt;br /&gt;とりあえずrailsのはbinディレクトリしかないのでとりあえずrailsコマンドの中身を見てみる。&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt; 1 #!/usr/bin/env ruby&lt;br /&gt; 2&lt;br /&gt; 3 if File.exists?(File.join(File.expand_path(&#39;../..&#39;, __FILE__), &#39;.git&#39;))&lt;br /&gt; 4   railties_path = File.expand_path(&#39;../../railties/lib&#39;, __FILE__)&lt;br /&gt; 5   $:.unshift(railties_path)&lt;br /&gt; 6 end&lt;br /&gt; 7 require &quot;rails/cli&quot;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;3行目では「gems」に「.git」があるか確認しています。&lt;br /&gt;あれば「XXX/gems/railties/lib」をrailties_pathに格納します。&lt;br /&gt;「$:」はロードパスを示す組み込み変数で「$LOAD_PATH」としても同じです。&lt;br /&gt;5行目ではそのロードパスの先頭にrailties_pathを挿入しています。&lt;br /&gt;7行目では「railities/lib/rails/cli.rb」を読み込んでいます。&lt;br /&gt;&lt;br /&gt;要するに「railties/lib/rails/cli.rb」を読んでいるだけなんだけど、最初に「.git」の有無をチェックしているのはなぜだろう。&lt;br /&gt;存在した場合だけロードパスにrailtiesのパスを先頭に追加している。&lt;br /&gt;ググってみても分からん。&lt;br /&gt;とりあえず課題として置いておこう。&lt;br /&gt;&lt;br /&gt;とにもかくにもここから分かるのはRailsの一番核になっているのが&lt;br /&gt;railtieだということ。&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;Railtieに関するドキュメントを訳した&quot;&gt;ここら辺りで予習しておくと良いでしょう。&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://maigo-lalala.blogspot.com/feeds/7079985770137710317/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2011/12/rubyrails-linux-rails-usrlibrubygems1.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/7079985770137710317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/7079985770137710317'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2011/12/rubyrails-linux-rails-usrlibrubygems1.html' title='Railsのソースを読んでみる#1 railsコマンド'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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-169100485598022363.post-2939826708772956021</id><published>2011-12-01T09:25:00.003+09:00</published><updated>2011-12-09T21:30:17.772+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ruby"/><title type='text'>[ruby]includeとextend</title><content type='html'>Rubyにおけるincludeとextendの違いは言葉で言われてもピンと来ないので実際に試した方が早いのね。&lt;div&gt;irbで試しましょう。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;とりあえずこんなモジュールを用意します。&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;module A&lt;/div&gt;&lt;div&gt;　def hello&lt;/div&gt;&lt;div&gt;　　&quot;hello&quot;&lt;/div&gt;&lt;div&gt;　end&lt;/div&gt;&lt;div&gt;end&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;そして使ってみます。まずはinclude。&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;class B&lt;/div&gt;&lt;div&gt;　include A&lt;/div&gt;&lt;div&gt;end&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;test = B.new&lt;/div&gt;&lt;div&gt;test.hello =&amp;gt; #&quot;hello&quot;&lt;/div&gt;&lt;div&gt;B.hello =&amp;gt; #&quot;NoMethodError&quot;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;次にextend。&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;class C&lt;/div&gt;&lt;div&gt;　extend A&lt;/div&gt;&lt;div&gt;end&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;C.hello =&amp;gt; #&quot;hello&quot;&lt;/div&gt;&lt;div&gt;test = C.new&lt;/div&gt;&lt;div&gt;test.hello =&amp;gt; #&quot;NoMethodError&quot;&lt;/div&gt;&lt;div&gt;test.extend(A)&lt;/div&gt;&lt;div&gt;test.hello =&amp;gt; #&quot;hello&quot;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;つまりincludeはインスタンスメソッドを差し込むのに対して、extendは特異メソッドを挿入するかたちになります。&lt;/div&gt;&lt;div&gt;だからクラス定義の中でextendすると、クラスの特異メソッド＝クラスメソッドになります。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maigo-lalala.blogspot.com/feeds/2939826708772956021/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2011/12/rubyincludeextend.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/2939826708772956021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/2939826708772956021'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2011/12/rubyincludeextend.html' title='[ruby]includeとextend'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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-169100485598022363.post-6556649944518360870</id><published>2011-11-17T21:49:00.002+09:00</published><updated>2011-11-17T22:04:13.597+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oauth"/><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><title type='text'>[Rails]OmniAuthの使い方</title><content type='html'>RailsでOAuthを使うにはOmniAuthが簡単で便利。&lt;div&gt;というわけで使ってみよう。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;gem &#39;omniauth&#39;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;とGemfileに追記して、bundle installします。&lt;/div&gt;&lt;div&gt;「config/initializers/omniauth.rb」というファイルが出来ているので&lt;/div&gt;&lt;div&gt;以下のように編集します。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;Rails.application.config.middleware.use OmniAuth::Builder do&lt;/div&gt;&lt;div&gt;  provider :XXX, &quot;Consumerキー&quot;, &quot;Consumerシークレット&quot;&lt;/div&gt;&lt;div&gt;end&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;「XXX」の部分やOAuthを使って利用したいサービスを指定します。&lt;/div&gt;&lt;div&gt;例）:twitter, :facebook, :githubなど&lt;/div&gt;&lt;div&gt;Consumerキーやシークレットはそれぞれのサービスで取得したキーやシークレットの値を指定します。&lt;/div&gt;&lt;div&gt;これをそのままハードコーディングしてしまうのは問題なので一般的には以下のように指定します。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;例）provider :twitter, ENV[&#39;TWITTER_KEY&#39;], ENV[&#39;TWITTER_SECRET&#39;]&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;環境変数からとってくるようにします。&lt;/div&gt;&lt;div&gt;環境変数の指定は各OSの手順に従えばよいですが、heroku上で利用する場合は以下のコマンドを使います。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;heroku config:add TWITTER_KEY=&quot;XXXXXX&quot;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;これで「ENV[&quot;TWITTER_KEY&quot;]」とすれば「XXXXX」が取得できます。&lt;/div&gt;&lt;div&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://maigo-lalala.blogspot.com/feeds/6556649944518360870/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2011/11/railsomniauth.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/6556649944518360870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/6556649944518360870'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2011/11/railsomniauth.html' title='[Rails]OmniAuthの使い方'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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-169100485598022363.post-9182420851122280136</id><published>2011-10-29T21:26:00.000+09:00</published><updated>2011-10-29T21:26:44.756+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><title type='text'>[こんなん作ってみました]Otaku Yellow Page</title><content type='html'>Ruby on Railsを使って何かつくってみたいな、と思って&lt;div&gt;「Otaku Yellow Page」なるものをつくってみました。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;http://oyp.heroku.com/&quot;&gt;Otaku Yellow Page&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&gt;ソースコードは全てGitHubにあげています。&lt;/div&gt;&lt;div&gt;Rails3.1のサンプルコードとしてチェックしてみてください。&lt;/div&gt;&lt;div&gt;RSpecごとぶっこんでます。&lt;/div&gt;&lt;div&gt;ツッコミどころがあれば教えてくださいね。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://github.com/kukimo/OtakuYellowPage&quot;&gt;kukimo/OtakuYellowPage&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;推しメンを登録して、推しカブリを検索できるサービスです。&lt;/div&gt;&lt;div&gt;とりあえずTwitterとmixiとAmebaに対応しました（プロフィールにリンクするのみ）。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;主に使っているのは以下のものです。&lt;/div&gt;&lt;div&gt;・Ruby1.9.2&lt;/div&gt;&lt;div&gt;・Ruby on Rails 3.1.0&lt;/div&gt;&lt;div&gt;・Haml&lt;/div&gt;&lt;div&gt;・SCSS (ほとんど使えてない、、、)&lt;/div&gt;&lt;div&gt;・RSpec2.6.4&lt;/div&gt;&lt;div&gt;・Capybara&lt;/div&gt;&lt;div&gt;・Bootstrap, from Twitter&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;本当はOmniAuthを使ってTwttier, mixi, Amebaと連携したかったのだけれどmixiとAmebaのAPIではあまり思ったことがやれなさそうだったので使わずにイエローページという位置づけにしてみました。&lt;/div&gt;&lt;div&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://maigo-lalala.blogspot.com/feeds/9182420851122280136/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2011/10/otaku-yellow-page.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/9182420851122280136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/9182420851122280136'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2011/10/otaku-yellow-page.html' title='[こんなん作ってみました]Otaku Yellow Page'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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-169100485598022363.post-160864992538832299</id><published>2011-10-24T09:09:00.002+09:00</published><updated>2011-10-24T09:14:44.738+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><title type='text'>Rails3.1をHerokuで動かす</title><content type='html'>どハマりしましたが、とても参考になる記事がありました。&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;http://yaplog.jp/rails3_super/archive/15&quot;&gt;Rails3.1をHeroku&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;</content><link rel='replies' type='application/atom+xml' href='http://maigo-lalala.blogspot.com/feeds/160864992538832299/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2011/10/rails31heroku.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/160864992538832299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/160864992538832299'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2011/10/rails31heroku.html' title='Rails3.1をHerokuで動かす'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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-169100485598022363.post-8129090266052947966</id><published>2011-10-15T12:01:00.004+09:00</published><updated>2011-10-15T12:12:38.631+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><title type='text'>アプリのvalidationで失敗したら</title><content type='html'>XCodeを4.2にアップデートしたら過去のアプリがvalidationに失敗するようになってしまいました。以下のようなメッセージが出ます。&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;application executable is missing a required architecture. At least one of the following architecture(s) must be present: armv6&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;XCodeを更新したことでarmv7のアーキテクチャ（のみ）でビルドしようとするようになったらしく、古いバージョンまでサポートするように(Deployment targetを4.0にする、など）設定していると、ダメだよ！と言われるようです。&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;「Build setting」の「Architectures」を見ると「$(ARCHS_STANDARD_32_BIT)」となっていて、これがarmv7を指しているみたい。&lt;/div&gt;&lt;div&gt;なのでここに「+」して「armv6」を追加してやります。&lt;/div&gt;&lt;div&gt;これでvalidationが通るようになります。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;s&lt;a href=&quot;http://stackoverflow.com/questions/4198676/warning-iphone-apps-should-include-an-armv6-architecture-even-with-build-config&quot;&gt;tackoverflowを参考にしました。&lt;/a&gt;&lt;/div&gt;&lt;div&gt;２番目の回答が今回の解決方法に相当します。&lt;/div&gt;&lt;div&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://maigo-lalala.blogspot.com/feeds/8129090266052947966/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2011/10/validation.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/8129090266052947966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/8129090266052947966'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2011/10/validation.html' title='アプリのvalidationで失敗したら'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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-169100485598022363.post-1800263831855071425</id><published>2011-10-13T20:26:00.000+09:00</published><updated>2011-10-13T20:26:06.756+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><title type='text'>Bing APIで検索してみよう</title><content type='html'>画像検索用のAPIはいくつか公開されていますが、Bingはその中でも簡単に使えて制限が少ないと思います。&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;何はともあれまずはAppIDが必要になるので、&lt;a href=&quot;http://www.bing.com/toolbox/bingdeveloper/&quot;&gt;こちら&lt;/a&gt;から登録しておきます。&lt;/div&gt;&lt;div&gt;AppIDを取得したら&lt;/div&gt;&lt;div&gt;        &lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;http://api.search.live.net/json.aspx?Appid=(AppID)&amp;amp;query=(検索文字)&amp;amp;sources=(検索対象)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;とGETしてやれば結果がJSONで返ってきます。&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;sorcesには以下のように種類があります。詳細はドキュメントを参照してください。&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;web、image、video、newsなどなど。&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;oasisの画像検索をしたい場合は&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(255, 0, 0); &quot;&gt;http://api.search.live.net/json.aspx?Appid=(AppID)&amp;amp;query=oasis&amp;amp;sources=image&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;となります。&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;iPhoneアプリで利用する場合、ほぼ確実に年齢制限が必要になるのでAppStoreにリリースする際はちゃんと設定しましょう（リジェクトされます）。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maigo-lalala.blogspot.com/feeds/1800263831855071425/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2011/10/bing-api.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/1800263831855071425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/1800263831855071425'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2011/10/bing-api.html' title='Bing APIで検索してみよう'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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-169100485598022363.post-7581049192751888589</id><published>2011-10-04T18:58:00.002+09:00</published><updated>2011-10-04T19:03:41.268+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><title type='text'>[iOS]突然シミュレータ上で起動しなくなる場合</title><content type='html'>&lt;div&gt;クリーンしてからビルドし直してシミュレータで起動しようとしたところ、アプリが起動しようとしたところでクラッシュ。&lt;/div&gt;&lt;div&gt;何度もやり直してもダメ。&lt;/div&gt;&lt;div&gt;コンソールには以下のようなメッセージが残っています。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;app due to uncaught exception &#39;NSInternalInconsistencyException&#39;, reason: &#39;Could not load NIB in bundle〜（省略）〜&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;MainWindow.nibが読み込めませんでした、というようなことを言っているのだけどさっぱり理由が分からない。そんなんいじってない。&lt;/div&gt;&lt;div&gt;なんで、こうなったのかはさっぱり分からないのだけど、とりあえず解決したのでメモ。。。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1) プロジェクト名/ja.lproj　と　en.lprojフォルダにある「MainWindow.xib」を２つともファイルインスペクターに追加する&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2) ビルドする&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;で、OK。&lt;/div&gt;&lt;div&gt;なんかの拍子でプロジェクトから消えてしまうらしい。。。&lt;/div&gt;&lt;div&gt;誤ってDeleteでも押したんだろうか。。。&lt;/div&gt;&lt;div&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://maigo-lalala.blogspot.com/feeds/7581049192751888589/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2011/10/ios.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/7581049192751888589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/7581049192751888589'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2011/10/ios.html' title='[iOS]突然シミュレータ上で起動しなくなる場合'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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-169100485598022363.post-4841671649013153098</id><published>2011-10-01T09:37:00.004+09:00</published><updated>2011-10-01T10:12:26.470+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><title type='text'>[iOS]UITableViewを下に引っ張って更新するUI</title><content type='html'>&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnYPzZU9crKawMSlsxmJAdgRhCX0oyqZgoDBowNhCyrhmro_iLfNo7t88AwUytcXgGX-bvBnVmOezFQh4wK8AB2VBNxnWjsvu8fDhiRYJZUNSltku4Ao5KyP_MZqntqBoQ8n6bm8xCCEkH/s1600/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6c6561682e6261636f6e66696c652e636f6d2f626c6f672f726566726573682d736d616c6c2d312e706e67.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 108px; height: 200px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnYPzZU9crKawMSlsxmJAdgRhCX0oyqZgoDBowNhCyrhmro_iLfNo7t88AwUytcXgGX-bvBnVmOezFQh4wK8AB2VBNxnWjsvu8fDhiRYJZUNSltku4Ao5KyP_MZqntqBoQ8n6bm8xCCEkH/s200/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6c6561682e6261636f6e66696c652e636f6d2f626c6f672f726566726573682d736d616c6c2d312e706e67.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5658317367868960082&quot; /&gt;&lt;/a&gt;&lt;br /&gt;Twitterクライアントでよく見かけるテーブルを下に引っ張るとアイコンが回転してロード中を示すUIがあります。&lt;div&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&gt;１つ目は「PullToRefresh」というもの。&lt;br /&gt;&lt;div&gt;左の画像は&lt;a href=&quot;https://github.com/leah/PullToRefresh&quot;&gt;「PullToRefresh」のGitHubのReadme&lt;/a&gt;から引っ張って来たものです。&lt;/div&gt;&lt;/div&gt;&lt;div&gt;簡単なのはこちらで、Readmeに書いてある通り（英語ですが迷わない程度に簡単です）です。&lt;/div&gt;&lt;div&gt;ごくごく簡単なサンプルも付属しているので、こちらも併せて読めば簡単です。&lt;/div&gt;&lt;div&gt;でもこれはUITableViewControllerを拡張する形になっているので、複数のパーツから構成されている画面に存在するUITableViewを拡張したい、というケースでは使えません。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;そういうケースでは「&lt;a href=&quot;https://github.com/enormego/EGOTableViewPullRefresh&quot;&gt;EGOTableViewPullRefresh&lt;/a&gt;」を使います。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1)EGORefreshTableHeaderView.h/mをコピーする&lt;/div&gt;&lt;div&gt;2)FrameworkにQuarzCoreを追加する&lt;/div&gt;&lt;div&gt;3)対象のUITableViewを持つControllerクラスでEGORefreshTableHeaderDelegateの実装を宣言&lt;/div&gt;&lt;div&gt;4)同様にUIScrollViewDelegateも実装宣言する&lt;/div&gt;        &lt;div&gt;5) EGORefreshTableHeaderViewのインスタンス変数を定義&lt;/div&gt;&lt;div&gt;6)下記のような感じで初期化する&lt;/div&gt;&lt;pre&gt;&lt;code&gt;  EGORefreshTableHeaderView *view = [[EGORefreshTableHeaderView alloc]&lt;br /&gt;    initWithFrame:CGRectMake(0.0f, 0.0f - self.tableView.bounds.size.height,&lt;br /&gt;    self.view.frame.size.width, self.tableView.bounds.size.height)];&lt;br /&gt;  view.delegate = self;&lt;br /&gt;  [self.tableView addSubview:view];&lt;br /&gt;  _refreshHeaderView = view;&lt;br /&gt;  [view release];&lt;br /&gt;  [_refreshHeaderView refreshLastUpdatedDate];&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;　最後のrefreshLastUpdatedDateは引っ張ったときに出てくる最終更新日時を設定するものです。適宜呼んでやりましょう。&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;7) UIScrollViewのdelegateを以下のように実装する&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;pre&gt;&lt;code&gt;&lt;blockquote&gt;- (void)scrollViewDidScroll:(UIScrollView *)scrollView{  &lt;br /&gt; [_refreshHeaderView egoRefreshScrollViewDidScroll:scrollView];&lt;br /&gt;}&lt;br /&gt;- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{&lt;br /&gt; [_refreshHeaderView egoRefreshScrollViewDidEndDragging:scrollView];&lt;br /&gt;}&lt;/blockquote&gt;8) &lt;/code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, serif; font-size: 16px; white-space: normal; &quot;&gt;EGORefreshTableHeaderDelegateで定義されるメソッドを実装する&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;blockquote&gt;- (void)egoRefreshTableHeaderDidTriggerRefresh:(EGORefreshTableHeaderView*)view&lt;br /&gt;　※ロード中アイコンが表示されている間にやっておきたい処理を実装する（非同期で）&lt;br /&gt;- (BOOL)egoRefreshTableHeaderDataSourceIsLoading:(EGORefreshTableHeaderView*)view&lt;br /&gt;　※ロード中かどうかをBOOL値で返す（NOを返したタイミングでロード中解除）&lt;br /&gt;- (NSDate*)egoRefreshTableHeaderDataSourceLastUpdated:(EGORefreshTableHeaderView*)view&lt;br /&gt;　※最終更新日時を返す。基本的には[NSDate date]しておけばよい&lt;/blockquote&gt;&lt;/code&gt;&lt;/pre&gt;&lt;span class=&quot;Apple-style-span&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://maigo-lalala.blogspot.com/feeds/4841671649013153098/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://maigo-lalala.blogspot.com/2011/10/iosuitableviewui.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/4841671649013153098'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/169100485598022363/posts/default/4841671649013153098'/><link rel='alternate' type='text/html' href='http://maigo-lalala.blogspot.com/2011/10/iosuitableviewui.html' title='[iOS]UITableViewを下に引っ張って更新するUI'/><author><name>鈴木クマ</name><uri>http://www.blogger.com/profile/02491938038704364421</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/AVvXsEgnYPzZU9crKawMSlsxmJAdgRhCX0oyqZgoDBowNhCyrhmro_iLfNo7t88AwUytcXgGX-bvBnVmOezFQh4wK8AB2VBNxnWjsvu8fDhiRYJZUNSltku4Ao5KyP_MZqntqBoQ8n6bm8xCCEkH/s72-c/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6c6561682e6261636f6e66696c652e636f6d2f626c6f672f726566726573682d736d616c6c2d312e706e67.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>