79件ヒット
[1-79件を表示]
(0.148秒)
別のキーワード
ライブラリ
- ビルトイン (20)
-
net
/ imap (12) - pstore (12)
-
rinda
/ tuplespace (12) - tsort (23)
クラス
- Hash (12)
-
Net
:: IMAP :: FetchData (12) - PStore (12)
-
Rinda
:: TupleEntry (12) - Thread (8)
モジュール
- TSort (23)
キーワード
- attr (12)
-
each
_ strongly _ connected _ component _ from (23)
検索結果
先頭5件
-
PStore
# fetch(name , default = PStore :: Error) -> object (21238.0) -
ルートnameに対応する値を得ます。
...値を返し、
与えられていなければ例外 PStore::Error が発生します。
@param name 探索するルート。
@param default name に対応するルートが登録されていない場合に返す値を指定する。
@raise PStore::Error name に対応するルートが登録さ......例:
require 'pstore'
db = PStore.new("/tmp/foo")
db.transaction do
p db.roots # => []
ary = db["root"] = [1,2,3,4]
ary[0] = [1,1.5]
end
db.transaction(true) do |pstore|
pstore.fetch("root") # => [[1, 1.5], 2, 3, 4]
pstore.fetch("root", 'aaa') # => [[......1, 1.5], 2, 3, 4]
pstore.fetch("not_root") # => 例外発生
end
@see Hash#fetch, PStore#[]... -
Rinda
:: TupleEntry # [](key) (21107.0) -
タプルの key に対応する要素を返します。
...タプルの key に対応する要素を返します。
Rinda::TupleEntry#value[key] を返します。
@param key 要素を指定するキー
@see Rinda::TupleEntry#fetch... -
Hash
# [](key) -> object | nil (18137.0) -
key に関連づけられた値を返します。
...ある場合は Hash#fetch または Hash#key? を使ってください。
@param key 探索するキーを指定します。
//emlist[例][ruby]{
h = {:ab => "some" , :cd => "all"}
p h[:ab] #=> "some"
p h[:ef] #=> nil
h1 = Hash.new("default value")
p h1[:non]......#=> "default value"
h2 = Hash.new {|*arg| arg}
p h2[:non] #=> [{}, :non]
//}
@see Hash.new, Hash#fetch,Hash#values_at,Hash#key?, Hash#default, Hash#default_proc... -
Thread
# [](name) -> object | nil (18113.0) -
name に対応したスレッドに固有のデータを取り出します。 name に対応するスレッド固有データがなければ nil を返し ます。
...@param name スレッド固有データのキーを文字列か Symbol で指定します。
//emlist[例][ruby]{
[
Thread.new { Thread.current["name"] = "A" },
Thread.new { Thread.current[:name] = "B" },
Thread.new { Thread.current["name"] = "C" }
].each do |th|
th.join
puts "#{th.inspe......002a541a8 dead>: B
# => #<Thread:0x00000002a54130 dead>: C
//}
Thread#[] と Thread#[]= を用いたスレッド固有の変数は
Fiber を切り替えると異なる変数を返す事に注意してください。
//emlist[][ruby]{
def meth(newvalue)
begin
oldvalue = Thread.current[:name]......Fiberを切り替える場合は動的スコープとしては
正しく動作しません。
//emlist[][ruby]{
f = Fiber.new {
meth(1) {
Fiber.yield
}
}
meth(2) {
f.resume
}
f.resume
p Thread.current[:name]
# => nil if fiber-local
# => 2 if thread-local (The value 2 is leaked to outside... -
TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) -> Enumerator (6213.0) -
node から到達可能な強連結成分についてのイテレータです。
...ected_component_from は
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).e......ach(&block)
end
end
non_sort = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}
non_sort.each_strongly_connected_component{|nodes|
p nodes
nodes.each {|node|
non_sort.each_strongly_connected_component_from(node){|ns|
printf("%s -> %s\n", node, ns.join(","))
}
}
}
#出力
#=> [4]
#=> 4 ->......4
#=> [2, 3]
#=> 2 -> 4
#=> 2 -> 2,3
#=> 3 -> 4
#=> 3 -> 3,2
#=> [1]
#=> 1 -> 4
#=> 1 -> 2,3
#=> 1 -> 1
//}
@see TSort.each_strongly_connected_component_from... -
TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) {|nodes| . . . } -> () (6213.0) -
node から到達可能な強連結成分についてのイテレータです。
...ected_component_from は
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).e......ach(&block)
end
end
non_sort = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}
non_sort.each_strongly_connected_component{|nodes|
p nodes
nodes.each {|node|
non_sort.each_strongly_connected_component_from(node){|ns|
printf("%s -> %s\n", node, ns.join(","))
}
}
}
#出力
#=> [4]
#=> 4 ->......4
#=> [2, 3]
#=> 2 -> 4
#=> 2 -> 2,3
#=> 3 -> 4
#=> 3 -> 3,2
#=> [1]
#=> 1 -> 4
#=> 1 -> 2,3
#=> 1 -> 1
//}
@see TSort.each_strongly_connected_component_from... -
Net
:: IMAP :: FetchData # attr -> { String => object } (6025.0) -
各メッセージのアトリビュートの値をハッシュテーブルで返します。
...式。
Net::IMAP::BodyTypeBasic, Net::IMAP::BodyTypeText,
Net::IMAP::BodyTypeMessage, Net::IMAP::BodyTypeMultipart
のいずれか。
: BODY[<section>]<<partial>>
section で指定されたセクションのボディの内容。文字列。
: BODY.PEEK[<section>]<<partial>>
secti......B でのメッセージボディ。
Net::IMAP::BodyTypeBasic, Net::IMAP::BodyTypeText,
Net::IMAP::BodyTypeMessage, Net::IMAP::BodyTypeMultipart
のいずれか。
: ENVELOPE
メッセージのエンベロープ。
Net::IMAP::Envelope オブジェクト。
: FLAGS
メッセー......されたフラグ。
Symbol の配列。String#capitalize でキャピタライズ
されている。
: INTERNALDATE
メッセージの内部日付。文字列。
: RFC822
BODY[] と同じ。文字列。
: RFC822.HEADER
BODY.PEEK[HEADER] と同じ。文字列。
: RFC822.SIZE...