別のキーワード
ライブラリ
- ビルトイン (268)
- benchmark (22)
- rss (11)
- shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (6)
クラス
- Array (88)
-
Benchmark
:: Report (22) -
Enumerator
:: Lazy (27) -
RSS
:: Rss :: Channel :: Item :: Guid (11) - Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6)
モジュール
- Enumerable (153)
キーワード
- chunk (11)
- collect (44)
- collect! (22)
-
collect
_ concat (11) -
each
_ with _ index (22) -
filter
_ map (15) -
flat
_ map (11) -
grep
_ v (22) - isPermaLink (11)
- join (18)
- map (44)
- map! (22)
-
max
_ by (44) - report (11)
検索結果
先頭5件
-
Benchmark
:: Report # item(label = "" , *fmt) { . . . } -> Benchmark :: Tms (18204.0) -
ラベルと与えられたブロックの実行時間を標準出力に出力します。
ラベルと与えられたブロックの実行時間を標準出力に出力します。
出力のフォーマットは Benchmark::Tms#format が行います。
@param label ラベル
@param fmt 結果に出力したいオブジェクト
@see Benchmark::Tms#format -
Benchmark
:: Report # report(label = "" , *fmt) { . . . } -> Benchmark :: Tms (3104.0) -
ラベルと与えられたブロックの実行時間を標準出力に出力します。
ラベルと与えられたブロックの実行時間を標準出力に出力します。
出力のフォーマットは Benchmark::Tms#format が行います。
@param label ラベル
@param fmt 結果に出力したいオブジェクト
@see Benchmark::Tms#format -
RSS
:: Rss :: Channel :: Item :: Guid # isPermaLink (3007.0) -
@todo
...@todo
* http://purl.org/dc/elements/1.1/... -
Shell
# join(*item) -> String (208.0) -
File クラスにある同名のクラスメソッドと同じです.
...File クラスにある同名のクラスメソッドと同じです.
@param item 連結したいディレクトリ名やファイル名を文字列で与えます。
@see File.join... -
Shell
:: CommandProcessor # join(*item) -> String (208.0) -
File クラスにある同名のクラスメソッドと同じです.
...File クラスにある同名のクラスメソッドと同じです.
@param item 連結したいディレクトリ名やファイル名を文字列で与えます。
@see File.join... -
Shell
:: Filter # join(*item) -> String (208.0) -
File クラスにある同名のクラスメソッドと同じです.
...File クラスにある同名のクラスメソッドと同じです.
@param item 連結したいディレクトリ名やファイル名を文字列で与えます。
@see File.join... -
Enumerable
# each _ with _ index(*args) {|item , index| . . . } -> self (202.0) -
要素とそのインデックスをブロックに渡して繰り返します。
要素とそのインデックスをブロックに渡して繰り返します。
ブロックを省略した場合は、
要素とそのインデックスを繰り返すような
Enumerator を返します。
Enumerator#with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。
@param args イテレータメソッド (each など) にそのまま渡されます。
//emlist[例][ruby]{
[5, 10, 15].each_with_index do |n, idx|
p [n, idx]
end
#... -
Enumerable
# max _ by {|item| . . . } -> object | nil (127.0) -
各要素を順番にブロックに渡して実行し、 その評価結果を <=> で比較して、 最大であった値に対応する元の要素、もしくは最大の n 要素が降順で入った配列を返します。
... ** (1.0/yield(v)) }
end
end
e = (-20..20).to_a*10000
a = e.wsample(20000) {|x|
Math.exp(-(x/5.0)**2) # normal distribution
}
# a is 20000 samples from e.
p a.length #=> 20000
h = a.group_by {|x| x }
-10.upto(10) {|x| puts "*" * (h[x].length/30.0).to_i if h[x] }
#=> *
# ***
# ******
# ****......*******
# ******************
# *****************************
# *****************************************
# ****************************************************
# ***************************************************************
# ************************************************************......********
# ***********************************************************************
# ***********************************************************************
# **************************************************************
# ****************************************************
# ***********... -
Enumerable
# max _ by(n) {|item| . . . } -> Array (127.0) -
各要素を順番にブロックに渡して実行し、 その評価結果を <=> で比較して、 最大であった値に対応する元の要素、もしくは最大の n 要素が降順で入った配列を返します。
... ** (1.0/yield(v)) }
end
end
e = (-20..20).to_a*10000
a = e.wsample(20000) {|x|
Math.exp(-(x/5.0)**2) # normal distribution
}
# a is 20000 samples from e.
p a.length #=> 20000
h = a.group_by {|x| x }
-10.upto(10) {|x| puts "*" * (h[x].length/30.0).to_i if h[x] }
#=> *
# ***
# ******
# ****......*******
# ******************
# *****************************
# *****************************************
# ****************************************************
# ***************************************************************
# ************************************************************......********
# ***********************************************************************
# ***********************************************************************
# **************************************************************
# ****************************************************
# ***********... -
Enumerable
# grep _ v(pattern) { |item| . . . } -> [object] (124.0) -
Enumerable#grep のマッチの条件を逆にして、pattern === item が成立 しない要素を全て含んだ配列を返します。
...て、pattern === item が成立
しない要素を全て含んだ配列を返します。
@param pattern 「===」メソッドを持つオブジェクトを指定します。
//emlist[例][ruby]{
(1..10).grep_v 2..5 # => [1, 6, 7, 8, 9, 10]
res =(1..10).grep_v(2..5) { |v| v * 2 }
res... -
Enumerator
:: Lazy # collect _ concat {|item| . . . } -> Enumerator :: Lazy (115.0) -
ブロックの実行結果をひとつに繋げたものに対してイテレートするような Enumerator::Lazy のインスタンスを返します。
..."b", "a", "r"]
//}
ブロックの返した値 x は、以下の場合にのみ分解され、連結されます。
* x が配列であるか、to_ary メソッドを持つとき
* x が each および force メソッドを持つ (例:Enumerator::Lazy) とき
それ以外のときは、x は...