As configured in my dotfiles.
start new:
tmux
start new with session name:
require 'json' | |
test2 = { | |
:foo1 => { | |
:target => "Something1", | |
:alias => "some_alias1" | |
}, | |
:foo2 => { | |
:target => "Something2", | |
:alias => "some_alias2" |
As configured in my dotfiles.
start new:
tmux
start new with session name:
module AtoiString | |
refine String do | |
def atoi | |
fixed_self = fix self | |
result = 0 | |
fixed_self.each_char do |c| | |
result = result * 10 + c.to_i | |
end | |
# A simple translate from a string to integer. | |
# A minus before all numbers will be consider to be a negative number. | |
def atoi(str) | |
return str if !str.is_a? String | |
fixed_str = fix(str) | |
result = 0 |
class Chromosome | |
attr_accessor :bit_string, :fitness | |
def initialize length, bit_string = nil | |
@length = length | |
if bit_string.nil? | |
generate_random length | |
else | |
@bit_string = bit_string |