<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>はるかなる熊</title>
	<atom:link href="http://b.ruyaka.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://b.ruyaka.com</link>
	<description>ウェブは面白い。VPSとか色々試しています。</description>
	<lastBuildDate>Thu, 17 May 2012 02:25:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>MacでDVD(.VOB)をMpeg4/Mov/h.264などに変換</title>
		<link>http://b.ruyaka.com/2012/05/09/mac-dvd-to-mpeg4-mov-h264-convert/</link>
		<comments>http://b.ruyaka.com/2012/05/09/mac-dvd-to-mpeg4-mov-h264-convert/#comments</comments>
		<pubDate>Wed, 09 May 2012 12:23:58 +0000</pubDate>
		<dc:creator>はるかなる熊</dc:creator>
				<category><![CDATA[その他]]></category>

		<guid isPermaLink="false">http://b.ruyaka.com/?p=2348</guid>
		<description><![CDATA[タイトルの通りMacでDVD(.VOB)をMpeg4/Mov/h.264などに変換する方法メモ。 アプリからだと上手く変換できず、Terminalから直接コマンドを打って変換します。 []$ sudo port install ffmpeg []$ ffmpeg -i /Volumes/*****/VIDEO_TS/*******.VOB -acodec libfaac -vcodec mpeg4 -b 1200k -mbd 2 -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -metadata title=X output.mp4]]></description>
			<content:encoded><![CDATA[<p>タイトルの通りMacでDVD(.VOB)をMpeg4/Mov/h.264などに変換する方法メモ。<br />
アプリからだと上手く変換できず、Terminalから直接コマンドを打って変換します。</p>
<blockquote><p>
[]$ sudo port install ffmpeg<br />
[]$ ffmpeg -i /Volumes/*****/VIDEO_TS/*******.VOB  -acodec libfaac -vcodec mpeg4 -b 1200k -mbd 2 -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -metadata title=X output.mp4
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://b.ruyaka.com/2012/05/09/mac-dvd-to-mpeg4-mov-h264-convert/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>さくらのVPSに音楽配信システム「Streeme」をインストール・設定</title>
		<link>http://b.ruyaka.com/2012/04/20/%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevps%e3%81%ab%e9%9f%b3%e6%a5%bd%e9%85%8d%e4%bf%a1%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e3%80%8cstreeme%e3%80%8d%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc/</link>
		<comments>http://b.ruyaka.com/2012/04/20/%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevps%e3%81%ab%e9%9f%b3%e6%a5%bd%e9%85%8d%e4%bf%a1%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e3%80%8cstreeme%e3%80%8d%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc/#comments</comments>
		<pubDate>Sat, 21 Apr 2012 06:12:25 +0000</pubDate>
		<dc:creator>はるかなる熊</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[さくらのVPS]]></category>
		<category><![CDATA[Streeme]]></category>

		<guid isPermaLink="false">http://b.ruyaka.com/?p=2311</guid>
		<description><![CDATA[Streeme Googleの音楽ストリーミング用のオープンソース。 iTunesライクなインターフェイスで、MITライセンスなので自由に使えます。 さくらのVPSにインストールしたので、そのメモ 1 さくらのVPSの準備 さくらのVPSを借りたあとに設定した事。 1-1. SSH設定 vim /etc/ssh/sshd_config Port 10415 PermitRootLogin no 1-2. 不要なデーモンを停止 chkconfig haldaemon off chkconfig acpid off chkconfig messagebus off chkconfig autofs off chkconfig auditd off chkconfig lvm2-monitor off chkconfig mdmonitor off chkconfig messagebus off chkconfig netfs off chkconfig restorecond off chkconfig smartd off chkconfig yum-updatesd 1-3. PHP5.3.10とMYSQL5.5.23をインストール []$ [...]]]></description>
			<content:encoded><![CDATA[<h4>Streeme</h4>
<p>Googleの音楽ストリーミング用のオープンソース。<br />
iTunesライクなインターフェイスで、MITライセンスなので自由に使えます。<br />
さくらのVPSにインストールしたので、そのメモ</p>
<h4>1 さくらのVPSの準備</h4>
<p>さくらのVPSを借りたあとに設定した事。</p>
<h5>1-1. SSH設定</h5>
<p>vim /etc/ssh/sshd_config</p>
<blockquote><p>
Port 10415<br />
PermitRootLogin no
</p></blockquote>
<h5>1-2. 不要なデーモンを停止</h5>
<blockquote><p>chkconfig haldaemon off<br />
chkconfig acpid off<br />
chkconfig messagebus off<br />
chkconfig autofs off<br />
chkconfig auditd off<br />
chkconfig lvm2-monitor off<br />
chkconfig mdmonitor off<br />
chkconfig messagebus off<br />
chkconfig netfs off<br />
chkconfig restorecond off<br />
chkconfig smartd off<br />
chkconfig yum-updatesd
</p></blockquote>
<h5>1-3. PHP5.3.10とMYSQL5.5.23をインストール</h5>
<blockquote><p>
[]$ yum -y update<br />
[]$ rpm -ivh http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm<br />
[]$ rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm (↑が繋がらない場合)<br />
[]$ rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm<br />
[]$ yum -y install httpd httpd-server<br />
[]$ yum -y install &#8211;enablerepo=remi php-mysql<br />
[]$ yum -y install &#8211;enablerepo=remi mysql mysql-server<br />
[]$ yum -y install &#8211;enablerepo=remi php<br />
[]$ yum -y install &#8211;enablerepo=remi php-pear*<br />
[]$ chkconfig mysqld on<br />
[]$ chkconfig httpd on<br />
[]$ /etc/init.d/mysqld start<br />
[]$ /etc/init.d/httpd start
</p></blockquote>
<h5>1-4. FTPのインストール(必要であれば)</h5>
<p>FTPをインストール。</p>
<blockquote><p>
[]$ yum -y install &#8211;enablerepo=remi vsftpd<br />
[]$ chkconfig &#8211;level 3 vsftpd on
</p></blockquote>
<p>/etc/vsftpd/vsftpd.conf</p>
<blockquote><p>
# 匿名でのアクセス禁止<br />
anonymous_enable=NO<br />
# chroot設定<br />
chroot_local_user=YES<br />
chroot_list_enable=YES<br />
chroot_list_file=/etc/vsftpd/chroot_list<br />
# ローカルタイム設定<br />
use_localtime=YES
</p></blockquote>
<h4>2 Streemeのインストール</h4>
<p>公式ドキュメントを参考にインストール。<br />
<a href="http://code.google.com/p/streeme/wiki/InstallingStreemeLinux" title="http://code.google.com/p/streeme/wiki/InstallingStreemeLinux" target="_blank">http://code.google.com/p/streeme/wiki/InstallingStreemeLinux</a></p>
<h5>2-1. Streemeソースのダウンロード</h5>
<blockquote><p>
[]$ cd /var/www/<br />
[]$ svn checkout http://streeme.googlecode.com/svn/trunk/ yourdomain.com<br />
[]$ chown apache:apache -R yourdomain.com<br />
[]$ chmod g+w -R yourdomain.com
</p></blockquote>
<h5>2-2. Apaceh設定</h5>
<p>vim /etc/httpd/conf.d/streeme.conf</p>
<pre class="brush: plain; title: ; notranslate">
# This is the configuration for the streeme app communication path

NameVirtualHost *:80

&lt;VirtualHost *:80&gt;
  DocumentRoot &quot;/var/www/yourdomain.com/web&quot;
  DirectoryIndex index.php
  ServerName yourdomain.com
  &lt;Directory &quot;/var/www/yourdomain.com/web&quot;&gt;
    AllowOverride All
    Allow from All
  &lt;/Directory&gt;

  Alias /sf &quot;/var/www/yourdomain.com/lib/vendor/symfony/data/web/sf&quot;
  &lt;Directory &quot;/var/www/yourdomain.com/lib/vendor/symfony/data/web/sf&quot;&gt;
    AllowOverride All
    Allow from All
  &lt;/Directory&gt;
&lt;/VirtualHost&gt;

# ストリーミング用サーバーの設定
Listen *:8096
NameVirtualHost *:8096

&lt;VirtualHost *:8096&gt;
  DocumentRoot &quot;/var/www/yourdomain.com/web&quot;
  DirectoryIndex index.php
  &lt;Directory &quot;/var/www/yourdomain.com/web&quot;&gt;
    AllowOverride All
    Allow from All
  &lt;/Directory&gt;
&lt;/VirtualHost&gt;

#Disable SVN directory sniffing through apache
&lt;Directory ~ &quot;.*\.svn&quot;&gt;
Order allow,deny
Deny from all
Satisfy All
&lt;/Directory&gt;
</pre>
<p>設定できたらサーバーを再起動。</p>
<h5>2-3. PHP設定</h5>
<p>[]$ vim /etc/php.ini</p>
<blockquote><p>
magic_quotes_gpc = Off<br />
short_open_tag = Off<br />
memory_limit = 256M or higher<br />
date.timezone = &#8220;Asia/Tokyo&#8221;<br />
extension=apc.so
</p></blockquote>
<p>必要なライブラリをインストール。</p>
<blockquote><p>
[]$ yum -y install &#8211;enablerepo=remi php-cli (既にインストールされている)<br />
[]$ yum -y install &#8211;enablerepo=remi php-pear<br />
[]$ yum -y install &#8211;enablerepo=remi curl php5-curl (既にインストールされている)<br />
[]$ yum -y install &#8211;enablerepo=remi php-gd (既にインストールされている)<br />
[]$ yum -y install &#8211;enablerepo=remi php-posix<br />
[]$ yum -y install &#8211;enablerepo=remi php-pecl-apc<br />
[]$ pear install -a HTTP_Download
</p></blockquote>
<h5>2-4. MYSQL設定</h5>
<p>vim /etc/my.cnf</p>
<blockquote><p>
[mysqld]<br />
query_cache_type=1<br />
query_cache_size=32M<br />
innodb_buffer_pool_size=512M<br />
thread_cache=1M<br />
table_cache=1M<br />
sort_buffer=1M<br />
join_buffer_size = 4M<br />
key_buffer=16M</p>
<p>[mysql]<br />
default-character-set=utf8</p>
</blockquote>
<h5>2-5. FFMPEGをインストール</h5>
<p>CentOS6のrpmforgeからFFMPEGをインストールします。</p>
<blockquote><p>
[]$ mkdir ~/sources<br />
[]$ cd ~/sources<br />
[]$ wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm<br />
[]$ rpm -Uhv rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm<br />
[]$ yum &#8211;enablerepo=rpmforge install -y ffmpeg
</p></blockquote>
<h5>2-6. サーバー再起動</h5>
<p>ここまでできたら、一旦再起動</p>
<blockquote><p>
[]$ /etc/init.d/httpd restart<br />
[]$ /etc/init.d/mysqld restart
</p></blockquote>
<h4>3 Streeme設定</h4>
<h5>3-1. DB作成&#038;設定</h5>
<p>MySQLでデータベース「streeme」を作成。</p>
<blockquote><p>
mysql> CREATE DATABASE `streeme` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;<br />
mysql> CREATE DATABASE `streemetest` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
</p></blockquote>
<p>streemeでDB設定。</p>
<blockquote><p>
[]$ cp config/databases.template.yml config/databases.yml<br />
[]$ vim config/databases.yml </p>
<p>username: your_mysql_username<br />
password: your_mysql_pass
</p></blockquote>
<h5>3-2. フォルダの権限変更</h5>
<p>logフォルダとcacheフォルダの権限を777に変更。</p>
<blockquote><p>
[]$ chmod 777 log cache</p></blockquote>
<h5>3-3. アプリ設定</h5>
<blockquote><p>
[]$ cp apps/client/config/app.template.yml apps/client/config/app.yml<br />
[]$ vim apps/client/config/app.yml
</p></blockquote>
<h5>3-4. Amazon連携</h5>
<p>Amazon Web Serviceと連携するための設定。<br />
ファイルだけ作っておく。。</p>
<blockquote><p>cp config/cloudfusion.template.php config/cloudfusion.php</p></blockquote>
<h5>3-5. キャッシュクリア&#038;テスト</h5>
<p>こんな感じで表示されれば完了。</p>
<blockquote><p>
[]# ./symfony cc<br />
[]# php check_configuration.php<br />
********************************<br />
*                              *<br />
*  symfony requirements check  *<br />
*                              *<br />
********************************</p>
<p>php.ini used by PHP: /etc/php.ini</p>
<p>** WARNING **<br />
*  The PHP CLI can use a different php.ini file<br />
*  than the one used with your web server.<br />
*  If this is the case, please launch this<br />
*  utility from your web server.<br />
** WARNING **</p>
<p>** Mandatory requirements **</p>
<p>  OK        PHP version is at least 5.2.4 (5.3.10)<br />
  OK        PEAR HTTP_Download is Installed<br />
  OK        Symfony is Installed</p>
<p>** Optional checks **</p>
<p>  OK        PDO is installed<br />
  OK        PDO has some drivers installed: mysql, pgsql, sqlite<br />
  OK        PHP-XML module is installed<br />
  OK        XSL module is installed<br />
  OK        The token_get_all() function is available<br />
  OK        The mb_strlen() function is available<br />
  OK        The iconv() function is available<br />
  OK        The utf8_decode() is available<br />
  OK        The posix_isatty() is available<br />
  OK        A PHP accelerator is installed<br />
  OK        php.ini has short_open_tag set to off<br />
  OK        php.ini has magic_quotes_gpc set to off<br />
  OK        php.ini has register_globals set to off<br />
  OK        php.ini has session.auto_start set to off<br />
  OK        PHP version is not 5.2.9</p>
</blockquote>
<h4>はまった箇所</h4>
<blockquote><p>{StreemeMediaProxy} The file for key *********************** could not be read from the filesystem</p></blockquote>
<p>【確認事項】<br />
1. php check_configuration.phpで全てOKがでているか確認<br />
2. mod_rewriteが正しくインストールできているか確認。<br />
3. musicフォルダの権限が正しいか確認。<br />
※3で、home直下のディレクトリの権限を変更するのを忘れていたため音楽が再生されなかった・・。</p>
]]></content:encoded>
			<wfw:commentRss>http://b.ruyaka.com/2012/04/20/%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevps%e3%81%ab%e9%9f%b3%e6%a5%bd%e9%85%8d%e4%bf%a1%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e3%80%8cstreeme%e3%80%8d%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>音楽ストリーミング用オープンソース「Streeme」</title>
		<link>http://b.ruyaka.com/2012/04/18/streaming-music-streeme/</link>
		<comments>http://b.ruyaka.com/2012/04/18/streaming-music-streeme/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 12:33:38 +0000</pubDate>
		<dc:creator>はるかなる熊</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[オープンソース]]></category>

		<guid isPermaLink="false">http://b.ruyaka.com/?p=2293</guid>
		<description><![CDATA[Googleの音楽ストリーミング用オープンソース「Streeme」。 これいいです!! HTML5ベースで、PCでもスマートフォンでも視聴可能です。 デザインも洗練されていて使い勝手もよいように思います。 さくらのVPSで試しましたが、簡単にインストール&#038;設定できて、 MITライセンスなので自由に使えます。 PCだとこんな感じで表示されます。iTunesライクなデザインです。↓ スマートォン版の画面はこんな感じです。PCでみてるので横幅広いですが↓ ただ、ユーザーの作成や楽曲ファイルの更新は直接コマンドを打たなければならないです。 音楽を更新するコマンドは例えばこんな感じです。 WEB上で管理できたら楽なんですけどね。 ./symfony scan-media &#8211;type=filesystem 関連サイト ・Streeme http://code.google.com/p/streeme/]]></description>
			<content:encoded><![CDATA[<p>Googleの音楽ストリーミング用オープンソース「Streeme」。<br />
これいいです!!<br />
HTML5ベースで、PCでもスマートフォンでも視聴可能です。<br />
デザインも洗練されていて使い勝手もよいように思います。</p>
<p>さくらのVPSで試しましたが、簡単にインストール&#038;設定できて、<br />
MITライセンスなので自由に使えます。</p>
<p>PCだとこんな感じで表示されます。iTunesライクなデザインです。↓<br />
<a href="http://b.ruyaka.com/2012/04/18/streaming-music-streeme/screen-shot-2012-04-18-at-2-16-35-pm/" rel="attachment wp-att-2294"><img src="http://b.ruyaka.com/wp-content/uploads/2012/04/Screen-shot-2012-04-18-at-2.16.35-PM-580x427.png" alt="" title="Screen shot 2012-04-18 at 2.16.35 PM" width="580" height="427" class="alignnone size-large wp-image-2294" /></a></p>
<p>スマートォン版の画面はこんな感じです。PCでみてるので横幅広いですが↓<br />
<a href="http://b.ruyaka.com/2012/04/18/streaming-music-streeme/screen-shot-2012-04-18-at-2-16-57-pm/" rel="attachment wp-att-2295"><img src="http://b.ruyaka.com/wp-content/uploads/2012/04/Screen-shot-2012-04-18-at-2.16.57-PM-580x427.png" alt="" title="Screen shot 2012-04-18 at 2.16.57 PM" width="580" height="427" class="alignnone size-large wp-image-2295" /></a></p>
<p>ただ、ユーザーの作成や楽曲ファイルの更新は直接コマンドを打たなければならないです。<br />
音楽を更新するコマンドは例えばこんな感じです。<br />
WEB上で管理できたら楽なんですけどね。</p>
<blockquote><p>./symfony scan-media &#8211;type=filesystem</p></blockquote>
<h4>関連サイト</h4>
<p>・Streeme<br />
<a href="http://code.google.com/p/streeme/" title="steeme" target="_blank">http://code.google.com/p/streeme/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://b.ruyaka.com/2012/04/18/streaming-music-streeme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Googleドキュメントスプレットシートとマップを連動</title>
		<link>http://b.ruyaka.com/2012/02/14/google%e3%83%89%e3%82%ad%e3%83%a5%e3%83%a1%e3%83%b3%e3%83%88%e3%82%b9%e3%83%97%e3%83%ac%e3%83%83%e3%83%88%e3%82%b7%e3%83%bc%e3%83%88%e3%81%a8%e3%83%9e%e3%83%83%e3%83%97%e3%82%92%e9%80%a3%e5%8b%95/</link>
		<comments>http://b.ruyaka.com/2012/02/14/google%e3%83%89%e3%82%ad%e3%83%a5%e3%83%a1%e3%83%b3%e3%83%88%e3%82%b9%e3%83%97%e3%83%ac%e3%83%83%e3%83%88%e3%82%b7%e3%83%bc%e3%83%88%e3%81%a8%e3%83%9e%e3%83%83%e3%83%97%e3%82%92%e9%80%a3%e5%8b%95/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 07:49:13 +0000</pubDate>
		<dc:creator>はるかなる熊</dc:creator>
				<category><![CDATA[Google Services]]></category>
		<category><![CDATA[Google Document]]></category>
		<category><![CDATA[Google Map]]></category>

		<guid isPermaLink="false">http://b.ruyaka.com/?p=2273</guid>
		<description><![CDATA[GoogleスプレッドシートでGoogleMapと連動させてみたら、思いのほか素敵だったのでアップ。 シートデータを自動的に参照してGoogleマップ上のポイントしてくれます。 さらに、統計グラフも自動生成するように設定。 マップとの連動はシートを選択して 「挿入」→「ガジェット」→「マップ」から簡単に作れます。 ちなみに、下記はポスティングを自動集計用シート。]]></description>
			<content:encoded><![CDATA[<p>GoogleスプレッドシートでGoogleMapと連動させてみたら、思いのほか素敵だったのでアップ。<br />
シートデータを自動的に参照してGoogleマップ上のポイントしてくれます。<br />
さらに、統計グラフも自動生成するように設定。</p>
<p>マップとの連動はシートを選択して<br />
「挿入」→「ガジェット」→「マップ」から簡単に作れます。</p>
<p>ちなみに、下記はポスティングを自動集計用シート。</p>
<p><a href="http://b.ruyaka.com/2012/02/14/google%e3%83%89%e3%82%ad%e3%83%a5%e3%83%a1%e3%83%b3%e3%83%88%e3%82%b9%e3%83%97%e3%83%ac%e3%83%83%e3%83%88%e3%82%b7%e3%83%bc%e3%83%88%e3%81%a8%e3%83%9e%e3%83%83%e3%83%97%e3%82%92%e9%80%a3%e5%8b%95/screen-shot-2012-02-14-at-4-45-55-pm/" rel="attachment wp-att-2277"><img src="http://b.ruyaka.com/wp-content/uploads/2012/02/Screen-shot-2012-02-14-at-4.45.55-PM.png" alt="Googleドキュメントスプレットシートとマップを連動" title="Screen shot 2012-02-14 at 4.45.55 PM" width="1071" height="1256" class="alignnone size-full wp-image-2277" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://b.ruyaka.com/2012/02/14/google%e3%83%89%e3%82%ad%e3%83%a5%e3%83%a1%e3%83%b3%e3%83%88%e3%82%b9%e3%83%97%e3%83%ac%e3%83%83%e3%83%88%e3%82%b7%e3%83%bc%e3%83%88%e3%81%a8%e3%83%9e%e3%83%83%e3%83%97%e3%82%92%e9%80%a3%e5%8b%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>さくらのVPSにSambaをインストール</title>
		<link>http://b.ruyaka.com/2011/12/27/%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevps%e3%81%absamba%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/</link>
		<comments>http://b.ruyaka.com/2011/12/27/%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevps%e3%81%absamba%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 11:52:27 +0000</pubDate>
		<dc:creator>はるかなる熊</dc:creator>
				<category><![CDATA[その他]]></category>

		<guid isPermaLink="false">http://b.ruyaka.com/?p=2110</guid>
		<description><![CDATA[SAMBAのインストール方法 テスト環境 VPS:さくらのVPS CentOS 5.5 Samba 3.6.1 必要なライブラリインストール 必要なファイルを予めインストールする。 yum install pam-devel readline-devel fileutils libacl-devel openldap-devel krb5-devel cups-devel keyutils-libs-devel libtalloc libtdb SAMBAインストール ソースからコンパイル&#038;インストールする。 $ wget ftp://ftp.samba.gr.jp/pub/samba/samba-3.6.1.tar.gz $ tar zxvf samba-3.6.1.tar.gz $ cd samba-3.6.1/source3 $ ./configure &#8211;prefix=/usr/local $ make $ make install SAMBA設定 $ cd ../packaging/RHEL/setup $ cp samba.log /etc/logrotate.d/samba $ cp samba.pamd /etc/pam.d/samba $ cp [...]]]></description>
			<content:encoded><![CDATA[<h4>SAMBAのインストール方法</h4>
<h5>テスト環境</h5>
<p>VPS:<a href="http://px.a8.net/svt/ejp?a8mat=1O2ONN+805TKI+D8Y+BWVTE" target="_blank">さくらのVPS</a><br />
CentOS 5.5<br />
Samba 3.6.1<br />
<img border="0" width="1" height="1" src="http://www12.a8.net/0.gif?a8mat=1O2ONN+805TKI+D8Y+BWVTE" alt=""></p>
<h5>必要なライブラリインストール</h5>
<p>必要なファイルを予めインストールする。</p>
<blockquote><p>yum install pam-devel readline-devel fileutils libacl-devel openldap-devel krb5-devel cups-devel keyutils-libs-devel libtalloc libtdb
</p></blockquote>
<h5>SAMBAインストール</h5>
<p>ソースからコンパイル&#038;インストールする。</p>
<blockquote><p>
$ wget ftp://ftp.samba.gr.jp/pub/samba/samba-3.6.1.tar.gz<br />
$ tar zxvf samba-3.6.1.tar.gz<br />
$ cd samba-3.6.1/source3<br />
$ ./configure &#8211;prefix=/usr/local<br />
$ make<br />
$ make install
</p></blockquote>
<h5>SAMBA設定</h5>
<blockquote><p>
$ cd ../packaging/RHEL/setup<br />
$ cp samba.log /etc/logrotate.d/samba<br />
$ cp samba.pamd /etc/pam.d/samba<br />
$ cp samba.sysconfig /etc/sysconfig/samba<br />
$ cp smb.conf /etc/samba/<br />
$ cp smbprint /etc/samba/<br />
$ cp smbusers /etc/samba/<br />
$ cp smb.init /etc/rc.d/init.d/smb<br />
$ cp swat /etc/xinetd.d<br />
$ cp winbind.init /etc/rc.d/init.d/winbind<br />
$ echo /usr/local/lib >> /etc/ld.so.conf.d/usrlocal.conf<br />
$ ldconfig<br />
$ ldconfig -p | egrep libnetapi\|libsmb\|libtalloc\|libtdb\|libwbclient
</p></blockquote>
<h5>設定ファイル変更</h5>
<p>/etc/samba/smb.conf</p>
<blockquote><p>
[homes]<br />
   comment = Home Directories<br />
   browseable = no<br />
   writable = yes<br />
   create mask = 0644<br />
   directory mask = 0755<br />
   valid users = %U<br />
   vfs objects = recycle<br />
   recycle:exclude = *.tmp *~<br />
   recycle:maxsize = 0<br />
   recycle:touch = no<br />
   recycle:keeptree = no<br />
   recycle:repository = .recycle</p>
<p>[public]<br />
    path = /home/samba/public<br />
    writable = yes<br />
    create mask = 0666<br />
    directory mask = 0777<br />
    guest only = no<br />
    guest ok = no<br />
    vfs objects = recycle<br />
    recycle:exclude = *.tmp *~<br />
    recycle:maxsize = 0<br />
    recycle:touch = no<br />
    recycle:versions = yes<br />
    recycle:keeptree = no<br />
    recycle:repository = .recycle%u
</p></blockquote>
<h5>サーバー起動</h5>
<blockquote><p>/etc/init.d/smb start</p></blockquote>
<h4>参考サイト</h4>
<p>・sambaのインストール</p>
<p>http://ja.528p.com/linux/centos/SP001-samba.html</p>
<p>・VistaからSambaにアクセスできない場合の対処法<br />
chieko.goto@rakutojp.com</p>
]]></content:encoded>
			<wfw:commentRss>http://b.ruyaka.com/2011/12/27/%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevps%e3%81%absamba%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>さくらのVPSにMTOS(Movable Type Open Source)をインストール</title>
		<link>http://b.ruyaka.com/2011/12/12/%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevps%e3%81%abmtosmovable-type-open-source%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/</link>
		<comments>http://b.ruyaka.com/2011/12/12/%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevps%e3%81%abmtosmovable-type-open-source%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 10:18:25 +0000</pubDate>
		<dc:creator>はるかなる熊</dc:creator>
				<category><![CDATA[Movable Type]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[さくらのVPS]]></category>

		<guid isPermaLink="false">http://b.ruyaka.com/?p=2013</guid>
		<description><![CDATA[今までMTOSを使った事がなかったが、今回さくらのVPSにインストールしてみた。 忘れないようにメモ。参考までに。 たぶんほぼコピペでいけるはず。 サーバー環境 サーバーはさくらのVPSを使用。(serversman@vpsでもよい) ・CentOS 5.5 ・Perl 5.8.8 ・Apache 2.2 ・MySQL 5.7 ・ImageMagick 6.7.4 ・Perlモジュールを諸々 サーバー設定手順 RPM-forgeインストール RPMforgeリポジトリを導入して、最新のパッケージを取得できるようにする。 # RPMキーをダウンロード wget http://apt.sw.be/RPM-GPG-KEY.dag.txt rpm &#8211;import RPM-GPG-KEY.dag.txt # RPM-forgeパッケージをダウンロード wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm # インストールする rpm -ivh rpmforge-release-0.5.2-2.el5.rf.i386.rpm yum -y update rpmforge-release 必要なパッケージをインストール GIT $ yum install git MySQL $ yum install mysql mysql-devel mysql-server $ /etc/init.d/mysqld start [...]]]></description>
			<content:encoded><![CDATA[<p>今までMTOSを使った事がなかったが、今回さくらのVPSにインストールしてみた。<br />
忘れないようにメモ。参考までに。<br />
たぶんほぼコピペでいけるはず。</p>
<h4>サーバー環境</h4>
<p>サーバーは<a href="http://px.a8.net/svt/ejp?a8mat=1O2ONN+805TKI+D8Y+BWVTE" target="_blank">さくらのVPS</a><img border="0" width="1" height="1" src="http://www10.a8.net/0.gif?a8mat=1O2ONN+805TKI+D8Y+BWVTE" alt="">を使用。(<a href="http://px.a8.net/svt/ejp?a8mat=1NYTB5+2T7PMA+1QFI+101SOI" target="_blank">serversman@vps</a><img border="0" width="1" height="1" src="http://www10.a8.net/0.gif?a8mat=1NYTB5+2T7PMA+1QFI+101SOI" alt="">でもよい)<br />
・CentOS 5.5<br />
・Perl 5.8.8<br />
・Apache 2.2<br />
・MySQL 5.7<br />
・ImageMagick 6.7.4<br />
・Perlモジュールを諸々</p>
<h4>サーバー設定手順</h4>
<h5>RPM-forgeインストール</h5>
<p>RPMforgeリポジトリを導入して、最新のパッケージを取得できるようにする。</p>
<blockquote><p>
<em># RPMキーをダウンロード</em><br />
wget http://apt.sw.be/RPM-GPG-KEY.dag.txt<br />
rpm &#8211;import RPM-GPG-KEY.dag.txt<br />
<em># RPM-forgeパッケージをダウンロード</em><br />
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm<br />
<em># インストールする</em><br />
rpm -ivh rpmforge-release-0.5.2-2.el5.rf.i386.rpm<br />
yum -y update rpmforge-release
</p></blockquote>
<h5>必要なパッケージをインストール</h5>
<h6>GIT</h6>
<blockquote><p>$ yum install git</p></blockquote>
<h6>MySQL</h6>
<blockquote><p>$ yum install mysql mysql-devel mysql-server<br />
$ /etc/init.d/mysqld start<br />
$ chkconfig &#8211;level 3 mysqld on
</p></blockquote>
<h6>Apache</h6>
<blockquote><p>$ yum install httpd httpd-devel<br />
<em>CGIをハンドラに追加する</em><br />
$ echo &#8220;AddHandler cgi-script .cgi&#8221; >> /etc/httpd/conf/http.conf<br />
<em>Apacheを再起動する</em><br />
$ /etc/init.d/httpd restart<br />
$ chkconfig &#8211;level 3 httpd on
</p></blockquote>
<h6>VSFTP</h6>
<blockquote><p>$ yum install vsftpd<br />
$ /etc/init.d/vsftpd start<br />
$ chkconfig &#8211;level 3 vsftpd on
</p></blockquote>
<h6>Perl</h6>
<blockquote><p>$ yum install perl perl-Jcode</p></blockquote>
<h6>ImageMagick</h6>
<blockquote><p>
<em>ImageMagickをインストール(関連ライブラリを一気にインストールするため)</em><br />
$ yum install ImageMagick ImageMagick-devel<br />
<em>ImageMagickとImageMagick-develのみ削除(バージョンが古いので)</em><br />
$ yum remove ImageMagick ImageMagick-devel<br />
<em>関連ライブラリをインストール</em><br />
$ yum install libpng libtiff jasper libpng-devel libtiff-devel  jasper-devel<br />
<em>sourcesフォルダを作成してそこでImageMagickをソースからインストールする</em><br />
$ mkdir ~/sources<br />
$ cd ~/sources<br />
$ wget ftp://ftp.kddlabs.co.jp/graphics/ImageMagick/ImageMagick-6.7.4-0.zip<br />
$ unzip ImageMagick-6.7.4-0.zip<br />
$ cd ImageMagick-6.7.4-0<br />
$ ./configure<br />
$ make<br />
$ make install<br />
<em>PerlでImageMagickを使うためのパッケージをインストール</em><br />
$ yum install ImageMagick-perl
</p></blockquote>
<h6>MTに必要なモジュールのインストール</h6>
<blockquote><p>
<em># Image::Size用モジュール</em><br />
$ yum install perl-Image-Size<br />
<em># Crypt::DSA (コメント投稿時のサインインが高速になります。)</em><br />
$ yum install perl-Crypt-DSA<br />
<em># Archive::Zip (バックアップと復元で圧縮の機能を利用する場合に必要となります。)</em><br />
$ yum install perl-Archive-Zip<br />
<em># Cache::Memcached (キャッシング機能としてmemcachedを利用する場合に必要となります。)</em><br />
$ yum install perl-Cache-Memcached<br />
<em># Mail::Sendmail (SMTPサーバーを経由してメールを送信する場合に必要になります。)</em><br />
$ yum install perl-Mail-Sendmail<br />
<em># GD (アップロードした画像のサムネイルを作成する場合に必要となります。)</em><br />
$ yum install gd gd-devel<br />
<em># XML::Parser (アクションストリームを利用するために必要です。)</em><br />
$ yum install perl-XML-Parser perl-XML-Dumper<br />
<em># IPC::Run (MTのイメージドライバとしてNetPBMを利用する場合に必要となります。)</em><br />
$ yum install perl-IPC-Run
</p></blockquote>
<h5>MTOSサーバー設定</h5>
<blockquote><p>
$ cd /var/www/<br />
$ git clone http://github.com/movabletype/movabletype.git<br />
$ chown apache:apache -R movabletype<br />
$ chmod -R 775 movabletype<br />
<em># データベース「MovableType」を作成。(任意のデータベース名をつけてください)</em><br />
$ mysql -u root -p -e &#8220;CREATE DATABASE movabletype CHARACTER SET utf8;&#8221;<br />
$ vim /etc/httpd/conf.d/movalbetype.conf
</p></blockquote>
<pre class="brush: plain; title: /etc/httpd/conf.d/movalbetype.conf; notranslate">
&lt;VirtualHost *:80&gt;
   DocumentRoot /var/www/movabletype/
   ServerName example.com # あなたのドメイン
   ErrorLog /var/log/httpd/mt.com-error_log
   CustomLog /var/log/httpd/mt.com-access_log common

   DirectoryIndex index.html index.htm index.cgi index.html.var
   # SuexecUserGroup apache apache

   # MTOS - Application Dir
   &lt;Directory &quot;/var/www/movabletype&quot;&gt;
       Options -FollowSymLinks -Indexes ExecCGI
       AllowOverride All
       Order allow,deny
       Allow from all
   &lt;/Directory&gt;

   # MTOS - Static Dir
   &lt;Directory &quot;/var/www/movabletype/mt-static&quot;&gt;
       Options -FollowSymLinks -Indexes -ExecCGI
       AllowOverride All
       Order allow,deny
       Allow from all
   &lt;/Directory&gt;
&lt;/VirtualHost&gt;
</pre>
<blockquote><p># サーバー再起動する。<br />
/etc/init.d/httpd restart</p></blockquote>
<h4>MTOSサーバー設定インストール</h4>
<p>サイトにアクセスします。<br />
この例の場合はURLは「example.com」です。</p>
<h6>1. Movable Typeへようこそ</h6>
<p><a href="http://b.ruyaka.com/2011/12/12/%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevps%e3%81%abmtosmovable-type-open-source%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/screen-shot-2011-12-12-at-4-10-01-pm/" rel="attachment wp-att-2060"><img src="http://b.ruyaka.com/wp-content/uploads/2011/12/Screen-shot-2011-12-12-at-4.10.01-PM.png" alt="" title="Screen shot 2011-12-12 at 4.10.01 PM" width="618" height="300" class="size-full wp-image-2060" alt="Movable Typeへようこそ"/></a></p>
<h6>2. システムチェック</h6>
<p><a href="http://b.ruyaka.com/2011/12/12/%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevps%e3%81%abmtosmovable-type-open-source%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/screen-shot-2011-12-12-at-4-10-14-pm/" rel="attachment wp-att-2061"><img src="http://b.ruyaka.com/wp-content/uploads/2011/12/Screen-shot-2011-12-12-at-4.10.14-PM.png" alt="" title="Screen shot 2011-12-12 at 4.10.14 PM" width="616" height="308" class="size-full wp-image-2061"  alt="システムチェック"/></a></p>
<h6>3. データベース設定</h6>
<p><a href="http://b.ruyaka.com/2011/12/12/%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevps%e3%81%abmtosmovable-type-open-source%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/screen-shot-2011-12-12-at-5-27-58-pm/" rel="attachment wp-att-2063"><img src="http://b.ruyaka.com/wp-content/uploads/2011/12/Screen-shot-2011-12-12-at-5.27.58-PM.png" alt="" title="Screen shot 2011-12-12 at 5.27.58 PM" width="617" height="586" class="-full wp-image-2063"  alt="データベース設定"/></a></p>
<h6>4. データベース設定完了</h6>
<p><a href="http://b.ruyaka.com/2011/12/12/%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevps%e3%81%abmtosmovable-type-open-source%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/screen-shot-2011-12-12-at-5-28-09-pm/" rel="attachment wp-att-2064"><img src="http://b.ruyaka.com/wp-content/uploads/2011/12/Screen-shot-2011-12-12-at-5.28.09-PM.png" alt="" title="Screen shot 2011-12-12 at 5.28.09 PM" width="615" height="251" class="size-full wp-image-2064"  alt="データベース設定完了"/></a></p>
<h6>5. メール設定</h6>
<p><a href="http://b.ruyaka.com/2011/12/12/%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevps%e3%81%abmtosmovable-type-open-source%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/screen-shot-2011-12-12-at-5-29-29-pm/" rel="attachment wp-att-2065"><img src="http://b.ruyaka.com/wp-content/uploads/2011/12/Screen-shot-2011-12-12-at-5.29.29-PM.png" alt="" title="Screen shot 2011-12-12 at 5.29.29 PM" width="615" height="483" class="size-full wp-image-2065"  alt="メール設定"/></a></p>
<h6>6. メール設定完了</h6>
<p><a href="http://b.ruyaka.com/2011/12/12/%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevps%e3%81%abmtosmovable-type-open-source%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/screen-shot-2011-12-12-at-5-30-30-pm/" rel="attachment wp-att-2066"><img src="http://b.ruyaka.com/wp-content/uploads/2011/12/Screen-shot-2011-12-12-at-5.30.30-PM.png" alt="" title="Screen shot 2011-12-12 at 5.30.30 PM" width="615" height="268" class="size-full wp-image-2066"  alt="メール設定完了"/></a></p>
<h6>7. 構成ファイル</h6>
<p><a href="http://b.ruyaka.com/2011/12/12/%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevps%e3%81%abmtosmovable-type-open-source%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/screen-shot-2011-12-12-at-5-41-23-pm/" rel="attachment wp-att-2067"><img src="http://b.ruyaka.com/wp-content/uploads/2011/12/Screen-shot-2011-12-12-at-5.41.23-PM.png" alt="" title="Screen shot 2011-12-12 at 5.41.23 PM" width="615" height="310" class="size-full wp-image-2067"  alt="構成ファイル"/></a></p>
<h6>8. アカウントの作成</h6>
<p><a href="http://b.ruyaka.com/2011/12/12/%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevps%e3%81%abmtosmovable-type-open-source%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/screen-shot-2011-12-12-at-5-42-26-pm/" rel="attachment wp-att-2068"><img src="http://b.ruyaka.com/wp-content/uploads/2011/12/Screen-shot-2011-12-12-at-5.42.26-PM.png" alt="" title="Screen shot 2011-12-12 at 5.42.26 PM" width="615" height="656" class="size-full wp-image-2068"  alt="アカウントの作成"/></a></p>
<h6>9. 設定完了</h6>
<p>http://example.com/mt.cgi</p>
<p>にアクセスするとログインフォームが表示されると思います。<br />
先程登録したユーザーIDとパスワードを入力してログインしましょう!!</p>
<p></p>
<h4>備考</h4>
<h5>サーバーチューニング&#038;セキュリティ周り</h5>
<p>さくらのVPSの基本的な設定はさくらインターネット社長である田中社長ブログを参考にする。<br />
・CentOSをサーバーとして活用するための基本的な設定</p>
<p>http://tanaka.sakura.ad.jp/archives/001065.html</p>
]]></content:encoded>
			<wfw:commentRss>http://b.ruyaka.com/2011/12/12/%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevps%e3%81%abmtosmovable-type-open-source%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone/iPadアプリ開発 画像解像度まとめ</title>
		<link>http://b.ruyaka.com/2011/12/10/iphoneipad%e3%82%a2%e3%83%97%e3%83%aa%e9%96%8b%e7%99%ba-%e8%a7%a3%e5%83%8f%e5%ba%a6%e3%81%be%e3%81%a8%e3%82%81/</link>
		<comments>http://b.ruyaka.com/2011/12/10/iphoneipad%e3%82%a2%e3%83%97%e3%83%aa%e9%96%8b%e7%99%ba-%e8%a7%a3%e5%83%8f%e5%ba%a6%e3%81%be%e3%81%a8%e3%82%81/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 08:16:45 +0000</pubDate>
		<dc:creator>はるかなる熊</dc:creator>
				<category><![CDATA[iPhoneアプリ]]></category>
		<category><![CDATA[その他]]></category>

		<guid isPermaLink="false">http://b.ruyaka.com/?p=2015</guid>
		<description><![CDATA[iPhone/iPadアプリ開発で準備しておく必要がある画像をまとめてみる。 ファイル名 解像度 対応機種 アイコン Icon.png 57 x 57 iPhone3G/3GS用 Icon@2x.png 114 x 114 iPhone4用 Icon-Small@2x.png 58 x 58 iPhone4 Spotlight用 Icon-Small.png 29 x 29 設定メニュー/Spotlight用 Icon-Small-50.png 50 x 50 iPad Spotlight用 Icon-72.png 72 x 72 iPad用 起動画像(iPhone用) Default.png 320 x 480 iPhone3G/3GS用 Default@2x.png 640 x 960 iPhone4用 起動画像(iPad用) Default-Portrait.png 768 x 1004 汎用縦：ホームボタンが下 Default-PortraitUpsideDown.png [...]]]></description>
			<content:encoded><![CDATA[<p>iPhone/iPadアプリ開発で準備しておく必要がある画像をまとめてみる。</p>
<table>
<tr>
<th>ファイル名</th>
<th>解像度</th>
<th>対応機種</th>
</tr>
<tr>
<th colspan="3" style="text-align:center">アイコン</th>
</tr>
<tr>
<th>Icon.png</th>
<td>57 x 57</td>
<td>iPhone3G/3GS用</td>
</tr>
<tr>
<th>Icon@2x.png</th>
<td>114 x 114</td>
<td>iPhone4用</td>
</tr>
<tr>
<th>Icon-Small@2x.png</th>
<td>58 x 58</td>
<td>iPhone4 Spotlight用</td>
</tr>
<tr>
<th>Icon-Small.png</th>
<td>29 x 29</td>
<td>設定メニュー/Spotlight用</td>
</tr>
<tr>
<th>Icon-Small-50.png</th>
<td>50 x 50</td>
<td>iPad Spotlight用</td>
</tr>
<tr>
<th>Icon-72.png</th>
<td>72 x 72</td>
<td>iPad用</td>
</tr>
<tr>
<th colspan="3" style="text-align:center">起動画像(iPhone用)</th>
</tr>
<tr>
<th>Default.png</th>
<td>320 x 480</td>
<td>iPhone3G/3GS用</td>
</tr>
<tr>
<th>Default@2x.png</th>
<td>640 x 960</td>
<td>iPhone4用</td>
</tr>
<tr>
<th colspan="3" style="text-align:center">起動画像(iPad用)</th>
</tr>
<tr>
<th>Default-Portrait.png</th>
<td>768 x 1004</td>
<td>汎用縦：ホームボタンが下</td>
</tr>
<tr>
<th>Default-PortraitUpsideDown.png</th>
<td>768 x 1004</td>
<td>逆さま縦：ホームボタンが上</td>
</tr>
<tr>
<th>Default-Landscape.png</th>
<td>1024 x 748</td>
<td>汎用横</td>
</tr>
<tr>
<th>Default-LandscapeLeft.png</th>
<td>1024 x 748</td>
<td>横左：ホームボタンが左</td>
</tr>
<tr>
<th>Default-LandscapeRight.png</th>
<td>1024 x 748</td>
<td>横右：ホームボタンが右</td>
</tr>
<tr>
<th colspan="3" style="text-align:center">AppleStore用(ファイル名は何でもよい)</th>
</tr>
<tr>
<th>LargeIcon.png</th>
<td>512 x 512</td>
<td>サムネイル</td>
</tr>
<tr>
<th>iPhoneScreenShot.jpg</th>
<td>960 x 640<br />960 x 600<br />640 x 960<br />640 x 920<br />480 x 320<br />480 x 300<br />320 x 480<br />320 x 460</td>
<td>iPhone用スクリーンショット<br />72DPI以上<br />RGBカラー<br />jpg,png,tiff</td>
</tr>
<tr>
<th>iPadScreenShot.jpg</th>
<td>1024 x 768<br />1024 x 748<br />768 x 1024<br />768 x 1004</td>
<td>ipad用スクリーンショット<br />72DPI以上<br />RGBカラー<br />jpg,png,tiff</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://b.ruyaka.com/2011/12/10/iphoneipad%e3%82%a2%e3%83%97%e3%83%aa%e9%96%8b%e7%99%ba-%e8%a7%a3%e5%83%8f%e5%ba%a6%e3%81%be%e3%81%a8%e3%82%81/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>さくらインターネットの石狩データセンター</title>
		<link>http://b.ruyaka.com/2011/10/19/%e3%81%95%e3%81%8f%e3%82%89%e3%82%a4%e3%83%b3%e3%82%bf%e3%83%bc%e3%83%8d%e3%83%83%e3%83%88%e3%81%ae%e7%9f%b3%e7%8b%a9%e3%83%87%e3%83%bc%e3%82%bf%e3%82%bb%e3%83%b3%e3%82%bf%e3%83%bc/</link>
		<comments>http://b.ruyaka.com/2011/10/19/%e3%81%95%e3%81%8f%e3%82%89%e3%82%a4%e3%83%b3%e3%82%bf%e3%83%bc%e3%83%8d%e3%83%83%e3%83%88%e3%81%ae%e7%9f%b3%e7%8b%a9%e3%83%87%e3%83%bc%e3%82%bf%e3%82%bb%e3%83%b3%e3%82%bf%e3%83%bc/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 08:56:08 +0000</pubDate>
		<dc:creator>はるかなる熊</dc:creator>
				<category><![CDATA[VPS]]></category>
		<category><![CDATA[さくらのVPS]]></category>

		<guid isPermaLink="false">http://b.ruyaka.com/?p=2000</guid>
		<description><![CDATA[個人的に楽しみにしているさくらインターネットの石狩データセンター。 http://ishikari.sakura.ad.jp/ 　日本データセンター協会が主催する「フューチャーシンキング&#038;デザインコンセプト・アワード」を受賞したみたいですね。 　都内に比べて立地も安いので、今後のさくらのホスティングサービスにもスペック・パフォーマンスにも良くなるのでしょうか。ホスティングサーバーのスペックを比較すると資源に余裕のある海外のほうがコストパフォーマンスが優れている事が多々ありますが、ロケーションが遠すぎてレスポンスが悪く結局実用的ではなかったりします。 　今回の北海道石狩という立地でこの規模のデータセンターとなれば、海外同様に低コストでのサービスを展開できそうです。なので、石狩データセンターが稼働すれば今まで以上にコストパフォーマンスの優れたサービスを期待できそうです。既にさくらのVPSには色々お世話になっているので期待大です。 ■「フューチャーシンキング&#038;デザインコンセプト・アワード」を受賞 http://journal.mycom.co.jp/news/2011/10/18/040/ JDCCでは「北海道初の大型センターの建設」と「同地の気候を活用した外気冷房の全面導入、高電圧直流給電システムなどによる省エネルギー効果を高める工夫など」を高く評価し、竣工前での受賞となった。 ■『CEDEC AWARDS』のネットワーク部門で最優秀賞 http://cedec.cesa.or.jp/2011/event/awards/index.html CESAが主催する国内最大級のゲーム開発者向けカンファレンス『CEDEC 2011』のイベントとして開催される『CEDEC AWARDS』のネットワーク部門において、世界最高水準のエネルギー効率を達成する石狩データセンターにおける省電力への取り組みを評価いただき、優秀賞を受賞し、最優秀賞へとノミネートされました。]]></description>
			<content:encoded><![CDATA[<p>個人的に楽しみにしているさくらインターネットの石狩データセンター。<br />
<a href="http://ishikari.sakura.ad.jp/" target="_blank">http://ishikari.sakura.ad.jp/</a></p>
<p>　日本データセンター協会が主催する「フューチャーシンキング&#038;デザインコンセプト・アワード」を受賞したみたいですね。</p>
<p>　都内に比べて立地も安いので、今後のさくらのホスティングサービスにもスペック・パフォーマンスにも良くなるのでしょうか。ホスティングサーバーのスペックを比較すると資源に余裕のある海外のほうがコストパフォーマンスが優れている事が多々ありますが、ロケーションが遠すぎてレスポンスが悪く結局実用的ではなかったりします。</p>
<p>　今回の北海道石狩という立地でこの規模のデータセンターとなれば、海外同様に低コストでのサービスを展開できそうです。なので、石狩データセンターが稼働すれば今まで以上にコストパフォーマンスの優れたサービスを期待できそうです。既にさくらのVPSには色々お世話になっているので期待大です。</p>
<p>■「フューチャーシンキング&#038;デザインコンセプト・アワード」を受賞<br />
<a href="http://journal.mycom.co.jp/news/2011/10/18/040/" target="_blank">http://journal.mycom.co.jp/news/2011/10/18/040/</a></p>
<blockquote><p>JDCCでは「北海道初の大型センターの建設」と「同地の気候を活用した外気冷房の全面導入、高電圧直流給電システムなどによる省エネルギー効果を高める工夫など」を高く評価し、竣工前での受賞となった。</p></blockquote>
<p>■『CEDEC AWARDS』のネットワーク部門で最優秀賞<br />
<a href="http://cedec.cesa.or.jp/2011/event/awards/index.html" target="_blank">http://cedec.cesa.or.jp/2011/event/awards/index.html</a></p>
<blockquote><p>
CESAが主催する国内最大級のゲーム開発者向けカンファレンス『CEDEC 2011』のイベントとして開催される『CEDEC AWARDS』のネットワーク部門において、世界最高水準のエネルギー効率を達成する石狩データセンターにおける省電力への取り組みを評価いただき、優秀賞を受賞し、最優秀賞へとノミネートされました。
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://b.ruyaka.com/2011/10/19/%e3%81%95%e3%81%8f%e3%82%89%e3%82%a4%e3%83%b3%e3%82%bf%e3%83%bc%e3%83%8d%e3%83%83%e3%83%88%e3%81%ae%e7%9f%b3%e7%8b%a9%e3%83%87%e3%83%bc%e3%82%bf%e3%82%bb%e3%83%b3%e3%82%bf%e3%83%bc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[iPhoneアプリ開発] UIImageViewでタッチとホールドを検出</title>
		<link>http://b.ruyaka.com/2011/09/28/iphone-uiimageview-touch-and-hold-action/</link>
		<comments>http://b.ruyaka.com/2011/09/28/iphone-uiimageview-touch-and-hold-action/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 13:14:18 +0000</pubDate>
		<dc:creator>はるかなる熊</dc:creator>
				<category><![CDATA[iPhoneアプリ]]></category>

		<guid isPermaLink="false">http://b.ruyaka.com/?p=1968</guid>
		<description><![CDATA[2012/2/14 コードの部分を修正しました。 iPhoneアプリ開発で画像をタッチしたりホールドしたらアクションをおこしたい・・ って場合はあると思います。 そのメモです。ざっくりです。 コーディングのポイント タッチとホールドを実現するのにキーとなるコードは以下の通り。 これだけわかれば組めるはず。 UIImageViewのタッチを有効にします。 (self = UIImageView) // タッチイベントを許可する self.userInteractionEnabled = YES; // マルチタッチを有効にする。 [self setMultipleTouchEnabled:YES]; すると、以下の3つのタッチイベントが有効になります。 // タッチした時に呼ばれるアクション - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event // タッチ離した時に呼ばれるアクション - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event ホールドはNSTimerを使って実現します。 [NSTimer scheduledTimerWithTimeInterval:delay target:self selector:@selector(touchesHold:withEvent:) userInfo:nil repeats:NO]; 実際のコード 妖精の画像をタッチしたりホールドするとアクションがおこしたかった。 妖精をUIImageViewを継承してFairyクラスとしてます。 はまったポイント 下記のエラーにはまりました。 touchesHoldメソッドは存在するのに、見つかりませんよと怒られる。 *** Terminating app due to uncaught [...]]]></description>
			<content:encoded><![CDATA[<blockquote style="background:#FFCCCC"><p>2012/2/14 コードの部分を修正しました。</p></blockquote>
<p>iPhoneアプリ開発で画像をタッチしたりホールドしたらアクションをおこしたい・・<br />
って場合はあると思います。<br />
そのメモです。ざっくりです。</p>
<h4>コーディングのポイント</h4>
<p>タッチとホールドを実現するのにキーとなるコードは以下の通り。<br />
これだけわかれば組めるはず。</p>
<p>UIImageViewのタッチを有効にします。<br />
(self = UIImageView)</p>
<blockquote><p>
// タッチイベントを許可する<br />
self.userInteractionEnabled = YES;<br />
// マルチタッチを有効にする。<br />
[self setMultipleTouchEnabled:YES];
</p></blockquote>
<p>すると、以下の3つのタッチイベントが有効になります。</p>
<blockquote><p>
// タッチした時に呼ばれるアクション<br />
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event<br />
// タッチ離した時に呼ばれるアクション<br />
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
</p></blockquote>
<p>ホールドはNSTimerを使って実現します。</p>
<blockquote><p>[NSTimer scheduledTimerWithTimeInterval:delay target:self selector:@selector(touchesHold:withEvent:) userInfo:nil repeats:NO];</p>
</blockquote>
<h4>実際のコード</h4>
<p>妖精の画像をタッチしたりホールドするとアクションがおこしたかった。<br />
妖精をUIImageViewを継承してFairyクラスとしてます。</p>
<pre class="brush: cpp; title: TestImageView.h; notranslate">
#import &lt;Foundation/Foundation.h&gt;

@interface TestImageView : UIImageView {
    NSTimer *touchTimer;
}

@end
</pre>
<pre class="brush: cpp; title: TestImageView.m; notranslate">

@implementation TestImageView

- (void)viewDidLoad
{
    [super viewDidLoad];
    //タッチイベントを許可する
　　self.userInteractionEnabled = YES;
　　[self setMultipleTouchEnabled:YES];
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    NSLog(@&quot;タッチイベント開始&quot;);

    /**
     * NSTimerでホールド処理を呼び出す
     * ホールド中に処理を繰り返すならrepeatsをYES、そうでなければNO
     * ホールドの座標を使用したい場合はUserInfoにtouchesを渡す
     */
    touchTimer = [NSTimer scheduledTimerWithTimeInterval:0.8 target:self
                                                selector:@selector(touchesHold:) userInfo:touches repeats:YES];
    [touchTimer retain];
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
    NSLog(@&quot;タッチイベント終了&quot;);
    if ([touchTimer isValid]) [touchTimer invalidate];
}

- (void)touchesHold:(NSTimer *)timer {
    NSLog(@&quot;タッチホールド&quot;);

    /**
     * ここにホールド時の処理を書く
     * 下記は一例です。(ホールド中に画像が拡大して飛び出ててきます)
     */
    // userInfoを取得
    NSSet *touches = [timer userInfo];
    // 座標の取得
    UITouch *aTouch = [touches anyObject];
    CGPoint point = [aTouch locationInView:self.view];

    // Imageオブジェクトを生成
    NSString *imgName = [[NSString alloc] initWithFormat:@&quot;popupImageSample.gif&quot;];
    UIImageView *iv = [[UIImageView alloc] initWithImage:[UIImage imageNamed:imgName]];
    [self.view addSubview:iv];
    iv.frame = CGRectMake(0, 0, 30, 30);
    iv.center = CGPointMake(point.x, point.y);
    iv.alpha  = 0.8;

    // アニメーション処理実装
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:1.0];
    [UIView setAnimationDelay:0.0];
    [UIView setAnimationRepeatCount:1.0];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
    [UIView setAnimationDelegate:self];
    iv.transform = CGAffineTransformMakeScale(300, 300);
    iv.alpha  = 0.0;
    [UIView commitAnimations];

    // アニメーション終了後にオブジェクトをリリースする
    [self performSelector:@selector(animationStopped:) withObject:iv afterDelay:1.0];

    [imgName release];
}

