I hereby claim:
- I am zentetsukenz on github.
- I am zentetsuken (https://keybase.io/zentetsuken) on keybase.
- I have a public key whose fingerprint is A806 B364 D7DA 20B7 6823 313B D576 6A02 170C 4847
To claim this, I am signing this object:
function pluck (arrayOfObject, property) { | |
return arrayOfObject.map(function (item) { | |
return item[property]; | |
}); | |
}; |
ActiveRecord::Base.transaction do | |
100.times do |i| | |
Item.create({ | |
name: "item #{i + 1}" | |
}) | |
end | |
end |
add_foreign_key :source_table_name, :target_table_name, column: :explicit_column_name |
array_of_objects.map { |object| object.field_to_sum }.inject(:+) |
def find_mismatch_value_between_hash(a, b) | |
pivot_hash = a | |
another_hash = b | |
result_hash = {} | |
pivot_hash.keys.each do |k| | |
pivot_value = pivot_hash[k] | |
another_value = another_hash[k] | |
# gem install ascii_charts # if necessary | |
require 'ascii_charts' | |
require 'benchmark' | |
require './test.rb' | |
include Benchmark | |
class Runner | |
def self.run | |
new.run |
Class A | |
attr_accessor :name, :value | |
def initialize | |
@value = rand(10) | |
@name = "Mr. #{@value}_#{rand(100)}" | |
end | |
end | |
a = Array.new(10).collect { |e| e = A.new } |
I hereby claim:
To claim this, I am signing this object:
# 0 is too far from ` ;) | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |
import pandas as pd | |
import numpy as np | |
import gym | |
from gym import wrappers | |
def build_state(observation, feature_bins): | |
return_val = "" | |
for i in range(len(feature_bins)): | |
return_val = return_val + str(np.digitize([observation[i]], feature_bins[i])[0]) | |
return int(return_val) |