Skip to content

Instantly share code, notes, and snippets.

@notbenh
notbenh / springer-free-maths-books.md
Created December 30, 2015 23:36 — forked from bishboria/springer-free-maths-books.md
Springer made a bunch of books available for free, these were the direct links
@notbenh
notbenh / bench_map.t
Created June 4, 2015 18:46
checking to see if a single map is any faster than multiple with a grep? how does that compare with a foreach?
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use Benchmark qw{:all};
my @input = 1..9999;
sub map_and_grep { map{$_ * 2} grep{ m/9/ } map{$_ / 2} @_ };
@notbenh
notbenh / item_qty.t
Created June 4, 2015 14:50
a few ideas on how to replicate items based on two arrayrefs
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
=head1 GOAL
Given two 'matched' arrayrefs :
my $items = ['a','b'];
@notbenh
notbenh / bundle_pid.t
Created May 19, 2015 01:16
How to group possible bundles when given only part_ids
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
my $bundle = {
A => [qw{box widget1}],
B => [qw{box widget1 widget2}],
C => [qw{box widget1 widget3}],
D => [qw{box widget1 widget2 widget3}]
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use Test::Differences;
use List::MoreUtils qw{uniq};
sub pp {
my %lookup;
my $i;
@notbenh
notbenh / output.txt
Created September 9, 2014 22:59
output
Length Count
1 17
2 267
3 267
4 169
5 140
6 112
7 99
8 68
9 61
@notbenh
notbenh / output.txt
Created September 8, 2014 14:18
final output
Length Count
1 17
2 267
3 267
4 169
5 140
6 112
7 99
8 68
9 61
@notbenh
notbenh / output
Created August 12, 2014 00:30
output from script
1 16
2 267
3 267
4 170
5 140
6 112
7 100
8 68
9 61
10 56
@notbenh
notbenh / output.txt
Created August 6, 2014 17:34
output from script
1 16
2 267
3 267
4 170
5 140
6 112
7 100
8 68
9 61
10 56
@notbenh
notbenh / output final
Created July 30, 2014 15:20
output final
1 16
2 267
3 267
4 170
5 140
6 112
7 100
8 68
9 61
10 56