2008-01-25
■[linux] testlink_bugzilla を使ってみる 
VMware Playerの元で、Fedora8が立ち上がったら、IPアドレスを使って、以下のURLをアクセスすることでそれぞれにアクセスできるようになっています。
TestLink: http://アドレス/testlink/
Bugzilla: http://アドレス/bugzilla/
後は、以下の管理ユーザアカウントを使って、新しいユーザを作ったりして色々と試してください。
TestLinkの管理ユーザ:admin、パスワード:password
Bugzillaの管理ユーザ:root@localhost.local、パスワード:password
VMware PlayerでTestLinkとBugzillaを - ヨシムラ・クォリティ・サービス
Bugzilla のカスタマイズについて検索していたところ、テスト管理ツール TestLink の存在を知った。
んで、ちょっと使ってみようと思ったのですが、Bugzilla 管理ユーザ用のログイン名が間違ってますね。
コメントでお知らせしようかと思ったのですが、コメント欄がなかったので、こちらに書いておきます。
2007-11-14
■[PHP] mt_rand 関数について 
たまたま PHP MANUAL で調べ物をしていて mt_rand 関数を知った
int mt_rand ( [int $min, int $max] )
古い libc の多くの乱数発生器は、怪しげであるか特性が不明であったりし、 また低速でした。デフォルトでは、PHP は rand() において libc の乱数発生器を使用します。 mt_rand() 関数は、その代替品となるものです。 この関数は、その特性が既知の乱数生成器 » Mersenne Twister を使用し、 平均的な libc の rand()よりも 4 倍以上高速に乱数を生成します。
PHP: mt_rand - Manual
んで rand と mt_rand でどれだけ差が出るんだろ?と気になってベンチとってみた。。。
きっと、実行回数が増えれば増えるほど、差は開くと予想してたのですが…結果は以下のように。
MAX_NUM = 10
| time index | ex time | % | |
|---|---|---|---|
| Start | 1194944181.93750200 | - | 0.00% |
| rand | 1194944181.93754600 | 0.000044 | 56.41% |
| mt_rand | 1194944181.93756600 | 0.000020 | 25.64% |
| Stop | 1194944181.93758000 | 0.000014 | 17.95% |
| total | - | 0.000078 | 100.00% |
MAX_NUM = 100
| time index | ex time | % | |
|---|---|---|---|
| Start | 1194956957.34375300 | - | 0.00% |
| rand | 1194956957.34382800 | 0.000075 | 52.08% |
| mt_rand | 1194956957.34388300 | 0.000055 | 38.19% |
| Stop | 1194956957.34389700 | 0.000014 | 9.72% |
| total | - | 0.000144 | 100.00% |
MAX_NUM = 10000
| time index | ex time | % | |
|---|---|---|---|
| Start | 1194957321.32812800 | - | 0.00% |
| rand | 1194957321.33204900 | 0.003921 | 51.40% |
| mt_rand | 1194957321.33573200 | 0.003683 | 48.28% |
| Stop | 1194957321.33575600 | 0.000024 | 0.31% |
| total | - | 0.007628 | 100.00% |
なんか予想に反する結果が出たし…
なんでか、分からないので、とりあえず保留。。。ってか、何か根本的に勘違いしているのかな?
<?php /** * rand, mt_rand のベンチスクリプト * * $Id: sampleRandBench.php 7991 2007-11-13 17:29:04Z doublenegative $ * * ------------------------------------------------------------------------------------------------- * **/ error_reporting( E_ALL ); define( 'MAX_NUM', 10 ); { require_once 'Benchmark/Timer.php'; $timer = new Benchmark_Timer(); $timer->start(); for ( $i = 0; $i < MAX_NUM; $i++ ) { $random = rand(); } $timer->setMarker( 'rand' ); for ( $i = 0; $i < MAX_NUM; $i++ ) { $random = mt_rand(); } $timer->setMarker( 'mt_rand' ); $timer->stop(); $timer->display(); }
2007-11-13
■[PHP] Services_MixiAPI を使ってみた 
via. mixiステーション2.2.1で追加されたAPIの発掘
やば。。。もう1ヶ月半も前のネタなので、既出かも知れません。
とはいえ、なんか色々追加されてるみたいで面白そうなので試してみました。基本的にはWSSE認証+XMLということで、mixiのあしあとAPIを使って「あしあと一覧」を作ってみた - Do You PHP はてなでやっていることと変わりありません。
mixiのAPIが増えていたので、Services_MixiAPI作ってみた - Do You PHP はてな
更に遅れること、二ヶ月弱、どれだけ波に乗り遅れてるんだ、という感じですが…
実行環境 Windows XP の xampp-win32-1.6.3a (Apache 2.2.4, PHP 5.2.3) で、サンプルコードをほとんどそのまま使わせて頂きました。
特に問題なく利用できました。有難う御座います。
使ってみて、細かい部分で気づいた点を、以下に挙げておきます…
- AbstractAPI.php の buildWSSEAuth 内で利用している posix_getpid() が windows 上では使えない(POSIX自体がね)
- サンプルのマイミクへのリンクは $entry->author->url ではなくて $entry->author->uri ではないかと…(typoっぽい)
- サンプルのあしあと表示のリンクは $entry->link->href ではなくて $entry->link['href'] ではないかと…(typoっぽい)
- 最新アルバムを表示するための author->uri が空で返ってくる(Mixi側の仕様っぽい。。。なんでだろ?)
- $updated に代入する値を substr( $updated_iso8601, x, y ) しているけど、私だったら date( 'Y/m/d H:i:s', strtotime( $entry->updated ) ) にする
実際に、テスト表示に使ったコード。
<?php /** * Services_MixiAPI を利用したテストスクリプト * * $Id: sampleServicesMixiApi.php 7989 2007-11-13 16:04:22Z doublenegative $ * * ------------------------------------------------------------------------------------------------- * 以下の内容を表示する * 直近のあしあと、全マイミク、マイミク日記やコミュニティなどの最新更新一覧 **/ error_reporting( E_ALL ); { require_once 'HTTP/Request.php'; require_once 'Services/MixiAPI/Factory.php'; $user = '********'; $pass = '********'; $id = '********'; $service = Services_MixiAPI_Factory::getInstance( Services_MixiAPI_Factory::API_MODE_FOOTPRINT, $user, $pass, $id ); $service->execute(); $xml = new SimpleXMLElement( $service->get() ); echo "<div>FootPrint</div>\n<ul>\n"; foreach ( $xml->entry as $entry ) { printf( '<li><a href="%1$s" title="%2$sさん">%2$s</a>さん (%3$s)</li>' . "\n", $entry->link[ 'href' ], $entry->author->name, date( 'Y/m/d H:i:s', strtotime( $entry->updated ) ) ); } echo "</ul><br />\n<hr size=1 /><br />\n"; /** * マイミク一覧 */ $service = Services_MixiAPI_Factory::getInstance( Services_MixiAPI_Factory::API_MODE_MYMIXI, $user, $pass, $id ); $service->execute(); $xml = new SimpleXMLElement( $service->get() ); echo "<div>MyMixi</div>\n<ul>\n"; foreach ( $xml->entry as $entry ) { printf( '<li><a href="%1$s" title="%2$sさん%3$s">%2$s</a>さん%3$s</li>' . "\n", $entry->link[0][ 'href' ], $entry->title, isset( $entry->category[ 'label' ] ) ? ' (' . $entry->category[ 'label' ] . ')' : '' ); } echo "</ul><br />\n<hr size=1 /><br />\n"; /** * マイミク日記、コミュニティなど最新更新一覧 */ $service = Services_MixiAPI_Factory::getInstance( Services_MixiAPI_Factory::API_MODE_WHATSNEW, $user, $pass, $id ); $service->execute(); $xml = new SimpleXMLElement( $service->get() ); foreach ( $xml->entry as $entry ) { ${$entry->category[ 'term' ]}[] = $entry; # echo "<pre>\n"; var_dump( $entry ); echo "</pre><br />\n<hr width=80% size=1 /><br />\n"; } $terms = array( 'diary', 'comment', 'album', 'video', 'bbs' ); foreach( $terms as $num => $term ) { if ( isset( ${$term} ) ) { echo '<div>' . $term . "</div>\n<ul>\n"; foreach ( ${$term} as $line ) { switch ( $term ) { case 'diary': printf( "<li>%s %s</li>\n", $line->content, date( 'Y/m/d H:i:s', strtotime( $line->updated ) ) ); break; case 'comment': case 'album': case 'video': printf( '<li><a href="%1$s" title="%2$s">%2$s</a> (<a href="%3$s" title="%4$s">%4$s</a>さんの%5$s)</li>' . "\n", $line->link[ 'href' ], $line->title, $line->author->uri, $line->author->name, $line->category[ 'label' ] ); break; case 'bbs': printf( '<li><a href="%1$s" title="%2$s">%2$s</a> (「<a href="%3$s" title="%4$s">%4$s</a>」の%5$s)</li>', $line->link[ 'href' ], $line->title, $line->author->uri, $line->author->name, $line->category[ 'label' ] ); break; default: } } # if ( $term === 'album' ) { echo "<pre>\n"; var_dump( $line ); echo "</pre><br />\n"; } echo "</ul><br />\n<hr size=1 /><br />\n"; } } }
2006-11-06
■[linux][windows] ping 
社内のネットワーク系の勉強会で ping の -R オプションを教えてもらった。
これ便利だなぁ〜と感心っていうか、知らなかったのが恥ずかしい…。
で windows でも同じことが出来ないものかと調べてみたら、どうも以下のコマンドでOKっぽい。
ping -r 9 -n 1 xxx.xxx.xxx.xxx
ちなみに
-r Count IP ヘッダーにある Record Route オプションを使用して、エコー要求メッセージおよび対応する エコー応答メッセージが通過するパスを記録することを指定します。IPv4 でのみ使用可能です。 パスの各ホップは、Record Route オプションのエントリを使用します。 可能な場合は、送信元と宛先の間のホップの数に等しいか、またはそれを超える Count を指定します。 Count の値は、最小で 1、最大で 9 です。 -n Count 送信するエコー要求メッセージの数を指定します。既定値は 4 です。 -R 往復のパスをトレースすることを指定します。IPv6 でのみ使用可能です。
とのこと。

おデブで全身けむくじゃらの熊野郎で非モテだった俺が
30歳になってまさかの大フィーバーwwww
「腹のプニプニとか包茎具合が超カワイイ!」って女共が勝手に盛り上がってるよwwwww
おかげでゲーム三昧のニート生活続けられるしウメェwwww
http://ra5m5NH.zebu.iphone5.net/
もーさすがに3回は果てるってーー!!!(>_<)
連続じゃないだけマシだけど1 0 万の為とはいえ3回ヤるとティ ンコさんが火を噴きそうなくらい真っ赤っ赤だよ(^^;
まー何気に足 コ キしてもらったのって初めてだし、得っちゃ得だけどねーwww
http://kachi.strowcrue.net/SNuPtbg/