別のキーワード
クラス
- Exception (12)
- Matrix (100)
- Set (18)
- Vector (148)
-
WIN32OLE
_ TYPE (12)
モジュール
- TSort (23)
キーワード
- == (12)
- collect (48)
- collect! (37)
- collect2 (24)
-
default
_ event _ sources (12) - each (24)
-
each
_ strongly _ connected _ component _ from (23) -
elements
_ to _ f (12) -
elements
_ to _ i (12) -
elements
_ to _ r (12) - map! (37)
- map2 (12)
検索結果
先頭5件
- TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) -> Enumerator - TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) {|nodes| . . . } -> () - WIN32OLE
_ TYPE # default _ event _ sources -> [WIN32OLE _ TYPE] - Matrix
# collect!(which = :all) -> Enumerator - Matrix
# collect!(which = :all) {|element| . . . } -> self
-
TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) -> Enumerator (115.0) -
node から到達可能な強連結成分についてのイテレータです。
...m は
tsort_each_node を呼びません。
@param node ノードを指定します。
//emlist[例 到達可能なノードを表示する][ruby]{
require 'tsort'
class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
e... -
TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) {|nodes| . . . } -> () (115.0) -
node から到達可能な強連結成分についてのイテレータです。
...m は
tsort_each_node を呼びません。
@param node ノードを指定します。
//emlist[例 到達可能なノードを表示する][ruby]{
require 'tsort'
class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
e... -
WIN32OLE
_ TYPE # default _ event _ sources -> [WIN32OLE _ TYPE] (49.0) -
型が持つソースインターフェイスを取得します。
...場合は空配列を返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Worksheet')
tobj.default_event_sources.map {|intf| intf.name} #=> ["DocEvents"]
WIN32OLE_EVENT.newでインターフェイス名を指定しない場合は、ここで
返されたインタ......。
ここでは最終イベントのStatusTextChangeイベントのメッセージについては既
知としています。
# coding : cp932
require 'win32ole'
type = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'InternetExplorer')
ctl = WIN32OLE.new(type.progid)
source = type.default......now}: #{m.name} was called"
p arg
end
end
end
evt = WIN32OLE_EVENT.new(ctl)
evt.handler = WebEvent.new
ctl.navigate2 'http://www.ruby-lang.org/'
loop do
break if evt.handler.completed
WIN32OLE_EVENT.message_loop
end
ctl.Quit
このプログラムを実行するとWindows... -
Matrix
# collect!(which = :all) -> Enumerator (33.0) -
行列の各要素に対してブロックの適用を繰り返した結果で要素を置き換えます。
...の各要素に対してブロックの適用を繰り返した結果で要素を置き換えます。
ブロックのない場合は、自身と map! から生成した Enumerator オブジェクトを返します。
@param which which に以下の Symbol を指定することで、......詳細は、 Matrix#each の項目を参照して下さい。
//emlist[例][ruby]{
require 'matrix'
m = Matrix[[1, 2], [3, 4]]
p m.map! { |element| element * 10 } #=> Matrix[[10, 20], [30, 40]]
p m #=> Matrix[[10, 20], [30, 40]]
//}
@see Matrix#each, Matrix#map... -
Matrix
# collect!(which = :all) {|element| . . . } -> self (33.0) -
行列の各要素に対してブロックの適用を繰り返した結果で要素を置き換えます。
...の各要素に対してブロックの適用を繰り返した結果で要素を置き換えます。
ブロックのない場合は、自身と map! から生成した Enumerator オブジェクトを返します。
@param which which に以下の Symbol を指定することで、......詳細は、 Matrix#each の項目を参照して下さい。
//emlist[例][ruby]{
require 'matrix'
m = Matrix[[1, 2], [3, 4]]
p m.map! { |element| element * 10 } #=> Matrix[[10, 20], [30, 40]]
p m #=> Matrix[[10, 20], [30, 40]]
//}
@see Matrix#each, Matrix#map... -
Matrix
# collect(which = :all) -> Enumerator (33.0) -
行列の各要素に対してブロックの適用を繰り返した結果を、要素として持つ行列を生成します。
...Symbol の詳細は、 Matrix#each の項目を参照して下さい。
//emlist[例][ruby]{
require 'matrix'
m = Matrix[[1, 2], [3, 4]]
p m.map { |x| x + 100 } # => Matrix[[101, 102], [103, 104]]
p m.map(:diagonal) { |x| x * 10 } # => Matrix[[10, 2], [3, 40]]
//}
@see Matrix#each, Matrix#map!... -
Matrix
# collect(which = :all) {|x| . . . } -> Matrix (33.0) -
行列の各要素に対してブロックの適用を繰り返した結果を、要素として持つ行列を生成します。
...Symbol の詳細は、 Matrix#each の項目を参照して下さい。
//emlist[例][ruby]{
require 'matrix'
m = Matrix[[1, 2], [3, 4]]
p m.map { |x| x + 100 } # => Matrix[[101, 102], [103, 104]]
p m.map(:diagonal) { |x| x * 10 } # => Matrix[[10, 2], [3, 40]]
//}
@see Matrix#each, Matrix#map!... -
Exception
# ==(other) -> bool (31.0) -
自身と指定された other のクラスが同じであり、 message と backtrace が == メソッドで比較して 等しい場合に true を返します。そうでない場合に false を返します。
...[ruby]{
require "date"
def check_long_month(month)
return if Date.new(2000, month, -1).day == 31
raise "#{month} is not long month"
end
def get_exception
return begin
yield
rescue => e
e
end
end
results = [2, 2, 4].map { |e | get_exception { check_long_month(e) } }
p results.map......{ |e| e.class }
# => [RuntimeError, RuntimeError, RuntimeError]
p results.map { |e| e.message }
# => ["2 is not long month", "2 is not long month", "4 is not long month"]
# class, message, backtrace が同一のため true になる
p results[0] == results[1] # => true
# class, backtrace が同... -
Vector
# collect! -> Enumerator (27.0) -
ベクトルの各要素を順番にブロックに渡して評価し、その結果で要素を置き換えます。
...果で要素を置き換えます。
ブロックのない場合は、自身と map! から生成した Enumerator オブジェクトを返します。
//emlist[例][ruby]{
require 'matrix'
v = Vector[1, 2, 3]
p v.map!{ |el| el * 2 } #=> Vector[2, 4, 6]
p v #=> Vector[2, 4,... -
Vector
# collect! {|element| . . . } -> self (27.0) -
ベクトルの各要素を順番にブロックに渡して評価し、その結果で要素を置き換えます。
...果で要素を置き換えます。
ブロックのない場合は、自身と map! から生成した Enumerator オブジェクトを返します。
//emlist[例][ruby]{
require 'matrix'
v = Vector[1, 2, 3]
p v.map!{ |el| el * 2 } #=> Vector[2, 4, 6]
p v #=> Vector[2, 4,... -
Matrix
# collect -> Enumerator (21.0) -
行列の各要素に対してブロックの適用を繰り返した結果を、要素として持つ行列を生成します。
...適用を繰り返した結果を、要素として持つ行列を生成します。
ブロックがない場合、 Enumerator を返します。
//emlist[例][ruby]{
require 'matrix'
m = Matrix[[1, 2], [3, 4]]
p m.map { |x| x + 100 } # => Matrix[[101, 102], [103, 104]]
//}
@see Matrix#each... -
Matrix
# collect {|x| . . . } -> Matrix (21.0) -
行列の各要素に対してブロックの適用を繰り返した結果を、要素として持つ行列を生成します。
...適用を繰り返した結果を、要素として持つ行列を生成します。
ブロックがない場合、 Enumerator を返します。
//emlist[例][ruby]{
require 'matrix'
m = Matrix[[1, 2], [3, 4]]
p m.map { |x| x + 100 } # => Matrix[[101, 102], [103, 104]]
//}
@see Matrix#each... -
Vector
# collect -> Enumerator (21.0) -
ベクトルの各要素に対してブロックを評価した結果を、要素として持つベクトルを生成します。
...して持つベクトルを生成します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'matrix'
a = [1, 2, 3.5, -10]
v1 = Vector.elements(a)
p v1 # => Vector[1, 2, 3.5, -10]
v2 = v1.map{|x|
x * -1
}
p v2 # => Vector[-1, -2, -3.5, 10]
//}...