2006-04-01から1ヶ月間の記事一覧
http://tokyoenvious.xrea.jp/b/とこの日記の境界があいまいになってきた。こっちはもっとくだらんこと/メモにしよう。
遅! Perlも久しぶり。こんな感じでいいんかな。 package Plagger::Plugin::CustomFeed::HatenaDiaryReferer; use strict; use base qw( Plagger::Plugin ); use DateTime; use Encode; use HTML::TokeParser; use Plagger::UserAgent; use Plagger::Util qw…
Perlerになろっと。と思ってなんかのソース開いたら$foo->bar->bazの色がひどい(barまでしか色付かない)。あと矢印の色も消す。after/syntax/perl.vim if !exists("perl_no_extended_vars") syn clear perlMethod syn match perlMethod "\(->\)\I\i*"hs=s+2 …
昔Compile Errorの理由が分からなくて放置してたやつ。UVaのシステムが変わってて、Compile Errorが出たときはエラーメッセージをメールで送り付けてくれる。これ便利。
STLで文字列を逆順にするのってどうするんだろうなぁ。
小数点以下を2桁に揃えて出力するには、 #include <iostream> #include <iomanip> using namespace std; ... cout << setiosflags(ios::fixed) << setprecision(2) << x;とやる。</iomanip></iostream>
こんなコード書いてたんじゃ使いものにならないなぁと思いつつ。
http://unknownplace.org/memo/2006/04/20#e001 ?B, del.icio.usとのインテグレートGreasemonkey Scriptを誰かが作れば完璧
こんな感じかな。 (define (square x) (* x x)) (define (expmod base ex m) (cond ((= ex 0) 1) ((and (not (= base 1)) (not (= base (- m 1))) (= (remainder (square base) m) 1)) 0) ((even? ex) (remainder (square (expmod base (/ ex 2) m)) m)) (el…
# yum install perlしてもPerlのバージョンが上がらない。5.8.0だぞ。 http://www.perl.com/CPAN/src/stable.tar.gz % ./Configure長々と質問が続く。 % make depend % make % make test # make install
# yum install libxml
% perl -MCPAN -e shell Can't locate CPAN.pm in @INC... BEGIN failed--compilation aborted.ほうほう。 http://www.perl.com/CPAN/modules/by-module/CPAN/CPAN-1.87.tar.gz % perl Makefile.PL % make # make install % perl -MCPAN -e shell ...いろい…
del.icio.us/inbox/ma.la はsubscribeしてたのに del.icio.us/ma.la をsubscribeしてなかった。2ヶ月くらい。
Rubyで画像を扱うライブラリ。ImageMagickを使う。 参考: http://pub.cozmixng.org/~the-rwiki/rw-cgi.rb?cmd=view;name=RMagick ImageMagickのインストール http://www.imagemagick.org/script/install-source.php % ./configure --enable-shared % make # …
f $ x = f x これは map ($ 0) xs あるいは zipWith ($) fs xs など のような高階関数を使う場面でも有用である。 つまり Prelude> zipWith ($) [(1+),(2*),sqrt] [1,2,3] [2.0,4.0,1.7320508075688772]これは便利そう。