296件ヒット
[1-100件を表示]
(0.101秒)
別のキーワード
ライブラリ
- ビルトイン (143)
-
net
/ imap (11) -
net
/ smtp (55) -
rubygems
/ package / tar _ input (11) -
rubygems
/ remote _ fetcher (11) - socket (44)
- tsort (21)
クラス
- Addrinfo (22)
-
Gem
:: Package :: TarInput (11) -
Gem
:: RemoteFetcher (11) -
Net
:: IMAP :: Envelope (11) -
Net
:: SMTP (55) - Object (44)
- Range (22)
- String (33)
- UNIXServer (11)
- UNIXSocket (11)
モジュール
- Enumerable (44)
- TSort (21)
キーワード
- accept (11)
-
connect
_ from (22) - each (22)
-
each
_ strongly _ connected _ component _ from (21) - encode (33)
-
enum
_ for (22) -
get
_ proxy _ from _ env (11) -
load
_ gemspec (11) -
max
_ by (44) - ready (11)
- recvfrom (11)
-
send
_ mail (11) - sendmail (11)
-
to
_ enum (22)
検索結果
先頭5件
- Net
:: IMAP :: Envelope # from -> [Net :: IMAP :: Address] | nil - TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) {|nodes| . . . } -> () - Addrinfo
# connect _ from(host , port) {|sock| . . . } -> object - Gem
:: RemoteFetcher # get _ proxy _ from _ env -> URI | nil - TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) -> Enumerator
-
Net
:: IMAP :: Envelope # from -> [Net :: IMAP :: Address] | nil (18219.0) -
From を Net::IMAP::Address オブジェクトの配列で返します。
...From を Net::IMAP::Address オブジェクトの配列で返します。
エンベロープに存在しないときは nil を返します。... -
TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) {|nodes| . . . } -> () (6240.0) -
node から到達可能な強連結成分についてのイテレータです。
...達可能な強連結成分についてのイテレータです。
返す値は規定されていません。
each_strongly_connected_component_from は
tsort_each_node を呼びません。
@param node ノードを指定します。
//emlist[例 到達可能なノードを表示する][ruby]{
r......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... -
Addrinfo
# connect _ from(host , port) {|sock| . . . } -> object (6216.0) -
引数で指定されたアドレスから 自身のアドレスへソケットを接続します。
...ケット接続のローカル側のアドレスになります。
require 'socket'
Addrinfo.tcp("www.ruby-lang.org", 80).connect_from("0.0.0.0", 4649) {|s|
s.print "GET / HTTP/1.0\r\nHost: www.ruby-lang.org\r\n\r\n"
puts s.read
}
@param host ホスト(IP アドレスもしくはホ... -
Gem
:: RemoteFetcher # get _ proxy _ from _ env -> URI | nil (6203.0) -
環境変数にセットされている HTTP proxy の情報を取得して返します。
環境変数にセットされている HTTP proxy の情報を取得して返します。
ここでチェックしている環境変数は以下の通りです。
* http_proxy
* http_proxy_user
* http_proxy_pass
* HTTP_PROXY
* HTTP_PROXY_USER
* HTTP_PROXY_PASS -
TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) -> Enumerator (6140.0) -
node から到達可能な強連結成分についてのイテレータです。
...達可能な強連結成分についてのイテレータです。
返す値は規定されていません。
each_strongly_connected_component_from は
tsort_each_node を呼びません。
@param node ノードを指定します。
//emlist[例 到達可能なノードを表示する][ruby]{
r......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... -
Addrinfo
# connect _ from(host , port) -> Socket (6116.0) -
引数で指定されたアドレスから 自身のアドレスへソケットを接続します。
...ケット接続のローカル側のアドレスになります。
require 'socket'
Addrinfo.tcp("www.ruby-lang.org", 80).connect_from("0.0.0.0", 4649) {|s|
s.print "GET / HTTP/1.0\r\nHost: www.ruby-lang.org\r\n\r\n"
puts s.read
}
@param host ホスト(IP アドレスもしくはホ... -
UNIXSocket
# recvfrom(maxlen , flags = 0) -> [String [String , String]] (6107.0) -
recvfrom(2) を用いてソケットからメッセージを受け取ります。
...recvfrom(2) を用いてソケットからメッセージを受け取ります。
maxlen で受け取るメッセージの最大長をバイト数で指定します。
flags には Socket::MSG_* という名前の定数の bitwise OR を渡します。
戻り値は文字列と相手ソケット......のパスのペアです。
例:
require 'socket'
UNIXServer.open("/tmp/s") {|serv|
c = UNIXSocket.open("/tmp/s")
s = serv.accept
s.send "a", 0
p c.recvfrom(10)[0] #=> "a"
}
@param maxlen 受け取るメッセージの最大長
@param flags フラグ... -
Net
:: SMTP # open _ message _ stream(from _ addr , *to _ addrs) {|f| . . . . } -> () (247.0) -
メール書き込みの準備をし、書き込み先のストリームオブジェクトを ブロックに渡します。ブロック終了後、書きこんだ結果が 送られます。
...
from_domain は送り主のメールアドレス ('...@...'のかたち) 、
to_addrs には送信先メールアドレスを文字列で渡します。
require 'net/smtp'
Net::SMTP.start('smtp.example.com', 25) {|smtp|
smtp.open_message_stream('from@example.com', 'to@example.net') {|f|......f.puts 'From: from@example.com'
f.puts 'To: to@example.net'
f.puts 'Subject: test mail'
f.puts
f.puts 'This is test mail.'
}
}
ready は obsolete です。
@param from_addr 送信元のメールアドレス
@param to_addrs 送信先のメールアドレス(複... -
Net
:: SMTP # ready(from _ addr , *to _ addrs) {|f| . . . . } -> () (247.0) -
メール書き込みの準備をし、書き込み先のストリームオブジェクトを ブロックに渡します。ブロック終了後、書きこんだ結果が 送られます。
...
from_domain は送り主のメールアドレス ('...@...'のかたち) 、
to_addrs には送信先メールアドレスを文字列で渡します。
require 'net/smtp'
Net::SMTP.start('smtp.example.com', 25) {|smtp|
smtp.open_message_stream('from@example.com', 'to@example.net') {|f|......f.puts 'From: from@example.com'
f.puts 'To: to@example.net'
f.puts 'Subject: test mail'
f.puts
f.puts 'This is test mail.'
}
}
ready は obsolete です。
@param from_addr 送信元のメールアドレス
@param to_addrs 送信先のメールアドレス(複... -
Enumerable
# max _ by {|item| . . . } -> object | nil (152.0) -
各要素を順番にブロックに渡して実行し、 その評価結果を <=> で比較して、 最大であった値に対応する元の要素、もしくは最大の n 要素が降順で入った配列を返します。
...ator: ["albatross", "dog", "horse"]:max_by>
a.max_by { |x| x.length } # => "albatross"
//}
//emlist[例][ruby]{
a = %w[albatross dog horse]
a.max_by(2) # => #<Enumerator: ["albatross", "dog", "horse"]:max_by(2)>
a.max_by(2) {|x| x.length } # => ["albatross", "horse"]
//}
//emlist......def wsample(n)
self.max_by(n) {|v| rand ** (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...