/**
 * アニメーション停止後の処理
 */
- (void)animationStopped:(UIImageView *)ivv
{
    NSLog(@&quot;画像をリリースします&quot;);
    [ivv removeFromSuperview];
    [ivv release];
    ivv = NULL;
}
</pre>
<h4>はまったポイント</h4>
<p>下記のエラーにはまりました。<br />
touchesHoldメソッドは存在するのに、見つかりませんよと怒られる。</p>
<blockquote><p>
*** Terminating app due to uncaught exception &#8216;NSInvalidArgumentException&#8217;, reason: &#8216;-[UIImageView touchesHold:]: unrecognized selector sent to instance 0x4e22670&#8242;
</p></blockquote>
<p>解決法がわかると、ほんと大した事なくて凹むのですが・・・。<br />
ただのセレクタの表記ミスでした。<br />
しっかり引数もつけてあげましょう。</p>
<blockquote><p>
(誤) [NSTimer .... selector:@selector(touchesHold:) .....];<br />
(正) [NSTimer .... selector:@selector(touchesHold:withEvent:) .....];
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://b.ruyaka.com/2011/09/28/iphone-uiimageview-touch-and-hold-action/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhoneアプリ開発 EXC_BAD_ACCESS対策方法</title>
		<link>http://b.ruyaka.com/2011/09/24/iphone-app-exc_bad_access-debug/</link>
		<comments>http://b.ruyaka.com/2011/09/24/iphone-app-exc_bad_access-debug/#comments</comments>
		<pubDate>Sat, 24 Sep 2011 08:23:55 +0000</pubDate>
		<dc:creator>はるかなる熊</dc:creator>
				<category><![CDATA[iPhoneアプリ]]></category>
		<category><![CDATA[Debug]]></category>

		<guid isPermaLink="false">http://b.ruyaka.com/?p=1936</guid>
		<description><![CDATA[必ずぶつかるEXC_BAD_ACCESS iPhone/iPadアプリを開発していてかならず見るのでEXC_BAD_ACCESSのエラー。。 このエラーは発生箇所が記述されないのでとても困る。 発生源をピンポイントで掴む方法はないみたいだけど、手かがりをコンソールに表示することはできるみたい。 その方法をメモ。 ちなみにXcodeのバージョンは4.3 Xcode設定方法 設定はとても簡単。 1. Schemeから「Edit Scheme」をクリック! 　 2. RunからEnviroment Variablesに追加 下記三つの項目を追加する。値は全てYESにする。 NSZombieEnabled &#124; YES MallocStackLogging &#124; YES NSDebugEnabled &#124; YES こんな感じですね。↓ 設定はこれだけでOK!! 　 3. EXC_BAD_ACCESS時にコンソールを見てみると&#8230; 以前より詳細なメッセージが表示されるようになりました。 下記を見てみるとUIImageまわりで問題が起きているようでした。 (残念ながらこの情報までしかだしてくれませんが・・) *** -[UIImage isKindOfClass:]: message sent to deallocated instance 0x561c4d0 もっと詳細な情報がほしい場合は、コンソール下の(gdb)に下記のコマンドをうつことで得ることができます。 shell malloc_history {pid/partial-process-name} {address} なので、上のキャプチャ画像の場合はこんな感じ。↓ shell malloc_history 3966 0x561c4d0 このコマンドをうつと大量の文字がズラズラとでてきます。。 ここを見てメソッドなりクラスなり手かがりがわかる場合もあるようです。 今回は、このコマンドでこれといった情報は得られなかったので、 [...]]]></description>
			<content:encoded><![CDATA[<h4>必ずぶつかるEXC_BAD_ACCESS</h4>
<p>iPhone/iPadアプリを開発していてかならず見るのでEXC_BAD_ACCESSのエラー。。<br />
このエラーは発生箇所が記述されないのでとても困る。<br />
発生源をピンポイントで掴む方法はないみたいだけど、手かがりをコンソールに表示することはできるみたい。<br />
その方法をメモ。<br />
ちなみにXcodeのバージョンは4.3</p>
<h4>Xcode設定方法</h4>
<p>設定はとても簡単。</p>
<h5>1. Schemeから「Edit Scheme」をクリック!</h5>
<p><a href="http://b.ruyaka.com/wp-content/uploads/2011/09/Screen-shot-2011-09-24-at-4.46.41-PM.png"><img src="http://b.ruyaka.com/wp-content/uploads/2011/09/Screen-shot-2011-09-24-at-4.46.41-PM.png" alt="Edit Schemeをクリック" title="Screen shot 2011-09-24 at 4.46.41 PM" width="435" height="118" class="alignnone size-full wp-image-1938" /></a></p>
<p>　</p>
<h5>2. RunからEnviroment Variablesに追加</h5>
<p>下記三つの項目を追加する。値は全てYESにする。</p>
<blockquote><p>
NSZombieEnabled  |   YES<br />
MallocStackLogging  |  YES<br />
NSDebugEnabled  |  YES
</p></blockquote>
<p>こんな感じですね。↓<br />
<a href="http://b.ruyaka.com/wp-content/uploads/2011/09/Screen-shot-2011-09-24-at-4.50.41-PM.png"><img src="http://b.ruyaka.com/wp-content/uploads/2011/09/Screen-shot-2011-09-24-at-4.50.41-PM.png" alt="Enviroment VariablesにNSZombieEnabled" title="Screen shot 2011-09-24 at 4.50.41 PM" width="708" height="485" class="alignnone size-full wp-image-1945" /></a></p>
<p>設定はこれだけでOK!!</p>
<p>　</p>
<h5>3. EXC_BAD_ACCESS時にコンソールを見てみると&#8230;</h5>
<p>以前より詳細なメッセージが表示されるようになりました。<br />
下記を見てみるとUIImageまわりで問題が起きているようでした。<br />
(残念ながらこの情報までしかだしてくれませんが・・)</p>
<blockquote><p> *** -[UIImage isKindOfClass:]: message sent to deallocated instance 0x561c4d0</p></blockquote>
<p><a href="http://b.ruyaka.com/wp-content/uploads/2011/09/Screen-shot-2011-09-24-at-4.56.31-PM.png"><img src="http://b.ruyaka.com/wp-content/uploads/2011/09/Screen-shot-2011-09-24-at-4.56.31-PM.png" alt="EXC_BAD_ACCESS時のコンソール" title="Screen shot 2011-09-24 at 4.56.31 PM" width="883" height="177" class="alignnone size-full wp-image-1947" /></a></p>
<p>もっと詳細な情報がほしい場合は、コンソール下の(gdb)に下記のコマンドをうつことで得ることができます。</p>
<blockquote><p>shell malloc_history {pid/partial-process-name} {address}</p></blockquote>
<p>なので、上のキャプチャ画像の場合はこんな感じ。↓</p>
<blockquote><p>shell malloc_history 3966 0x561c4d0</p></blockquote>
<p>このコマンドをうつと大量の文字がズラズラとでてきます。。<br />
ここを見てメソッドなりクラスなり手かがりがわかる場合もあるようです。<br />
今回は、このコマンドでこれといった情報は得られなかったので、<br />
コンソールにでてたUIImageまわりを諸々確認して解決しました。</p>
<p>もっとピンポイントでわかる方法はないものか・・・。</p>
]]></content:encoded>
			<wfw:commentRss>http://b.ruyaka.com/2011/09/24/iphone-app-exc_bad_access-debug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NSLocalizedStringでiphoneアプリ多言語対応 Xcode4</title>
		<link>http://b.ruyaka.com/2011/09/12/iphone-ns-localized-string/</link>
		<comments>http://b.ruyaka.com/2011/09/12/iphone-ns-localized-string/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 09:57:19 +0000</pubDate>
		<dc:creator>はるかなる熊</dc:creator>
				<category><![CDATA[iPhoneアプリ]]></category>

		<guid isPermaLink="false">http://b.ruyaka.com/?p=1898</guid>
		<description><![CDATA[NSLocalizedStringで多言語対応 日本語版のiPadアプリが完成したので、AppleStoreに登録しようとしたところ、Primary Languageで止まった。 Primary Language、つまり「主要な言語」を選択してください、ってことなんだけど、 登録進めようとしたところ、「Primary Languageは1度決めたら2度変更できませんよ」って警告がでた。 日本語選択したら、そのアカウントではずっと日本語ですよ。ってことみたい。 いや・・。それは困る。 一応、調べてみたら本当にそういうことみたい。 前置き長くなったけど、iPhoneアプリの多言語対応化について調べたのでメモ。 多言語対応のためのNSLocalizedStringってのが最初から入っているので、そんなに大変ではないです。 ちなみにXcodeのVersionは4.0.2です。 NSLocalizedStringの使い方 とっても簡単。特にライブラリをインポートしたりは必要ありません。 ちなみに引数はNSLocalizedString(@&#8221;{キー}&#8221;, &#8220;{コメント}&#8221;)。 genstringsコマンドを使って言語化ファイル生成 次にTerminalを起動して以下のコマンドを叩きます。 $ cd {あなたのアプリのパス} $ genstrings -a $(find . -name &#8220;*.m&#8221;) すると、Localizable.stringsというファイルが生成されると思います。 Xcode設定 生成されたLocalizable.stringsファイルをXcode内のSupporting Filesフォルダにドロップ&#038;ドラックします。 そうしたら、Supporting Filesフォルダ内のLocalizable.stringsをクリックして、 ユーティリティのFile Inspectorを表示します。 すると、画面右側に下記のようなフォームが表示されると思います。 変更箇所は2カ所のみで。 ▼Localization内の+ボタンを押して言語を追加。(私の場合EnglishとJapanese) ▼Text SettingsのText EncodingをUTF-16に変更する。(UTF-8のままだとエラーが起きるみたい) こんな感じでLocalizable.stringsの下に言語ファイルが生成されればOK。 あとは各言語ファイルを直接翻訳かけていけばOKです。 /* Title for this application */ &#8220;Title&#8221; = &#8220;タイトル&#8221;; 言語の切り替えはシミュレーターを起動して設定から [...]]]></description>
			<content:encoded><![CDATA[<h4>NSLocalizedStringで多言語対応</h4>
<p>日本語版のiPadアプリが完成したので、AppleStoreに登録しようとしたところ、Primary Languageで止まった。<br />
Primary Language、つまり「主要な言語」を選択してください、ってことなんだけど、<br />
登録進めようとしたところ、「Primary Languageは1度決めたら2度変更できませんよ」って警告がでた。<br />
日本語選択したら、そのアカウントではずっと日本語ですよ。ってことみたい。<br />
いや・・。それは困る。<br />
一応、調べてみたら本当にそういうことみたい。</p>
<p>前置き長くなったけど、iPhoneアプリの多言語対応化について調べたのでメモ。<br />
多言語対応のためのNSLocalizedStringってのが最初から入っているので、そんなに大変ではないです。<br />
ちなみにXcodeのVersionは4.0.2です。</p>
<p><a href="http://b.ruyaka.com/wp-content/uploads/2011/09/Screen-shot-2011-09-12-at-6.19.15-PM.png"><img src="http://b.ruyaka.com/wp-content/uploads/2011/09/Screen-shot-2011-09-12-at-6.19.15-PM.png" alt="" title="Screen shot 2011-09-12 at 6.19.15 PM" width="979" height="263" class="alignnone size-full wp-image-1899" /></a></p>
<h4>NSLocalizedStringの使い方</h4>
<p>とっても簡単。特にライブラリをインポートしたりは必要ありません。<br />
ちなみに引数はNSLocalizedString(@&#8221;{キー}&#8221;, &#8220;{コメント}&#8221;)。</p>
<pre class="brush: java; title: 変更前; notranslate">
self.title = @&quot;タイトル&quot;;
</pre>
<pre class="brush: java; title: 変更後; notranslate">
self.title = NSLocalizedString(@&quot;Title&quot;, &quot;Title for this application&quot;);
</pre>
<h4>genstringsコマンドを使って言語化ファイル生成</h4>
<p>次にTerminalを起動して以下のコマンドを叩きます。</p>
<blockquote><p>
$ cd {あなたのアプリのパス}<br />
$ genstrings -a $(find . -name &#8220;*.m&#8221;)
</p></blockquote>
<p>すると、Localizable.stringsというファイルが生成されると思います。<br />
<a href="http://b.ruyaka.com/wp-content/uploads/2011/09/Screen-shot-2011-09-12-at-6.31.01-PM.png"><img border=1 src="http://b.ruyaka.com/wp-content/uploads/2011/09/Screen-shot-2011-09-12-at-6.31.01-PM.png" alt="" title="Screen shot 2011-09-12 at 6.31.01 PM" width="189" height="299" class="alignnone size-full wp-image-1906" /></a></p>
<h4>Xcode設定</h4>
<p>生成されたLocalizable.stringsファイルをXcode内のSupporting Filesフォルダにドロップ&#038;ドラックします。<br />
<a href="http://b.ruyaka.com/wp-content/uploads/2011/09/Screen-shot-2011-09-12-at-6.33.53-PM.png"><img src="http://b.ruyaka.com/wp-content/uploads/2011/09/Screen-shot-2011-09-12-at-6.33.53-PM.png" alt="" title="Screen shot 2011-09-12 at 6.33.53 PM" width="223" height="76" class="alignnone size-full wp-image-1909" /></a></p>
<p>そうしたら、Supporting Filesフォルダ内のLocalizable.stringsをクリックして、<br />
ユーティリティのFile Inspectorを表示します。</p>
<p><a href="http://b.ruyaka.com/wp-content/uploads/2011/09/Screen-shot-2011-09-12-at-6.36.26-PM.png"><img src="http://b.ruyaka.com/wp-content/uploads/2011/09/Screen-shot-2011-09-12-at-6.36.26-PM.png" alt="" title="Screen shot 2011-09-12 at 6.36.26 PM" width="649" height="248" class="alignnone size-full wp-image-1911" /></a></p>
<p>すると、画面右側に下記のようなフォームが表示されると思います。<br />
変更箇所は2カ所のみで。<br />
▼Localization内の+ボタンを押して言語を追加。(私の場合EnglishとJapanese)<br />
▼Text SettingsのText EncodingをUTF-16に変更する。(UTF-8のままだとエラーが起きるみたい)</p>
<p><a href="http://b.ruyaka.com/wp-content/uploads/2011/09/FileInspector.png"><img src="http://b.ruyaka.com/wp-content/uploads/2011/09/FileInspector.png" alt="" title="FileInspector" width="280" height="665" class="alignnone size-full wp-image-1921" /></a></p>
<p>こんな感じでLocalizable.stringsの下に言語ファイルが生成されればOK。<br />
あとは各言語ファイルを直接翻訳かけていけばOKです。</p>
<p><a href="http://b.ruyaka.com/wp-content/uploads/2011/09/Screen-shot-2011-09-12-at-6.47.03-PM.png"><img src="http://b.ruyaka.com/wp-content/uploads/2011/09/Screen-shot-2011-09-12-at-6.47.03-PM.png" alt="" title="Screen shot 2011-09-12 at 6.47.03 PM" width="261" height="90" class="alignnone size-full wp-image-1917" /></a></p>
<blockquote><p>/* Title for this application */<br />
&#8220;Title&#8221; = &#8220;タイトル&#8221;;
</p></blockquote>
<h4>言語の切り替えはシミュレーターを起動して設定から</h4>
<p>一応、言語の切り替えは成功。</p>
<p><a href="http://b.ruyaka.com/wp-content/uploads/2011/09/Screen-shot-2011-09-12-at-6.48.25-PM.png"><img src="http://b.ruyaka.com/wp-content/uploads/2011/09/Screen-shot-2011-09-12-at-6.48.25-PM.png" alt="" title="Screen shot 2011-09-12 at 6.48.25 PM" width="843" height="235" class="alignnone size-full wp-image-1918" /></a></p>
<p>ただ、言語切り替えた後、一度シミュレータを再起動しないとアプリ起動時に落ちるの。これは仕様だろうか・・。</p>
]]></content:encoded>
			<wfw:commentRss>http://b.ruyaka.com/2011/09/12/iphone-ns-localized-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>さくらのVSPでオンラインデータ管理システムBoxroomを試してみる。</title>
		<link>http://b.ruyaka.com/2011/08/23/%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevsp%e3%81%a7%e3%82%aa%e3%83%b3%e3%83%a9%e3%82%a4%e3%83%b3%e3%83%87%e3%83%bc%e3%82%bf%e7%ae%a1%e7%90%86%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0boxroom%e3%82%92%e8%a9%a6/</link>
		<comments>http://b.ruyaka.com/2011/08/23/%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevsp%e3%81%a7%e3%82%aa%e3%83%b3%e3%83%a9%e3%82%a4%e3%83%b3%e3%83%87%e3%83%bc%e3%82%bf%e7%ae%a1%e7%90%86%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0boxroom%e3%82%92%e8%a9%a6/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 12:36:44 +0000</pubDate>
		<dc:creator>はるかなる熊</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[さくらのVPS]]></category>
		<category><![CDATA[その他]]></category>
		<category><![CDATA[オープンソース]]></category>
		<category><![CDATA[boxroom]]></category>

		<guid isPermaLink="false">http://b.ruyaka.com/?p=1857</guid>
		<description><![CDATA[貴重なデータをサーバー上に保管 IT化が進んでいないところでは、社内の貴重なデータを普通のデスクトップパソコンに保存、管理してるケースも少なくないと思う。 貴重なデータは最低でも以下の環境に置かれていることが望ましい。 １．データセンター内のサーバー ２．ハードディスクが多重化されている。 ３．複数のサーバーでバックアップ 上記の条件が揃っているサービスとしてクラウドがあげれるが、 安心かと思われたクラウドでも昨年、Amazonクラウドサービスで 大規模の障害がおきた。 そのため、クラウドを利用する時も、3のバックアップは他ホスティングサービスを 利用したほうが一層安心かもしれない。 オンラインデータ管理システムBoxroom とある会社からデータ管理システムを頼まれたので、オープンソースで良いのがないか探していたところ、 Boxroomを発見。なかなか良さそう。しかもRailsで実装されている。 試してみたところ予想以上に使い勝手がよいのでメモ。 ちなみに、その会社、聞いたところによると大切なデータを外付けHDDで保管しているとのこと。 手軽な外付けHDDなんて、そのまま持っかれたら終わりだし。 開発環境は ServersMan@VPS CentOS 5.4 Ruby 1.9.2 Rails 3.0.9 インストール方法 Git,Ruby,Railsなどはインストールしてあるものとする。 []$ git clone https://github.com/mischa78/boxroom.git []$ cd boxroom # GemfileとGemfile.lockに書かれているバージョンが古いので変更。 # rakeファイルの変更はbundleコマンドをたたく前に必要あり。 # rake = 0.8.7 → 0.9.2 # 他にもバージョンが違うgemがあったら「gem list」を参考に変更しておく。 []$ vim Gemfile []$ vim Gemfile.lock []$ bundle [...]]]></description>
			<content:encoded><![CDATA[<h4>貴重なデータをサーバー上に保管</h4>
<p>IT化が進んでいないところでは、社内の貴重なデータを普通のデスクトップパソコンに保存、管理してるケースも少なくないと思う。<br />
貴重なデータは最低でも以下の環境に置かれていることが望ましい。<br />
１．データセンター内のサーバー<br />
２．ハードディスクが多重化されている。<br />
３．複数のサーバーでバックアップ<br />
上記の条件が揃っているサービスとしてクラウドがあげれるが、<br />
安心かと思われたクラウドでも昨年、Amazonクラウドサービスで<br />
大規模の障害がおきた。<br />
そのため、クラウドを利用する時も、3のバックアップは他ホスティングサービスを<br />
利用したほうが一層安心かもしれない。</p>
<h4>オンラインデータ管理システムBoxroom</h4>
<p>とある会社からデータ管理システムを頼まれたので、オープンソースで良いのがないか探していたところ、<br />
Boxroomを発見。なかなか良さそう。しかもRailsで実装されている。<br />
試してみたところ予想以上に使い勝手がよいのでメモ。<br />
ちなみに、その会社、聞いたところによると大切なデータを外付けHDDで保管しているとのこと。<br />
手軽な外付けHDDなんて、そのまま持っかれたら終わりだし。</p>
<p>開発環境は</p>
<blockquote><p>
<a href="http://px.a8.net/svt/ejp?a8mat=1NYTB5+2T7PMA+1QFI+101KYQ" target="_blank">ServersMan@VPS</a><img border="0" width="1" height="1" src="http://www13.a8.net/0.gifa8mat=1NYTB5+2T7PMA+1QFI+101KYQ" alt=""><br />
CentOS 5.4<br />
Ruby 1.9.2<br />
Rails 3.0.9
</p></blockquote>
<h4>インストール方法</h4>
<p>Git,Ruby,Railsなどはインストールしてあるものとする。</p>
<blockquote><p>
[]$ git clone https://github.com/mischa78/boxroom.git<br />
[]$ cd boxroom<br />
# GemfileとGemfile.lockに書かれているバージョンが古いので変更。<br />
# rakeファイルの変更はbundleコマンドをたたく前に必要あり。<br />
# rake = 0.8.7 → 0.9.2<br />
# 他にもバージョンが違うgemがあったら「gem list」を参考に変更しておく。<br />
[]$ vim Gemfile<br />
[]$ vim Gemfile.lock<br />
[]$ bundle<br />
Using rake (0.9.2)<br />
Using abstract (1.0.0)<br />
Using activesupport (3.0.9)<br />
Using builder (2.1.2)<br />
Using i18n (0.5.0)<br />
Using activemodel (3.0.9)<br />
Using erubis (2.6.6)<br />
Using rack (1.2.3)<br />
Using rack-mount (0.6.14)<br />
Using rack-test (0.5.7)<br />
Using tzinfo (0.3.29)<br />
Using actionpack (3.0.9)<br />
Using mime-types (1.16)<br />
Using polyglot (0.3.1)<br />
Using treetop (1.4.9)<br />
Using mail (2.2.19)<br />
Using actionmailer (3.0.9)<br />
Using arel (2.0.10)<br />
Using activerecord (3.0.9)<br />
Using activeresource (3.0.9)<br />
Using acts_as_tree (0.1.1)<br />
Using bundler (1.0.15)<br />
Using cocaine (0.1.0)<br />
Using dynamic_form (1.1.4)<br />
Using factory_girl (1.3.3)<br />
Using rdoc (3.8)<br />
Using thor (0.14.6)<br />
Using railties (3.0.9)<br />
Using factory_girl_rails (1.0.1)<br />
Using paperclip (2.3.16)<br />
Using rails (3.0.9)<br />
Using sqlite3 (1.3.3)<br />
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.<br />
[]$ rake db:migrate RAILS_ENV=development<br />
[]$ rake db:migrate RAILS_ENV=production
</p></blockquote>
<h4>Passengerで本番環境で動かすには、、</h4>
<p>Boxroomは本番環境ではxSendFileというApacheモジュールが必要で、Apacheの初期状態でははいってない。<br />
そのためインストールして設定する必要がある。</p>
<blockquote><p>
[]$ yum install -y mod_xsendfile<br />
[]$ vim /etc<br />
# xSendFileの設定<br />
[]$ vim /etc/httpd/conf.d/xsendfile.conf</p>
<blockquote style="background: #000000; color: #FFFFFF"><p>LoadModule      xsendfile_module        modules/mod_xsendfile.so<br />
&lt;IfModule xsendfile_module&gt;<br />
  XSendFile on<br />
  XSendFilePath /var/www/uploads<br />
&lt;/IfModule&lt;&gt;
</p></blockquote>
<p># バーチャルホストの設定はこんな感じ。<br />
[]$ vim /etc/httpd/conf.d/boxroom.conf</p>
<blockquote style="background: #000000; color: #FFFFFF"><p>
NameVirtualHost *:80<br />
&lt;VirtualHost *:80&gt;<br />
    DocumentRoot /var/www/boxroom/public/<br />
    ServerName your_boxroom_domain.com<br />
    ErrorLog /var/log/httpd/boxroom-error_log<br />
    CustomLog /var/log/httpd/boxroom-access_log common<br />
    XSendFile on<br />
    XSendFilePath /var/www/boxroom/uploads/production<br />
&lt;/VirtualHost&gt;
</p></blockquote>
</blockquote>
<h4>BoxroomでHTML5のファイル複数同時アップロードを実装する場合</h4>
<p>こんな感じ変更すれば複数同時アップロードを実装できました。</p>
<pre class="brush: ruby; title: app/controllers/files_controller.rb : 31行目; notranslate">
  def create
    if params[:user_file][&quot;attachment&quot;].class == Array
      # 複数ファイルの場合の処理
      params[:user_file][&quot;attachment&quot;].each do |f|
        @file = @target_folder.user_files.build({&quot;attachment&quot; =&gt; f})
        render :action =&gt; 'new' and return unless @file.valid?
      end

      params[:user_file][&quot;attachment&quot;].each do |f|
        @file = @target_folder.user_files.build({&quot;attachment&quot; =&gt; f})
        @file.save
      end
      redirect_to folder_url(@target_folder)

    else
      # 単数ファイルの場合の処理
      @file = @target_folder.user_files.build(params[:user_file])
      if @file.save
        redirect_to folder_url(@target_folder)
      else
        render :action =&gt; 'new'
      end
    end
  end
</pre>
<pre class="brush: xml; title: app/views/files/new.html.erb : 12行目; notranslate">
   &lt;%# f.file_field :attachment %&gt;
    &lt;input id=&quot;user_file_attachment&quot; name=&quot;user_file[attachment][]&quot; type=&quot;file&quot; multiple = &quot;multiple&quot; /&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://b.ruyaka.com/2011/08/23/%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevsp%e3%81%a7%e3%82%aa%e3%83%b3%e3%83%a9%e3%82%a4%e3%83%b3%e3%83%87%e3%83%bc%e3%82%bf%e7%ae%a1%e7%90%86%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0boxroom%e3%82%92%e8%a9%a6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[AS3デバック方法] FlashからFirebugにログ出力する。</title>
		<link>http://b.ruyaka.com/2011/08/19/as3_debug_flash_firebuglog_howto/</link>
		<comments>http://b.ruyaka.com/2011/08/19/as3_debug_flash_firebuglog_howto/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 08:50:29 +0000</pubDate>
		<dc:creator>はるかなる熊</dc:creator>
				<category><![CDATA[その他]]></category>

		<guid isPermaLink="false">http://b.ruyaka.com/?p=1858</guid>
		<description><![CDATA[はまったのでメモ。 FlashのActionScript内で記述された内容をFirebugにログ出力したかったんだけど、 AS3になれていないので時間がかかった・・。 これだけでFirefoxで実行しても下記のようなフラッシュからセキュリティエラーがでる。 Adobe Flash Player Security これを解決するには、 Global Security Settings panelで実行しているローカルのswfを許可設定してあげないと駄目みたい。 Flashでは、当たり前なのかもしれないけど知らなかったのではまった・・。 下記サイトから&#8221;edit location&#8221;をクリックしてテスト用のswfファイルを選択する。 http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html 上の設定が終わったあと試してみると無事にFirebugに出力されました。]]></description>
			<content:encoded><![CDATA[<p>はまったのでメモ。<br />
FlashのActionScript内で記述された内容をFirebugにログ出力したかったんだけど、<br />
AS3になれていないので時間がかかった・・。</p>
<pre class="brush: jscript; title: test.flv内のコードに記述; notranslate">
// Firebugにログ出力する関数を作成
function ftrace(msg) {
	trace(&quot;ftrace = &quot;, msg);
	return ExternalInterface.call(&quot;window.console.log&quot;, msg)
		|| ExternalInterface.call(&quot;opera.postError&quot;, msg)
		|| ExternalInterface.call(&quot;printfire&quot;, msg)
		|| ExternalInterface.call(&quot;Debug.writeln&quot;, msg)
		|| ExternalInterface.call(&quot;debug.trace&quot;, msg)
	;
}

// ftrace実行
ftrace(&quot;firebug log test&quot;);
</pre>
<p>これだけでFirefoxで実行しても下記のようなフラッシュからセキュリティエラーがでる。<br />
Adobe Flash Player Security<br />
<a href="http://b.ruyaka.com/wp-content/uploads/2011/08/adobe_flash_player_security.jpg"><img src="http://b.ruyaka.com/wp-content/uploads/2011/08/adobe_flash_player_security.jpg" alt="" title="adobe_flash_player_security" width="543" height="372" class="alignnone size-full wp-image-1863" /></a></p>
<p>これを解決するには、<br />
Global Security Settings panelで実行しているローカルのswfを許可設定してあげないと駄目みたい。<br />
Flashでは、当たり前なのかもしれないけど知らなかったのではまった・・。<br />
下記サイトから&#8221;edit location&#8221;をクリックしてテスト用のswfファイルを選択する。</p>
<p>http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html</p>
<p><a href="http://b.ruyaka.com/wp-content/uploads/2011/08/clobal_security_settings_panel.jpg"><img src="http://b.ruyaka.com/wp-content/uploads/2011/08/clobal_security_settings_panel.jpg" alt="" title="clobal_security_settings_panel" width="407" height="312" class="alignnone size-full wp-image-1865" /></a></p>
<p>上の設定が終わったあと試してみると無事にFirebugに出力されました。<br />
<a href="http://b.ruyaka.com/wp-content/uploads/2011/08/Screen-shot-2011-08-19-at-5.34.14-PM.png"><img src="http://b.ruyaka.com/wp-content/uploads/2011/08/Screen-shot-2011-08-19-at-5.34.14-PM.png" alt="" title="Screen shot 2011-08-19 at 5.34.14 PM" width="515" height="144" class="alignnone size-full wp-image-1867" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://b.ruyaka.com/2011/08/19/as3_debug_flash_firebuglog_howto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSL3_GET_SERVER_CERTIFICATE</title>
		<link>http://b.ruyaka.com/2011/08/02/ssl3_get_server_certificate/</link>
		<comments>http://b.ruyaka.com/2011/08/02/ssl3_get_server_certificate/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 12:10:16 +0000</pubDate>
		<dc:creator>はるかなる熊</dc:creator>
				<category><![CDATA[さくらのVPS]]></category>
		<category><![CDATA[boxroom]]></category>

		<guid isPermaLink="false">http://b.ruyaka.com/?p=1852</guid>
		<description><![CDATA[こんなエラーがでた。 たいした内容じゃないけどメモ。 環境はさくらのVPSでCentOS 5.4。 エラー内容 []$ git clone https://github.com/mischa78/boxroom.git Cloning into boxroom&#8230; error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://github.com/mischa78/boxroom.git/info/refs fatal: HTTP request failed []$ wget https://github.com/mischa78/boxroom/zipball/v1.3 &#8211;2011-08-02 20:58:21&#8211; https://github.com/mischa78/boxroom/zipball/v1.3 github.com をDNSに問いあわせています&#8230; 207.97.227.239 github.com&#124;207.97.227.239&#124;:443 に接続しています&#8230; 接続しました。 エラー: github.com の証明書(発行者: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV [...]]]></description>
			<content:encoded><![CDATA[<p>こんなエラーがでた。<br />
たいした内容じゃないけどメモ。<br />
環境はさくらのVPSでCentOS 5.4。</p>
<h4>エラー内容</h4>
<blockquote><p>
[]$ git clone https://github.com/mischa78/boxroom.git<br />
Cloning into boxroom&#8230;<br />
error: SSL certificate problem, verify that the CA cert is OK. Details:<br />
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://github.com/mischa78/boxroom.git/info/refs<br />
fatal: HTTP request failed
</p></blockquote>
<blockquote><p>
[]$ wget https://github.com/mischa78/boxroom/zipball/v1.3<br />
&#8211;2011-08-02 20:58:21&#8211;  https://github.com/mischa78/boxroom/zipball/v1.3<br />
github.com をDNSに問いあわせています&#8230; 207.97.227.239<br />
github.com|207.97.227.239|:443 に接続しています&#8230; 接続しました。<br />
エラー: github.com の証明書(発行者: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV CA-1)の検証に失敗しました:<br />
  発行者の権限を検証できませんでした。<br />
github.com に安全の確認をしないで接続するには、`&#8211;no-check-certificate&#8217; を使ってください。<br />
SSL による接続が確立できません。
</p></blockquote>
<h4>解決方法</h4>
<blockquote><p>
cp /etc/pki/tls/certs/ca-bundle.crt /root/backup/<br />
curl http://curl.haxx.se/ca/cacert.pem -o /etc/pki/tls/certs/ca-bundle.crt</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://b.ruyaka.com/2011/08/02/ssl3_get_server_certificate/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OpenPNE3.4 コミュニティのカテゴリ一覧を表示</title>
		<link>http://b.ruyaka.com/2011/07/23/openpne3-4_showcommunitycategories/</link>
		<comments>http://b.ruyaka.com/2011/07/23/openpne3-4_showcommunitycategories/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 10:52:08 +0000</pubDate>
		<dc:creator>はるかなる熊</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[さくらのVPS]]></category>
		<category><![CDATA[OpenPNE]]></category>
		<category><![CDATA[Symfony]]></category>

		<guid isPermaLink="false">http://b.ruyaka.com/?p=1829</guid>
		<description><![CDATA[OpenPNE3.4をさくらのVPSにインストールしてみたものの情報の少なさに苦戦中。 仕様なのかわからないけど、コミュニティ検索画面に大カテゴリが表示されないので勉強がてら実装してみる。URLでいうと&#8221;/community/search&#8221;の部分。 しばらくRubyばかりやってたのでPHPが懐かしい。 ↓mixiでいうこの部分 実装 OpenPNE3.4もSymfonyもまだよくわかっていないので、かなり荒削りだと思うけど・・。 一応、これでカテゴリ一覧が表示されました。 大カテゴリ取得して小カテゴリ取得して所属コミュニティ数を取得してるのでDBクエリが微妙なとこ。 スタイルシートはこんな感じ。 参考サイト http://www.symfony-project.org/doctrine/1_2/ja/06-Working-With-Data 　→　DB操作例がたくさん記述してある。 余談 管理側でスキンプラグインを変更しても反映されないよね・・。]]></description>
			<content:encoded><![CDATA[<p>OpenPNE3.4を<a href="http://px.a8.net/svt/ejp?a8mat=1O2ONN+805TKI+D8Y+BWVTE" target="_blank">さくらのVPS</a><img border="0" width="1" height="1" src="http://www13.a8.net/0.gif?a8mat=1O2ONN+805TKI+D8Y+BWVTE" alt="">にインストールしてみたものの情報の少なさに苦戦中。<br />
仕様なのかわからないけど、コミュニティ検索画面に大カテゴリが表示されないので勉強がてら実装してみる。URLでいうと&#8221;/community/search&#8221;の部分。<br />
しばらくRubyばかりやってたのでPHPが懐かしい。</p>
<p>↓mixiでいうこの部分<br />
<a href="http://b.ruyaka.com/wp-content/uploads/2011/07/Screen-shot-2011-07-23-at-7.31.25-PM.png"><img src="http://b.ruyaka.com/wp-content/uploads/2011/07/Screen-shot-2011-07-23-at-7.31.25-PM-300x102.png" alt="" title="Screen shot 2011-07-23 at 7.31.25 PM" width="300" height="102" class="alignnone size-medium wp-image-1834" /></a></p>
<h5>実装</h5>
<p>OpenPNE3.4もSymfonyもまだよくわかっていないので、かなり荒削りだと思うけど・・。<br />
一応、これでカテゴリ一覧が表示されました。<br />
大カテゴリ取得して小カテゴリ取得して所属コミュニティ数を取得してるのでDBクエリが微妙なとこ。</p>
<pre class="brush: php; title: apps/pc_frontend/modules/community/templates/searchSuccess.php; notranslate">
&lt;div class=&quot;partsHeading&quot;&gt;&lt;h3&gt;カテゴリ&lt;/h3&gt;&lt;/div&gt;
&lt;?php
// 大カテゴリを取得
$q = Doctrine_Query::create()
  -&gt;select('cc.*')
  -&gt;from('CommunityCategory cc')
  -&gt;where('level = 0');
$l_categories = $q-&gt;fetchArray();

// 取得した大カテゴリを表示する
echo &quot;&lt;table class='communityCategories'&gt;&quot;;
foreach ($l_categories as $key =&gt; $l_category)
{
  // 小カテゴリを取得する。
  // 所属するコミュニティの数もあわせて取得する。
  $q = Doctrine_Query::create()
    -&gt;select('cc.*, (SELECT COUNT(id) FROM Community WHERE community_category_id = cc.id) AS count')
    -&gt;from('CommunityCategory cc')
    -&gt;where('tree_key = ? AND level != 0', $l_category[&quot;id&quot;]);

  echo &quot;&lt;tr&gt;&quot;;
  echo &quot;&lt;th&gt;&quot; . $l_category[&quot;name&quot;] . &quot;&lt;/th&gt;&quot;;
  echo &quot;&lt;td&gt;&quot;;
  $s_categories = $q-&gt;fetchArray();
  foreach ($s_categories as $key =&gt; $s_category)
  {
    echo link_to($s_category[&quot;name&quot;] . &quot;(&quot;. $s_category[&quot;count&quot;] .&quot;)&quot;, &quot;/community/search?community[community_category_id]=&quot; . $s_category[&quot;id&quot;]);
  }
  echo &quot;&lt;/td&gt;&quot;;
  echo &quot;&lt;/tr&gt;&quot;;
}
echo &quot;&lt;/table&gt;&quot;;
</pre>
<p>スタイルシートはこんな感じ。</p>
<pre class="brush: css; title: {スキンフォルダ}/web/css/main.css; notranslate">
table.communityCategories {
  margin: 10px 0px 15px 0px;
  table-layout: fixed;
  width: 100%;
  border-width: 0 1px 1px 0;
  border-style: solid;
  border-color: #CCCCCC;
}
table.communityCategories a {
  padding: 5px 15px 5px 0px;
}
table.communityCategories th {
  width: 30%;
  padding: 5px;
  border-width: 1px 0 0 1px;
  border-style: solid;
  border-color: #CCCCCC;
}
table.communityCategories td {
  width: 70%;
  padding: 5px;
  border-width: 1px 0 0 1px;
  border-style: solid;
  border-color: #CCCCCC;
}
</pre>
<h5>参考サイト</h5>
<p><a target="_blank" href="http://www.symfony-project.org/doctrine/1_2/ja/06-Working-With-Data">http://www.symfony-project.org/doctrine/1_2/ja/06-Working-With-Data</a><br />
　→　DB操作例がたくさん記述してある。</p>
<h5>余談</h5>
<p>管理側でスキンプラグインを変更しても反映されないよね・・。</p>
]]></content:encoded>
			<wfw:commentRss>http://b.ruyaka.com/2011/07/23/openpne3-4_showcommunitycategories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

