636件ヒット
[1-100件を表示]
(0.159秒)
種類
- インスタンスメソッド (352)
- 特異メソッド (231)
- モジュール関数 (53)
クラス
- Array (99)
-
Encoding
:: Converter (11) -
Enumerator
:: Lazy (11) - IO (154)
- Mutex (2)
- Object (22)
- StopIteration (11)
- String (132)
-
Thread
:: Mutex (9)
モジュール
- Enumerable (66)
- GC (33)
-
GC
:: Profiler (33) - Kernel (53)
キーワード
- === (11)
- [] (66)
-
_ dump (11) - catch (22)
- combination (22)
- fetch (11)
- inject (33)
-
latest
_ gc _ info (11) - loop (9)
- new (11)
- permutation (22)
- popen (154)
-
primitive
_ errinfo (11) -
raw
_ data (11) - reduce (33)
-
repeated
_ combination (22) -
repeated
_ permutation (22) - report (11)
- slice (66)
- stat (22)
- synchronize (11)
- test (22)
検索結果
先頭5件
-
GC
:: Profiler . result -> String (27415.0) -
GC のプロファイル情報をフォーマットし、文字列として返します。
...生した場合の実行例です。
$ ruby -e "GC::Profiler.enable; a = Array.new(100000){ 'aa' }; puts GC::Profiler.result"
GC 5 invokes.
Index Invoke Time(sec) Use Size(byte) Total Size(byte) Total Object GC Time(ms)
1 0.012......: GC invokes
GC の起動回数
: Invoke Time
Ruby が起動してから GC が起動するまでに経過した時間
: Use Size
ヒープ内での使用サイズ
: Total Size
ヒープ全体のサイズ
: Total Object
ヒープ内に存在するオブジェクトの個数
: GC Time
G......C の処理時間
@see GC::Profiler.report... -
StopIteration
# result -> object (27309.0) -
この例外オブジェクトを発生させる原因となったメソッド等の返り値を返します。
...ect = Object.new
def object.each
yield :yield1
yield :yield2
:each_returned
end
enumerator = object.to_enum
p enumerator.next #=> :yield1
p enumerator.next #=> :yield2
begin
enumerator.next
rescue StopIteration => error
p error.result #=> :each_returned
end... -
Encoding
:: Converter # primitive _ errinfo -> Array (18624.0) -
直前の Encoding::Converter#primitive_convert による変換の結果を保持する五要素の配列を返します。
...ncoding::Converter#primitive_convert による変換の結果を保持する五要素の配列を返します。
@return [result, enc1, enc2, error_bytes, readagain_bytes] という五要素の配列
result は直前の primitive_convert の戻り値です。
それ以外の四要素は :invalid_b......incomplete_input か :undefined_conversion だった場合に意味を持ちます。
enc1 はエラーの発生した原始変換の変換元のエンコーディング、enc2 は変換先のエンコーディングです。
error_bytes はエラーの発生原因となったバイト列、readagai......primitive_errinfo はもっぱら Encoding::Converter#primitive_convert と組み合わせて使います。Encoding::Converter#convert を用いている場合にも取得することはできますが、有用な使い方は難しいでしょう。
//emlist[][ruby]{
# \xff is invalid as EUC-JP.... -
Mutex
# synchronize { . . . } -> object (12326.0) -
mutex をロックし、ブロックを実行します。実行後に必ず mutex のロックを解放します。
...@raise ThreadError self 既にカレントスレッドにロックされている場合に発
生します。
また、Signal.#trap に指定したハンドラ内で実行
した場合に発生します。
//emlist[例][ruby]{
m = Mutex.new
r......esult = m.synchronize do
m.locked? # => true
# critical part
"result"
end
m.locked? # => false
result # => "result"
//}... -
Thread
:: Mutex # synchronize { . . . } -> object (12326.0) -
mutex をロックし、ブロックを実行します。実行後に必ず mutex のロックを解放します。
...@raise ThreadError self 既にカレントスレッドにロックされている場合に発
生します。
また、Signal.#trap に指定したハンドラ内で実行
した場合に発生します。
//emlist[例][ruby]{
m = Mutex.new
r......esult = m.synchronize do
m.locked? # => true
# critical part
"result"
end
m.locked? # => false
result # => "result"
//}... -
Array
# permutation(n = self . length) -> Enumerator (12320.0) -
サイズ n の順列をすべて生成し,それを引数としてブロックを実行します。
...する Enumerator オブジェクトを返します。
@param n 生成する配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整......emlist[例][ruby]{
a = [1, 2, 3]
a.permutation.to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
a.permutation(1).to_a #=> [[1],[2],[3]]
a.permutation(2).to_a #=> [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]
a.permutation(3).to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
a.permu......tion(0).to_a #=> [[]]: one permutation of length 0
a.permutation(4).to_a #=> [] : no permutations of length 4
//}
ブロックが与えられた場合、作成した配列の各要素を引数としてブロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2, 3]
result... -
Array
# permutation(n = self . length) { |p| block } -> self (12320.0) -
サイズ n の順列をすべて生成し,それを引数としてブロックを実行します。
...する Enumerator オブジェクトを返します。
@param n 生成する配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整......emlist[例][ruby]{
a = [1, 2, 3]
a.permutation.to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
a.permutation(1).to_a #=> [[1],[2],[3]]
a.permutation(2).to_a #=> [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]
a.permutation(3).to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
a.permu......tion(0).to_a #=> [[]]: one permutation of length 0
a.permutation(4).to_a #=> [] : no permutations of length 4
//}
ブロックが与えられた場合、作成した配列の各要素を引数としてブロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2, 3]
result... -
Array
# repeated _ combination(n) -> Enumerator (12320.0) -
サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行 します。
...する Enumerator オブジェクトを返します。
@param n 生成される配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に......指定した場合に発生します。
//emlist[例][ruby]{
a = [1, 2, 3]
a.repeated_combination(1).to_a #=> [[1], [2], [3]]
a.repeated_combination(2).to_a #=> [[1,1],[1,2],[1,3],[2,2],[2,3],[3,3]]
a.repeated_combination(3).to_a #=> [[1,1,1],[1,1,2],[1,1,3],[1,2,2],[1,2,3],......,3,3]]
a.repeated_combination(4).to_a #=> [[1,1,1,1],[1,1,1,2],[1,1,1,3],[1,1,2,2],[1,1,2,3],
# [1,1,3,3],[1,2,2,2],[1,2,2,3],[1,2,3,3],[1,3,3,3],
# [2,2,2,2],[2,2,2,3],[2,2,3,3],[2,3,3,3],[3,3,3,3]]
a.repeated_combination(0).to_... -
Array
# repeated _ combination(n) { |c| . . . } -> self (12320.0) -
サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行 します。
...する Enumerator オブジェクトを返します。
@param n 生成される配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に......指定した場合に発生します。
//emlist[例][ruby]{
a = [1, 2, 3]
a.repeated_combination(1).to_a #=> [[1], [2], [3]]
a.repeated_combination(2).to_a #=> [[1,1],[1,2],[1,3],[2,2],[2,3],[3,3]]
a.repeated_combination(3).to_a #=> [[1,1,1],[1,1,2],[1,1,3],[1,2,2],[1,2,3],......,3,3]]
a.repeated_combination(4).to_a #=> [[1,1,1,1],[1,1,1,2],[1,1,1,3],[1,1,2,2],[1,1,2,3],
# [1,1,3,3],[1,2,2,2],[1,2,2,3],[1,2,3,3],[1,3,3,3],
# [2,2,2,2],[2,2,2,3],[2,2,3,3],[2,3,3,3],[3,3,3,3]]
a.repeated_combination(0).to_... -
Array
# repeated _ permutation(n) -> Enumerator (12320.0) -
サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。
...する Enumerator オブジェクトを返します。
@param n 生成する配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整......mlist[例][ruby]{
a = [1, 2]
a.repeated_permutation(1).to_a #=> [[1], [2]]
a.repeated_permutation(2).to_a #=> [[1,1],[1,2],[2,1],[2,2]]
a.repeated_permutation(3).to_a #=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
a.repeated_permutation......[[]] # one permutation of length 0
//}
ブロックが与えられた場合、作成した配列の各要素を引数としてブロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2]
result = []
a.repeated_permutation(3) {|e| result << e} # => [1,2]
result #=> [[1,1,1... -
Array
# repeated _ permutation(n) { |p| . . . } -> self (12320.0) -
サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。
...する Enumerator オブジェクトを返します。
@param n 生成する配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整......mlist[例][ruby]{
a = [1, 2]
a.repeated_permutation(1).to_a #=> [[1], [2]]
a.repeated_permutation(2).to_a #=> [[1,1],[1,2],[2,1],[2,2]]
a.repeated_permutation(3).to_a #=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
a.repeated_permutation......[[]] # one permutation of length 0
//}
ブロックが与えられた場合、作成した配列の各要素を引数としてブロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2]
result = []
a.repeated_permutation(3) {|e| result << e} # => [1,2]
result #=> [[1,1,1...