soffritto::journal http://journal.soffritto.org/ soffritto::journal むー。 http://journal.soffritto.org/entry/308 http://journal.soffritto.org/entry/308 Mon, 05 Jan 2009 13:04:47 -0000 <div class="section"> <ul> <li> 一般的な環境だと普通にModPerl::RegistryでNanoAが動く。</li> <li> 某環境だと <ul> <li> 未設定のままの<a href="http://sylvia-vm.local/admin/">http://sylvia-vm.local/admin/</a>(nanoa設置場所)にアクセスすると</li> <li> 正しく<a href="http://sylvia-vm.local/admin/nanoa.cgi/system/setup">http://sylvia-vm.local/admin/nanoa.cgi/system/setup</a>にリダイレクトする</li> <li> リダイレクト先でContent-Length: 0で200が帰ってくる</li> </ul> </li> </ul> <pre> GET /admin/nanoa.cgi/system/setup HTTP/1.1 Host: sylvia-vm.local HTTP/1.1 200 OK Date: Mon, 05 Jan 2009 13:03:22 GMT Server: Apache/2.0.59 (Unix) mod_perl/2.0.3 Perl/v5.8.5 Content-Length: 0 Connection: close Content-Type: text/plain; charset=UTF-8 Connection closed by foreign host. </pre> <p>ModPerl::Registryをオフるとちゃんと動く</p> </div> 某所のhttpd.confの例の部分 http://journal.soffritto.org/entry/307 http://journal.soffritto.org/entry/307 Mon, 05 Jan 2009 12:21:36 -0000 <div class="section"> <pre> &lt;Location /> Options +ExecCGI AddHandler perl-script .cgi PerlResponseHandler +ModPerl::RegistryPrefork PerlOptions +ParseHeaders &lt;/Location> </pre> <p>あー。早めにメモ帳を準備しよう。</p> <pre> Synopsis # httpd.conf PerlModule ModPerl::Registry Alias /perl/ /home/httpd/perl/ &lt;Location /perl> SetHandler perl-script PerlResponseHandler ModPerl::Registry #PerlOptions +ParseHeaders #PerlOptions -GlobalRequest Options +ExecCGI &lt;/Location> </pre> </div> えらー http://journal.soffritto.org/entry/306 http://journal.soffritto.org/entry/306 Mon, 05 Jan 2009 02:03:47 -0000 <div class="section"> <pre> DBI db handle 0xb34830 cleared whilst still active. dbih_clearcom (dbh 0xb34830, com 0x15853f0, imp DBD::GoogleSpreadsheets::db): FLAGS 0x180115: COMSET Active Warn PrintError PrintWarn PARENT DBI::dr=HASH(0xb3450c) KIDS 0 (0 Active) IMP_DATA HASH(0xb3486c) </pre> <p>おう。disconnectしやんといかんのか。</p> </div> DBD::GoogleSpreadsheetsもできたみたいです http://journal.soffritto.org/entry/305 http://journal.soffritto.org/entry/305 Sun, 04 Jan 2009 17:23:00 -0000 <div class="section"> <p>と、いうわけでDBD::GoogleSpreadsheetsが営業日の朝になる前にテストを全部パスしてくれました。リリースの仕方は考えるとして、とりあえずこれでDBI経由でGoogleSpreadsheetsに読み書きできるようになったはず。PODまだ書いてない。</p> <pre> my $dbh = DBI->connect('dbi:GoogleSpreadsheets:key_of_spreadsheet', 'yourname@gmail.com', 'yourpass'); $dbh->do('create table test ( id int, name text )'); </pre> <p>などというような使い方が可能。今後リリースに向けていろいろやります。リリース前にDBIメーリングリストに投げろ、って書いてあった気がする。こわい。</p> <p>codereposにあります。</p> <p><a href="http://svn.coderepos.org/share/lang/perl/DBD-GoogleSpreadsheets/trunk/">http://svn.coderepos.org/share/lang/perl/DBD-GoogleSpreadsheets/trunk/</a></p> </div> memo 3 http://journal.soffritto.org/entry/304 http://journal.soffritto.org/entry/304 Sun, 04 Jan 2009 12:30:56 -0000 <div class="section"> <p>ということで NULLABLEとかtable_infoとかtype_info_allとかget_infoとかか。</p> <p>→type_info_allはperldoc DBI参照。</p> <p>→typeをクリアすれば全部行けそうな気がするんだけどもう頭が回らない。</p> <pre> Test($state or ($dbdriver eq 'CSV') or ($dbdriver eq 'ConfFile') or ($ref = $cursor->{'NULLABLE'}) && @$ref == @table_def && !($$ref[0] xor ($table_def[0][3] & $COL_NULLABLE)) && !($$ref[1] xor ($table_def[1][3] & $COL_NULLABLE))) or DbiError($cursor->err, $cursor->errstr); if (!$state && $verbose) { print "Nullable:\n"; for ($i = 0; $i < @$ref; $i++) { print " ", ($$ref[$i] & $COL_NULLABLE) ? "yes" : "no", "\n"; } </pre> <p>このテストが意味は分かるんだけど分かりたくない気分。</p> <p>→って思ったらCSVこれスルーじゃんか!!!!ちくしょー。騙された。</p> </div> memo 2 http://journal.soffritto.org/entry/303 http://journal.soffritto.org/entry/303 Sun, 04 Jan 2009 09:58:55 -0000 <div class="section"> <pre> [danjou@sylvia] $ prove -lv t/41listfields.t t/41listfields.... 1..25 Execution ERROR: no such table: test at /Users/danjou/tmp/20081230/DBD-GoogleSpreadsheets/trunk/lib/DBD/GoogleSpreadsheets.pm line 266. called from /Library/Perl/5.8.8/darwin-thread-multi-2level/DBI.pm at 1562. Execution ERROR: no such table: test at /Users/danjou/tmp/20081230/DBD-GoogleSpreadsheets/trunk/lib/DBD/GoogleSpreadsheets.pm line 266. called from t/41listfields.t at 36. ok 1 - drop table if exists test SQL ERROR: Bad table or column name 'key' is a SQL reserved word! Execution ERROR: No command found!. not ok 2 - create table test not ok 3 - table info for test # Failed test 'create table test' # at t/41listfields.t line 46. # Failed test 'table info for test' # at t/41listfields.t line 48. not ok 4 - column_info for test # Failed test 'column_info for test' # at t/41listfields.t line 50. not ok 5 - $sth defined Can't call method "err" on an undefined value at t/41listfields.t line 56. DBI db handle 0xb98350 cleared whilst still active. dbih_clearcom (dbh 0xb98350, com 0x16a3a00, imp DBD::GoogleSpreadsheets::db): FLAGS 0x180195: COMSET Active Warn RaiseError PrintError PrintWarn PARENT DBI::dr=HASH(0xb9802c) KIDS 0 (0 Active) IMP_DATA HASH(0xb9838c) # Failed test '$sth defined' # at t/41listfields.t line 54. # Looks like you planned 25 tests but ran 5. # Looks like you failed 4 tests of 5 run. # Looks like your test exited with 255 just after 5. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 24/25 subtests Test Summary Report ------------------- t/41listfields (Wstat: 65280 Tests: 5 Failed: 4) Failed tests: 2-5 Non-zero exit status: 255 Parse errors: Bad plan. You planned 25 tests but ran 5. Files=1, Tests=5, 7 wallclock secs ( 0.04 usr 0.01 sys + 0.90 cusr 0.10 csys = 1.05 CPU) Result: FAIL </pre> </div> memo http://journal.soffritto.org/entry/302 http://journal.soffritto.org/entry/302 Sun, 04 Jan 2009 07:00:57 -0000 <div class="section"> <pre> $VAR1 = bless( { 'NUM_OF_FIELDS' => 2, 'asterisked_columns' => 1, 'original_string' => 'select * from test', 'org_table_names' => [ 'test' ], 'already_prepared' => { 'select * from test' => 1 }, 'set_function' => undef, 'NUM_OF_ROWS' => 2, 'PrintError' => 1, 'alpha_compare' => 1, 'tables' => [ bless( { 'name' => 'TEST' }, 'SQL::Statement::Table' ) ], 'table_names' => [ 'TEST' ], 'opts' => { 'function_defs' => {} }, 'limit_clause' => {}, 'command' => 'SELECT', 'table_alias' => {}, 'NAME' => [ 'id', 'name' ], 'text_numbers' => 1, 'computed_column' => {}, 'ORG_NAME' => { 'ID' => 'id', 'NAME' => 'name' }, 'table_func' => {}, 'data' => [ [ '1', 'Nobuo Danjou' ], [ '2', 'test value 2' ] ], 'column_names' => [ '*' ], 'params' => [], 'col_obj' => {}, 'all_cols' => [ '*', 'TEST.ID', 'TEST.NAME' ], 'org_col_names' => [ undef ], 'columns' => [ bless( { 'table' => 'TEST', 'name' => 'ID' }, 'SQL::Statement::Column' ), bless( { 'table' => 'TEST', 'name' => 'NAME' }, 'SQL::Statement::Column' ) ] }, 'DBD::GoogleSpreadsheets::Statement' ); </pre> </div> と思ったら http://journal.soffritto.org/entry/301 http://journal.soffritto.org/entry/301 Fri, 02 Jan 2009 12:50:30 -0000 <div class="section"> <p>さっき計ったら50.0kgだった。日で2キロくらいは上下するわなぁ。にしてもひどい。</p> </div> ものすごい太ってた http://journal.soffritto.org/entry/300 http://journal.soffritto.org/entry/300 Thu, 01 Jan 2009 14:58:06 -0000 <div class="section"> <p>51.8kgとな!最近全然ジョギングしとらんしのう。あ、目標に追加。ジョギング再開とジョギングし続けられる余裕を持つこと、など。</p> </div> ことしの目標 http://journal.soffritto.org/entry/299 http://journal.soffritto.org/entry/299 Thu, 01 Jan 2009 14:40:07 -0000 <div class="section"> <p>やっぱ書いとこう。</p> <ul> <li> 自己中心的に</li> <li> 自分のペースで着実に</li> <li> 安請け合いしない。 <ul> <li> 受けるものの理由を常に考える</li> <li> 最後まで行けそう(興味が持続しそう)なものに注力する</li> <li> 作りかけで放り出さない。最後まで作る。</li> <li> 撤退戦略</li> </ul> </li> <li> 既存案件の精度を高める</li> <li> 自ら機会を創り出し、機会によって自らを変えよ</li> </ul> </div>