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
{ | |
"results" : [ | |
{ | |
"address_components" : [ | |
{ | |
"long_name" : "\u003ca href=http://localhost:20000/form/DataTool.view_region?submit=Send+to+RPC&3=t&3.1=-22.467512&3.1.=y&3.2=-42.655755&3.2.=y&3.3=2.500000&3.3.=y&3.4=0.000000&3.4.=y&3.5=0.071465&3.5.=y&3.6=-1.143429&3.6.=y&database=mapmaker_prod\u003eSV pose\u003c/a\u003e", | |
"short_name" : "\u003ca href=http://localhost:20000/form/DataTool.view_region?submit=Send+to+RPC&3=t&3.1=-22.467512&3.1.=y&3.2=-42.655755&3.2.=y&3.3=2.500000&3.3.=y&3.4=0.000000&3.4.=y&3.5=0.071465&3.5.=y&3.6=-1.143429&3.6.=y&database=mapmaker_prod\u003eSV pose\u003c/a\u003e", | |
"types" : [ "route" ] | |
}, | |
{ |
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 URI; | |
use JSON; | |
use YAML::XS; | |
my $uri = URI->new('http://translate.google.com/translate_a/t'); |
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
my $url = URI->new('http://books.google.com/ngrams/graph'); | |
$url->query_form( | |
year_start => 1800, | |
year_end => 2000, | |
corpus => $corpus, | |
smoothing => 30, | |
content => encode_utf8($q), | |
); |
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 httpProxy = require('http-proxy'); | |
var http = require('http'); | |
var fs = require('fs'); | |
var proxy = httpProxy.createProxyServer({ | |
target:'http://localhost:9005' | |
}); | |
proxy.listen(8005); |
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]; |
OlderNewer