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
| irb(main):020:0> class BF2142Query | |
| irb(main):021:1> | |
| irb(main):022:1* def initialize(server, query_port) | |
| irb(main):023:2> @socket = UDPSocket.new | |
| irb(main):024:2> @socket.connect(server, query_port) | |
| irb(main):025:2> self.query | |
| irb(main):026:2> end | |
| irb(main):027:1> | |
| irb(main):028:1* def query | |
| irb(main):029:2> array = self.challenge |
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
| $LOAD_PATH.unshift File.join(File.dirname(__FILE__), "..", "lib") | |
| require "tempfile" | |
| require "rubygems" | |
| require "micronaut" | |
| Micronaut.configure {|config| config.mock_with :rr } | |
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
| def solve_for(teams) | |
| t1 = Time.now | |
| cs = Array.new(teams) {|i| 1 << i } | |
| combinations = cs.combination(2).map {|c| [c, (c.first | c.last)] } | |
| combos = combinations.map {|c| c.last } | |
| found = nil | |
| loop { |
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 Class | |
| protected :instance_type | |
| def initialize(sclass=Object) | |
| unless sclass.kind_of?(Class) | |
| raise TypeError, "superclass must be a Class (#{sclass.class} given)" | |
| end | |
| set_superclass sclass |
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
| % cumulative self self total | |
| time seconds seconds calls ms/call ms/call name | |
| ------------------------------------------------------------ | |
| 3.54 85.06 62.73 2757051 0.02 0.03 String::Unpacker#dispatch {} | |
| 1.59 41.97 27.65 263184 0.11 0.16 Prawn::Font::AFM#latin_kern_pairs_table {} | |
| 1.75 45.99 16.58 976019 0.02 0.05 Prawn::Images::PNG#unfilter_image_data {} | |
| 0.36 17.60 12.68 101544 0.12 0.17 Prawn::Font::AFM#parse_afm {} | |
| 0.17 8.03 8.29 3782972 0.00 0.00 Regexp#search_region | |
| 0.16 5.53 7.56 38300749 0.00 0.00 String#== | |
| 0.12 3.83 6.14 36361734 0.00 0.00 Array#at |
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
| ## App/Site | |
| application :FarmNoises do | |
| layout_for "text/html" => Waves::Renderers::Hoshi, :template => "templates/html/layout.meh" | |
| end | |
| ## Resource | |
| resource :Moo do | |
| renderer_for "text/x-markdown" => lambda {|content| "<div>" + Markdown.render content "</div>" } |
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
| $val = :hi | |
| $outer = false | |
| $inner = false | |
| t1 = Thread.new do | |
| begin | |
| $outer = true | |
| t2 = Thread.new do |
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
| commit 6d992de6dbca249251f3c2872edc9f205dd55b39 | |
| Author: Eero Saynatkari <projects@kittensoft.org> | |
| Date: Thu Apr 2 20:02:44 2009 +0300 | |
| Hack Kernel.eval working. | |
| diff --git a/kernel/common/variable_scope.rb b/kernel/common/variable_scope.rb | |
| index 508ba75..ac9635e 100644 | |
| --- a/kernel/common/variable_scope.rb | |
| +++ b/kernel/common/variable_scope.rb |
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/ruerue/code/rubinius/master/vm/vm | |
| require "rubygems" | |
| require "rack" | |
| require "rack/builder" | |
| require "rack/lint" | |
| require "rack/response" | |
| require "rack/showexceptions" | |
| require "rack/handler" | |
| require "rack/handler/mongrel" |
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
| 01:19:15 @paws ~/code/rubinius/master:master > vm/vm gem install --no-ri --no-rdoc -r waves | |
| Building native extensions. This could take a while... | |
| Successfully installed rake-0.8.4 | |
| Successfully installed abstract-1.0.0 | |
| Successfully installed erubis-2.6.4 | |
| Successfully installed highline-1.5.0 | |
| Successfully installed rakegen-0.6.6 | |
| Successfully installed choice-0.1.3 | |
| Successfully installed autocode-1.0.0 | |
| Successfully installed rack-0.9.1 |