I hereby claim:
- I am danbernier on github.
- I am danbernier (https://keybase.io/danbernier) on keybase.
- I have a public key whose fingerprint is 1FAA B199 F574 EF19 B109 5666 05EF 0F12 A572 A5FA
To claim this, I am signing this object:
void setup() { | |
size(800, 600); | |
ballArray = new Ball[40]; | |
for (int i = 0; i < ballArray.length; i++) { | |
ballArray[i] = | |
new Ball(random(width), random(height)); | |
} | |
} | |
Ball[] ballArray; |
import peasy.*; | |
PeasyCam camera; | |
PVector[] spherePos; | |
void setup() { | |
size(800, 600, P3D); | |
camera = new PeasyCam(this, 0,0,0, 200); | |
setUpSpheres(); | |
} |
I hereby claim:
To claim this, I am signing this object:
stop_words_arg = case stop_words_arg | |
when :guess then guess_language(string) | |
when Symbol then stop_words(stop_words_arg) | |
when Java::CueLangStop::StopWords then stop_words_arg | |
when nil then nil # is this one really necessary? it documents, but it seems overkill | |
end |
module RSlow | |
class HtmlResource < ParsableResource | |
attr_accessor :doc, :scripts, :stylesheets, :images | |
def initialize(url) | |
super | |
@doc = Nokogiri::HTML(@contents) | |
@scripts = fetch_script_resources(".//script", 'src', JsResource) | |
@stylesheets = fetch_stylesheet_resources(".//link[@rel]", 'href', CssResource) | |
@images = fetch_image_resources(".//img", 'src', Resource) |
module RSlow | |
class HtmlResource < ParsableResource | |
attr_accessor :doc, :scripts, :stylesheets, :images | |
def initialize(url) | |
super | |
@doc = Nokogiri::HTML(@contents) | |
@scripts = fetch_script_resources(".//script", 'src', JsResource) | |
@stylesheets = fetch_stylesheet_resources(".//link[@rel]", 'href', CssResource) | |
@images = fetch_image_resources(".//img", 'src', Resource) |
# @paragraphs is an Array of Strings - various puts'es confirm this. | |
@paragraphs.each do |paragraph| | |
renderer = HH::LessonParaRenderer.new(container) | |
markdown = Redcarpet::Markdown.new(renderer) | |
p paragraph # Just checking - it's a String! | |
# raises: <TypeError: wrong argument type Array (expected String)> | |
markdown.render(paragraph) | |
end |
def hunt_for_bugs(score, location) | |
bug_work(hidden_bugs(location), :hide_points).size | |
end | |
def fix_bugs(score, location) | |
just_fixed = bug_work(found_bugs(location), :hit_points) | |
@bug_list.reject! { |bug| bug.dead? } | |
just_fixed.size | |
end |
ruby-1.9.2-p290 :001 > class Foo | |
ruby-1.9.2-p290 :002?> def bonk | |
ruby-1.9.2-p290 :003?> @bonk = nil | |
ruby-1.9.2-p290 :004?> end | |
ruby-1.9.2-p290 :005?> end | |
=> nil | |
ruby-1.9.2-p290 :006 > f = Foo.new | |
=> #<Foo:0x007ff15c1e65b8> | |
ruby-1.9.2-p290 :007 > f.bonk | |
=> nil |
import wordcram.*; | |
/* | |
This takes advantage of two nice WordCram features, and one accident of implementation: | |
- Feature 1: you can set and get any properties you want on your Words | |
- Feature 2: you can implement `void wordsCounted(Word[] words)` in your sketch, | |
and it'll be called after the words are counted up | |
WordCram normalizes the Word weights, so the most-frequent Word has a weight of 1, and |