種類
- インスタンスメソッド (349)
- 特異メソッド (155)
- 文書 (71)
- ライブラリ (11)
ライブラリ
- ビルトイン (140)
- csv (66)
-
net
/ pop (66) - openssl (11)
- optparse (33)
- psych (34)
-
rexml
/ document (44) - stringio (55)
-
webrick
/ log (11) - zlib (44)
クラス
- Array (107)
- CSV (66)
- IO (11)
- Integer (11)
-
Net
:: POPMail (66) - OptionParser (33)
-
REXML
:: Document (22) -
REXML
:: Element (11) -
REXML
:: Formatters :: Default (11) - String (11)
- StringIO (55)
-
WEBrick
:: BasicLog (11) -
Zlib
:: Deflate (22) -
Zlib
:: GzipWriter (11) -
Zlib
:: Inflate (11)
モジュール
-
OpenSSL
:: Buffering (11) - Psych (34)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 7 . 0 (5) - all (22)
- combination (22)
-
load
_ stream (22) - mail (22)
- new (33)
- open (44)
- pack (19)
- pack テンプレート文字列 (11)
- parse (22)
- permutation (22)
- pop (22)
- read (11)
- readlines (11)
- readpartial (11)
-
repeated
_ combination (22) -
repeated
_ permutation (22) - rss (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 3 feature (11) -
safe
_ load (12) - separator (11)
-
set
_ dictionary (22) - string (11)
- summarize (22)
-
to
_ r (11) - unpack (11)
- write (44)
検索結果
先頭5件
-
StringIO
# <<(obj) -> self (24200.0) -
obj を pos の位置に書き込みます。 必要なら obj.to_s を呼んで 文字列に変換します。 self を返します。
...obj を pos の位置に書き込みます。 必要なら obj.to_s を呼んで
文字列に変換します。 self を返します。
@param obj 自身に書き込みたい、文字列か to_s が定義されたオブジェクトを指定します。... -
Zlib
:: GzipWriter # <<(str) -> self (21318.0) -
str を出力します。str が文字列でない場合は to_s を用いて 文字列に変換します。
...str を出力します。str が文字列でない場合は to_s を用いて
文字列に変換します。
@param str 出力したいオブジェクトを与えます。
require 'zlib'
filename='hoge1.gz'
fw = File.open(filename, "w")
Zlib::GzipWriter.wrap(fw, Zlib::BEST_COMPRESSION){|......gz|
gz << "hoge" << "fuga"
}
fr = File.open(filename)
Zlib::GzipReader.wrap(fr){|gz|
puts gz.read
}
#=> hogefuga
@see IO#<<... -
OpenSSL
:: Buffering # <<(s) -> self (21206.0) -
文字列 s を書き込みます。
...文字列 s を書き込みます。
IO#<< と同様です。
@param s 出力する文字列... -
IO
# readpartial(maxlen , outbuf = "") -> String (15342.0) -
IO から長さ maxlen を上限として読み込み、文字列として返します。 即座に得られるデータが存在しないときにはブロックしてデータの到着を待ちます。 即座に得られるデータが 1byte でも存在すればブロックしません。
...
IO から長さ maxlen を上限として読み込み、文字列として返します。
即座に得られるデータが存在しないときにはブロックしてデータの到着を待ちます。
即座に得られるデータが 1byte でも存在すればブロックしません。
バ......込みメソッドとして動作します。
既に EOF に達していれば EOFError が発生します。
ただし、maxlen に 0 が指定されている場合は、空文字列 "" を返します。
readpartial はブロックを最小限に抑えることによって、
パイプ、ソケ......端末などのストリームに対して適切に動作するよう設計されています。
readpartial がブロックするのは次の全ての条件が満たされたときだけです。
* IO オブジェクト内のバッファが空
* ストリームにデータが到着していな... -
StringIO
# string -> String (12312.0) -
自身が表す文字列を返します。
...たバッファとして使われている文字列です。
文字列は複製されないことに注意して下さい。
//emlist[例][ruby]{
require "stringio"
sio = StringIO.new
sio << "abc"
s = sio.string
p s #=> "abc"
sio << "xyz"
p s #=> "abcxyz"
//}... -
Zlib
:: Deflate # set _ dictionary(string) -> String (12312.0) -
圧縮に用いる辞書を指定します。string を返します。 このメソッドは Zlib::Deflate.new, Zlib::ZStream#reset を呼び出した直後にのみ有効です。詳細は zlib.h を参照して下さい。
...tring を返します。
このメソッドは Zlib::Deflate.new, Zlib::ZStream#reset
を呼び出した直後にのみ有効です。詳細は zlib.h を参照して下さい。
@param string 辞書に用いる文字列を指定します。詳しくは zlib.h を参照してください。
@return......ます。
require 'zlib'
def case1(str)
dez = Zlib::Deflate.new
comp_str = dez.deflate(str)
comp_str << dez.finish
comp_str.size
end
def case2(str, dict)
dez = Zlib::Deflate.new
p dez.set_dictionary(dict)
comp_str = dez.deflate(str)
comp_str << dez.finish......tr.size
end
i = 10
dict = 'hoge_fuga_ugougo'
sset = [ dict, 'taeagbamike', 'ugotagma', 'fugebogya' ]
g = [ 0, 1, 1, 1, 0, 0, 0, 3, 3, 3, 0, 0, 1, 1, 0, 0, 0, 1, 2, 2, 0, 0, 0, 2, 0, 1, 1, 0, 0, 0, 0, 0]
str = (1..i).collect{|m| t = rand(g.size); sset.at(g[t])}.join("")
printf "%d nor... -
Array
# permutation(n = self . length) -> Enumerator (12306.0) -
サイズ n の順列をすべて生成し,それを引数としてブロックを実行します。
...する Enumerator オブジェクトを返します。
@param n 生成する配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整......][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.permutation(0).......ermutation of length 0
a.permutation(4).to_a #=> [] : no permutations of length 4
//}
ブロックが与えられた場合、作成した配列の各要素を引数としてブロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2, 3]
result = []
a.permutation(2) {|e| r... -
Array
# permutation(n = self . length) { |p| block } -> self (12306.0) -
サイズ n の順列をすべて生成し,それを引数としてブロックを実行します。
...する Enumerator オブジェクトを返します。
@param n 生成する配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整......][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.permutation(0).......ermutation of length 0
a.permutation(4).to_a #=> [] : no permutations of length 4
//}
ブロックが与えられた場合、作成した配列の各要素を引数としてブロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2, 3]
result = []
a.permutation(2) {|e| r... -
Array
# repeated _ combination(n) -> Enumerator (12306.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 (12306.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_...