Results for: "Data"

Sets the log level to Logger::FATAL. See Log Level.

Equivalent to calling add with severity Logger::FATAL.

Return candidates for word.

Returns the status of thr.

"sleep"

Returned if this thread is sleeping or waiting on I/O

"run"

When this thread is executing

"aborting"

If this thread is aborting

false

When this thread is terminated normally

nil

If terminated with an exception.

a = Thread.new { raise("die now") }
b = Thread.new { Thread.stop }
c = Thread.new { Thread.exit }
d = Thread.new { sleep }
d.kill                  #=> #<Thread:0x401b3678 aborting>
a.status                #=> nil
b.status                #=> "sleep"
c.status                #=> false
d.status                #=> "aborting"
Thread.current.status   #=> "run"

See also the instance methods alive? and stop?

Returns internal information of TracePoint.

The contents of the returned value are implementation specific. It may be changed in future.

This method is only for debugging TracePoint itself.

Returns the state of the coverage measurement.

Returns a Hash containing information about the GC.

The contents of the hash are implementation specific and may change in the future without notice.

The hash includes information about internal statistics about GC such as:

count

The total number of garbage collections ran since application start (count includes both minor and major garbage collections)

time

The total time spent in garbage collections (in milliseconds)

heap_allocated_pages

The total number of :heap_eden_pages + :heap_tomb_pages

heap_sorted_length

The number of pages that can fit into the buffer that holds references to all pages

heap_allocatable_pages

The total number of pages the application could allocate without additional GC

heap_available_slots

The total number of slots in all :heap_allocated_pages

heap_live_slots

The total number of slots which contain live objects

heap_free_slots

The total number of slots which do not contain live objects

heap_final_slots

The total number of slots with pending finalizers to be run

heap_marked_slots

The total number of objects marked in the last GC

heap_eden_pages

The total number of pages which contain at least one live slot

heap_tomb_pages

The total number of pages which do not contain any live slots

total_allocated_pages

The cumulative number of pages allocated since application start

total_freed_pages

The cumulative number of pages freed since application start

total_allocated_objects

The cumulative number of objects allocated since application start

total_freed_objects

The cumulative number of objects freed since application start

malloc_increase_bytes

Amount of memory allocated on the heap for objects. Decreased by any GC

malloc_increase_bytes_limit

When :malloc_increase_bytes crosses this limit, GC is triggered

minor_gc_count

The total number of minor garbage collections run since process start

major_gc_count

The total number of major garbage collections run since process start

compact_count

The total number of compactions run since process start

read_barrier_faults

The total number of times the read barrier was triggered during compaction

total_moved_objects

The total number of objects compaction has moved

remembered_wb_unprotected_objects

The total number of objects without write barriers

remembered_wb_unprotected_objects_limit

When :remembered_wb_unprotected_objects crosses this limit, major GC is triggered

old_objects

Number of live, old objects which have survived at least 3 garbage collections

old_objects_limit

When :old_objects crosses this limit, major GC is triggered

oldmalloc_increase_bytes

Amount of memory allocated on the heap for objects. Decreased by major GC

oldmalloc_increase_bytes_limit

When :old_malloc_increase_bytes crosses this limit, major GC is triggered

If the optional argument, hash, is given, it is overwritten and returned. This is intended to avoid probe effect.

This method is only expected to work on CRuby.

Returns true if the file at path new is newer than all the files at paths in array old_list; false otherwise.

Argument new and the elements of old_list should be interpretable as paths:

FileUtils.uptodate?('Rakefile', ['Gemfile', 'README.md']) # => true
FileUtils.uptodate?('Gemfile', ['Rakefile', 'README.md']) # => false

A non-existent file is considered to be infinitely old.

Related: FileUtils.touch.

Returns true if the file at path new is newer than all the files at paths in array old_list; false otherwise.

Argument new and the elements of old_list should be interpretable as paths:

