I hereby claim:
- I am flada-auxv on github.
- I am flada (https://keybase.io/flada) on keybase.
- I have a public key ASDQh1yTlP0ZPvfFJRGsVa8gwRhhgJVM0fEKC43oE_NELAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
truffle のデフォルトのディレクトリ構成で contracts/ に Test.sol を配置して
truffle console
> migrate --reset
Fuga.deployed().then(c => c.FugaEvent().options.topics[0] )
// '0x036b5e160c95e397eb8e8ad88d596c87ba315b302a96e253e54a15d259ad4e1a'
Hoge.deployed().then(c => c.HogeEvent().options.topics[0] )
// Calculate revenue from gen0 kitty sale (as in some block range) | |
// | |
// $ node /path/to/thisFile | |
// { wei: "9598226439521243188", | |
// ether: "9.598226439521243188", | |
// blockRange: "6090000...6100000", | |
// "salesCount(only gen0 kitty)": 117, | |
// "birthCount(only gen0 kitty)": 148, | |
// "SalesCount(all the kitties)": 458 } |
class Hoge | |
def combination(array, num) | |
return [] if num == 0 | |
return array.map {|elem| Array(elem) } if num == 1 | |
each_with_rest(array).with_object([]) {|(elem, rest), result| | |
result.push(*_combination(rest, [elem], num)) | |
} | |
end |
class Player | |
attr_reader :size | |
def initialize(senryaku) | |
@count = 0 | |
@size = senryaku.size | |
@senryaku = senryaku | |
@senryaku_enum = senryaku.each_char.cycle | |
end |
source 'https://rubygems.org' | |
gem 'sinatra' |
source "https://rubygems.org" | |
gem "sinatra" |
# from http://guides.rubyonrails.org/association_basics.html#the-has-many-through-association | |
##### Model ##### | |
class Physician < ActiveRecord::Base | |
has_many :appointments | |
has_many :patients, through: :appointments | |
accepts_nested_attributes_for :appointments | |
end |
#!/usr/bin/env ruby | |
LOG_ITEMS = %w(ip_address ident_user_name authenticate_user_name access_date request_line status_code forwarding_byte caller_url user_agent).each | |
class LogParser | |
def initialize(logs) | |
@logs = logs.chomp | |
@result = {} | |
@start_idx = 0 | |
end |
class Circuit | |
def initialize(circuit) | |
@circuit = analyze(circuit) | |
end | |
def calc | |
@circuit.inject(0) {|memo, item| memo + item.val}.truncate | |
end | |
def analyze(circuit) |