Skip to content

Instantly share code, notes, and snippets.

View nekokak's full-sized avatar

Atsushi Kobayashi nekokak

View GitHub Profile
21:55:12 >#soozy@freenode:nekokak< https://github.com/lestrrat/Text-MeCab/blob/master/lib/Text/MeCab/Dict.pm#L130
21:55:13 >#soozy@freenode:nekokak< なんですけど
21:55:31 >#soozy@freenode:nekokak< なんでerrorのときだけchdirでもとのdirにもどってるですか?
21:55:39 >#soozy@freenode:nekokak< エラー関係なくもどっていいとおもうんですが
21:57:33 >#soozy@freenode:nekokak< rebuildしたあとdirが元々のばしょとかわってしまってるので
21:57:39 >#soozy@freenode:nekokak< その後のコードの実行に影響がありますた
21:58:36 <#soozy@freenode:gfx__> Cwd::Guardno
21:58:41 <#soozy@freenode:gfx__> 出番!
21:58:53 >#soozy@freenode:nekokak< すねー
22:59:20 <#soozy@freenode:lestrrat> 適当に書き殴ったコードだから多分意図はない
#! /usr/bin/perl
use strict;
use warnings;
use Benchmark qw/cmpthese/;
cmpthese(500000, {
use Teng::Connector;
my $conn = Teng::Connector->new($connect_info);
my $schema = Tegn::Schema::Loader->load($conn);
my $teng = Teng->new($conn);
+----+--------------+------------------+------+---------------+------+---------+------+-------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+--------------+------------------+------+---------------+------+---------+------+-------+-------------+
| 1 | PRIMARY | foo | ALL | NULL | NULL | NULL | NULL | 39611 | Using where |
| 2 | UNION | foo | ALL | NULL | NULL | NULL | NULL | 39611 | Using where |
| 3 | UNION | foo | ALL | NULL | NULL | NULL | NULL | 39611 | Using where |
| 4 | UNION | foo | ALL | NULL | NULL | NULL | NULL | 39611 | Using where |
| 5 | UNION | foo | ALL | NULL | NULL | NULL | NULL | 39611 | Using where |
| NULL | UNION RESULT | <union1,2,3,4,5> | ALL | NULL | NULL | NULL | NULL | NULL | |
+----+--------------+-----
CREATE TABLE foo (
id int(10) unsigned NOT NULL auto_increment,
name1 varchar(255) NOT NULL default '',
name2 varchar(255) NOT NULL default '',
PRIMARY KEY (id)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into foo (name1, name2) values ('nekokak', 'kobayashi');
insert into foo (name1, name2) values ('koba04', 'kobayashi');
insert into foo (name1, name2) values ('tokuhirom','matsuno');
#! perl
use strict;
use warnings;
package Hoge;
sub new { bless {}, +shift}
sub DESTROY {
my @caller = caller();
use Data::Dumper;
warn Dumper \@caller;
#! perl
use strict;
use warnings;
package Hoge;
sub new { bless {}, +shift}
sub DESTROY {
my @caller = caller();
use Data::Dumper;
warn Dumper \@caller;
#! perl
use strict;
use warnings;
package Hoge;
sub new { my $self = bless {}, +shift; warn $self; $self;}
sub DESTROY {
my $self = shift;
warn $self;
my @caller = caller;
#! perl
use strict;
use warnings;
package Hoge;
sub new { bless {}, +shift }
sub DESTROY {
my $self = shift;
warn $self;
my @caller = caller;
#! perl
use strict;
use warnings;
package Hoge;
sub new { bless {}, +shift }
sub DESTROY {
my @caller = caller;
use Data::Dumper;
warn Dumper \@caller;