34件ヒット
[1-34件を表示]
(0.056秒)
検索結果
先頭5件
-
Timeout
. # timeout(sec , exception _ class = nil) {|i| . . . } -> object (35292.0) -
ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。
...c 秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout::Error が発生します。
exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはい......require 'timeout'
def calc_pi(min)
loop do
x = rand
y = rand
x**2 + y**2 < 1.0 ? min[0] += 1 : min[1] += 1
end
end
t = 5
min = [ 0, 0]
begin
Timeout.timeout(t){
calc_pi(min)
}
rescue Timeout::Error
puts "timeout"
end
printf "%d: pi =......ution expired (TimeoutError)
from -:6:in `timeout'
from -:6
# gethostbyname が0.1秒かからない場合は例外が発生しないので
# その場合は、t に小さい数値(0.000001のような)に変える。
timeout による割り込みは Kernel.#system によ... -
Timeout
. # timeout(sec , exception _ class , message) {|i| . . . } -> object (35292.0) -
ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。
...c 秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout::Error が発生します。
exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはい......require 'timeout'
def calc_pi(min)
loop do
x = rand
y = rand
x**2 + y**2 < 1.0 ? min[0] += 1 : min[1] += 1
end
end
t = 5
min = [ 0, 0]
begin
Timeout.timeout(t){
calc_pi(min)
}
rescue Timeout::Error
puts "timeout"
end
printf "%d: pi =......ution expired (TimeoutError)
from -:6:in `timeout'
from -:6
# gethostbyname が0.1秒かからない場合は例外が発生しないので
# その場合は、t に小さい数値(0.000001のような)に変える。
timeout による割り込みは Kernel.#system によ... -
Timeout
. # timeout(sec , exception _ class = nil) {|i| . . . } -> object (35291.0) -
ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。
...c 秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout::Error が発生します。
exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはい......require 'timeout'
def calc_pi(min)
loop do
x = rand
y = rand
x**2 + y**2 < 1.0 ? min[0] += 1 : min[1] += 1
end
end
t = 5
min = [ 0, 0]
begin
Timeout.timeout(t){
calc_pi(min)
}
rescue Timeout::Error
puts "timeout"
end
printf "%d: pi =......ution expired (TimeoutError)
from -:6:in `timeout'
from -:6
# gethostbyname が0.1秒かからない場合は例外が発生しないので
# その場合は、t に小さい数値(0.000001のような)に変える。
timeout による割り込みは Kernel.#system によ... -
NEWS for Ruby 3
. 0 . 0 (114.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...voke the scheduler hook `#io_wait(io, events, timeout)` in a non-blocking execution context. 16786
* Kernel
* Kernel#clone when called with the `freeze: false` keyword will call `#initialize_clone` with the `freeze: false` keyword. 14266
* Kernel#clone when called with the `freeze: true` k......ded.
* Socket
* Add :connect_timeout to TCPSocket.new 17187
* Net::HTTP
* Net::HTTP#verify_hostname= and Net::HTTP#verify_hostname have been added to skip hostname verification. 16555
* Net::HTTP.get, Net::HTTP.get_response, and Net::HTTP.get_print can take the request headers as a......efault.
* OpenStruct
* Initialization is no longer lazy. 12136
* Builtin methods can now be overridden safely. 15409
* Implementation uses only methods ending with `!`.
* Ractor compatible.
* Improved support for YAML. 8382
* Use officially discouraged. Read OpenStruct@Cave... -
ruby 1
. 6 feature (78.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...1.6.7 (2002-07-30) [i586-linux]
: 2002-06-03 sprintf()
"%d" で引数を整数にするときに、((<組み込み関数/Integer>)) と同じ規則を
使用するようになりました。
p sprintf("%d", nil)
=> -:1:in `sprintf': no implicit conversion from nil (TypeError)......dev:17155>))
open("|-","r+") {|f|
if f
f.dup.close_write
else
sleep 1
end
}
=> ruby 1.6.7 (2002-03-01) [i586-linux]
-:3:in `close_write': closing non-duplex IO for writing (IOError)
from -:3
from -:1:in `open'......def initialize(obj) @obj = obj end
def []=() @obj = obj end
def []() @obj end
end
module Kernel
def _ptr() Ptr.new(self) end
end
def foo(int)
int[] += 1
end
x = 1._ptr...