I hereby claim:
- I am johnford on github.
- I am bc_johnford (https://keybase.io/bc_johnford) on keybase.
- I have a public key ASAM63beLhMhbeal0ASFwb1cpM6Z3FTdPDPAlVwMxwuQuQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
### Keybase proof | |
I hereby claim: | |
* I am johnford on github. | |
* I am ghettocode (https://keybase.io/ghettocode) on keybase. | |
* I have a public key ASBk4vB1sOyTElveKVCD8XviX05du-Mch1Oomlc_zr2I-Qo | |
To claim this, I am signing this object: |
import scala.collection.mutable.ListBuffer | |
val diffs: ListBuffer[List[Any]] = new ListBuffer[List[Any]]() | |
diffs.append(List("field1", 1, 2)) | |
diffs.append(List("field2", 3, 4)) | |
diffs.append(List("field3", 5, 6)) | |
/* At this point, I'd like to do something like: diffs.toList.unzip and wind up with List("field1", "field2", "field3"), List((1,2), (3,4), (5,6)) | |
But that thows an exception: "error: No implicit view available from List[Any] => (A1, A2)." */ |
def doit(k, array) | |
array.reduce([]) do |memo,o| | |
if memo.length < k | |
memo << o | |
elsif (min = memo.min) < o | |
memo[memo.index(min)] = o | |
end | |
memo | |
end | |
end |
require 'yaml' | |
class Store | |
attr_accessor :name, :address, :city, :state, :zip, :phone_number | |
end | |
def list_of_stores | |
files = Dir.glob('*.yml') | |
stores = [] |