http://yapcasia.org/2014/talk/list
あとで引っ越し予定なので、スタッフ以外はブクマするべからず
- One layer down below. (20 分)
- Kang-min Liu [レギュラー] [その他] [英語]
http://yapcasia.org/2014/talk/list
あとで引っ越し予定なので、スタッフ以外はブクマするべからず
#!/usr/bin/env perl | |
use 5.10.0; | |
use strict; | |
use warnings; | |
use utf8; | |
use Test::More; | |
sub merge { | |
my ($a, $b) = @_; |
use strict; | |
use warnings; | |
use utf8; | |
use Benchmark qw/:hireswallclock/; | |
my $x = 20141024; | |
my $b = timeit(10000000, sub { $x ** 2 }); # => isa 'Benchmark' | |
print timestr($b); |
use strict; | |
use warnings; | |
use utf8; | |
use Test::More; | |
{ | |
no strict qw/refs/; | |
*{'world!'} = sub { 'world' }; | |
is *{'world!'}{CODE}->(), 'world', 'symbol table call'; |
use strict; | |
use warnings; | |
use utf8; | |
use feature qw/say/; | |
my $dog = bless {}, 'Dog'; | |
if (can $dog 'bow') { | |
say 'can bow'; | |
} |
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
use DBIx::Sunny; | |
app->attr(dbh => sub { DBIx::Sunny->connect('dbi:mysql:dbname=bbs', 'root','') }); | |
get '/' => sub { | |
my $c = shift; | |
my $entries = app->dbh->select_all('SELECT * FROM entry'); |
use strict; | |
use warnings; | |
use utf8; | |
use Amon2::Lite; | |
use Cache::Memcached::Fast; | |
use Plack::Session::Store::Cache; | |
get '/' => sub { | |
my $c = shift; |
use strict; | |
use warnings; | |
# XXX 素数定理の int ($N*log($N) + $N*log(log($N)) + 1) で抑えて計算したいけど、 | |
# この近似値だとゆるすぎたので、10000番目の素数を決め打ちで、、。 | |
my $max = 104729; | |
# 問題文で与えられているものは事前準備 | |
my $res = 28; # 5番目までの素数の和 | |
my @composites = (); |
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=320,height=device-height,user-scalable=0"> | |
<script type="text/javascript"> | |
window.onload = function(){ | |
draw(); | |
} | |
function draw() { |
<!doctype html> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<img id="hoge" /> | |
<script> | |
var img = new Image(); |