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
| # Ruby 1.9.2 | |
| # Home: https://gist.github.com/856219 | |
| # My CPP template: template_cpp.rb | |
| # OJ Support: | |
| # Online Judge of Zhejiang University | |
| # Author: [email protected] | |
| require 'uri' | |
| require 'net/http' | |
| #require 'hpricot' |
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 "fiber" | |
| f1 = Fiber.new { |f2| f2.resume Fiber.current;loop{puts "A"; f2.transfer} } | |
| f2 = Fiber.new { |f1| f1.transfer; loop{puts "B"; f1.transfer} } | |
| f1.resume f2 |