ようこそ YAPC::Asia 2009 は 2009/09/10-11に 東京工業大学大岡山キャンパス (東京都目黒区) で Japan Perl Association主催で 開催されます。 特別研修が受けられます!Moose入門、DBIx::ClassとMySQLによるスケーリング術、そしてPerl/Unicode/Ajaxについて、あの小飼弾氏を含む最強の講師達から学べる! 今回が初めてのYAPCへの参加の場合はこちらから参加者登録することができます。もしYAPC::Asia Tokyo 2008を含む他のYAPCにAct経由でログインした事がある場合は、前回と同じID/パスワードを使用してログインしてください。 YAPC::Asia Tokyo 2009の写真をficia.comにアップしました。ficia.comを運営するetolabo.comは今回YAPCスピーカーのうち3人
2008年04月09日01:00 カテゴリLightweight Languages perl - Encode 入門 すでにOSCONでもYAPCでも、あちこちそちこちでこの基本方針に関しては話したのですが、ここ 404 Blog Not Found でも改めて。 Perl で utf8 化けしたときにどうしたらいいか - TokuLog 改め だまってコードを書けよハゲ 入り口で decode して、内部ではすべて flagged utf8 で扱い、出口で encode する。これがすべてです!とにかくこの基本方針をまもっていれば幸せになれます。ここでは、EUC-JPでエンコードされたファイル中の「小飼弾」「こがいだん」「コガイダン」「Kogai Dan」を正規表現で書き換えて標準出力にEUC-JPで出力するプログラムを例にとって説明します。 decode() then encode(
Imager::ExifOrientation - Exifの情報を元にして画像を回転するよ 全国的にみんな真面目だな〜。勉強会の目的なんてないよ。楽しいからやっている。それで何が悪いのかな?の実況中継、その勉強会への 参加そのものについてちょっと考えなおした方がいいかもしれない。 Imager::ExifOrientationをCPANにうpりました。 Exif の Orientation というパラメータを元にして回転済みのImagerオブジェクトを返します。 一緒に Imager::Filter::ExifOrientation もバンドルしてるので、filterとしても利用出来ます。 Orientationは何かと言うと、カメラに縦方向センサーが入ってる機種で、画像に対してカメラの上方向はどちらかというような情報が入っている所です。 わかり易い説明は500で見れないのでgoogle
「ウェブリブログ」は 2023年1月31日 をもちましてサービス提供を終了いたしました。 2004年3月のサービス開始より19年近くもの間、沢山の皆さまにご愛用いただきましたことを心よりお礼申し上げます。今後とも、BIGLOBEをご愛顧賜りますよう、よろしくお願い申し上げます。 ※引っ越し先ブログへのリダイレクトサービスは2024年1月31日で終了いたしました。 BIGLOBEのサービス一覧
日頃より楽天のサービスをご利用いただきましてありがとうございます。 サービスをご利用いただいておりますところ大変申し訳ございませんが、現在、緊急メンテナンスを行わせていただいております。 お客様には、緊急のメンテナンスにより、ご迷惑をおかけしており、誠に申し訳ございません。 メンテナンスが終了次第、サービスを復旧いたしますので、 今しばらくお待ちいただけますよう、お願い申し上げます。
perldoc コマンドでドキュメントを参照するとき、標準ではページャーがmore に指定されており、何かと不便を感じる。 例) perldoc -m Plagger less にしたい! こういうときは、環境変数PERLDOC_PAGER を指定してあげればいいようです。 例)sh,bash,zsh の場合 export PERLDOC_PAGER=less また、perldoc perldoc で"便利(useful)"と紹介されている次の設定もいいと思います。 export PERLDOC_PAGER='less -+C -E' less のオプションの意味は次の通り。 オプション 効果 -+C 表示する前に画面の表示をクリアーする -E 表示がファイル末尾に到達したとき、自動的にページャーを終了する ※-C ではなく、-+C と書いてあることについてその意味がよく分かっていない…
書いた。 use strict; use warnings; use lib qw/lib/; use GNTP::Growl; my $growl = GNTP::Growl->new(AppName => "my perl app"); $growl->register([ { Name => "foo", }, { Name => "bar", }, ]); $growl->notify( Event => "foo", Title => "おうっふー おうっふー", Message => "大事な事なので\n2回言いました", Icon => "http://mattn.kaoriya.net/images/logo.png", ); こんなソースで こんな物が動く。 開発はこの辺で... mattn's perl-gntp-growl at master - GitHub
iCalendar 形式経由でスケジュールを社内 blog に表示 仕事用に Skype 名を作成し、ついでに社内 blog に Skype ボタンを貼りつけてログイン状態を表示できるようにしてみた。 そういえば電話もそうなんだけれど、本社に連絡を取るとき「もしかして会議中?」などと勘繰ってかけるかどうか迷ってしまうことがある。 かけたい人の予定がわかればいいのになと。 ならば逆もしかりだろうということで、自分の仕事のスケジュールを晒してみようと思いついた。 グループウェアとかそういうのは大袈裟なので、まずは社内 blog のサイドバーに表示するようにしたい。 ということでこの3連休に実装してみた。 構成 入力 完全なスケジュールはほぼ日手帳に手書きで管理しているので、ミーティング・外出など晒しカテゴリのイベントだけを、電子化する必要がある。 手で HTML 毎回ごりごり書き直すのも嫌なの
Algorithm::RabinKarp でソースコード中の重複を発見 blog.bulknews.net で紹介されていた、Algorithm::RabinKarp Perl モジュールを試してみた。 ハッシュを使って文字列検索を行う Rabin-Karp アルコリズムを実装しているモジュールで、モジュールをインストールすると rabin.pl というスクリプトが一緒にインストールされる。 これを使うと例えば rabin.pl '*.pm' lib > rabin.txt で lib ディレクトリ内の *.pm ファイル全てのなかで重複する部分を発見してくれる(内部的には File::Find::Rule を使ってファイルを処理している)。 リファクタリング対象になりそうなところを探すのに便利そうだ。 実際使ってみると重複個所がいろいろ発見できて面白い。 ただ、 文字単位で、行の途中から
Perlで条件に合うよう,ソートするプログラムを教えてください. 1行目を比較して,重複する配列で且つ添え字の若いもの(@array = <DATA>)を削除します. 以下結果です Z 100 10 10 SC 200 5 9 SA 200 70 5 CC 100 100 9 BB 300 50 2 AA 100 70 5 c 5 0 0 9 上記の結果を元に,2行目の数字を比較して,降順にソートします. BB 300 50 2 SC 200 5 9 SA 200 70 5 Z 100 10 10 CC 100 10 9 AA 100 70 5 c 5 0 0 9 上記の結果を元に,2行目が,同一の場合のペアのみを選び出して,3行目の数字を比較して,2行目の並びは崩さず降順にソートします. BB 300 50 2 SA 200 70 5 SC 200 5 9 AA 100 70 5 CC
Chapter1の後半戦は、Test::More。 Perl Testing: A Developer's Notebook (Developers Notebook) Test::MoreはTest::Simpleのスーパーセットで完全に置き換えて使ってOK、モジュールをただしく読み込めたかどうかなどのテスト関数も含めいろんな機能あるでよ、とのことです。 早速。 package AnalyzeSentence; use strict; use warnings; use base qw/Exporter/; our $WORD_SEPARATOR = qr/\s+/; our @EXPORT_OK = qw($WORD_SEPARATOR count_words words); sub words { my $sentence = shift; return split $WORD_SE
for文と言えば、 for(my $i=0, $i<@hoge.length; $i++){ #何かの処理 } を想像されるかもしれませんが、foreach文のeachを省略しても perlは、foreach文だなっと解釈して処理してくれます。 つまり省略せずにきちんと書くと foreach my $value ( 1..$winfo{'LIMIT'} ) { my ( $wkey ) = sprintf( "%03d",$value ); $wnum{ $wkey } = sprintf( "%s名",$value ); } のようになり上記の場合 (1..$winfo{'LIMIT'})の1個1個の要素が $valueに格納されて処理がループされるところが my $valueの部分を省略すると暗黙的に$_に格納されることを利用して foreach ( 1..$winfo{'LIMIT'
良くあるDBICのサンプルではDBIx::Class::Schema::load_classes()を使ってクラスのロードを行っています。 CD.pm package CD; use strict; use warnings; use base 'DBIx::Class::Schema'; __PACKAGE__->load_classes; 1; load_classes()はクラスを指定しないと CD Album Track という構成において自動的にクラスをロードすることができます。 ここでResultSetの拡張をしたいと考えます。例えば CD/ResultSet/Album.pm package CD::ResultSet::Album; use strict; use warnings; use base 'DBIx::Class::ResultSet'; sub search
If my thesis is correct -- that much of the work done on the Perl language, the Perl culture, and its ecosystem including CPAN in the past ten years has made the language easier to use and Perl programs more maintainable -- then Perl fans have a lot of work to do to overcome the weight of bad code and creaky tutorials found in the wild. Browse PerlMonks for ten minutes, and you'll see that many pe
Memcachedに大量のJSONを保存していたのですが.Memcachedサーバの容量を超えてしまい,データ容量の削減が必要になってしまいました.いろいろ調べているうちに,クライアントとして使っているCache::Memcached::Fastに圧縮オプションがあることを発見したので,試してみました.デフォルトではオフになっているのですが,newする際にcompress_thresholdを設定することで有効になります. Cache::Memcached::Fast->new( my $memcached_comp = Cache::Memcached::Fast->new({( servers => [qw/localhost:11211/], compress_threshold => 500, compress_ratio => 0.9, )}); この設定の便利な点は,圧縮オプシ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く