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
| use Encode; | |
| use Encode::DoubleEncodedUTF8; | |
| my $dodgy_utf8 = "Some byte strings from the web/DB with double-encoded UTF-8 bytes"; | |
| my $fixed = decode("utf-8-de", $dodgy_utf8); # Fix it |
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
| for i in {0..255} ; do | |
| printf "\x1b[38;5;${i}mcolour${i}\n" | |
| done |
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
| Examining task ID: task_201206131155_0003_m_000009 (and more) from job job_201206131155_0003 | |
| Examining task ID: task_201206131155_0003_m_000000 (and more) from job job_201206131155_0003 | |
| Examining task ID: task_201206131155_0003_m_000002 (and more) from job job_201206131155_0003 | |
| Exception in thread "Thread-147" java.lang.RuntimeException: Error while reading from task log url | |
| at org.apache.hadoop.hive.ql.exec.errors.TaskLogProcessor.getErrors(TaskLogProcessor.java:130) | |
| at org.apache.hadoop.hive.ql.exec.JobDebugger.showJobFailDebugInfo(JobDebugger.java:211) | |
| at org.apache.hadoop.hive.ql.exec.JobDebugger.run(JobDebugger.java:81) | |
| at java.lang.Thread.run(Thread.java:662) | |
| Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: http://10.84.74.227:9103/tasklog?taskid=attempt_201206131155_0003_m_000002_4&start=-8193 | |
| at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436) |
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
| package Net::MusixMatch; | |
| use Moose; | |
| use Net::API::Abstract; | |
| extends 'Net::API::Abstract'; | |
| set_domain 'http://api.musixmatch.com/ws/1.1/'; | |
| using Simple::Auth; | |
| using JSON parser; | |
| api_method 'track' => ( |
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
| sub get_track { | |
| my $self = shift; | |
| my %params = @_; | |
| return unless $params{ track_id } | |
| || $params{ track_mbid } | |
| || $params{ track_echonest_id }; | |
| my $result = $self->_call_api( 'track.get', %params ); |
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
| use strict; | |
| use warnings; | |
| use feature 'say'; | |
| use lib 'gen-perl'; | |
| use Thrift::XS; | |
| use Thrift::Socket; | |
| use Thrift::FramedTransport; | |
| use Thrift::XS::BinaryProtocol; |
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
| sub get{ | |
| my $self = shift; | |
| my $key = shift; | |
| my $column_path = shift; | |
| my $consistency_level = shift; | |
| $self->send_get($key, $column_path, $consistency_level); | |
| return $self->recv_get(); | |
| } |
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
| package Cassandra::Column; | |
| use base qw(Class::Accessor); | |
| Cassandra::Column->mk_accessors( qw( name value timestamp ttl ) ); |
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
| struct Column { | |
| 1: required binary name, | |
| 2: optional binary value, | |
| 3: optional i64 timestamp, | |
| 4: optional i32 ttl, | |
| } | |
| ... | |
| service Cassandra { |
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
| use strict; | |
| use warnings; | |
| use feature qw/ say /; | |
| use constant MXM_HM_GROUP => 9604; | |
| use Net::Hiveminder; | |
| use DateTime; | |