33件ヒット
[1-33件を表示]
(0.017秒)
検索結果
先頭3件
-
ruby 1
. 8 . 4 feature (78.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...hod#bind [bug]>))
* ((<ruby 1.8.4 feature/set_trace_func [bug]>))
* ((<ruby 1.8.4 feature/set_trace_func [change]>))
* ((<ruby 1.8.4 feature/printf [bug]>))
* ((<ruby 1.8.4 feature/Hash [bug]>))
* ((<ruby 1.8.4 feature/test [bug]>))
* ((<ruby 1.8.4 feature/File.identical? [new]>))
* ((......$SAFE=4でtrace_funcの追加を禁止。
: printf [bug]
#Wed Dec 7 15:31:35 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
#
# * sprintf.c (rb_str_format): integer overflow check added.
#
# * sprintf.c (GETASTER): ditto.
printfのフォーマット指定子にinteger overflo......i Nakada <nobu@ruby-lang.org>
#
# * file.c (test_identical): test if two files are identical.
#
# * file.c (rb_f_test): support DOSISH systems where st_ino is not
# reliable. fixed: [ruby-core:06672]
#
# * win32.h, win32.c (rb_w32_osid): check the running platform.
i... -
Timeout
. # timeout(sec , exception _ class = nil) {|i| . . . } -> object (36.0) -
ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。
...end
end
t = 5
min = [ 0, 0]
begin
Timeout.timeout(t){
calc_pi(min)
}
rescue Timeout::Error
puts "timeout"
end
printf "%d: pi = %f\n", min[0] + min[1], min[0]*4.0/(min[0]+min[1])
#例
#=> 417519: pi = 3.141443
例 独自の例外を発生させるタイム......発生しないので
# その場合は、t に小さい数値(0.000001のような)に変える。
timeout による割り込みは Kernel.#system によって呼び出された外部プログラムを
タイムアウトさせる事はできないので、IO.popen、Kernel.#openを使用する......# system だととまらない
# system("./loop.sh")
com = IO.popen("./loop.sh")
pid = com.pid
while line = com.gets
print line
end
}
rescue Timeout::Error => err
puts "timeout: shell execution."
Process.kill('SIGINT', pid)
printf "[resu... -
Timeout
. # timeout(sec , exception _ class , message) {|i| . . . } -> object (36.0) -
ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。
...end
end
t = 5
min = [ 0, 0]
begin
Timeout.timeout(t){
calc_pi(min)
}
rescue Timeout::Error
puts "timeout"
end
printf "%d: pi = %f\n", min[0] + min[1], min[0]*4.0/(min[0]+min[1])
#例
#=> 417519: pi = 3.141443
例 独自の例外を発生させるタイム......発生しないので
# その場合は、t に小さい数値(0.000001のような)に変える。
timeout による割り込みは Kernel.#system によって呼び出された外部プログラムを
タイムアウトさせる事はできないので、IO.popen、Kernel.#openを使用する......# system だととまらない
# system("./loop.sh")
com = IO.popen("./loop.sh")
pid = com.pid
while line = com.gets
print line
end
}
rescue Timeout::Error => err
puts "timeout: shell execution."
Process.kill('SIGINT', pid)
printf "[resu...