ライブラリ
- ビルトイン (926)
-
cgi
/ html (120) - csv (60)
- dbm (24)
- digest (36)
- fiddle (120)
-
fiddle
/ import (24) - forwardable (48)
- gdbm (24)
- getoptlong (24)
-
io
/ console (12) - logger (1)
- matrix (156)
- mkmf (48)
-
net
/ ftp (196) -
net
/ http (48) -
net
/ imap (72) -
net
/ pop (24) - openssl (36)
- pathname (24)
- rake (24)
-
rexml
/ document (60) -
rinda
/ tuplespace (12) - rss (24)
-
rubygems
/ package / tar _ header (12) -
rubygems
/ package / tar _ writer (24) -
rubygems
/ remote _ fetcher (12) -
rubygems
/ source _ index (36) -
rubygems
/ source _ info _ cache _ entry (12) - sdbm (24)
- set (18)
- shell (12)
-
shell
/ command-processor (12) -
shell
/ filter (12) - stringio (24)
- strscan (96)
- tempfile (24)
- thread (20)
-
webrick
/ httpresponse (12) -
webrick
/ httpservlet / filehandler (24) -
webrick
/ server (12) - win32ole (24)
- zlib (36)
クラス
- Array (93)
- CSV (12)
-
CSV
:: Row (24) -
CSV
:: Table (24) - DBM (24)
-
Digest
:: Base (36) -
Encoding
:: Converter (24) - Enumerator (12)
-
Enumerator
:: ArithmeticSequence (7) -
Enumerator
:: Chain (7) -
Fiddle
:: Pointer (120) - File (24)
-
File
:: Stat (36) - GDBM (24)
-
Gem
:: Package :: TarHeader (12) -
Gem
:: Package :: TarWriter (24) -
Gem
:: RemoteFetcher (12) -
Gem
:: SourceIndex (36) -
Gem
:: SourceInfoCacheEntry (12) - GetoptLong (24)
- Hash (24)
- IO (12)
- Integer (24)
-
Logger
:: Application (1) - MatchData (24)
- Matrix (96)
- Method (48)
-
Net
:: FTP (176) -
Net
:: FTP :: MLSxEntry (20) -
Net
:: HTTPGenericRequest (24) -
Net
:: IMAP (12) -
Net
:: IMAP :: BodyTypeBasic (12) -
Net
:: IMAP :: BodyTypeMessage (12) -
Net
:: IMAP :: BodyTypeText (12) -
Net
:: IMAP :: ContentDisposition (12) -
Net
:: IMAP :: FetchData (12) -
Net
:: POPMail (24) - Object (48)
-
OpenSSL
:: Cipher (12) -
OpenSSL
:: SSL :: SSLContext (24) - Pathname (24)
-
REXML
:: Attributes (24) -
REXML
:: Elements (12) -
REXML
:: Parent (24) -
RSS
:: Maker :: ItemsBase (24) -
Rake
:: Application (12) - Random (12)
- Range (36)
-
Rinda
:: TupleEntry (12) -
RubyVM
:: InstructionSequence (12) - SDBM (24)
- Set (24)
- Shell (12)
-
Shell
:: CommandProcessor (12) -
Shell
:: Filter (12) - String (223)
- StringIO (24)
- StringScanner (96)
- Struct (36)
- Symbol (24)
- Tempfile (24)
-
Thread
:: Queue (24) -
Thread
:: SizedQueue (130) - UnboundMethod (72)
- Vector (60)
-
WEBrick
:: GenericServer (12) -
WEBrick
:: HTTPResponse (12) -
WEBrick
:: HTTPServlet :: DefaultFileHandler (24) -
WIN32OLE
_ METHOD (24) -
Zlib
:: Deflate (12) -
Zlib
:: Inflate (12) -
Zlib
:: ZStream (12)
モジュール
-
CGI
:: HtmlExtension (120) -
Fiddle
:: Importer (24) - Forwardable (24)
- Kernel (48)
-
Net
:: HTTPHeader (24) -
Rake
:: TaskManager (12) - SingleForwardable (24)
キーワード
- + (36)
- +@ (12)
- - (36)
- -@ (12)
- << (12)
- == (24)
- [] (84)
-
add
_ file _ simple (24) - arity (24)
- attr (12)
-
avail
_ out= (12) - bind (12)
-
bit
_ length (12) - blksize (12)
-
block
_ size (12) -
body
_ stream (12) -
body
_ stream= (12) - bsearch (48)
- byterindex (3)
- bytes (12)
- bytesize (12)
-
check
_ signedness (24) -
check
_ sizeof (24) - clear (12)
- clone (12)
- close (10)
-
column
_ count (12) -
column
_ size (12) -
def
_ delegators (24) -
def
_ instance _ delegators (12) -
def
_ single _ delegators (12) - deq (12)
-
digest
_ length (12) - each2 (24)
-
each
_ grapheme _ cluster (16) -
each
_ index (12) - empty? (8)
- enq (12)
-
enum
_ for (24) - eql? (24)
- facts (10)
- fetch (12)
-
fetch
_ size (12) -
field
_ size _ limit (12) -
file
_ field (24) - get (36)
-
get
_ option (12) - getbinaryfile (24)
- hash (24)
- length (260)
-
make
_ partial _ content (12) -
matched
_ size (12) - matchedsize (12)
- max (12)
- max= (12)
-
max
_ size (12) -
max
_ size= (12) - minor (24)
- mlsd (20)
- name (12)
- pack (21)
- param (12)
-
password
_ field (24) - peek (12)
- peep (12)
- pop (12)
-
prepare
_ range (12) -
primitive
_ convert (24) - ptr (12)
- push (12)
- put (24)
- putbinaryfile (24)
- ref (12)
-
rest
_ size (12) - restsize (12)
- retrbinary (24)
- rindex (12)
-
row
_ count (12) -
row
_ size (12) -
scrolling
_ list (24) -
sent
_ size (12) -
session
_ cache _ size (12) -
session
_ cache _ size= (12) -
set
_ dictionary (24) -
set
_ log (1) - shift (12)
- size= (12)
- size? (42)
-
size
_ opt _ params (12) -
size
_ params (12) - sizeof (12)
- slice (72)
- storbinary (24)
-
synthesize
_ file _ task (12) - terminate (12)
-
text
_ field (24) -
to
_ a (12) -
to
_ enum (24) -
to
_ str (24) - tokens (12)
- transpose (12)
- truncate (12)
- unpack (12)
- winsize (12)
検索結果
先頭5件
- Array
# pack(template , buffer: String . new) -> String - Kernel
# check _ signedness(type , headers = nil , opts = nil) -> "signed" | "unsigned" | nil - Kernel
# check _ signedness(type , headers = nil , opts = nil) { . . . } -> "signed" | "unsigned" | nil - Range
# bsearch -> Enumerator - Range
# bsearch {|obj| . . . } -> object | nil
-
Array
# pack(template , buffer: String . new) -> String (291.0) -
配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。
...配列の内容を template で指定された文字列にしたがって、
バイナリとしてパックした文字列を返します。
テンプレートは
型指定文字列とその長さ(省略時は1)を並べたものです。長さと
して * が指定された時は「残りのデ......プレート文字列の通りです。
buffer が指定されていれば、バッファとして使って返値として返します。
もし template の最初にオフセット (@) が指定されていれば、
結果はオフセットの後ろから詰められます。
buffer の元の内......てください。
buffer のサイズ(capacity)が足りなければ、packはメモリを確保します。
//emlist[例][ruby]{
['!'].pack('@1a', buffer: 'abc') # => "a!"
['!'].pack('@5a', buffer: 'abc') # => "abc\u0000\u0000!"
//}
@param template 自身のバイナリとしてパックする... -
Kernel
# check _ signedness(type , headers = nil , opts = nil) -> "signed" | "unsigned" | nil (197.0) -
Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.
...Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.
If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS......F_', followed by the +type+
name, followed by '=X' where 'X' is positive integer if the +type+ is
unsigned, or negative integer if the +type+ is signed.
For example, if size_t is defined as unsigned, then
check_signedness('size_t') would returned +1 and the
SIGNEDNESS_OF_SIZE_T=+1 preprocesso......r macro would be passed to the
compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is
done.... -
Kernel
# check _ signedness(type , headers = nil , opts = nil) { . . . } -> "signed" | "unsigned" | nil (197.0) -
Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.
...Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.
If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS......F_', followed by the +type+
name, followed by '=X' where 'X' is positive integer if the +type+ is
unsigned, or negative integer if the +type+ is signed.
For example, if size_t is defined as unsigned, then
check_signedness('size_t') would returned +1 and the
SIGNEDNESS_OF_SIZE_T=+1 preprocesso......r macro would be passed to the
compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is
done.... -
Range
# bsearch -> Enumerator (125.0) -
ブロックの評価結果で範囲内の各要素の大小判定を行い、条件を満たす値を二 分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を 返します。
...要素の場合: true を返す
* 求める値がブロックパラメータより後の要素の場合: false を返す
ブロックの評価結果が true になる最初の要素を返すか、nil を返します。
//emlist[例][ruby]{
ary = [0, 4, 7, 10, 12]
(0...ary.size).bsearch {|i| ary[......i] >= 4 } # => 1
(0...ary.size).bsearch {|i| ary[i] >= 6 } # => 2
(0...ary.size).bsearch {|i| ary[i] >= 8 } # => 3
(0...ary.size).bsearch {|i| ary[i] >= 100 } # => nil
(0.0...Float::INFINITY).bsearch {|x| Math.log(x) >= 0 } # => 1.0
//}
find-any モードは bsearch(3) のように動作します......st[例][ruby]{
ary = [0, 100, 100, 100, 200]
(0..4).bsearch {|i| 100 - ary[i] } # => 1, 2 or 3
(0..4).bsearch {|i| 300 - ary[i] } # => nil
(0..4).bsearch {|i| 50 - ary[i] } # => nil
//}
上記の 2 つのモードを混在して使用しないでください(ブロックの評価結果は
常に t... -
Range
# bsearch {|obj| . . . } -> object | nil (125.0) -
ブロックの評価結果で範囲内の各要素の大小判定を行い、条件を満たす値を二 分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を 返します。
...要素の場合: true を返す
* 求める値がブロックパラメータより後の要素の場合: false を返す
ブロックの評価結果が true になる最初の要素を返すか、nil を返します。
//emlist[例][ruby]{
ary = [0, 4, 7, 10, 12]
(0...ary.size).bsearch {|i| ary[......i] >= 4 } # => 1
(0...ary.size).bsearch {|i| ary[i] >= 6 } # => 2
(0...ary.size).bsearch {|i| ary[i] >= 8 } # => 3
(0...ary.size).bsearch {|i| ary[i] >= 100 } # => nil
(0.0...Float::INFINITY).bsearch {|x| Math.log(x) >= 0 } # => 1.0
//}
find-any モードは bsearch(3) のように動作します......st[例][ruby]{
ary = [0, 100, 100, 100, 200]
(0..4).bsearch {|i| 100 - ary[i] } # => 1, 2 or 3
(0..4).bsearch {|i| 300 - ary[i] } # => nil
(0..4).bsearch {|i| 50 - ary[i] } # => nil
//}
上記の 2 つのモードを混在して使用しないでください(ブロックの評価結果は
常に t... -
Array
# bsearch -> Enumerator (107.0) -
ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値を二分探 索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返し ます。self はあらかじめソートしておく必要があります。
...ラメータの値か前の要素の場合: true を返す
* 求める値がブロックパラメータより後の要素の場合: false を返す
ブロックの評価結果が true になる最初の要素を返すか、nil を返します。
//emlist[例][ruby]{
ary = [0, 4, 7, 10, 12]
ary.bs......ラメータの値が求める値の範囲よりも大きい(j <= k < self.size)場合: 負の数を返す
ブロックの評価結果が 0 になるいずれかの要素を返すか、nil を返します。
//emlist[例][ruby]{
ary = [0, 4, 7, 10, 12]
# 4 <= v < 8 になる要素を検索
ary......結果は
常に true/false、数値のいずれかを一貫して返すようにしてください)。
また、二分探索の各イテレーションで値がどのような順序で選ばれるかは
未規定です。
ブロックが与えられなかった場合は、 Enumerator のインス... -
Array
# bsearch { |x| . . . } -> object | nil (107.0) -
ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値を二分探 索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返し ます。self はあらかじめソートしておく必要があります。
...ラメータの値か前の要素の場合: true を返す
* 求める値がブロックパラメータより後の要素の場合: false を返す
ブロックの評価結果が true になる最初の要素を返すか、nil を返します。
//emlist[例][ruby]{
ary = [0, 4, 7, 10, 12]
ary.bs......ラメータの値が求める値の範囲よりも大きい(j <= k < self.size)場合: 負の数を返す
ブロックの評価結果が 0 になるいずれかの要素を返すか、nil を返します。
//emlist[例][ruby]{
ary = [0, 4, 7, 10, 12]
# 4 <= v < 8 になる要素を検索
ary......結果は
常に true/false、数値のいずれかを一貫して返すようにしてください)。
また、二分探索の各イテレーションで値がどのような順序で選ばれるかは
未規定です。
ブロックが与えられなかった場合は、 Enumerator のインス... -
Array
# each _ index -> Enumerator (107.0) -
各要素のインデックスに対してブロックを評価します。
...ブロックを評価します。
以下と同じです。
//emlist[例][ruby]{
(0 ... ary.size).each do |index|
# ....
end
//}
ブロックが与えられなかった場合は、自身と each_index から生成した
Enumerator オブジェクトを返します。
@see Array#each, Array#reve...