Puts ARGF
into binary mode. Once a stream is in binary mode, it cannot be reset to non-binary mode. This option has the following effects:
Newline conversion is disabled.
Encoding
conversion is disabled.
Content is treated as ASCII-8BIT.
Returns true if ARGF
is being read in binary mode; false otherwise. To enable binary mode use ARGF.binmode
.
For example:
ARGF.binmode? #=> false ARGF.binmode ARGF.binmode? #=> true
Explicitly terminate option processing.
Returns true if option processing has terminated, false otherwise.
Returns a section of the matrix. The parameters are either:
start_row, nrows, start_col, ncols; OR
row_range, col_range
Matrix.diagonal(9, 5, -3).minor(0..1, 0..2) => 9 0 0 0 5 0
Like Array#[]
, negative indices count backward from the end of the row or column (-1 is the last element). Returns nil if the starting row or column is greater than row_count
or column_count
respectively.
Returns the determinant of the matrix.
Beware that using Float
values can yield erroneous results because of their lack of precision. Consider using exact types like Rational
or BigDecimal
instead.
Matrix[[7,6], [3,9]].determinant => 45
deprecated; use Matrix#determinant
Returns the imaginary part of the matrix.
Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]] => 1+2i i 0 1 2 3 Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]].imaginary => 2i i 0 0 0 0
Terminates option parsing. Optional parameter arg
is a string pushed back to be the first non-option argument.
Returns the binding associated with prc.
def fred(param) proc {} end b = fred(99) eval("param", b.binding) #=> 99
Returns the main thread.
Terminates thr
and schedules another thread to be run, returning the terminated Thread
. If this is the main thread, or the last thread, exits the process.
Returns the maximum size of the queue.
Sets the maximum size of the queue to the given number
.
Return the generated binding object from event
Returns a Binding
object, describing the variable and method bindings at the point of call. This object can be used when calling eval
to execute the evaluated command in this environment. See also the description of class Binding
.
def get_binding(param) binding end b = get_binding("hello") eval("param", b) #=> "hello"
Returns the object in enum with the minimum value. The first form assumes all objects implement Comparable
; the second uses the block to return a <=> b.
a = %w(albatross dog horse) a.min #=> "albatross" a.min { |a, b| a.length <=> b.length } #=> "dog"
If the n
argument is given, minimum n
elements are returned as a sorted array.
a = %w[albatross dog horse] a.min(2) #=> ["albatross", "dog"] a.min(2) {|a, b| a.length <=> b.length } #=> ["dog", "horse"] [5, 1, 3, 4, 2].min(3) #=> [1, 2, 3]
Returns the object in enum with the maximum value. The first form assumes all objects implement Comparable
; the second uses the block to return a <=> b.
a = %w(albatross dog horse) a.max #=> "horse" a.max { |a, b| a.length <=> b.length } #=> "albatross"
If the n
argument is given, maximum n
elements are returned as an array, sorted in descending order.
a = %w[albatross dog horse] a.max(2) #=> ["horse", "dog"] a.max(2) {|a, b| a.length <=> b.length } #=> ["albatross", "horse"] [5, 1, 3, 4, 2].max(3) #=> [5, 4, 3]
Returns the maximum number of gids allowed in the supplemental group access list.
Process.maxgroups #=> 32
Sets the maximum number of gids allowed in the supplemental group access list.
Returns true
iff the scan pointer is at the beginning of the line.
s = StringScanner.new("test\ntest\n") s.bol? # => true s.scan(/te/) s.bol? # => false s.scan(/st\n/) s.bol? # => true s.terminate s.bol? # => true