Returns the index of the current cursor position in Readline.line_buffer
.
The index in Readline.line_buffer
which matches the start of input-string passed to completion_proc
is computed by subtracting the length of input-string from Readline.point
.
start = (the length of input-string) - Readline.point
Raises NotImplementedError
if the using readline library does not support.
Set
the index of the current cursor position in Readline.line_buffer
.
Raises NotImplementedError
if the using readline library does not support.
See Readline.point
.
Returns the log priority mask in effect. The mask is not reset by opening or closing syslog.
Sets the log priority mask. A method LOG_UPTO is defined to make it easier to set mask values. Example:
Syslog.mask = Syslog::LOG_UPTO(Syslog::LOG_ERR)
Alternatively, specific priorities can be selected and added together using binary OR. Example:
Syslog.mask = Syslog::LOG_MASK(Syslog::LOG_ERR) | Syslog::LOG_MASK(Syslog::LOG_CRIT)
The priority mask persists through calls to open() and close().
Returns an inspect() string summarizing the object state.
Returns self, for backward compatibility.
Decompresses string
. Raises a Zlib::NeedDict
exception if a preset dictionary is needed for decompression.
This method is almost equivalent to the following code:
def inflate(string) zstream = Zlib::Inflate.new buf = zstream.inflate(string) zstream.finish zstream.close buf end
See also Zlib.deflate
Returns true
if the named file is a symbolic link.
Invokes the block with a Benchmark::Report object, which may be used to collect and report on the results of individual benchmark tests. Reserves label_width
leading spaces for labels on each line. Prints caption
at the top of the report, and uses format
to format each line. Returns an array of Benchmark::Tms
objects.
If the block returns an array of Benchmark::Tms
objects, these will be used to format additional lines of output. If labels
parameter are given, these are used to label these extra lines.
Note: Other methods provide a simpler interface to this one, and are suitable for nearly all benchmarking requirements. See the examples in Benchmark
, and the bm
and bmbm
methods.
Example:
require 'benchmark' include Benchmark # we need the CAPTION and FORMAT constants n = 5000000 Benchmark.benchmark(CAPTION, 7, FORMAT, ">total:", ">avg:") do |x| tf = x.report("for:") { for i in 1..n; a = "1"; end } tt = x.report("times:") { n.times do ; a = "1"; end } tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end } [tf+tt+tu, (tf+tt+tu)/3] end
Generates:
user system total real for: 0.970000 0.000000 0.970000 ( 0.970493) times: 0.990000 0.000000 0.990000 ( 0.989542) upto: 0.970000 0.000000 0.970000 ( 0.972854) >total: 2.930000 0.000000 2.930000 ( 2.932889) >avg: 0.976667 0.000000 0.976667 ( 0.977630)
Invokes the block with a Benchmark::Report object, which may be used to collect and report on the results of individual benchmark tests. Reserves label_width
leading spaces for labels on each line. Prints caption
at the top of the report, and uses format
to format each line. Returns an array of Benchmark::Tms
objects.
If the block returns an array of Benchmark::Tms
objects, these will be used to format additional lines of output. If labels
parameter are given, these are used to label these extra lines.
Note: Other methods provide a simpler interface to this one, and are suitable for nearly all benchmarking requirements. See the examples in Benchmark
, and the bm
and bmbm
methods.
Example:
require 'benchmark' include Benchmark # we need the CAPTION and FORMAT constants n = 5000000 Benchmark.benchmark(CAPTION, 7, FORMAT, ">total:", ">avg:") do |x| tf = x.report("for:") { for i in 1..n; a = "1"; end } tt = x.report("times:") { n.times do ; a = "1"; end } tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end } [tf+tt+tu, (tf+tt+tu)/3] end
Generates:
user system total real for: 0.970000 0.000000 0.970000 ( 0.970493) times: 0.990000 0.000000 0.990000 ( 0.989542) upto: 0.970000 0.000000 0.970000 ( 0.972854) >total: 2.930000 0.000000 2.930000 ( 2.932889) >avg: 0.976667 0.000000 0.976667 ( 0.977630)
Returns the sine of z
, where z
is given in radians
CMath.sin(1 + 1i) #=> (1.2984575814159773+0.6349639147847361i)
Returns the hyperbolic sine of z
, where z
is given in radians
CMath.sinh(1 + 1i) #=> (0.6349639147847361+1.2984575814159773i)
Returns the arc sine of z
CMath.asin(1 + 1i) #=> (0.6662394324925153+1.0612750619050355i)
returns the inverse hyperbolic sine of z
CMath.asinh(1 + 1i) #=> (1.0612750619050357+0.6662394324925153i)
Returns the sine of z
, where z
is given in radians
CMath.sin(1 + 1i) #=> (1.2984575814159773+0.6349639147847361i)
Returns the hyperbolic sine of z
, where z
is given in radians
CMath.sinh(1 + 1i) #=> (0.6349639147847361+1.2984575814159773i)
Returns the arc sine of z
CMath.asin(1 + 1i) #=> (0.6662394324925153+1.0612750619050355i)
returns the inverse hyperbolic sine of z
CMath.asinh(1 + 1i) #=> (1.0612750619050357+0.6662394324925153i)