• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
全裸でワンライナー(仮)
 

全裸でワンライナー(仮)

on

  • 2,383 views

Yokohama.pm 出張版 in YAPC::Asia 2009 前夜祭で喋ったLightningTalksの資料です。

Yokohama.pm 出張版 in YAPC::Asia 2009 前夜祭で喋ったLightningTalksの資料です。
http://yokohama.pm.org/2009/08/yokohamapm-in-yapcasia-2009-1.html

Statistics

Views

Total Views
2,383
Views on SlideShare
2,286
Embed Views
97

Actions

Likes
2
Downloads
4
Comments
0

4 Embeds 97

http://d.hatena.ne.jp 94
http://reader.freerss.net 1
http://www.slideshare.net 1
http://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

全裸でワンライナー(仮) 全裸でワンライナー(仮) Presentation Transcript

  • my $profile = { name => ' ', id => 'sugyan', age => 26, };
  • perl -le 'print "Hello"'
  • perl -e'print$b,($a/=$b)- 1?"*":$/while$b=(grep{not $a%$_}1..($a||=pop))[1]' 60 2*2*3*5
  • perl -le'$x=2**pop;print$ "x--$x,map$x&$_?$"x2:"/ ",0..$y++while$x' 2 / // / / ////
  • for i in $(echo 0{0..9}{0 ..5}{0..9} {10..23}{0..5} {0..9}); do wget -w5 --ra ndom-wait http://*******/ $i.jpg; done
  • perl -MText::MeCab -MNet::Twitter -MEncode=encode_utf8 -e ' my $t = '''Net::Twitter'''->new('''username''', ''sugy an''', '''password''', '''******''');my $statuses = $t ->friends_timeline;my $status = $$statuses[rand @$statuses] ;my $text = encode_utf8($$status{'''text'''});my $user = $$status{'''user'''}{'''screen_name'''};$text =~ s/ [^ s]+ /z($&);/egmsx;$t->update("@$user 343201214350250 200343201243343201237: $text");sub z {my $text = shif t @_;my $zenra = "345205250350243270343201247";my $mecab = '''Text::MeCab'''->new;my $n = $mecab->parse($te xt);my $output = '''''';$n = $n->next while $n->next;my $ flg = 0;while (($n = $n->prev)->prev) {if ($flg) {my $inser t = 1;if ($n->feature =~ / A (345220215350251236|34 5211257350251236|345213225350251236) /msx) {$ins ert = 0;}elsif ($n->feature =~ / A 345212251(3452132 25)?350251236 /msx and (split(/,/, $n->prev->feature, 0) )[5] =~ / 351200243347224250 /msx) {$insert = 0;}if ( $insert) {$output = $zenra . $output;$flg = 0;}}$output = $ n->surface . $output;if ($n->feature =~ / A 3452132253 50251236 /msx) {$flg = 1;}}if ($flg) {$output = $zenra . $output;}return $output;}'
  • hoge.pl #!/usr/bin/perl use List::Util 'max'; my @a = (4, 2, 3); print max(@a), "n";
  • % perl -MAcme::OneLiner hoge.pl
  • % perl -MAcme::OneLiner hoge.pl perl -e 'use List::Util ('''max' ''); my(@a) = (4, 2, 3);print ma x(@a), "n";'
  • % perl -MAcme::OneLiner hoge.pl
  • % perl -MAcme::OneLiner hoge.pl perl -e 'use List::Util ('''max'''); my(@a) = (4, 2, 3); print max(@a), "n ";'
  • % perl -MAcme::OneLiner hoge.pl perl -e 'use List::Util ('''max'''); my(@a) = (4, 2, 3); print max(@a), "n ";' % perl -MAcme::OneLiner=short hoge.pl
  • % perl -MAcme::OneLiner hoge.pl perl -e 'use List::Util ('''max'''); my(@a) = (4, 2, 3); print max(@a), "n ";' % perl -MAcme::OneLiner=short hoge.pl perl -MList::Util=max -e 'my(@a) = (4, 2, 3);print max(@a), "n";'
  • % perl -MAcme::OneLiner hoge.pl
  • % perl -MAcme::OneLiner hoge.pl perl -e 'use List::Util ('''max'''); m y(@a) = (4, 2, 3); print max(@a), "n";'
  • % perl -MAcme::OneLiner hoge.pl perl -e 'use List::Util ('''max'''); m y(@a) = (4, 2, 3); print max(@a), "n";' % perl -MAcme::OneLiner=symbol hoge.pl
  • % perl -MAcme::OneLiner hoge.pl perl -e 'use List::Util ('''max'''); m y(@a) = (4, 2, 3); print max(@a), "n";' % perl -MAcme::OneLiner=symbol hoge.pl perl -e '""!~("(?{".("!(==>+/#[#%~/<&*=- ,{<+-%,+#`;,|-.:#>/<>{;]>#{&?{}%}!{{]>?< #/_,#;"^"|}}`/|`}:&_&;{=_;<-+%>-~|{.]{?` *#>>?%-,&%_(-%/~<&,:;.{#|+?-./<<>"^"(&%} ]><*[?/,}+;]!|`(><;{=)%}!:<:-,)-*#>}-+-. .{()/)*{-(>#=/.#,~=>")."})")'
  • To install this module, ... perl Makefile.PL make make test make install To install with Module::Build, ... perl Build.PL ./Build ./Build test ./Build install
  • To install this module, ... perl -MExtUtils::MakeMaker -Mwarnings make make test make install To install with Module::Build, ... perl -MModule::Build -Mwarnings -Mstr ./Build ./Build test ./Build install
  • -Mstrict=refs -e 'WriteMakefile(q/NAME/, ict=refs -e 'my $builder = q/Module::Build
  • q/Acme::OneLiner/, q/AUTHOR/, q/Yoshihiro /->new(q/module_name/, q/Acme::OneLiner/,
  • Sugi <sugi1982@gmail.com>/, q/VERSION_FROM q/license/, q/perl/, q/dist_author/, q/Yos
  • /, q/lib/Acme/OneLiner.pm/, q/ABSTRACT_F hihiro Sugi <sugi1982@gmail.com>/, q/dist_
  • ROM/, q/lib/Acme/OneLiner.pm/, q/PL_FILE version_from/, q/lib/Acme/OneLiner.pm/,
  • S/, {}, q/PREREQ_PM/, {q/Test::More/, 0, q q/requires/, {q/Test::More/, 0, q/version/
  • /version/, 0, q/IO::CaptureOutput/, 0}, q/ , 0, q/IO::CaptureOutput/, 0}, q/add_to_cl
  • dist/, {q/COMPRESS/, q/gzip -9f/, q/SUFFIX eanup/, [q/Acme-OneLiner-*/]); $builder->c
  • /, q/gz/}, q/clean/, {q/FILES/, q/Acme-One reate_build_script;'
  • Liner-*/});'
  • To install this module, ... perl -MExtUtils::MakeMaker -Mwarni... make make test make install To install with Module::Build, ... perl -MModule::Build -Mwarnings -M... ./Build ./Build test ./Build install