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:
| def has_cycle?(items) # hash: { id => parent_id, id => nil } | |
| return false if items.size < 2 | |
| items = items.dup | |
| items.keys.each do |starting_point| | |
| visited_items = [] | |
| item = starting_point | |
| while item.present? | |
| return true if visited_items.include?(item) |
| interface UGen<T> { | |
| T val(); | |
| } | |
| interface Movie { | |
| void update(); | |
| void draw(PGraphics g); | |
| } | |
| class MovieBag implements Movie { |
| =begin | |
| It's easy to mistakenly say: | |
| describe 'my feature', type: 'feature' do | |
| ... | |
| end | |
| ...when you really mean: | |
| describe 'my feature', type: :feature do |
| 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 |
| function allTests(thisFnWrapsAllYourTests) { | |
| var successes = 0; | |
| var failures = []; | |
| var scopes = []; | |
| var msgInScope = function(msg) { | |
| return scopes.concat([msg]).join(": "); | |
| } | |
| var doTheseListsMatch = function(expected, actual) { |
I hereby claim:
To claim this, I am signing this object:
| import peasy.*; | |
| PeasyCam camera; | |
| PVector[] spherePos; | |
| void setup() { | |
| size(800, 600, P3D); | |
| camera = new PeasyCam(this, 0,0,0, 200); | |
| setUpSpheres(); | |
| } |
| 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; |
| module HasFakeBooleanColumns | |
| def self.wallpaper_over_fake(column_name) | |
| define_method(column_name) do | |
| self.attributes(column_name) == 'true' | |
| end | |
| define_method("#{column_name)=".to_sym) do |value| | |
| self.update_attribute(column_name, value == 'true') | |
| end | |
| end |
| var getRatingText = (function() { | |
| var ratingText = { | |
| singular: { | |
| "Closed": L("1_person_voted_to_get_this_issue_fixed", "1 person voted to get this issue fixed"), | |
| "Archived": L("1_person_voted_to_get_this_issue_fixed", "1 person voted to get this issue fixed"), | |
| default: L("1_person_wants_this_fixed", "1 person wants this fixed") | |
| }, | |
| plural: { | |
| "Closed": L("people_voted_to_get_this_issue_fixed", "%s people voted to get this issue fixed"), |