Created by Christopher Manning
Nodes are linked to nodes in neighboring cells. The cell's color is a function of its area.
- Drag the nodes to interact with the diagram.
- Use the mousewheel to add/remove nodes.
| date | wounds | other | disease | |
|---|---|---|---|---|
| 5/1854 | 0 | 95 | 105 | |
| 6/1854 | 0 | 40 | 95 | |
| 7/1854 | 0 | 140 | 520 | |
| 8/1854 | 20 | 150 | 800 | |
| 9/1854 | 220 | 230 | 740 | |
| 10/1854 | 305 | 310 | 600 | |
| 11/1854 | 480 | 290 | 820 | |
| 12/1854 | 295 | 310 | 1100 | |
| 1/1855 | 230 | 460 | 1440 |
| class Class | |
| def attr_accessor_with_history(attr_name) | |
| attr_name = attr_name.to_s # make sure it's a string | |
| attr_reader attr_name # create the attribute's getter | |
| attr_reader attr_name+"_history" # create bar_history getter | |
| class_eval %Q{ | |
| define_method "#{attr_name}=" do |value| | |
| @#{attr_name} = value | |
| @#{attr_name}_history ||= [nil] | |
| @#{attr_name}_history << value |
| class Class | |
| def attr_accessor_with_history attribute_name | |
| attr_reader "#{attribute_name}" | |
| attr_reader "#{attribute_name}_history" | |
| define_method "#{attribute_name}=" do |new_value| | |
| history = instance_variable_get("@#{attribute_name}_history") || [nil] | |
| instance_variable_set "@#{attribute_name}_history", history | |
| history << new_value |
| require "test/unit" | |
| class String | |
| def palindrome? | |
| stripped = self.gsub(/\W/,'') | |
| stripped == stripped.reverse | |
| end | |
| end | |
| class TestPalindromeChecker < Test::Unit::TestCase |
| class String | |
| def palindrome? | |
| stripped = self.gsub(/\W/,'') | |
| stripped == stripped.reverse | |
| end | |
| end | |
| puts "race_car".palindrome? |
| class String | |
| def palindrome? | |
| stripped = self.gsub(/\W/,'') | |
| stripped == stripped.reverse | |
| end | |
| end | |
| puts "race_car".palindrome? |
Created by Christopher Manning
Nodes are linked to nodes in neighboring cells. The cell's color is a function of its area.
| rails new 'appname' | |
| rails scaffold birds name:string description:text .... | |
| (generates views, routes, database models) | |
| rake db:create (once when creating app) | |
| rake db:migrate (every time database changes.. from scaffold/migrations) | |
| rails s (starts server) | |
| rails c (starts interactive prompt) |
| class Player | |
| QuestContainer quests; | |
| end | |
| class QuestContainer | |
| Quest[] completed; | |
| Quest[] locked; | |
| Quest[] unlocked; | |
| end |
| #!/usr/bin/ruby | |
| # inkscape -b '#ffffff' -e circles.png -w 3000 circles.svg | |
| # gem install color-tools | |
| require 'color' | |
| # http://code.google.com/p/chipmunk-physics/ | |
| # svn checkout http://chipmunk-physics.googlecode.com/svn/trunk/ chipmunk-physics-read-only | |
| # cmake -D BUILD_RUBY_EXT=ON . | |
| # make && sudo make install |