Skip to content

Instantly share code, notes, and snippets.

library(data.table)
dyn.load('mmap_alloc.dll')
## create test ~74GB dataset, similar to
## https://github.com/Rdatatable/data.table/wiki/Benchmarks-:-Grouping
N=2e9; K=100
set.seed(1)
DT = list()
# empty mmap columns
perfect.sample2 = function(n, dist, ...) match.fun(paste('q', dist, sep=''))((1:n) / (n+1), ...)
all.equal(perfect.sample(100, 'norm'), perfect.sample2(100, 'norm')) # => T
require 'yaml'
class Game
Room = Struct.new :title, :description, :exits, :objects
Object = Struct.new :terms, :description
Action = Struct.new :terms, :code
attr_reader :blackboard