Skip to content

Instantly share code, notes, and snippets.

View toushimi's full-sized avatar

とうしみ toushimi

View GitHub Profile
@toushimi
toushimi / Semaphore_test.rb
Created March 23, 2011 07:57
Semaphore_test
class Semaphore
@resource=1
def GetResource
while true do
unless @resource==0
@resource-=1
break
end
sleep 1
end
@toushimi
toushimi / kadai2
Created January 8, 2012 16:31
test
class Prime
include Enumerable
def initialize(num = 100)
ary = (3..num).to_a
@prime = [2]
ary.each do |item|
tmp = 0
flag = true
@prime.each do |pr|
### Keybase proof
I hereby claim:
* I am toushimi on github.
* I am toushimi (https://keybase.io/toushimi) on keybase.
* I have a public key ASCKEJ3RIO1imVxhqKmvHOl3CrYHOlHYe5juqm3FRrgNygo
To claim this, I am signing this object: