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
The world in which the players originally exists is much like our reality, set some time into the future(year 2023). However, societies worldwide has been undergoing the "second enlightenment revolution". It's described as the gradual rise of rationality and scientific thought, quicker and more effective reform of social institutions, reduction of military spending, decrease in guard labor, and increased security. The IQ of the population rose by 1 IQ point each year in some places, especially third world countries where increased nutrition, economic propserity, complex cultural exports, and better education makes the most impact. | |
That is not to say the player characters are smarter than us, but it's certainly true that they are better read, educated, and more abstract thinkers on average. The rise of IQ are not a reflection of their rising general intelligence, but their abstract problem solving ability and the abstract knowledge that they had accumulated through a lifetime of learning and exposure to comp |
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
def get path | |
Net::HTTP::Get.new(path) | |
end | |
def info gem_name, http | |
request = get("/api/v1/gems/#{gem_name}.json") | |
response = http.request request | |
return response.body | |
end |
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
Template.stats.rendered = () -> | |
width = 500 | |
height = 350 | |
date = "2012-12-30" | |
begin = moment(date).startOf("day")._d | |
end = moment(date).endOf("day")._d | |
console.log(begin) | |
console.log(end) | |
events = Events.find({user_id: Meteor.userId(), date: {$gte: start, $lt: end} } ) |
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
Template.stats.rendered = () -> | |
width = 500 | |
height = 350 | |
svg = d3.select("#svg") | |
.append("svg") | |
.attr("width",width) | |
.attr("height",height) | |
colors = [ |
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
svg | |
.append("rect") | |
.attr("x",0) | |
.attr("y",0) | |
.attr("width",width) | |
.attr("height",height) | |
.attr("fill","gray") | |
.attr("opacity",0.5) | |
.on("click",(o)-> | |
o.remove() |
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 "rubygems" | |
require "gems" | |
require "json" | |
require "retryable" | |
gems = [] | |
File.open("gems", "r") do |f| | |
while (l = f.gets) do | |
gems << l.strip() | |
end |
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
#Example line: | |
#{:name=>"-", :info=>{"name"=>"-", "downloads"=>5117, "version"=>"1", "version_downloads"=>5117, "platform"=>"ruby", "authors"=>"Ace Johnson", "info"=>"1", "licenses"=>nil, "project_uri"=>"http://rubygems.org/gems/-", "gem_uri"=>"http://rubygems.org/gems/--1.gem", "homepage_uri"=>nil, "wiki_uri"=>nil, "documentation_uri"=>nil, "mailing_list_uri"=>nil, "source_code_uri"=>nil, "bug_tracker_uri"=>nil, "dependencies"=>{"development"=>[], "runtime"=>[]}}, :versions=>[{"authors"=>"Ace Johnson", "built_at"=>"2010-04-10T07:00:00Z", "description"=>"1", "downloads_count"=>5117, "number"=>"1", "summary"=>"ace is the highest card", "platform"=>"ruby", "prerelease"=>false, "licenses"=>nil, "requirements"=>nil}], :dependencies=>[{:name=>"-", :number=>"1", :platform=>"ruby", :dependencies=>[]}]} | |
require "rubygems" | |
require "json" | |
file = File.open("test-data","r") | |
file.each_line do |l| | |
Marshal::load(l.strip()) | |
end |
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 "rubygems" | |
require "gems" | |
require "json" | |
require "retryable" | |
gems = [] | |
File.open("gems", "r") do |f| | |
while (l = f.gets) do | |
gems << l.strip() | |
end |
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
#code_block_replacer | |
#A Search and Replace Utilty that insert source code into your document. | |
class CodeBlockReplacer | |
def load_lines filename | |
lines = [] | |
file = File.open(filename,"r") | |
file.each_line do |f| | |
lines.push(f) | |
end |
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
msg = ["hello","world","replace","me","with","this\n","now!"] | |
filename = "test_me" | |
def load_lines filename | |
lines = [] | |
file = File.open(filename,"r") | |
file.each_line do |f| | |
lines.push(f) | |
end | |
lines |