253件ヒット
[1-100件を表示]
(0.133秒)
ライブラリ
- ビルトイン (204)
-
minitest
/ unit (1) - openssl (36)
- zlib (12)
クラス
- Array (48)
-
OpenSSL
:: Cipher (24) -
OpenSSL
:: Engine (12) - Random (120)
- Thread (36)
-
Zlib
:: Deflate (12)
モジュール
キーワード
- == (12)
-
assert
_ operator (1) - bytes (12)
- join (24)
- left (12)
-
marshal
_ dump (12) -
marshal
_ load (12) -
random
_ iv (12) -
random
_ key (12) - sample (24)
- seed (12)
-
set
_ default (12) -
set
_ dictionary (12) - shuffle (12)
- shuffle! (12)
- state (12)
- value (12)
検索結果
先頭5件
-
Random
# rand -> Float (27378.0) -
一様な擬似乱数を発生させます。
...は乱数の範囲から除かれます。
range.end - range.begin が整数を返す場合は range.begin + self.rand((range.end - range.begin) + e)
の値を返します(e は終端を含む場合は1、含まない場合は0です)。
range.end - range.begin が実数を返す場合も同様で......Range オブジェクトで指定します。
range.end - range.begin は数値である必要があり、
range.begin + 数値 が適切な値を返す必要があります。
@raise Errno::EDOM rand(1..Float::INFINITY) などのように範囲に問題があるときに......ruby]{
# Kernel.#rand とほぼ同様の使い勝手
prng = Random.new(1234)
prng.rand # => 0.1915194503788923
srand(1234)
rand # => 0.1915194503788923
# max に実数も指定出来る
prng.rand(6.5) # => 4.043707011758907
# (rand(6) と同等)
rand(6.5)... -
Random
# rand(max) -> Integer | Float (27378.0) -
一様な擬似乱数を発生させます。
...は乱数の範囲から除かれます。
range.end - range.begin が整数を返す場合は range.begin + self.rand((range.end - range.begin) + e)
の値を返します(e は終端を含む場合は1、含まない場合は0です)。
range.end - range.begin が実数を返す場合も同様で......Range オブジェクトで指定します。
range.end - range.begin は数値である必要があり、
range.begin + 数値 が適切な値を返す必要があります。
@raise Errno::EDOM rand(1..Float::INFINITY) などのように範囲に問題があるときに......ruby]{
# Kernel.#rand とほぼ同様の使い勝手
prng = Random.new(1234)
prng.rand # => 0.1915194503788923
srand(1234)
rand # => 0.1915194503788923
# max に実数も指定出来る
prng.rand(6.5) # => 4.043707011758907
# (rand(6) と同等)
rand(6.5)... -
Random
# rand(range) -> Integer | Float (27378.0) -
一様な擬似乱数を発生させます。
...は乱数の範囲から除かれます。
range.end - range.begin が整数を返す場合は range.begin + self.rand((range.end - range.begin) + e)
の値を返します(e は終端を含む場合は1、含まない場合は0です)。
range.end - range.begin が実数を返す場合も同様で......Range オブジェクトで指定します。
range.end - range.begin は数値である必要があり、
range.begin + 数値 が適切な値を返す必要があります。
@raise Errno::EDOM rand(1..Float::INFINITY) などのように範囲に問題があるときに......ruby]{
# Kernel.#rand とほぼ同様の使い勝手
prng = Random.new(1234)
prng.rand # => 0.1915194503788923
srand(1234)
rand # => 0.1915194503788923
# max に実数も指定出来る
prng.rand(6.5) # => 4.043707011758907
# (rand(6) と同等)
rand(6.5)... -
OpenSSL
:: Cipher # random _ iv -> String (12201.0) -
IV を乱数で生成し、暗号オブジェクトに設定します。
IV を乱数で生成し、暗号オブジェクトに設定します。
生成した IV を文字列で返します。 -
OpenSSL
:: Cipher # random _ key -> String (12201.0) -
鍵を乱数で生成し、暗号オブジェクトに設定します。
鍵を乱数で生成し、暗号オブジェクトに設定します。
生成した鍵を文字列で返します。 -
Random
# marshal _ load(array) -> Random (9201.0) -
Random#marshal_dump で得られた配列を基に、Randomオブジェクトを復元します。
...
Random#marshal_dump で得られた配列を基に、Randomオブジェクトを復元します。
@param array 三要素以下からなる配列を指定します。
何を指定するかはRandom#marshal_dumpを参考にしてください。
@raise ArgumentError array が3より大......きい場合に発生します。
//emlist[例][ruby]{
r1 = Random.new(1)
a1 = r1.marshal_dump
r2 = Random.new(3)
r3 = r2.marshal_load(a1)
p r1 == r2 # => true
p r1 == r3 # => true
//}
@see Random#marshal_dump... -
Random
# marshal _ dump -> Array (9101.0) -
Random#marshal_load で復元可能な配列を返します。
...Random#marshal_load で復元可能な配列を返します。
//emlist[例][ruby]{
r1 = Random.new(1)
a1 = r1.marshal_dump
r2 = Random.new(3)
p r1 == r2 # => false
r3 = r2.marshal_load(a1)
p r1 == r2 # => true
p r1 == r3 # => true
//}... -
Random
# seed -> Integer (9101.0) -
現在の乱数の種を返します。
...現在の乱数の種を返します。
//emlist[例][ruby]{
p Random.new(3).seed # => 3
//}... -
Zlib
:: Deflate # set _ dictionary(string) -> String (6125.0) -
圧縮に用いる辞書を指定します。string を返します。 このメソッドは Zlib::Deflate.new, Zlib::ZStream#reset を呼び出した直後にのみ有効です。詳細は zlib.h を参照して下さい。
...圧縮に用いる辞書を指定します。string を返します。
このメソッドは Zlib::Deflate.new, Zlib::ZStream#reset
を呼び出した直後にのみ有効です。詳細は zlib.h を参照して下さい。
@param string 辞書に用いる文字列を指定します。詳しく......b'
def case1(str)
dez = Zlib::Deflate.new
comp_str = dez.deflate(str)
comp_str << dez.finish
comp_str.size
end
def case2(str, dict)
dez = Zlib::Deflate.new
p dez.set_dictionary(dict)
comp_str = dez.deflate(str)
comp_str << dez.finish
comp_str.size
end......= 10
dict = 'hoge_fuga_ugougo'
sset = [ dict, 'taeagbamike', 'ugotagma', 'fugebogya' ]
g = [ 0, 1, 1, 1, 0, 0, 0, 3, 3, 3, 0, 0, 1, 1, 0, 0, 0, 1, 2, 2, 0, 0, 0, 2, 0, 1, 1, 0, 0, 0, 0, 0]
str = (1..i).collect{|m| t = rand(g.size); sset.at(g[t])}.join("")
printf "%d normal:%d, dict:%d\n",...