Skip to content

Instantly share code, notes, and snippets.

Debian8 - mysql-5.5.52-0+deb8u1

Configured
with:
../src/configure
-v
--with-pkgversion=Debian 4.9.2-10
--with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs
--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++
@ichirin2501
ichirin2501 / yapcasia2015.pl
Created August 22, 2015 02:36
yapcasia2015.pl
#!/usr/bin/env perl
$_ = 'Drink coffee! Supported by Six Apart';
tr/a-z/Blogging after this event!/;
tr/N-ZA-z/A-za-m/;
@m = split //, $_;
$j = sub { join(chr(0), @_) };
$_ = chr(104) . $j->(@m[10, 11]) . pack("H*", join('', qw/70 3a 2f 2f/));
$_ .= $m[4] . chr(46) . $m[4] . '<3';
@ichirin2501
ichirin2501 / PE48.pl
Created September 8, 2012 03:29
Project Euler 48
#!/usr/bin/perl
use warnings;
use strict;
use bigint;
use List::Util qw/sum/;
my $mod = 10**10;
sub binmod{
@ichirin2501
ichirin2501 / PE34.pl
Created August 25, 2012 04:51
Project Euler 34
#!/usr/bin/perl
use warnings;
use strict;
use List::Util qw/sum/;
sub fact{
my $n = shift;
return 1 if $n == 0;
return $n * &fact($n - 1);
@ichirin2501
ichirin2501 / PE32.pl
Created August 23, 2012 13:36
Project Euler 32
#!/usr/bin/perl
use warnings;
use strict;
use List::Util qw/sum/;
my %S = ();
for(my $i=1000; $i<=9999; $i++){
for(my $j=1; $j*$j<=$i; $j++){
if( $i % $j == 0 ){
@ichirin2501
ichirin2501 / PE31.pl
Created August 22, 2012 02:30
Project Euler 31
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
sub calc{
my $L = shift;
my @coin = $#_ == 0 ? @{$_[0]} : @_;
@ichirin2501
ichirin2501 / PE30.pl
Created August 21, 2012 05:18
Project Euler 30
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use List::Util qw/sum/;
# (9^5) + (9^5) + (9^5) + (9^5) + (9^5) + (9^5) = 354294
my @res = grep{ my $t = $_; $t == sum map{$_ ** 5} split(//,$t) } 2..354294;
print sum @res;
@ichirin2501
ichirin2501 / PE29.pl
Created August 20, 2012 04:45
Project Euler 29
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use bigint;
use List::MoreUtils qw/uniq/;
my ($a, $b) = (100, 100);
my @res = uniq map{ my $t = $_; map{ $t ** $_ } 2..$b } 2..$a;
@ichirin2501
ichirin2501 / PE28.pl
Created August 19, 2012 04:05
Project Euler 28
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use List::Util qw/sum/;
my $i;
my $res = 0;
for($i=1; $i<=999; $i+=2){
@ichirin2501
ichirin2501 / PE27.pl
Created August 18, 2012 06:40
Project Euler 27
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
sub is_prime{
my $n = shift;
return 0 if $n < 2;