This file contains hidden or 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
DEFS: | |
lots: 1000 | |
small_grid: 5 medium_grid: 80 large_grid: | |
small_object: 2 medium_object: 20 large_object: 100 | |
w/ lots of small objects in small size grid 0.040000 0.000000 0.040000 ( 0.038262) | |
w/ lots of medium objects in small size grid 0.110000 0.000000 0.110000 ( 0.108360) | |
w/ lots of small objects in medium size grid 0.040000 0.000000 0.040000 ( 0.046014) | |
w/ lots of medium objects in medium size grid 0.050000 0.000000 0.050000 ( 0.047339) | |
w/ lots of large objects in small size grid 1.160000 0.010000 1.170000 ( 1.172766) |
This file contains hidden or 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
/Users/shawn42/code/games/unexpected_outcome/src/actors.rb:38:in `block in invoke': undefined method `index' for #<Chingu::Animation:0x00000100ae00a0> (NoMethodError) | |
from /Users/shawn42/code/games/unexpected_outcome/src/actors.rb:38:in `each' | |
from /Users/shawn42/code/games/unexpected_outcome/src/actors.rb:38:in `all?' | |
from /Users/shawn42/code/games/unexpected_outcome/src/actors.rb:38:in `invoke' | |
from /Users/shawn42/code/games/unexpected_outcome/src/player.rb:78:in `block in space' | |
from /Users/shawn42/code/games/chingu/lib/chingu/traits/collision_detection.rb:254:in `block (3 levels) in each_collision' |
This file contains hidden or 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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
ObjectionInjector *injector = [Objection createInjector]; | |
[Objection setGlobalInjector:injector]; | |
} | |
- (void)viewDidLoad { | |
id myModel = [[Objection globalInjector] getObject:[MyModel class]]; | |
} |
This file contains hidden or 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
module ActionView | |
# = Action View Resolver | |
class Resolver | |
... | |
def find_templates(name, prefix, partial, details) | |
path = build_path(name, prefix, partial, details) | |
query(path, EXTENSION_ORDER.map { |ext| details[ext] }, details[:formats]) | |
end | |
def query(path, exts, formats) |
This file contains hidden or 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
module ActionView #:nodoc: | |
class ReloadableTemplate | |
... | |
def register_template_from_file(template_full_file_path) | |
if !@paths[relative_path = relative_path_for_template_file(template_full_file_path)] && File.file?(template_full_file_path) | |
register_template(ReloadableTemplate.new(relative_path, self)) | |
end | |
end |
This file contains hidden or 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
Dr. Suess as a Network Wizard | |
[email protected] | |
Here's an easy game to play. | |
Here's an easy thing to say.... | |
If a packet hits a pocket on a socket on a port, | |
and the bus is interupted as a very last resort, | |
and the address of the memory makes your floppy disk abort |
This file contains hidden or 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
# add these to your apache config | |
# courtesy of http://www.webdeveloper.com/forum/showthread.php?t=162526 | |
AddType application/vnd.ms-word.document.macroEnabled.12 docm | |
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx | |
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx | |
AddType application/vnd.ms-powerpoint.template.macroEnabled.12 potm | |
AddType application/vnd.openxmlformats-officedocument.presentationml.template potx | |
AddType application/vnd.ms-powerpoint.addin.macroEnabled.12 ppam | |
AddType application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm |
This file contains hidden or 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
class Object | |
# Define a deep_freeze method in Object (based on code posted by flavorrific | |
# http://flavoriffic.blogspot.com/2008/08/freezing-deep-ruby-data-structures.html) | |
# that will call freeze on the top-level object instance | |
# the method is called on and any child object instances contained in the | |
# parent. This patch will also raise an IndexError if keys from | |
# ‘deeply frozen’ Hashes or Arrays are accessed that do not exist. | |
# adapted by shawn42 from | |
# http://www.semintelligent.com/blog/articles/29/freezing-ruby-data-structures-recursively |
This file contains hidden or 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 'actor' | |
class Bacteria < Actor | |
has_behaviors :graphical, :updatable, :physical => { | |
:shape => :circle, | |
:mass => 10, | |
:radius => 45, | |
:friction => 1.7, | |
:moment => 150 | |
} |
This file contains hidden or 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
TTF.setup | |
full_name = "/path/to/font.ttf" | |
size = 20 | |
font = TTF.new(full_name, size) | |
text_image = font.render "hey there", true, [250,250,250,255] | |
text_image.blit screen |