There doesn't seem to be a good resource online describing the issues with protocol buffers and deterministic serialization (or lack thereof). This is a collection of links on the subject.
Protocol Buffers v3.0.0. release notes:
The deterministic serialization is, however, NOT canonical across languages; it is also unstable across different builds with schema changes due to unknown fields.
Wire format ordering and map iteration ordering of map values is undefined, so you cannot rely on your map items being in a particular order.
connection = Faraday::Connection.new('http://example.com') do |builder| | |
builder.request :url_encoded # for POST/PUT params | |
builder.adapter :net_http | |
end | |
# same as above, short form: | |
connection = Faraday.new 'http://example.com' | |
# GET | |
connection.get '/posts' |
require 'pp' | |
require 'irb/completion' | |
require 'rubygems' | |
require 'wirble' | |
require 'hirb' | |
Wirble.init | |
Wirble.colorize | |
IRB.conf[:AUTO_INDENT]=true |
def sum_data(index, page, data) | |
t = [] | |
page.each do |p| | |
if t.length == 0 | |
t = get_data_array(p, index, data) | |
else | |
temp = get_data_array(p, index, data) | |
t.each_index do | i | | |
t[i] += temp[i] | |
end |
This script installs a patched version of ruby 1.9.3-p194 with boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.
Many thanks to funny-falcon for the performance patches.
# c = CSVBuilder.new ['column 1 name', 'column 2 name', 'column 3 name'] | |
# rowdata.each do |r| | |
# special_column = r.boolean ? 'YES' : 'NO' | |
# c.add_row [special_column, r.name, r.date] | |
# end | |
# c.export('optional_filename.csv') | |
class CSVBuilder | |
def initialize(head) | |
if head.is_a?(Array) |