Skip to content

Instantly share code, notes, and snippets.

class Hand
def straight?
values = @cards.map{|card| card.value}.uniq.sort
values.each do |key, value|
values.delete_at(key) unless value == values[key - 1] + 1
end
values.length >= 5
end
end
class Hand
def straight?
values = @cards.map{|card| card.value}.uniq.sort
n = values.shift
while values.first == n || values.count >= 5
n = values.shift
end
end
end
class WebServerTest < Test::Unit::TestCase
def setup
@valid_request = "GET / HTTP/1.1\r\nHost: www.zedshaw.com\r\nContent-Type: text/plain\r\n\r\n"
@port = process_based_port
@tester = TestHandler.new
@app = Rack::URLMap.new('/test' => @tester)
redirect_test_io do
# We set num_processors=1 so that we can test the reaping code
@server = HttpServer.new("127.0.0.1", @port, @app, :num_processors => 1)
~/sites/ruby-bluetooth/src(master) $ make
gcc -fno-common -D_XOPEN_SOURCE=1 -fno-common -pipe -fno-common -c -o bluetooth_macosx.o bluetooth_macosx/bluetooth_macosx.m
bluetooth_macosx/bluetooth_macosx.m:2:17: error: ruby.h: No such file or directory
bluetooth_macosx/bluetooth_macosx.m:3:19: error: rubyio.h: No such file or directory
bluetooth_macosx/bluetooth_macosx.m:4:20: error: rubysig.h: No such file or directory
In file included from bluetooth_macosx/bluetooth_macosx.m:13:
bluetooth_macosx/bluetooth_macosx.h:13: error: syntax error before ‘VALUE’
bluetooth_macosx/bluetooth_macosx.h:13: warning: no semicolon at end of struct or union
bluetooth_macosx/bluetooth_macosx.h:14: warning: data definition has no type or storage class
bluetooth_macosx/bluetooth_macosx.h:17: error: syntax error before ‘bt_device_new’
Overheard in #philosophy:
15:19 daljahim: hey
15:20 daljahim: anyone fancy kate perry's new hit?
15:20 daljahim: i kissed a girl...
15:20 SilentQwerty: "God does not exist" entails that there are sense-data. Therefore God exists.
15:20 jseamus: SilentQwerty: how does that logically follow?
15:20 daljahim: it doesn't
15:21 jseamus: how do you know
15:21 jseamus: ?
>>> $.getJSON("http://github.com/api/v1/json/iownbey/docbox/commits/master")
[Exception... "Access to restricted URI denied" code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)" location: "file:///Users/imownbey/Sites/docbox_html/jquery.js Line: 28"]
ian-ownbeys-macbook:~ imownbey$ traceroute 216.155.130.130
traceroute to 216.155.130.130 (216.155.130.130), 64 hops max, 40 byte packets
1 172.16.228.1 (172.16.228.1) 1.790 ms 1.652 ms 2.621 ms
2 lm-core-vlan3228.usfca.edu (172.16.126.133) 1.168 ms 1.417 ms 1.344 ms
3 inet-msfc2-vlan3132.usfca.edu (172.16.126.158) 1.178 ms 1.106 ms 2.227 ms
4 138.202.128.202 (138.202.128.202) 9.107 ms 8.558 ms 8.536 ms
5 usf-1--usf-lan-interconnect.cenic.net (137.164.38.80) 3.083 ms 3.136 ms 1.736 ms
6 dc-sfo-dc1--usf-opteman.cenic.net (137.164.24.2) 9.863 ms 14.752 ms *
7 dc-oak-dc2--sfo-dc1-pos.cenic.net (137.164.22.33) 12.258 ms 10.301 ms 12.172 ms
8 dc-oak-core1--oak-agg2-ge-2.cenic.net (137.164.46.65) 10.971 ms 11.520 ms 10.205 ms
ian-ownbeys-macbook:~ imownbey$ ping irc.freenode.net
PING chat.freenode.net (140.211.166.4): 56 data bytes
36 bytes from corv-car1-gw.nero.net (207.98.64.177): Communication prohibited by filter
Dir.glob("**/{rakefile,Rakefile,rakefile.rb,Rakefile.rb,*.rake}").each do |f|
rake.add_import f
p f
end
rake.load_imports
p rake.top_level