るりまサーチ

最速Rubyリファレンスマニュアル検索!
207件ヒット [1-100件を表示] (0.078秒)
トップページ > クエリ:-[x] > クエリ:Empty[x] > クエリ:size[x]

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

ライブラリ

クラス

モジュール

オブジェクト

検索結果

<< 1 2 3 > >>

Readline::HISTORY.size -> Integer (15207.0)

ヒストリに格納された内容の数を取得します。

...ヒストリに格納された内容の数を取得します。

例: ヒストリの内容を最初から順番に出力する。

require "readline"

Readline::HISTORY.push("foo", "bar", "baz")
p Readline::HISTORY.length #=> 3

@see Readline::HISTORY.empty?...

Thread::SizedQueue#empty? -> bool (9201.0)

キューが空の時、真を返します。

キューが空の時、真を返します。

Matrix.empty(row_size=0, column_size=0) -> Matrix (6451.0)

要素を持たない行列を返します。

...もしくは列数が0の行列のことです。

row_size 、 column_size のいずれか一方は0である必要があります。

//emlist[例][ruby]{
require 'matrix'
m = Matrix.empty(2, 0)
m == Matrix[ [], [] ]
# => true
n = Matrix.empty(0, 3)
n == Matrix.columns([ [], [], [] ])
# => true
m...
...* n
# => Matrix[[0, 0, 0], [0, 0, 0]]
//}

@param row_size 行列の行数
@param column_size 行列の列数
@raise ArgumentError row_size, column_size が両方とも0でない場合に発生します...

FileTest.#empty?(file) -> bool (6213.0)

ファイルが存在して、そのサイズが 0 である時に真を返します。 そうでない場合、あるいはシステムコールに失敗した場合には false を返します。

...された IO オブジェクト file が既に close されていた場合に発生します。

//emlist[例:][ruby]{
IO.write("zero.txt", "")
FileTest.zero?("zero.txt") # => true
IO.write("nonzero.txt", "1")
FileTest.zero?("nonzero.txt") # => false
//}

@see FileTest.#size, FileTest.#size?...

FileTest.#zero?(file) -> bool (3113.0)

ファイルが存在して、そのサイズが 0 である時に真を返します。 そうでない場合、あるいはシステムコールに失敗した場合には false を返します。

...された IO オブジェクト file が既に close されていた場合に発生します。

//emlist[例:][ruby]{
IO.write("zero.txt", "")
FileTest.zero?("zero.txt") # => true
IO.write("nonzero.txt", "1")
FileTest.zero?("nonzero.txt") # => false
//}

@see FileTest.#size, FileTest.#size?...

絞り込み条件を変える

Thread::SizedQueue#deq(non_block = false) -> object (3112.0)

キューからひとつ値を取り出します。 キューに push しようと待っているスレッドがあれば、実行を再開させます。

...hread'

q = SizedQueue.new(4)

th1 = Thread.start do
while resource = q.pop
puts resource
end
end

[:resource1, :resource2, :resource3, nil].each{|r|
q.push(r)
}

th1.join
# => resource1
# resource2
# resource3
//}

//emlist[例: nonblock = true][ruby]{
require 'thread'

q = SizedQueue.new...
...resource = q.pop
puts resource
end
end

[:resource1, :resource2, :resource3, nil].each{|r|
q.push(r)
}

begin
th1.join
q.pop(true)
rescue => e
p e
p e.message
end

# => resource1
# resource2
# resource3
# => #<ThreadError: queue empty>
# => "queue empty"
//}

@see Thread::Queue#pop...

Thread::SizedQueue#pop(non_block = false) -> object (3112.0)

キューからひとつ値を取り出します。 キューに push しようと待っているスレッドがあれば、実行を再開させます。

...hread'

q = SizedQueue.new(4)

th1 = Thread.start do
while resource = q.pop
puts resource
end
end

[:resource1, :resource2, :resource3, nil].each{|r|
q.push(r)
}

th1.join
# => resource1
# resource2
# resource3
//}

//emlist[例: nonblock = true][ruby]{
require 'thread'

q = SizedQueue.new...
...resource = q.pop
puts resource
end
end

[:resource1, :resource2, :resource3, nil].each{|r|
q.push(r)
}

begin
th1.join
q.pop(true)
rescue => e
p e
p e.message
end

# => resource1
# resource2
# resource3
# => #<ThreadError: queue empty>
# => "queue empty"
//}

@see Thread::Queue#pop...

Thread::SizedQueue#shift(non_block = false) -> object (3112.0)

キューからひとつ値を取り出します。 キューに push しようと待っているスレッドがあれば、実行を再開させます。

...hread'

q = SizedQueue.new(4)

th1 = Thread.start do
while resource = q.pop
puts resource
end
end

[:resource1, :resource2, :resource3, nil].each{|r|
q.push(r)
}

th1.join
# => resource1
# resource2
# resource3
//}

//emlist[例: nonblock = true][ruby]{
require 'thread'

q = SizedQueue.new...
...resource = q.pop
puts resource
end
end

[:resource1, :resource2, :resource3, nil].each{|r|
q.push(r)
}

begin
th1.join
q.pop(true)
rescue => e
p e
p e.message
end

# => resource1
# resource2
# resource3
# => #<ThreadError: queue empty>
# => "queue empty"
//}

@see Thread::Queue#pop...

ruby 1.8.2 feature (1290.0)

ruby 1.8.2 feature ruby 1.8.2 での ruby 1.8.1 からの変更点です。

...されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど
* 互換性のある変更
* only backward-compatibility
* 影響の範囲が小さいと思われる変更
* [change]: 変更されたクラス/メソッドなど(互換性のない...
...y-dev:23014>))

=== 2004-02-20
: irb [lib] [new]
-
I オプションが使えるようになりました。((<ruby-list:39243>))

=== 2004-02-18
: StringScanner#peep [lib] [obsolete]
$VERVOSE が設定されている時に警告がでるようになりました。use #peek.
: StringScanner#empty?...
...tringScanner#restsize [lib] [obsolete]
$VERVOSE が設定されている時に警告がでるようになりました。use #rest_size.
: StringScanner#matchedsize [lib] [obsolete]
$VERVOSE が設定されている時に警告がでるようになりました。use #matched_size.
: ScanError [l...

NEWS for Ruby 3.0.0 (312.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...mlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}

* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern matching is redesigned. [EXPERIMENTAL]
* `=>` is added. It can be used like a rightward assignment.
17260
* `in...
...=== `--help` option

When the environment variable `RUBY_PAGER` or `PAGER` is present and has
a non-empty value, and the standard input and output are tty, the `--help`
option shows the help message via the pager designated by the value.
16754

=== `--backtrace-limit` option

The `--backtrace-limit...
...per-`Thread`. This change should be compatible for essentially all usages and avoids blocking when using a scheduler. 16792
* Proc
* Proc#== and Proc#eql? are now defined and will return true for separate Proc instances if the procs were created from the same block. 14267
* Queue / SizedQue...

絞り込み条件を変える

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize) -> Symbol (218.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...uffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize 変換先バッファの容量
@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol

options に...
...incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :finished

//emlist[][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''

begin
ret = ec.primitive_convert(src, dst)
p [ret, s...
...errinfo[3].dump[1..-2])
redo
when :undefined_conversion
c = ec.primitive_errinfo[3].dup.force_encoding(ec.primitive_errinfo[1])
ec.insert_output('\x{%X:%s}' % [c.ord, c.encoding])
redo
when :incomplete_input
ec.insert_output(ec.primitive_errinfo[3].dump[1..-2])
when :finish...
<< 1 2 3 > >>