This file contains 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 'rubygems' | |
require 'mysqlplus' | |
m = Mysql.real_connect('localhost','root') | |
m.send_query("SELECT 1") | |
p m.stat # should raise error? | |
m.get_result() # hangs |
This file contains 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 'rubygems' | |
require 'eventmachine' | |
require 'em-http' | |
require 'dataflow' | |
Thread.new { | |
EM.run{} | |
} | |
module EventMachine |
This file contains 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 'rubygems' | |
require 'eventmachine' | |
require 'dataflow' | |
# Experimenting with dataflow + EM | |
def do_pop_stuff | |
pop_client = EventMachine::POP::POP3Client.new('pop.gmail.com', 995, true, 'username', 'password') | |
print "stat: #{pop_client.stat}\n" | |
pop_client.mails.each do |m| | |
print m.raw + "\n" |
This file contains 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 'rubygems' | |
require 'spec' | |
include Spec::Matchers | |
a = (1..10).to_a | |
b = (5..15).to_a | |
matcher = MatchArray.new(a) | |
matcher.matches?(b) # => false |
NewerOlder