This file contains 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
#!perl -w | |
use strict; | |
use warnings; | |
use encoding 'utf-8'; | |
use MediaWiki::DumpFile::Pages; | |
use YAML::XS; | |
my $pages = MediaWiki::DumpFile::Pages | |
->new('dewiktionary-20120416-pages-meta-current.xml'); | |
This file contains 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
#!perl -w | |
use strict; | |
use warnings; | |
use XML::LibXML; | |
use XML::LibXSLT; | |
use autodie; | |
my ($html_path, $xslt_path) = @ARGV; | |
my $html_doc = XML::LibXML->load_html( location => $html_path, recover => 2, load_ext_dtd => 0 ); | |
my $xslt_doc = XML::LibXML->load_xml( location => $xslt_path ); |
This file contains 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
<?php | |
# | |
# Ad-hoc oblique service for ngram databases with compatible interface | |
# | |
header('Content-Type: text/plain;charset=UtF-8'); | |
if (@!isset($_REQUEST['q']) || @!isset($_REQUEST['nick'])) { | |
printf("I need a q! I need a nick! Sonst functioneren ik niet."); | |
exit(); |
This file contains 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
var ordered = [].sort.call([].slice.call(list, 0), function(a, b) { | |
return (a.p1 - b.p1) || (a.p2 - b.p2); | |
}); |
This file contains 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
#!perl -w | |
use Modern::Perl; | |
use Algorithm::Diff::XS; | |
use Statistics::Basic qw/median stddev avg/; | |
use Mail::Mbox::MessageParser; | |
use MIME::Parser; | |
use MIME::Parser::Reader; | |
use Mail::Field; | |
use Encode; | |
use HTML::Entities; |
This file contains 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
use v5.16; | |
use strict; | |
use warnings; | |
state $f = do { | |
open my $f, '>:utf8', 'delme.tmp'; | |
$f; | |
}; | |
print $f "" if 0; |
This file contains 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
package main; | |
use Modern::Perl; | |
use Coro::Generator; | |
my $even = generator { | |
my $x = 0; | |
while(1) { | |
$x += 2; | |
# use references as boxing mechanism | |
# yield non-reference to indicate end |
This file contains 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
package Acme::IEnumerable; | |
use v5.16; | |
use strict; | |
use warnings; | |
our $StopIteration = {}; | |
sub integers { | |
my ($class) = @_; | |
return bless sub { |
This file contains 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
package Acme::IEnumerable::List; | |
use Modern::Perl; | |
use base qw/Acme::IEnumerable/; | |
1; | |
package Acme::IEnumerable; | |
use Modern::Perl; | |
use Carp; |
This file contains 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
package Acme::IEnumerable::IGrouping; | |
use Modern::Perl; | |
use base qw/Acme::IEnumerable/; | |
1; | |
package Acme::IEnumerable::List; | |
use Modern::Perl; | |
use base qw/Acme::IEnumerable/; |