1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
#!/usr/bin/env ruby
require 'json'
y = []
10000.times do
h = {
'x' => rand,
'y' => rand,
'z' => rand,
'name' => ('a'..'z').to_a.shuffle[0..5].join + ' ' + rand(10000).to_s,
'opts' => {'1' => [1, true]},
}
y << h
end
File.open("2.json", 'w') { |f| f.write JSON.pretty_generate('coordinates' => y, 'info' => "some info") }
x = []
524288.times do
h = {
'x' => rand,
'y' => rand,
'z' => rand,
'name' => ('a'..'z').to_a.shuffle[0..5].join + ' ' + rand(10000).to_s,
'opts' => {'1' => [1, true]},
}
x << h
end
File.open("1.json", 'w') { |f| f.write JSON.pretty_generate('coordinates' => x, 'info' => "some info") }
|