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
{ | |
"bb": 2.0, | |
"committed_eur": 140.571633, | |
"committed_usd": 183.0, | |
"created_at": "2013-08-08 20:03:22.916840", | |
"ended_at": "2013-06-26 16:55:49", | |
"game_server": "PokerStars", | |
"game_type": "omaha", | |
"id": 1273, | |
"started_at": "2013-06-26 16:11:08", |
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
Andorra: 2485.96% | |
Macao SAR China: 2321.37% | |
Turks and Caicos Islands: 1091.68% | |
Sint Maarten (Dutch part): 1084.73% | |
Aruba: 849.74% | |
Monaco: 785.01% | |
Guam: 711.87% | |
Northern Mariana Islands: 630.33% | |
Cayman Islands: 536.74% | |
Palau: 525.20% |
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
### Usage example | |
Publisher = Struct.new(:name) | |
Book = Struct.new(:publisher) | |
Review = Struct.new(:book) | |
def Review.publisher | |
book.publisher | |
end |
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
final val TypeField = "$type" | |
final val ObjectField = "$object" | |
def encode[T <: Message](msg: T): Array[Byte] = { | |
val schema: protostuff.Schema[T] = msg.schema.asInstanceOf[protostuff.Schema[T]] | |
val out = new java.io.ByteArrayOutputStream | |
val context = new org.codehaus.jackson.io.IOContext(protostuff.JsonIOUtil.DEFAULT_JSON_FACTORY._getBufferRecycler(), out, false); | |
val generator = protostuff.JsonIOUtil.newJsonGenerator(out, context.allocWriteEncodingBuffer) |
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
group java_bean_model_schema : java_bean_model_base; | |
message_block(message, module, options, nested) ::= << | |
<if(!nested)> | |
<message:message_header(message=it, module=module, options=options)> | |
<endif> | |
public <if(nested)>static <endif>class <remote_model_schema_name(message=message, name=message.name)> | |
<options.(message.name + ".extends_schema_declaration"); format=" "> | |
<message:message_impl_declaration(message=it, options=options)> { |
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
import ( | |
"math" | |
) | |
type Currency struct { | |
Name string // "US Dollar" | |
IsoCode string // "USD" | |
Precision int // 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
package protocol | |
import ( | |
"fmt" | |
"log" | |
) | |
// pubsub | |
type Broker struct { | |
Send map[string]*chan *Message |
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
a = [1,2,3,5,6,7,10,11,12,14,15] | |
def split_gaps(a) | |
gaps = [] | |
buffer = a.inject([]) { |buffer, item| | |
prev = buffer[buffer.size - 1] | |
if prev && item - prev > 1 | |
gaps << buffer | |
[] |
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
JavaScript 1 | |
Ruby 2 | |
Java 3 | |
Python 4 | |
Shell 5 | |
PHP 6 | |
C 7 | |
C++ 8 | |
Perl 9 | |
Objective-C 10 |
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
# encoding: utf-8 | |
def parse_date(s) | |
map = {'ЯНВ' => 1, 'ФЕВ' => 2, 'МАР' => 3, 'АПР' => 4, 'МАЙ' => 5, 'ИЮН' => 6, 'ИЮЛ' => 7, 'АВГ' => 8, 'СЕН' => 9, 'ОКТ' => 10, 'НОЯ' => 11, 'ДЕК' => 12} | |
s =~ /^(\d+)(.+?)(\d+)$/ | |
Date.new($3.to_i + 2000, map[$2], $1.to_i) | |
end | |
require 'csv' | |
str = CSV.generate do |csv| | |
while line = gets |