This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yaml' | |
class Game | |
Room = Struct.new :title, :description, :exits, :objects | |
Object = Struct.new :terms, :description | |
Action = Struct.new :terms, :code | |
attr_reader :blackboard |