This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.evanmiller.org/how-not-to-sort-by-average-rating.html | |
sub ci_lower_bound ( $postive_ratings, $total_ratings, $confidence = 0.95 ) { | |
return 0 if $total_ratings == 0; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/Users/brian/bin/perls/perl-latest | |
use v5.26; | |
use utf8; | |
use strict; | |
use warnings; | |
use Mojo::File; | |
package Mojo::File::Role::parent { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/Users/brian/bin/perls/perl-latest | |
use v5.26; | |
use utf8; | |
use strict; | |
use warnings; | |
use Mojo::File qw(path); | |
use Mojo::UserAgent; | |
use Mojo::Util qw(dumper); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/Users/brian/bin/perls/perl-latest | |
use v5.28; | |
use utf8; | |
use strict; | |
use warnings; | |
use feature qw(signatures); | |
no warnings qw(experimental::signatures); | |
# non-blocking stream reading of a slow standard input | |
# perl -pe '$|++; sleep 1' /etc/hosts | perl-latest read_slowly.pl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/Users/brian/bin/perls/perl-latest | |
use v5.28; | |
use Mojo::DOM; | |
use Mojo::UserAgent; | |
my $data = do { local $/; <DATA> }; | |
my $url = 'http://m.mlb.com/teams/'; | |
my $tx = Mojo::UserAgent->new->get( $url ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=pod | |
I'm experiencing an odd problem on macOS 10.13. I suspect it's | |
something to do with APFS (Encrypted). It looks like there's some | |
other magic when I try to rename a file to a name that already exists. | |
I could not reproduce this on FAT or HFS+ filesystems. | |
I've tried this with perls back to 5.12, all compiled with clang | |
(4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/Applications/Rakudo/bin/perl6 | |
use Test; | |
multi infix:<↑> ( Int:D \n, Int:D \m --> Int:D ) | |
is equiv(&infix:<**>) | |
is assoc<right> | |
{ n ** m } | |
proto infix:<↑↑> ( Int:D \n, Int:D \m --> Int:D ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
by brian d foy <[email protected]> | |
Klint Finley's article for <i>Wired<i>, <a href="https://www.wired.com/story/giving-open-source-projects-life-after-a-developers-death/">Giving Open-Source Projects Life After A Developer's Death</A>, discusses the trouble taking over Ruby projects when the lead developer dies. He interviewed Neil Bowers, one of the people who helps maintain the Comprehensive Perl Archive Network then mangles the information to make it seem like the Neil by himself sometimes finds volunteers to take over projects if he feels like it at the time. | |
But the PAUSE (Perl Authors Upload Server) admins do much more than that. We've had an official policy around it for years. I remember the first time we had to deal with this. Over a decade ago <a href="http://archive.oreilly.com/pub/post/perl_loses_contributor_and_col.html">Iain Truskett, an important Perl developer, passed away</a>. Andy Lester took it upon himself to act as a executor of the developer's CPAN packages. He didn't want to mai |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/Applications/Rakudo/bin/perl6 | |
my $ranks = ( 2, 3, 4, 5, 6, 7, 8, 9, 10, 'J', 'Q', 'K', 'A' ); | |
my $suits = < ♣ ♡ ♠ ♢ >; | |
( @$ranks X @$suits ) | |
==> map { [~] @$_ } \ | |
==> my @cards; | |
; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/Applications/Rakudo/bin/perl6 | |
# http://www.decisionsciencenews.com/2017/06/19/counterintuitive-problem-everyone-room-keeps-giving-dollars-random-others-youll-never-guess-happens-next/ | |
multi MAIN ( Int $players = 100, Int $dollars = 100, Int $max-rounds = 5000 ) { | |
my @array = { | |
wallet => $dollars, # the current money N has | |
received => 0, # the cumulative money received | |
'given' => 0, # the cumulative money given | |
} xx $players; | |
my &recipient = &donate-to.assuming( @array.elems ); |