- or download this
+-+-+-+-+
|?| | | | first step: place a photo in the "?" cell
...
+---+/+-+ ***
|///|/|?|
+---+-+-+ first photo that fits is the 1x1
- or download this
+---+-+-+
|///|/|/|
...
+---+-+-+
|///|/|/|
+---+-+-+
- or download this
{
my %seen;
...
}
}
- or download this
<table border=1>
<tr><td></td><th>PM Markup:</th><th>Result:</th></tr>
...
</td></tr>
</table>
- or download this
# input:
# - env = mapping of variable names to types
...
return ( resulttype, constr1 + constr2
+ "type1==FuncType(type2,resulttype)
+" );
- or download this
# unify a list of constraints:
# - input = list of constraints of the form "lhs==rhs"
...
## FuncType, or other such impossible feats
else
croak "unification impossible!";
- or download this
## two containers that have the same value
my $x = 1;
...
$x = 5; ## change the value in one container ...
print $y; ## the other container is unaffected
- or download this
my $x = 1;
my $y = \$x; ## $y is a reference to $x
$x = 5;
print $$y;
- or download this
my $x = 0;
sub { $_[0] = 5 }->($x);
print "$x\n";
- or download this
my $x = 0;
my $y = sub { $_[0] }->($x); ## my $y = .. assignment operator
$y = 5;
print "$x\n"; ## still 0
- or download this
my $x = 0;
my $arr = sub { \@_ }->($x);
$arr->[0] = 5;
print "$x\n"; # 5
- or download this
my $arr = do {
my $x;
...
$arr->[0] = 5;
print "@$arr\n"; ## 5 5
- or download this
my $x = 0;
map { $_ = 5 } $x;
...
my $x = 0;
grep { $_ = 5 } $x;
print "$x\n";
- or download this
my $x = 0;
foreach my $y ($x) { $y = 5 }
print "$x\n";
- or download this
my $x = 0;
*y = \$x;
$y = 5;
print "$x\n";
- or download this
my @x = qw(1 2 3 4);
*y = \@x;
splice @y, 2, 1, "hi";
print "@x\n";
- or download this
use Lexical::Alias;
...
$y = 5;
print "$x\n";
- or download this
my $x = 0;
...
}
print "$x\n";
- or download this
x + (x+b) + ... + (x+(n-1)b) = k
nx + b(1 + 2 + .. + (n-1)) = k
nx + b(n(n-1)/2) = k
- or download this
bn^2 + (2x-b)n - 2k = 0
- or download this
my $p = UnorderedSetPartition->new(
items => ['a'..'f'],
...
## code repetition here?
$how_many_partitions = $p->count;
- or download this
sub binomial {
my ($n, $k) = @_;
...
}
$c;
}
- or download this
use Memoize;
memoize 'int_partitions';
...
}
print int_partitions(shift), $/;
- or download this
use Memoize;
memoize 'restricted_partitions';
...
}
print restricted_partitions(@ARGV), $/;
- or download this
--- mysqlPP.pm.orig 2005-02-16 23:40:15.000000000 -0600
+++ mysqlPP.pm 2005-02-16 23:41:17.000000000 -0600
...
}
my $mysql = $sth->FETCH('mysqlpp_handle');
my $result = eval {
- or download this
$sth = $dbh->prepare("select * from foo where id=?");
$sth->execute( param("id") );
## execute failed: called with 0 bind variables when 1 are needed
- or download this
# use CGI 'param'; ## not anymore!
use CGI; sub param { scalar CGI::param(@_) }
- or download this
"Robert "Bob" Smith","42","FooBar"
- or download this
use Text::xSV;
...
}
my $csv = Text::xSV->new( filename => "...", filter => \&filter );
- or download this
--- xSV-old.pm 2004-05-26 20:13:12.000000000 -0500
+++ xSV.pm 2004-05-26 20:32:48.000000000 -0500
...
);
foreach my $accessor (@normal_accessors) {
no strict 'refs';