I hereby claim:
- I am madebydna on github.
- I am andrea_singh (https://keybase.io/andrea_singh) on keybase.
- I have a public key ASABnGyvVjWQ_Aq1XYaqELkoXj8knsKY3I9uZGbY9wBJSQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
instructions = File.readlines("input_d2.txt").map(&:chomp!) | |
x, y = 0, 0 | |
instructions.each do |cmd| | |
direction, amt = cmd.match(/(forward|up|down) (\d+)/)[1..-1] | |
case direction | |
when "forward" | |
x += amt.to_i | |
when "up" | |
y -= amt.to_i |
class ImportJob | |
include Sidekiq::Worker | |
sidekiq_options :queue => :import, :retry => false, :backtrace => true | |
def perform(project_id) | |
# create master batch | |
a = Sidekiq::Batch.new | |
a.description = "Master Batch A" | |
a.on(:success, "ImportJob#on_success", {"step" => "a"}) | |
logger.info "Master Batch A starting #{a.bid}" |
module Stockreturns | |
class Stockreturns | |
end | |
module Application | |
extend self | |
def run |
module Logo | |
module Parser | |
def self.unroll_repeats(str) | |
str.gsub(/REPEAT (\d+) \[\s*(.*)\s*\]/) { |x| | |
$1.to_i.times.map { $2.strip }.join(" ") | |
} | |
end | |
def self.parse(source) | |
unroll_repeats(source).scan(/(RT|LT|FD|BK)\s+(\d+)/m) |
CS | |
Rt 135 | |
Fd 60 | |
REPEAT 2 [ Rt 90 Fd 150 ] | |
Rt 90 | |
Fd 60 | |
Rt 45 | |
Fd 128 |
#!/usr/bin/ruby | |
require 'pp' | |
f = File.open("input.txt", "r") | |
o = File.open("output.txt", "w+") | |
cases = f.readlines '' | |
cases.each do |c| | |
kase = c.split("\n").map{|i| i.split('')} | |
nl = kase[0] |
<?xml version="1.0" encoding="UTF-8"?> | |
<sphinx:docset> | |
<sphinx:schema> | |
<sphinx:field name="keywords"/> | |
.... other fields and attributes omitted | |
</sphinx:schema> | |
<sphinx:document id="163"> | |
<title>Logic of Architecture</title> | |
<keywords>Architekturtheorie, Entwurfsprozess in der Architektur, Computer Aided Design, Säulenordnungen, Formengrammatik</keywords> | |
</sphinx:document> |
class Address < ActiveRecord::Base | |
DELTA = 0.001 | |
validates :line1, :city, :presence => true | |
belongs_to :country | |
belongs_to :organisation | |
belongs_to :person | |
belongs_to :address_type | |
belongs_to :service |
class Table | |
attr_reader :rows, :headers, :header_support | |
def initialize(data = [], options = {}) | |
@header_support = options[:headers] | |
@headers = @header_support ? data.shift : [] | |
@rows = data | |
end | |
def column_index(pos) |