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 IO::Unread 'unread'; | |
use Data::Dumper; | |
sub read_line_group { | |
my ($handle, $key_regex) = @_; | |
my $previous_key; | |
my @lines; |
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 List::Util qw/max/; | |
use Math::Trig qw/:pi deg2rad rad2deg/; | |
my $d = XML::LibXML->load_xml(location => 'wurdlist.xml'); | |
my $m = deg2rad( 3 ); |
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 LWP::UserAgent; | |
use HTML::FormatText; | |
die "Usage: $0 bookid > example.txt\n" unless @ARGV == 1; | |
my $book = shift @ARGV; | |
my %seen; |
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
sub run_lengths { | |
return unless @_ > 0; | |
my $prev = shift @_; | |
my @runs = [$prev, 1]; | |
for (@_) { | |
if ($_ eq $prev) { | |
$runs[-1]->[1]++; | |
next; | |
} | |
push @runs, [$_, 1]; |
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::Parser; | |
use PerlIO::via::gzip; | |
use feature 'say'; | |
use Archive::Zip; | |
use Image::Magick; | |
use Algorithm::Diff 'sdiff'; | |
use List::Util qw/min max first/; |
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); | |
}); |
OlderNewer