FileUtils.uptodate?('Rakefile', ['Gemfile', 'README.md']) # => true
FileUtils.uptodate?('Gemfile', ['Rakefile', 'README.md']) # => false

A non-existent file is considered to be infinitely old.

Related: FileUtils.touch.

Returns the arc tangent of y and x in radians.

Examples:

atan2(-1.0, -1.0) # => -2.356194490192345  # -3*PI/4
atan2(-1.0, 0.0)  # => -1.5707963267948966 # -PI/2
atan2(-1.0, 1.0)  # => -0.7853981633974483 # -PI/4
atan2(0.0, -1.0)  # => 3.141592653589793   # PI

Returns the arc tangent of x.

Examples:

atan(-INFINITY) # => -1.5707963267948966 # -PI2
atan(-PI)       # => -1.2626272556789115
atan(-PI/2)     # => -1.0038848218538872
atan(0.0)       # => 0.0
atan(PI/2)      # => 1.0038848218538872
atan(PI)        # => 1.2626272556789115
atan(INFINITY)  # => 1.5707963267948966  # PI/2

Returns the inverse hyperbolic tangent of x.

Examples:

atanh(-1.0) # => -Infinity
atanh(0.0)  # => 0.0
atanh(1.0)  # => Infinity
No documentation available
No documentation available

Counts objects for each T_DATA type.

This method is only for MRI developers interested in performance and memory usage of Ruby programs.

It returns a hash as:

{RubyVM::InstructionSequence=>504, :parser=>5, :barrier=>6,
 :mutex=>6, Proc=>60, RubyVM::Env=>57, Mutex=>1, Encoding=>99,
 ThreadGroup=>1, Binding=>1, Thread=>1, RubyVM=>1, :iseq=>1,
 Random=>1, ARGF.class=>1, Data=>1, :autoload=>3, Time=>2}
# T_DATA objects existing at startup on r32276.

If the optional argument, result_hash, is given, it is overwritten and returned. This is intended to avoid probe effect.

The contents of the returned hash is implementation specific and may change in the future.

In this version, keys are Class object or Symbol object.

If object is kind of normal (accessible) object, the key is Class object. If object is not a kind of normal (internal) object, the key is symbol name, registered by rb_data_type_struct.

This method is only expected to work with C Ruby.

No documentation available
No documentation available
No documentation available
No documentation available
No documentation available

A recommended version for use with a ~> Requirement.

No documentation available
No documentation available

Calls the block with each repeated combination of length n of the elements of self; each combination is an Array; returns self. The order of the combinations is indeterminate.

When a block and a positive Integer argument n are given, calls the block with each n-tuple repeated combination of the elements of self. The number of combinations is (n+1)(n+2)/2.

n = 1:

a = [0, 1, 2]
a.repeated_combination(1) {|combination| p combination }

Output:

[0]
[1]
[2]

n = 2:

a.repeated_combination(2) {|combination| p combination }

Output:

[0, 0]
[0, 1]
[0, 2]
[1, 1]
[1, 2]
[2, 2]

If n is zero, calls the block once with an empty Array.

If n is negative, does not call the block:

a.repeated_combination(-1) {|combination| fail 'Cannot happen' }

Returns a new Enumerator if no block given:

a = [0, 1, 2]
a.repeated_combination(2) # => #<Enumerator: [0, 1, 2]:combination(2)>

Using Enumerators, it’s convenient to show the combinations and counts for some values of n:

e = a.repeated_combination(0)
e.size # => 1
e.to_a # => [[]]
e = a.repeated_combination(1)
e.size # => 3
e.to_a # => [[0], [1], [2]]
e = a.repeated_combination(2)
e.size # => 6
e.to_a # => [[0, 0], [0, 1], [0, 2], [1, 1], [1, 2], [2, 2]]

Makes a list of existing constants private.

Search took: 4ms  ·  Total Results: 2131