<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/ME2.2.3" -->
<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/"
	>

<channel>
	<title>mono-blog</title>
	<link>http://blog.mono-koubou.net</link>
	<description>mono-工房 blog written by kouichi</description>
	<pubDate>Thu, 11 Feb 2010 14:26:30 +0900</pubDate>
	<generator>http://wordpress.org/?v=ME2.2.3</generator>
	<language>ja</language>
			<item>
		<title>php-gdでの画像処理</title>
		<link>http://blog.mono-koubou.net/archives/208</link>
		<comments>http://blog.mono-koubou.net/archives/208#comments</comments>
		<pubDate>Thu, 11 Feb 2010 23:26:30 +0900</pubDate>
		<dc:creator>kouichi</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.mono-koubou.net/archives/208</guid>
		<description><![CDATA[php-gdでの画像処理は結構楽ちんです。
まずはインストール
yum -y install php-gd
でOKです。
サンプルなどは、GEEKなページに詳しく書かれているのでそちらを参考にしました。
いろいろ試していると、
PHP Warning:  imagecreatetruecolor() ・・・
こちらのエラーが出ました。
ググるとどうもGDのVersionが2.0.1以下ででるとのこと。
ただ、環境をみると2.0.28なので、Versionの問題ではなく、よくよくエラーを見てみると。
PHP Warning:  imagecreatetruecolor()[function.imagecreatetruecolor]: Invalid image dimensions in ・・・
Invalid image dimensionsということなので、imagecreatetruecolorの引数に1以下の値を指定しちゃだめというオチでした。
エラーは良く読めということでした。。。
]]></description>
		<wfw:commentRss>http://blog.mono-koubou.net/archives/208/feed</wfw:commentRss>
		</item>
		<item>
		<title>IEでセッションが切れてしまう件</title>
		<link>http://blog.mono-koubou.net/archives/207</link>
		<comments>http://blog.mono-koubou.net/archives/207#comments</comments>
		<pubDate>Thu, 18 Jun 2009 04:52:06 +0900</pubDate>
		<dc:creator>kouichi</dc:creator>
		
		<category><![CDATA[その他]]></category>

		<guid isPermaLink="false">http://blog.mono-koubou.net/archives/207</guid>
		<description><![CDATA[FireFoxではOKですが、IEだとセッションが切れてしまうという現象にぶつかりました。
結論から言うと、サブドメインに_（アンダーバー）が入っているURLはNGらしいです。
状況としては、アクセスするとURL以下にセッションIDが表示されているのでCookieが正しく動作していない様子。
同じアプリを別サイトで動かしたら正常動作するので、なぜか。。。と突き詰めていくと、アンダーバーがだめくさいということで、「サブドメイン アンダーバー」で検索してみると、
こちらに書いていますが、
～～～～
サブドメイン（だろうからドメインもそうなんだろう）にアンダーバー（ _ ）を含んだ場合、環境によりけりでCookieの発行が行えないんです。
～～～～
とのことです。
解決してよかった。
]]></description>
		<wfw:commentRss>http://blog.mono-koubou.net/archives/207/feed</wfw:commentRss>
		</item>
		<item>
		<title>地デジ キター</title>
		<link>http://blog.mono-koubou.net/archives/206</link>
		<comments>http://blog.mono-koubou.net/archives/206#comments</comments>
		<pubDate>Tue, 31 Mar 2009 13:57:24 +0900</pubDate>
		<dc:creator>kouichi</dc:creator>
		
		<category><![CDATA[その他]]></category>

		<guid isPermaLink="false">http://blog.mono-koubou.net/archives/206</guid>
		<description><![CDATA[家にもやっと地デジが来ました。
REGZAのZ7000だったらHDDあふれたら買い足せばいいやということでこれにしました。
Z7000シリーズはもう生産終わってるみたいですね。
店の人に後メーカー在庫残すのみです。って言われました。
後継が出るっぽいですが、安くなっているタイミングでちょうどよかったかもしれません。
テンションもあがっているところでwii fitで体脂肪燃やさねば。
]]></description>
		<wfw:commentRss>http://blog.mono-koubou.net/archives/206/feed</wfw:commentRss>
		</item>
		<item>
		<title>IE7で画面が白くなる件</title>
		<link>http://blog.mono-koubou.net/archives/205</link>
		<comments>http://blog.mono-koubou.net/archives/205#comments</comments>
		<pubDate>Thu, 26 Mar 2009 20:32:59 +0900</pubDate>
		<dc:creator>kouichi</dc:creator>
		
		<category><![CDATA[その他]]></category>

		<guid isPermaLink="false">http://blog.mono-koubou.net/archives/205</guid>
		<description><![CDATA[IE7で画面が白くなって表示される場合があります。
知り合いも同じ現象になったようなので、こちらに書いておきいます。
現象はcontent-typeの前にtitleタグが存在する場合に起こるようです。
＃実際はcontent-typeの前に日本語が存在する場合になるのかもしれません。
画面が真っ白になった場合でも右クリックでソースを表示すると、正しいソースが表示されるのが特徴です。
OKの場合
&#60;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"&#62;
&#60;html lang="ja"&#62;
&#60;head&#62;
&#60;meta http-equiv="content-type" content="text/html; charset=utf-8" /&#62;
&#60;title&#62;ログイン&#60;/title&#62;
NGの場合
&#60;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"&#62;
&#60;html lang="ja"&#62;
&#60;head&#62;
&#60;title&#62;ログイン&#60;/title&#62;
&#60;meta http-equiv="content-type" content="text/html; charset=utf-8" /&#62;
対応はcontent-typeを先に書けばOKです。
NGの場合でもFireFoxでは正常に表示されていたりしますので、なかなか気づきづらいですね。
]]></description>
		<wfw:commentRss>http://blog.mono-koubou.net/archives/205/feed</wfw:commentRss>
		</item>
		<item>
		<title>solrのスコア計算</title>
		<link>http://blog.mono-koubou.net/archives/204</link>
		<comments>http://blog.mono-koubou.net/archives/204#comments</comments>
		<pubDate>Thu, 26 Mar 2009 18:57:54 +0900</pubDate>
		<dc:creator>kouichi</dc:creator>
		
		<category><![CDATA[Lucene]]></category>

		<guid isPermaLink="false">http://blog.mono-koubou.net/archives/204</guid>
		<description><![CDATA[solr（Lucene）のスコア計算を改めて調べました。
こちらが詳しく書かれています。
score(q, d) =
coord(overlap, maxOverlap).
queryNorm(q).
Σ(tf(t in d). idf(t)＾2. norm(t, d))
t in q
というのが計算式です。
solrのリクエスト時にdebugQuery=onで実行して、こちらと見比べてみます。
テストデータをインポートして、&#8221;solr ipod&#8221;で検索、4件ヒットします。
例）
http://localhost:8983/solr/select/?q=solr+ipod&#38;version=2.2&#38;start=0&#38;rows=10&#38;indent=on&#38;debugQuery=on
そのうち、1件目のスコア情報を見てみると、下記のような感じです。
0.2925402 = (MATCH) product of:･･･（１）
0.5850804 = (MATCH) sum of:･･･（２）
0.5850804 = (MATCH) weight(text:ipod in 3), product of:･･･（３）
0.6273345 = queryWeight(text:ipod), product of:･･･（４）
2.871802 = idf(docFreq=3, numDocs=26)･･･（５）
0.21844627 = queryNorm･･･（６）
0.9326451 = (MATCH) fieldWeight(text:ipod in 3), product of:･･･（７）
1.7320508 = tf(termFreq(text:ipod)=3)･･･（８）
2.871802 = idf(docFreq=3, numDocs=26)･･･（９）
0.1875 = fieldNorm(field=text, doc=3)･･･（１０）
0.5 = coord(1/2)･･･（１１）

こちらと、計算式を見比べてみます。
0.2925402 = (MATCH) [...]]]></description>
		<wfw:commentRss>http://blog.mono-koubou.net/archives/204/feed</wfw:commentRss>
		</item>
		<item>
		<title>無線LANを買い換えました。</title>
		<link>http://blog.mono-koubou.net/archives/203</link>
		<comments>http://blog.mono-koubou.net/archives/203#comments</comments>
		<pubDate>Wed, 25 Mar 2009 14:04:10 +0900</pubDate>
		<dc:creator>kouichi</dc:creator>
		
		<category><![CDATA[その他]]></category>

		<guid isPermaLink="false">http://blog.mono-koubou.net/archives/203</guid>
		<description><![CDATA[無線LANの親機をWHR-G300Nに買い換えました。
以前使用していたのは壊れてしまいました。
相当昔に買ったもので、11gでしか接続できず、スループットが2Mbpsぐらいしか出なかったのですが、今度のは50Mbps出ているっぽいです。
早いです。
接続設定も楽にできました。
値段も安かったし、早めに買い換えればよかったかなぁ。
]]></description>
		<wfw:commentRss>http://blog.mono-koubou.net/archives/203/feed</wfw:commentRss>
		</item>
		<item>
		<title>PHPでsshを使いたい場合。Secure Shell2関数</title>
		<link>http://blog.mono-koubou.net/archives/202</link>
		<comments>http://blog.mono-koubou.net/archives/202#comments</comments>
		<pubDate>Thu, 12 Mar 2009 16:57:56 +0900</pubDate>
		<dc:creator>kouichi</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.mono-koubou.net/archives/202</guid>
		<description><![CDATA[PHPからsshを使う必要がでてきたので調べてみました。
以前javaでやろうとして結構大変だったのですが、PHPはssh2関数が用意されている！便利！
pecl install ssh2-beta
これが動けば後はphp.iniに
extension=ssh2.so
を追加すればOKなのですが、peclを動かしきるまでに若干ハマったので補足です。
まず、libssh2が必要です。
yum install libssh2
後は、phpizeが動かせなくてはだめです。
yum install php-dev
で、大丈夫のはず。
鍵にも対応しているので良いですね。
]]></description>
		<wfw:commentRss>http://blog.mono-koubou.net/archives/202/feed</wfw:commentRss>
		</item>
		<item>
		<title>Amazon EC2 でWindowsを使う場合</title>
		<link>http://blog.mono-koubou.net/archives/201</link>
		<comments>http://blog.mono-koubou.net/archives/201#comments</comments>
		<pubDate>Wed, 11 Mar 2009 20:27:18 +0900</pubDate>
		<dc:creator>kouichi</dc:creator>
		
		<category><![CDATA[サーバ関連]]></category>

		<guid isPermaLink="false">http://blog.mono-koubou.net/archives/201</guid>
		<description><![CDATA[前回に引き続き、Amazon EC2でwindowsを動かしてみました。
こちら当たりを参考にしましたが、今回はコンソールでの立ち上げを行ってみます。
まず、keypairファイルを作成します。
＞ec2-add-keypair windows-keypair
KEYPAIR windows-keypair xxxxxxxxx
-----BEGIN RSA PRIVATE KEY-----
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
～～～～
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-----END RSA PRIVATE KEY-----
として、
&#8212;&#8211;BEGIN RSA PRIVATE KEY&#8212;&#8211;
から
&#8212;&#8211;END RSA PRIVATE KEY&#8212;&#8211;
までをコピーしてファイルに保存します。（例 c:\key.pem）
次に、インスタンスを立ち上げます。
その際に追加したkeypairを指定します。
＞ec2-run-instances ami-41bf5828 -k windows-keypair
次に、リモートデスクトップのポートを空けます。
＞ec2-authorize default -p 3389
最後に、パスワードを取得します。
-kには上記で保存したkeypairの鍵ファイルを指定します。
そうするとパスワードが取得できます。
＞ec2-get-password インスタンスID -k c:\key.pem
xxxxxxx
後は、「スタート」-「プログラム」-「アクセサリ」-「リモートデスクトップ接続」を起動し、
コンピューター名に「ec2-xx-xx-xx-xx.compute-1.amazonaws.com」
を指定し「接続」ボタンをクリックします。
ユーザーIDはAdministrator、パスワードはec2-get-passwordで取得したパスワードを入力すればOKです。
日本語ではないので、ちょっと慣れません。
]]></description>
		<wfw:commentRss>http://blog.mono-koubou.net/archives/201/feed</wfw:commentRss>
		</item>
		<item>
		<title>Amazon EC2 コマンド備忘録</title>
		<link>http://blog.mono-koubou.net/archives/200</link>
		<comments>http://blog.mono-koubou.net/archives/200#comments</comments>
		<pubDate>Mon, 09 Mar 2009 22:52:46 +0900</pubDate>
		<dc:creator>kouichi</dc:creator>
		
		<category><![CDATA[サーバ関連]]></category>

		<guid isPermaLink="false">http://blog.mono-koubou.net/archives/200</guid>
		<description><![CDATA[久々時間が空いたので、AmazonEC2を動かしてみました。
頼むは先人の知恵なので、まずはこちらにしたがって、サインオン
つづいてセットアップ編
やっぱりターミナルでないとということで、こちらを参考に。
ポイントは、puttygenに読み込ませるprivate keyの改行コードをLFにする必要があるということ。
後は特に引っかかりどころはなくインスタンス作成終了。
http、sshの接続確認は完了しました。
以下備忘録
・private keyの表示
ec2-add-keypair gsg-keypair
・インスタンス起動
ec2-run-instances AMI -k gsg-keypair
・インスタンスの状況確認
ec2-describe-instances
→INSTANCE_IDの確認
→URLの確認
・ポートの開放
ec2-authorize default -p PORT
・ポートの閉じる
ec2-revoke default -p PORT
・インスタンス終了
ec2-terminate-instances INSTANCE_ID
次回はWindowsにもチャレンジしてみます。
]]></description>
		<wfw:commentRss>http://blog.mono-koubou.net/archives/200/feed</wfw:commentRss>
		</item>
		<item>
		<title>Apache-PHPをFastCGIで動かす。</title>
		<link>http://blog.mono-koubou.net/archives/199</link>
		<comments>http://blog.mono-koubou.net/archives/199#comments</comments>
		<pubDate>Fri, 30 Jan 2009 10:15:15 +0900</pubDate>
		<dc:creator>kouichi</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.mono-koubou.net/archives/199</guid>
		<description><![CDATA[昨日書きましたが、PHPをApacheモジュール版ではなく、FastCGIで動かすとちょっと早いです。
ただ、インストールに若干手間取ったので、書いておきます。
OSはCentOS5です。
まずはApacheをyumでインストール。
後々develが必要になってくるので、それもインストールします。
yum install httpd httpd-devel
FastCGIをインストールします。
こちらからFastCGIモジュールをダウンロード
wget http://www.fastcgi.com/dist/fcgi.tar.gz
tar xfz fcgi.tar.gz
cd fcgi
./configure
make
make install
次にApacheのFastCGIモジュールをインストールします。
ApacheのFastCGIモジュールは
mod_fastcgi
と
mod_fcgid
の2択です。
最初はmod_fastcgiからトライしましたが、うまくいかずmod_fcgidを入れました。
yumではないのでソースをここからダウンロードします。
解凍後、Makefile.AP2をMakefileにコピーします。
Apacheのソースの場所が必要なので、Makefileを編集
top_dir      = /usr/local/apache2↓
top_dir      = /usr/lib/httpd＃さっきのdevelがここで効いてきます。
後はmake、make installでOKです。
出来上がったmod_fcgid.soをApacheのmodulesディレクトリに設置し、httpd.confを編集し
LoadModule fcgid_module modules/mod_fcgid.so

FCGIWrapper /usr/local/bin/php-cgi .php
AddHandler fcgid-script .php
SocketPath /tmp/php-cgi.sock

とすれば動きました。
先日書いたとおり若干は早いですが、lighttpdにしたほうがよさそうですね。
]]></description>
		<wfw:commentRss>http://blog.mono-koubou.net/archives/199/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
