This document explains the high-level design of WebAssembly code: its types, constructs, and semantics. WebAssembly code can be considered a structured stack machine; a machine where most computations use a stack of values, but control flow is expressed in structured constructs such as blocks, ifs, and loops. In practice, implementations need not maintain an actual value stack, nor actual data structures for control; they need only behave as if they did so. For full details consult the formal Specification, for file-level encoding details consult Binary Encoding, and for the human-readable text representation consult Text Format.
Each function body consists of a list of instructions which forms an implicit block. Execution of instructions proceeds by way of a traditional program counter that advances through the instructions. Instructions fall into two categories: control instructions that form control constructs and simple instructions. Control instructions pop their argument value(s) off the stack, may change the program counter, and push result value(s) onto the stack. Simple instructions pop their argument value(s) from the stack, apply an operator to the values, and then push the result value(s) onto the stack, followed by an implicit advancement of the program counter.
All instructions and operators in WebAssembly are explicitly typed, with no overloading rules. Verification of WebAssembly code requires only a single pass with constant-time type checking and well-formedness checking.
WebAssembly offers a set of language-independent operators that closely match operators in many programming languages and are efficiently implementable on all modern computers. Each operator has a corresponding simple instruction.
The rationale document details why WebAssembly is designed as detailed in this document.
= Planned future feature
Some operators may trap under some conditions, as noted below. In the MVP, trapping means that execution in the WebAssembly instance is terminated and abnormal termination is reported to the outside environment. In a JavaScript environment such as a browser, a trap results in throwing a JavaScript exception. If developer tools are active, attaching a debugger before the termination would be sensible.
Call stack space is limited by unspecified and dynamically varying constraints and is a source of nondeterminism. If program call stack usage exceeds the available call stack space at any time, the execution in the WebAssembly instance is terminated and abnormal termination is reported to the outside environment.
Implementations must have an internal maximum call stack size, and every call must take up some resources toward exhausting that size (of course, dynamic resources may be exhausted much earlier). This rule exists to avoid differences in observable behavior; if some implementations have this property and others don’t, the same program which runs successfully on some implementations may consume unbounded resources and fail on others. Also, in the future, it is expected that WebAssembly will add some form of stack-introspection functionality, in which case such optimizations would be directly observable.
Support for explicit tail calls is planned in the future , which would add an explicit tail-call operator with well-defined effects on stack introspection.
WebAssembly has the following value types:
i32
: 32-bit integeri64
: 64-bit integerf32
: 32-bit floating pointf64
: 64-bit floating pointEach parameter and local variable has exactly one value type. Function signatures consist of a sequence of zero or more parameter types and a sequence of zero or more return types. (Note: in the MVP, a function can have at most one return type).
Note that the value types i32
and i64
are not inherently signed or
unsigned. The interpretation of these types is determined by individual
operators.
A linear memory is a contiguous, byte-addressable range of memory spanning
from offset 0
and extending up to a varying memory size. This size is always
a multiple of the WebAssembly page size, which is fixed to 64KiB (though large
page support may be added in an opt-in manner in the
future). The initial state of a linear
memory is defined by the module’s linear memory and
data sections. The memory size can be dynamically
increased by the grow_memory
operator.
A linear memory can be considered to be an untyped array of bytes, and it is unspecified how embedders map this array into their process’ own virtual memory. Linear memory is sandboxed; it does not alias other linear memories, the execution engine’s internal data structures, the execution stack, local variables, or other process memory.
Every WebAssembly instance has one specially-designated default linear memory which is the linear memory accessed by all the memory operators below. In the MVP, there are only default linear memories but new memory operators may be added after the MVP which can also access non-default memories.
Linear memories (default or otherwise) can either be imported or defined inside the module. After import or definition, there is no difference when accessing a linear memory whether it was imported or defined internally.
In the MVP, linear memory cannot be shared between threads of execution. The addition of threads will allow this.
Linear memory access is accomplished with explicit load
and store
operators.
All load
and store
operators use little-endian byte order when translating
between values and bytes.
Integer loads can specify a storage size which is smaller than the result type as
well as a signedness which determines whether the bytes are sign- or zero-
extended into the result type.
i32.load8_s
: load 1 byte and sign-extend i8 to i32i32.load8_u
: load 1 byte and zero-extend i8 to i32i32.load16_s
: load 2 bytes and sign-extend i16 to i32i32.load16_u
: load 2 bytes and zero-extend i16 to i32i32.load
: load 4 bytes as i32i64.load8_s
: load 1 byte and sign-extend i8 to i64i64.load8_u
: load 1 byte and zero-extend i8 to i64i64.load16_s
: load 2 bytes and sign-extend i16 to i64i64.load16_u
: load 2 bytes and zero-extend i16 to i64i64.load32_s
: load 4 bytes and sign-extend i32 to i64i64.load32_u
: load 4 bytes and zero-extend i32 to i64i64.load
: load 8 bytes as i64f32.load
: load 4 bytes as f32f64.load
: load 8 bytes as f64Stores have an additional input operand which is the value
to store to memory.
Like loads, integer stores may specify a smaller storage size than the operand
size in which case integer wrapping is implied.
i32.store8
: wrap i32 to i8 and store 1 bytei32.store16
: wrap i32 to i16 and store 2 bytesi32.store
: (no conversion) store 4 bytesi64.store8
: wrap i64 to i8 and store 1 bytei64.store16
: wrap i64 to i16 and store 2 bytesi64.store32
: wrap i64 to i32 and store 4 bytesi64.store
: (no conversion) store 8 bytesf32.store
: (no conversion) store 4 bytesf64.store
: (no conversion) store 8 bytesStore operators do not produce a value.
The above operators operate on the default linear memory.
Each linear memory access operator has an address operand and an unsigned integer byte offset immediate. The infinite-precision unsigned sum of the address operand’s value with the offset’s value is called the effective address, which is interpreted as an unsigned byte index into the linear memory.
Linear memory operators access the bytes starting at the effective address and extend for the number of bytes implied by the storage size. If any of the accessed bytes are beyond the current memory size, the access is considered out-of-bounds.
The use of infinite-precision in the effective address computation means that the addition of the offset to the address never causes wrapping, so if the address for an access is out-of-bounds, the effective address will always also be out-of-bounds.
In wasm32, address operands and offset attributes have type i32
, and linear
memory sizes are limited to 4 GiB (of course, actual sizes are further limited
by available resources). In wasm64, address operands and
offsets have type i64
. The MVP only includes wasm32; subsequent versions
will add support for wasm64 and thus
>4 GiB linear memory .
Each linear memory access operator also has an immediate positive integer power of 2 alignment attribute which must be no greater than the memory access’ size. An alignment value which is the same as the memory access’ size is considered to be a natural alignment. The alignment applies to the effective address and not merely the address operand, i.e. the immediate offset is taken into account when considering alignment.
The alignment has same type (determined by wasm32/wasm64, as described above) as the address and offset operands.
If the effective address of a memory access is a multiple of the alignment attribute value of the memory access, the memory access is considered aligned, otherwise it is considered misaligned. Aligned and misaligned accesses have the same behavior.
Alignment affects performance as follows:
Thus, it is recommend that WebAssembly producers align frequently-used data to permit the use of natural alignment access, and use loads and stores with the greatest alignment values practical, while always avoiding misaligned accesses.
Out of bounds accesses trap. If the access is a store, if any of the accessed bytes are out of bounds, none of the bytes are modified.
In the MVP, linear memory can be resized by a grow_memory
operator. The
operand to this operator is in units of the WebAssembly page size,
which is defined to be 64KiB (though large page support may be added in
the future ).
grow_memory
: grow linear memory by a given unsigned delta of pages.
Return the previous memory size in units of pages or -1 on failure.When a linear memory has a declared maximum memory size,
grow_memory
must fail if it would grow past the maximum. However,
grow_memory
may still fail before the maximum if it was not possible to
reserve the space up front or if enabling the reserved memory fails.
When there is no maximum memory size declared, grow_memory
is expected
to perform a system allocation which may fail.
The current size of the linear memory can be queried by the following operator:
current_memory
: return the current memory size in units of pages.As stated above, linear memory is contiguous, meaning there are no “holes” in the linear address space. After the MVP, there are future features proposed to allow setting protection and creating mappings within the contiguous linear memory.
In the MVP, memory can only be grown. After the MVP, a memory shrinking
operator may be added. However, due to normal fragmentation, applications are
instead expected release unused physical pages from the working set using the
discard
future feature.
The above operators operate on the default linear memory.
A table is similar to a linear memory whose elements, instead of being bytes, are opaque values of a particular table element type. This allows the table to contain values—like GC references, raw OS handles, or native pointers—that are accessed by WebAssembly code indirectly through an integer index. This feature bridges the gap between low-level, untrusted linear memory and high-level opaque handles/references at the cost of a bounds-checked table indirection.
The table’s element type constrains the type of elements stored in the table and allows engines to avoid some type checks on table use. When a WebAssembly value is stored in a table, the value’s type must precisely match the element type. Depending on the operator/API used to store the value, this check may be static or dynamic. Just like linear memory, updates to a table are observed immediately by all instances that reference the table. Host environments may also allow storing non-WebAssembly values in tables in which case, as with imports, the meaning of using the value is defined by the host environment.
Every WebAssembly instance has one specially-designated default
table which is indexed by call_indirect
and other future
table operators. Tables can either be imported or
defined inside the module. After import or
definition, there is no difference when calling into a table whether it was
imported or defined internally.
In the MVP, the primary purpose of tables is to implement indirect function calls in C/C++ using an integer index as the pointer-to-function and the table to hold the array of indirectly-callable functions. Thus, in the MVP:
call_indirect
;anyfunc
(function with any signature);WebAssembly
JavaScript API).These restrictions may be relaxed in the future .
Each function has a fixed, pre-declared number of local variables which occupy a single
index space local to the function. Parameters are addressed as local variables. Local
variables do not have addresses and are not aliased by linear memory. Local
variables have value types and are initialized to the appropriate zero value for their
type (0
for integers, +0.
for floating-point) at the beginning of the function,
except parameters which are initialized to the values of the arguments passed to the function.
get_local
: read the current value of a local variableset_local
: set the current value of a local variabletee_local
: like set_local
, but also returns the set valueThe details of index space for local variables and their types will be further clarified,
e.g. whether locals with type i32
and i64
must be contiguous and separate from
others, etc.
A global variable stores a single value of a fixed value type and may be declared either mutable or immutable. This provides WebAssembly with memory locations that are disjoint from any linear memory and thus cannot be arbitrarily aliased as bits.
Global variables are accessed via an integer index into the module-defined global index space. Global variables can either be imported or defined inside the module. After import or definition, there is no difference when accessing a global.
get_global
: get the current value of a global variableset_global
: set the current value of a global variableIt is a validation error for a set_global
to index an immutable global variable.
In the MVP, the primary use case of global variables is to represent instantiation-time immutable values as a useful building block for dynamic linking.
After the MVP, when reference types are added to the set of value types, global variables will be necessary to allow sharing reference types between threads since shared linear memory cannot load or store references.
WebAssembly offers basic structured control flow constructs such as blocks, loops, and ifs. All constructs are formed out of the following control instructions:
nop
: no operation, no effectblock
: the beginning of a block construct, a sequence of instructions with a label at the endloop
: a block with a label at the beginning which may be used to form loopsif
: the beginning of an if construct with an implicit then blockelse
: marks the else block of an ifbr
: branch to a given label in an enclosing constructbr_if
: conditionally branch to a given label in an enclosing constructbr_table
: a jump table which jumps to a label in an enclosing constructreturn
: return zero or more values from this functionend
: an instruction that marks the end of a block, loop, if, or functionBlocks are composed of matched pairs of block
… end
instructions, loops with matched pairs of
loop
… end
instructions, and ifs with either if
… end
or if
… else
… end
sequences.
For each of these constructs the instructions in the ellipsis are said to be enclosed in the
construct.
The br
, br_if
, and br_table
instructions express low-level branching and are hereafter refered to simply as branches.
Branches may only reference labels defined by a construct in which they are enclosed.
For example, references to a block
’s label can only occur within the block
’s body.
In practice, outer block
s can be used to place labels for any given branching
pattern, except that the nesting restriction makes it impossible to branch into the middle of a loop
from outside the loop. This limitation ensures by construction that all control flow graphs
are well-structured as in high-level languages like Java, JavaScript and Go.
Notice that a branch to a block
’s label is equivalent to a labeled break
in
high-level languages; branches simply break out of a block
, and branches to a loop
correspond to a “continue” statement.
Executing a return
pops return value(s) off the stack and returns from the current function.
Executing a block
or loop
instruction has no effect on the value stack.
Executing the end
of a block
or loop
(including implicit blocks such as in if
or for a function body) has no effect on the value stack.
Executing the end
of the implicit block for a function body pops the return value(s) (if any) off the stack and returns from the function.
Executing the if
instruction pops an i32
condition off the stack and either falls through to the next instruction
or sets the program counter to after the else
or end
of the if
.
Executing the else
instruction of an if
sets the program counter to after the corresponding end
of the if
.
Branches that exit a block
or if
may yield value(s) for that construct.
Branches pop result value(s) off the stack which must be the same type as the declared
type of the construct which they target. If a conditional or unconditional branch is taken, the values pushed
onto the stack between the beginning of the construct and the branch are discarded, the result value(s) are
pushed back onto the stack, and the program counter is updated to the end of the construct.
Branches that target a loop
do not yield a value; they pop any values pushed onto the stack since the start of the loop and set the program counter to the start of the loop.
The drop
operator can be used to explicitly pop a value from the stack.
The implicit popping associated with explicit branches makes compiling expression languages straightforward, even non-local control-flow transfer, requiring fewer drops.
Note that in the MVP, all control constructs and control instructions, including return
are
restricted to at most one value.
br_table
A br_table
consists of a zero-based array of labels, a default label,
and an index operand. A br_table
jumps to the label indexed in the array
or the default label if the index is out of bounds.
Each function has a signature, which consists of:
WebAssembly doesn’t support variable-length argument lists (aka varargs). Compilers targeting WebAssembly can instead support them through explicit accesses to linear memory.
In the MVP, the length of the return types sequence may only be 0 or 1. This restriction may be lifted in the future.
Direct calls to a function specify the callee by an index into the function index space.
call
: call function directlyA direct call to a function with a mismatched signature is a module verification error.
Indirect calls to a function indicate the callee with an i32
index into
a table. The expected signature of the target function (specified
by its index in the types section) is given as
a second immediate.
call_indirect
: call function indirectlyUnlike call
, which checks that the caller and callee signatures match
statically as part of validation, call_indirect
checks for signature match
dynamically, comparing the caller’s expected signature with the callee function’s
signature and and trapping if there is a mismatch. Since the callee may be in a
different module which necessarily has a separate types section,
and thus index space of types, the signature match must compare the underlying
func_type
.
As noted above, table elements may also be host-environment-defined
values in which case the meaning of a call (and how the signature is checked)
is defined by the host-environment, much like calling an import.
In the MVP, the single call_indirect
operator accesses the default table.
Multiple return value calls will be possible, though possibly not in the MVP. The details of multiple-return-value calls needs clarification. Calling a function that returns multiple values will likely have to be a statement that specifies multiple local variables to which to assign the corresponding return values.
These operators have an immediate operand of their associated type which is produced as their result value. All possible values of all types are supported (including NaN values of all possible bit patterns).
i32.const
: produce the value of an i32 immediatei64.const
: produce the value of an i64 immediatef32.const
: produce the value of an f32 immediatef64.const
: produce the value of an f64 immediateInteger operators are signed, unsigned, or sign-agnostic. Signed operators use two’s complement signed integer representation.
Signed and unsigned operators trap whenever the result cannot be represented
in the result type. This includes division and remainder by zero, and signed
division overflow (INT32_MIN / -1
). Signed remainder with a non-zero
denominator always returns the correct value, even when the corresponding
division would trap. Sign-agnostic operators silently wrap overflowing
results into the result type.
i32.add
: sign-agnostic additioni32.sub
: sign-agnostic subtractioni32.mul
: sign-agnostic multiplication (lower 32-bits)i32.div_s
: signed division (result is truncated toward zero)i32.div_u
: unsigned division (result is floored)i32.rem_s
: signed remainder (result has the sign of the dividend)i32.rem_u
: unsigned remainderi32.and
: sign-agnostic bitwise andi32.or
: sign-agnostic bitwise inclusive ori32.xor
: sign-agnostic bitwise exclusive ori32.shl
: sign-agnostic shift lefti32.shr_u
: zero-replicating (logical) shift righti32.shr_s
: sign-replicating (arithmetic) shift righti32.rotl
: sign-agnostic rotate lefti32.rotr
: sign-agnostic rotate righti32.eq
: sign-agnostic compare equali32.ne
: sign-agnostic compare unequali32.lt_s
: signed less thani32.le_s
: signed less than or equali32.lt_u
: unsigned less thani32.le_u
: unsigned less than or equali32.gt_s
: signed greater thani32.ge_s
: signed greater than or equali32.gt_u
: unsigned greater thani32.ge_u
: unsigned greater than or equali32.clz
: sign-agnostic count leading zero bits (All zero bits are considered leading if the value is zero)i32.ctz
: sign-agnostic count trailing zero bits (All zero bits are considered trailing if the value is zero)i32.popcnt
: sign-agnostic count number of one bitsi32.eqz
: compare equal to zero (return 1 if operand is zero, 0 otherwise)Shifts counts are wrapped to be less than the log-base-2 of the number of bits in the value to be shifted, as an unsigned quantity. For example, in a 32-bit shift, only the least 5 significant bits of the count affect the result. In a 64-bit shift, only the least 6 significant bits of the count affect the result.
Rotate counts are treated as unsigned. A count value greater than or equal to the number of bits in the value to be rotated yields the same result as if the count was wrapped to its least significant N bits, where N is 5 for an i32 value or 6 for an i64 value.
All comparison operators yield 32-bit integer results with 1
representing
true
and 0
representing false
.
The same operators are available on 64-bit integers as the those available for 32-bit integers.
Floating point arithmetic follows the IEEE 754-2008 standard, except that:
In the future, these limitations may be lifted, enabling full IEEE 754-2008 support .
Note that not all operators required by IEEE 754-2008 are provided directly. However, WebAssembly includes enough functionality to support reasonable library implementations of the remaining required operators.
When the result of any arithmetic operation other than neg
, abs
, or
copysign
is a NaN, the sign bit and the fraction field (which does not include
the implicit leading digit of the significand) of the NaN are computed as
follows:
If the fraction fields of all NaN inputs to the instruction all consist of 1 in the most significant bit and 0 in the remaining bits, or if there are no NaN inputs, the result is a NaN with a nondeterministic sign bit, 1 in the most significant bit of the fraction field, and all zeros in the remaining bits of the fraction field.
Otherwise the result is a NaN with a nondeterministic sign bit, 1 in the most significant bit of the fraction field, and nondeterminsitic values in the remaining bits of the fraction field.
32-bit floating point operations are as follows:
f32.add
: additionf32.sub
: subtractionf32.mul
: multiplicationf32.div
: divisionf32.abs
: absolute valuef32.neg
: negationf32.copysign
: copysignf32.ceil
: ceiling operatorf32.floor
: floor operatorf32.trunc
: round to nearest integer towards zerof32.nearest
: round to nearest integer, ties to evenf32.eq
: compare ordered and equalf32.ne
: compare unordered or unequalf32.lt
: compare ordered and less thanf32.le
: compare ordered and less than or equalf32.gt
: compare ordered and greater thanf32.ge
: compare ordered and greater than or equalf32.sqrt
: square rootf32.min
: minimum (binary operator); if either operand is NaN, returns NaNf32.max
: maximum (binary operator); if either operand is NaN, returns NaN64-bit floating point operators:
f64.add
: additionf64.sub
: subtractionf64.mul
: multiplicationf64.div
: divisionf64.abs
: absolute valuef64.neg
: negationf64.copysign
: copysignf64.ceil
: ceiling operatorf64.floor
: floor operatorf64.trunc
: round to nearest integer towards zerof64.nearest
: round to nearest integer, ties to evenf64.eq
: compare ordered and equalf64.ne
: compare unordered or unequalf64.lt
: compare ordered and less thanf64.le
: compare ordered and less than or equalf64.gt
: compare ordered and greater thanf64.ge
: compare ordered and greater than or equalf64.sqrt
: square rootf64.min
: minimum (binary operator); if either operand is NaN, returns NaNf64.max
: maximum (binary operator); if either operand is NaN, returns NaNmin
and max
operators treat -0.0
as being effectively less than 0.0
.
In floating point comparisons, the operands are unordered if either operand is NaN, and ordered otherwise.
i32.wrap/i64
: wrap a 64-bit integer to a 32-bit integeri32.trunc_s/f32
: truncate a 32-bit float to a signed 32-bit integeri32.trunc_s/f64
: truncate a 64-bit float to a signed 32-bit integeri32.trunc_u/f32
: truncate a 32-bit float to an unsigned 32-bit integeri32.trunc_u/f64
: truncate a 64-bit float to an unsigned 32-bit integeri32.reinterpret/f32
: reinterpret the bits of a 32-bit float as a 32-bit integeri64.extend_s/i32
: extend a signed 32-bit integer to a 64-bit integeri64.extend_u/i32
: extend an unsigned 32-bit integer to a 64-bit integeri64.trunc_s/f32
: truncate a 32-bit float to a signed 64-bit integeri64.trunc_s/f64
: truncate a 64-bit float to a signed 64-bit integeri64.trunc_u/f32
: truncate a 32-bit float to an unsigned 64-bit integeri64.trunc_u/f64
: truncate a 64-bit float to an unsigned 64-bit integeri64.reinterpret/f64
: reinterpret the bits of a 64-bit float as a 64-bit integerf32.demote/f64
: demote a 64-bit float to a 32-bit floatf32.convert_s/i32
: convert a signed 32-bit integer to a 32-bit floatf32.convert_s/i64
: convert a signed 64-bit integer to a 32-bit floatf32.convert_u/i32
: convert an unsigned 32-bit integer to a 32-bit floatf32.convert_u/i64
: convert an unsigned 64-bit integer to a 32-bit floatf32.reinterpret/i32
: reinterpret the bits of a 32-bit integer as a 32-bit floatf64.promote/f32
: promote a 32-bit float to a 64-bit floatf64.convert_s/i32
: convert a signed 32-bit integer to a 64-bit floatf64.convert_s/i64
: convert a signed 64-bit integer to a 64-bit floatf64.convert_u/i32
: convert an unsigned 32-bit integer to a 64-bit floatf64.convert_u/i64
: convert an unsigned 64-bit integer to a 64-bit floatf64.reinterpret/i64
: reinterpret the bits of a 64-bit integer as a 64-bit floatWrapping and extension of integer values always succeed. Promotion and demotion of floating point values always succeed. Demotion of floating point values uses round-to-nearest ties-to-even rounding, and may overflow to infinity or negative infinity as specified by IEEE 754-2008.
If the operand of promotion or demotion is a NaN, the result is a NaN with the following sign bit and fraction field (which does not include the implicit leading digit of the significand):
Reinterpretations always succeed.
Conversions from integer to floating point always succeed, and use round-to-nearest ties-to-even rounding.
Truncation from floating point to integer where IEEE 754-2008 would specify an invalid operator exception (e.g. when the floating point value is NaN or outside the range which rounds to an integer in range) traps.
drop
: a unary operator that discards the value of its operand.select
: a ternary operator with two operands, which have the same type as
each other, plus a boolean (i32) condition. select
returns the first
operand if the condition operand is non-zero, or the second otherwise.unreachable
: An instruction which always traps.
It is intended to be used for example after calls to functions which are known by the producer not to return.
This trap is intended to be impossible for user code to catch or handle, even in the future when it may be possible to
handle some other kinds of traps or exceptions.A module binary must be validated before it is compiled. Validation ensures that the module is well-defined and that its code cannot exhibit any undefined behavior. In particular, along with some runtime checks, this ensures that no program can access or corrupt memory it does not own.
Validation of code is mostly defined in terms of type-checking the use of the operand stack.
It sequentially checks for each instruction that the expected operands can be popped from the stack and tracks which new operands are pushed onto it. At the start of a function the stack is empty; at its end it must match the return type of the function. In addition, instructions inside a block
(or loop
or if
) cannot consume operands pushed outside. At the end of the block the remaining inner operands must match the block signature.
A special case is unconditional control transfers (br
, br_table
, return
, unreachable
), because execution never proceeds after them.
The stack after such an instruction is unconstrained, and thus said to be polymorphic.
The following instructions still must type-check,
but conceptually, values of any type can be popped off a polymorphic stack for the sake of checking consecutive instructions.
A polymorphic stack also matches any possible signature at the end of a block or function.
After the end of a block, the stack is determined by the block signature and the stack before the block.
The details of validation are currently defined by the spec interpreter.


My Profile
Home
(current)
About
Services
Education Details
Education Details
Contact
Subject Line
We'll never share your email with anyone else.
Email address
We'll never share your email with anyone else.
Reason for Contact
Check me out
Submit


old weather whaling
Down for maintenance
Old Weather Whaling is currently down for maintenance.
In the meantime, please visit the companion site Old Weather or the discussion forum. Thank you!
Old Weather Whaling is currently down for maintenance.
In the meantime, please visit the companion site Old Weather or the discussion forum. Thank you!


---
layout: default
title: 404 - Page not found
permalink: /404.html
---
404 error
The page you were looking for doesn't exist.
Sometimes a page moves or is deleted. I'm sorry you ended up here, but hopefully we can help you find what you're looking for.
You can search for a similar term or go back to the home page.


...WE OFFERS A LATEST BRANDS OF FASHION PRODUCTS IN GOOD COST AND WITH A BEST QUALITY OF MAN LIKESHIRTS,SHOES,PANTS,WANTCHES, GLASSES AND ETC WITH GUARANTEE...
SHOP NOW


LESSKEY
Section: User Commands (1)Updated: Version 436: 07 Jul 2009
Index Return to Main Contents
NAME
lesskey - specify key bindings for lessSYNOPSIS
lesskey [-o output] [--] [input]lesskey [--output=output] [--] [input]
lesskey -V
lesskey --version
DESCRIPTION
Lesskey is used to specify a set of key bindings to be used by less. The input file is a text file which describes the key bindings, If the input file is "-", standard input is read. If no input file is specified, a standard filename is used as the name of the input file, which depends on the system being used: On Unix systems, $HOME/.lesskey is used; on MS-DOS systems, $HOME/_lesskey is used; and on OS/2 systems $HOME/lesskey.ini is used, or $INIT/lesskey.ini if $HOME is undefined. The output file is a binary file which is used by less. If no output file is specified, and the environment variable LESSKEY is set, the value of LESSKEY is used as the name of the output file. Otherwise, a standard filename is used as the name of the output file, which depends on the system being used: On Unix and OS-9 systems, $HOME/.less is used; on MS-DOS systems, $HOME/_less is used; and on OS/2 systems, $HOME/less.ini is used, or $INIT/less.ini if $HOME is undefined. If the output file already exists, lesskey will overwrite it.The -V or --version option causes lesskey to print its version number and immediately exit. If -V or --version is present, other options and arguments are ignored.
The input file consists of one or more sections. Each section starts with a line that identifies the type of section. Possible sections are:
- #command
- Defines new command keys.
- #line-edit
- Defines new line-editing keys.
- #env
- Defines environment variables.
Blank lines and lines which start with a pound sign (#) are ignored, except for the special section header lines.
COMMAND SECTION
The command section begins with the line#command
If the command section is the first section in the file, this line may be omitted. The command section consists of lines of the form:
string <whitespace> action [extra-string] <newline>
Whitespace is any sequence of one or more spaces and/or tabs. The string is the command key(s) which invoke the action. The string may be a single command key, or a sequence of up to 15 keys. The action is the name of the less action, from the list below. The characters in the string may appear literally, or be prefixed by a caret to indicate a control key. A backslash followed by one to three octal digits may be used to specify a character by its octal value. A backslash followed by certain characters specifies input characters as follows:
- \b
- BACKSPACE
- \e
- ESCAPE
- \n
- NEWLINE
- \r
- RETURN
- \t
- TAB
- \ku
- UP ARROW
- \kd
- DOWN ARROW
- \kr
- RIGHT ARROW
- \kl
- LEFT ARROW
- \kU
- PAGE UP
- \kD
- PAGE DOWN
- \kh
- HOME
- \ke
- END
- \kx
- DELETE
A backslash followed by any other character indicates that character is to be taken literally. Characters which must be preceded by backslash include caret, space, tab and the backslash itself.
An action may be followed by an "extra" string. When such a command is entered while running less, the action is performed, and then the extra string is parsed, just as if it were typed in to less. This feature can be used in certain cases to extend the functionality of a command. For example, see the "{" and ":t" commands in the example below. The extra string has a special meaning for the "quit" action: when less quits, first character of the extra string is used as its exit status.
EXAMPLE
The following input file describes the set of default command keys used by less:
#command \r forw-line \n forw-line e forw-line j forw-line \kd forw-line ^E forw-line ^N forw-line k back-line y back-line ^Y back-line ^K back-line ^P back-line J forw-line-force K back-line-force Y back-line-force d forw-scroll ^D forw-scroll u back-scroll ^U back-scroll \40 forw-screen f forw-screen ^F forw-screen ^V forw-screen \kD forw-screen b back-screen ^B back-screen \ev back-screen \kU back-screen z forw-window w back-window \e\40 forw-screen-force F forw-forever R repaint-flush r repaint ^R repaint ^L repaint \eu undo-hilite g goto-line \kh goto-line < goto-line \e< goto-line p percent % percent \e[ left-scroll \e] right-scroll \e( left-scroll \e) right-scroll { forw-bracket {} } back-bracket {} ( forw-bracket () ) back-bracket () [ forw-bracket [] ] back-bracket [] \e^F forw-bracket \e^B back-bracket G goto-end \e> goto-end > goto-end \ke goto-end = status ^G status :f status / forw-search ? back-search \e/ forw-search * \e? back-search * n repeat-search \en repeat-search-all N reverse-search \eN reverse-search-all & filter m set-mark ' goto-mark ^X^X goto-mark E examine :e examine ^X^V examine :n next-file :p prev-file t next-tag T prev-tag :x index-file :d remove-file - toggle-option :t toggle-option t s toggle-option o _ display-option | pipe v visual ! shell + firstcmd H help h help V version 0 digit 1 digit 2 digit 3 digit 4 digit 5 digit 6 digit 7 digit 8 digit 9 digit q quit Q quit :q quit :Q quit ZZ quit
PRECEDENCE
Commands specified by lesskey take precedence over the default commands. A default command key may be disabled by including it in the input file with the action "invalid". Alternatively, a key may be defined to do nothing by using the action "noaction". "noaction" is similar to "invalid", but less will give an error beep for an "invalid" command, but not for a "noaction" command. In addition, ALL default commands may be disabled by adding this control line to the input file:#stop
This will cause all default commands to be ignored. The #stop line should be the last line in that section of the file.
Be aware that #stop can be dangerous. Since all default commands are disabled, you must provide sufficient commands before the #stop line to enable all necessary actions. For example, failure to provide a "quit" command can lead to frustration.
LINE EDITING SECTION
The line-editing section begins with the line:#line-edit
This section specifies new key bindings for the line editing commands, in a manner similar to the way key bindings for ordinary commands are specified in the #command section. The line-editing section consists of a list of keys and actions, one per line as in the example below.
EXAMPLE
The following input file describes the set of default line-editing keys used by less:
#line-edit \t forw-complete \17 back-complete \e\t back-complete ^L expand ^V literal ^A literal \el right \kr right \eh left \kl left \eb word-left \e\kl word-left \ew word-right \e\kr word-right \ei insert \ex delete \kx delete \eX word-delete \ekx word-delete \e\b word-backspace \e0 home \kh home \e$ end \ke end \ek up \ku up \ej down
LESS ENVIRONMENT VARIABLES
The environment variable section begins with the line#env
Following this line is a list of environment variable assignments. Each line consists of an environment variable name, an equals sign (=) and the value to be assigned to the environment variable. White space before and after the equals sign is ignored. Variables assigned in this way are visible only to less. If a variable is specified in the system environment and also in a lesskey file, the value in the lesskey file takes precedence. Although the lesskey file can be used to override variables set in the environment, the main purpose of assigning variables in the lesskey file is simply to have all less configuration information stored in one file.
EXAMPLE
The following input file sets the -i option whenever less is run, and specifies the character set to be "latin1":
#env LESS = -i LESSCHARSET = latin1
SEE ALSO
less(1)WARNINGS
It is not possible to specify special keys, such as uparrow, in a keyboard-independent manner. The only way to specify such keys is to specify the escape sequence which a particular keyboard sends when such a key is pressed.On MS-DOS and OS/2 systems, certain keys send a sequence of characters which start with a NUL character (0). This NUL character should be represented as \340 in a lesskey file.
COPYRIGHT
Copyright (C) 2000-2009 Mark Nudelmanlesskey is part of the GNU project and is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.
lesskey is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with lesskey; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
AUTHOR
Mark Nudelman<EMAIL_ADDRESS>Send bug reports or comments to the above address or to<EMAIL_ADDRESS>Index
- NAME
- SYNOPSIS
- DESCRIPTION
- COMMAND SECTION
- EXAMPLE
- PRECEDENCE
- LINE EDITING SECTION
- EXAMPLE
- LESS ENVIRONMENT VARIABLES
- EXAMPLE
- SEE ALSO
- WARNINGS
- COPYRIGHT
- AUTHOR
This document was created by man2html, using the manual pages.
Time: 05:29:05 GMT, December 24, 2015


{{Infobox prepared food | name = Biscocho | image = | caption = | alternate_name = | country = Philippines | region = Iloilo | creator = | course = | type = Bread | served = | main_ingredient = | variations = | calories = | other = }}
{{Unreferenced|date=December 2009}} Biscocho ({{Lang-es|bizcocho}}, "biscuit") refers to baked bread topped with butter and sugar, or garlic, in some cases. They are a popular delicacy of Iloilo province.
The etymology of the word itself is related to the English biscuit and Italian biscotti in that it is derived from the Latin phrase word bis coctus which means "twice baked".
{{portal|Food}}
{{Filipino food}}
{{Philippines-stub}} {{Bread-stub}}


Contact name
City
Contry
Is Promoted
Maria Anders
Berlin
Germany
Ana Trujillo
México D.F.
Mexico
Antonio Moreno
México D.F.
Mexico
Thomas Hardy
London
UK


Reflection
What's your take on the DBC/EDA experience?
If you are looking for a big challenge with the good staff, in my opinion EDA is that you need it, they are patient and helpful. but everything depent on you how much you work hard. if you practice hard I'm sure you can succsesful.
What are your impression?
my impression is, drunig my journey at EDA any time I had problem or I stuck on something they answer my qouations step by step that it make me happy.
How do you see yourself engaging with this type of culture?
Acually before, I didnt like to work with others but when I introduce with EDA I see how much is it great to work with each other and how much is helpfol to work as a team and now I really excited to work with other people,
Have your expectations at EDA changed? If so, how?
Of course, I havent seen like EDA, everything is differet you learn how to work as a team, actually you are working at EDA not study, and it's really good because later you have enough exprience to work at new place.
Are you excited to participate in this kind of learning environment?Does it make you nervous
I'm really excited that I'm a part of EDA and I'm lucky for finding EDA. I cant wait for learnig new things, I love challenges


Cannot bind to controller without directive '{0}'s controller.
When using the bindToController
feature of AngularJS, a directive is required
to have a Controller. A controller may be specified by adding a "controller"
property to the directive definition object. Its value should be either a
string, or an invokable object (a function, or an array whose last element is a
function).
For more information, see the directives guide.


class Object
Object is the default root of all Ruby objects. Object inherits from BasicObject which allows creating alternate object hierarchies. Methods on Object are available to all classes unless explicitly overridden.
Object mixes in the Kernel module, making the built-in kernel functions globally accessible. Although the instance methods of Object are defined by the Kernel module, we have chosen to document them here for clarity.
When referencing constants in classes inheriting from Object you do not need to use the full namespace.
For example, referencing File
inside YourClass
will find the top-level File class.
In the descriptions of Object's methods, the parameter symbol
refers to a symbol, which is either a quoted string or a Symbol (such as :name
).
Constants
- ARGF
ARGF is a stream designed for use in scripts that process files given as command-line arguments or passed in via STDIN.
See ARGF (the class) for more details.
- ARGV
ARGV contains the command line arguments used to run ruby.
A library like OptionParser can be used to process command-line arguments.
- Bignum
- DATA
DATA is a File that contains the data section of the executed file. To create a data section use
__END__
:$ cat t.rb puts DATA.gets __END__ hello world! $ ruby t.rb hello world!
- ENV
ENV is a Hash-like accessor for environment variables.
See ENV (the class) for more details.
- FALSE
An obsolete alias of
false
- Fixnum
- NIL
An obsolete alias of
nil
- ParseError
- RUBY_COPYRIGHT
The copyright string for ruby
- RUBY_DESCRIPTION
The full ruby version string, like
ruby -v
prints'- RUBY_ENGINE
The engine or interpreter this ruby uses.
- RUBY_ENGINE_VERSION
The version of the engine or interpreter this ruby uses.
- RUBY_PATCHLEVEL
The patchlevel for this ruby. If this is a development build of ruby the patchlevel will be -1
- RUBY_PLATFORM
The platform for this ruby
- RUBY_RELEASE_DATE
The date this ruby was released
- RUBY_REVISION
The SVN revision for this ruby.
- RUBY_VERSION
The running version of ruby
- SCRIPT_LINES__
When a Hash is assigned to
SCRIPT_LINES__
the contents of files loaded after the assignment will be added as an Array of lines with the file name as the key.- STDERR
Holds the original stderr
- STDIN
Holds the original stdin
- STDOUT
Holds the original stdout
- Synchronizer
A class that provides two-phase lock with a counter. See Sync_m for details.
- Synchronizer_m
A module that provides a two-phase lock with a counter.
- TOPLEVEL_BINDING
The Binding of the top level scope
- TRUE
An obsolete alias of
true
- ThWait
This class watches for termination of multiple threads. Basic functionality (wait until specified threads have terminated) can be accessed through the class method ThreadsWait.all_waits. Finer control can be gained using instance methods.
Example:
ThreadsWait.all_waits(thr1, thr2, ...) do |t| STDERR.puts "Thread #{t} has terminated." end th = ThreadsWait.new(thread1,...) th.next_wait # next one to be done
- TimeoutError
Raised by Timeout#timeout when the block times out.
Public Class Methods
# File ext/psych/lib/psych/core_ext.rb, line 2 def self.yaml_tag url Psych.add_tag(url, self) end
Public Instance Methods
Returns true if two objects do not match (using the =~ method), otherwise false.
static VALUE rb_obj_not_match(VALUE obj1, VALUE obj2) { VALUE result = rb_funcall(obj1, id_match, 1, obj2); return RTEST(result) ? Qfalse : Qtrue; }
Returns 0 if obj
and other
are the same object or
obj == other
, otherwise nil.
The <=>
is used by various methods to compare objects,
for example Enumerable#sort, Enumerable#max etc.
 Nil means
the two values could not be compared.
When you define <=>
, you can include Comparable to gain the methods
<=
, <
, ==
, >=
,
>
and between?
.
static VALUE rb_obj_cmp(VALUE obj1, VALUE obj2) { if (obj1 == obj2 || rb_equal(obj1, obj2)) return INT2FIX(0); return Qnil; }
Case Equality – For class Object, effectively the
same as calling #==
, but typically overridden by descendants
to provide meaningful semantics in case
statements.
VALUE rb_equal(VALUE obj1, VALUE obj2) { VALUE result; if (obj1 == obj2) return Qtrue; result = rb_funcall(obj1, id_eq, 1, obj2); if (RTEST(result)) return Qtrue; return Qfalse; }
Pattern Match—Overridden by descendants (notably Regexp
and
String
) to provide meaningful pattern-match semantics.
static VALUE rb_obj_match(VALUE obj1, VALUE obj2) { return Qnil; }
Passes args
to CSV.instance.
CSV("CSV,data").read #=> [["CSV", "data"]]
If a block is given, the instance is passed the block and the return value becomes the return value of the block.
CSV("CSV,data") { |c| c.read.any? { |a| a.include?("data") } } #=> true CSV("CSV,data") { |c| c.read.any? { |a| a.include?("zombies") } } #=> false
# File lib/csv.rb, line 2357 def CSV(*args, &block) CSV.instance(*args, &block) end
The primary interface to this library. Use to setup delegation when defining your class.
class MyClass < DelegateClass(ClassToDelegateTo) # Step 1 def initialize super(obj_of_ClassToDelegateTo) # Step 2 end end
Here's a sample of use from Tempfile which is really a File object with a few special rules about storage location and when the File should be deleted. That makes for an almost textbook perfect example of how to use delegation.
class Tempfile < DelegateClass(File) # constant and class member data initialization... def initialize(basename, tmpdir=Dir::tmpdir) # build up file path/name in var tmpname... @tmpfile = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL, 0600) # ... super(@tmpfile) # below this point, all methods of File are supported... end # ... end
# File lib/delegate.rb, line 377 def DelegateClass(superclass) klass = Class.new(Delegator) methods = superclass.instance_methods methods -= ::Delegator.public_api methods -= [:to_s, :inspect, :=~, :!~, :===] klass.module_eval do def __getobj__ # :nodoc: unless defined?(@delegate_dc_obj) return yield if block_given? __raise__ ::ArgumentError, "not delegated" end @delegate_dc_obj end def __setobj__(obj) # :nodoc: __raise__ ::ArgumentError, "cannot delegate to self" if self.equal?(obj) @delegate_dc_obj = obj end methods.each do |method| define_method(method, Delegator.delegating_block(method)) end end klass.define_singleton_method :public_instance_methods do |all=true| super(all) - superclass.protected_instance_methods end klass.define_singleton_method :protected_instance_methods do |all=true| super(all) | superclass.protected_instance_methods end return klass end
Returns a Digest subclass by name
in
a thread-safe manner even when on-demand loading is involved.
require 'digest' Digest("MD5") # => Digest::MD5 Digest(:SHA256) # => Digest::SHA256 Digest(:Foo) # => LoadError: library not found for class Digest::Foo -- digest/foo
# File ext/digest/lib/digest.rb, line 95 def Digest(name) const = name.to_sym Digest::REQUIRE_MUTEX.synchronize { # Ignore autoload's because it is void when we have #const_missing Digest.const_missing(const) } rescue LoadError # Constants do not necessarily rely on digest/*. if Digest.const_defined?(const) Digest.const_get(const) else raise end end
Returns the class of obj. This method must always be called with
an explicit receiver, as class
is also a reserved word in
Ruby.
1.class #=> Integer self.class #=> Object
VALUE rb_obj_class(VALUE obj) { return rb_class_real(CLASS_OF(obj)); }
Produces a shallow copy of obj—the instance variables of
obj are copied, but not the objects they reference.
clone
copies the frozen (unless :freeze keyword argument is
given with a false value) and tainted state of obj. See also the
discussion under Object#dup
.
class Klass attr_accessor :str end s1 = Klass.new #=> #<Klass:0x401b3a38> s1.str = "Hello" #=> "Hello" s2 = s1.clone #=> #<Klass:0x401b3998 @str="Hello"> s2.str[1,4] = "i" #=> "i" s1.inspect #=> "#<Klass:0x401b3a38 @str=\"Hi\">" s2.inspect #=> "#<Klass:0x401b3998 @str=\"Hi\">"
This method may have class-specific behavior. If so, that behavior will be
documented under the #initialize_copy
method of the class.
static VALUE rb_obj_clone2(int argc, VALUE *argv, VALUE obj) { static ID keyword_ids[1]; VALUE opt; VALUE kwargs[1]; VALUE clone; VALUE singleton; VALUE kwfreeze = Qtrue; if (!keyword_ids[0]) { CONST_ID(keyword_ids[0], "freeze"); } rb_scan_args(argc, argv, "0:", &opt); if (!NIL_P(opt)) { rb_get_kwargs(opt, keyword_ids, 0, 1, kwargs); kwfreeze = kwargs[0]; if (kwfreeze != Qundef && kwfreeze != Qtrue && kwfreeze != Qfalse) { rb_raise(rb_eArgError, "unexpected value for freeze: %s", rb_builtin_class_name(kwfreeze)); } } if (special_object_p(obj)) { if (kwfreeze == Qfalse) rb_raise(rb_eArgError, "can't unfreeze %s", rb_obj_classname(obj)); return obj; } clone = rb_obj_alloc(rb_obj_class(obj)); RBASIC(clone)->flags &= (FL_TAINT|FL_PROMOTED0|FL_PROMOTED1); RBASIC(clone)->flags |= RBASIC(obj)->flags & ~(FL_PROMOTED0|FL_PROMOTED1|FL_FREEZE|FL_FINALIZE); singleton = rb_singleton_class_clone_and_attach(obj, clone); RBASIC_SET_CLASS(clone, singleton); if (FL_TEST(singleton, FL_SINGLETON)) { rb_singleton_class_attached(singleton, clone); } init_copy(clone, obj); rb_funcall(clone, id_init_clone, 1, obj); if (Qfalse != kwfreeze) { RBASIC(clone)->flags |= RBASIC(obj)->flags & FL_FREEZE; } return clone; }
provides a unified clone
operation, for REXML::XPathParser to use across multiple
Object types
# File lib/rexml/xpath_parser.rb, line 10 def dclone clone end
DO NOT WRITE ANY MAGIC COMMENT HERE.
# File lib/irb/src_encoding.rb, line 2 def default_src_encoding return __ENCODING__ end
Defines a singleton method in the receiver. The method parameter
can be a Proc
, a Method
or an
UnboundMethod
object. If a block is specified, it is used as
the method body.
class A class << self def class_name to_s end end end A.define_singleton_method(:who_am_i) do "I am: #{class_name}" end A.who_am_i # ==> "I am: A" guy = "Bob" guy.define_singleton_method(:hello) { "#{self}: Hello there!" } guy.hello #=> "Bob: Hello there!"
static VALUE rb_obj_define_method(int argc, VALUE *argv, VALUE obj) { VALUE klass = rb_singleton_class(obj); return rb_mod_define_method(argc, argv, klass); }
Prints obj on the given port (default $>
).
Equivalent to:
def display(port=$>) port.write self nil end
For example:
1.display "cat".display [ 4, 5, 6 ].display puts
produces:
1cat[4, 5, 6]
static VALUE rb_obj_display(int argc, VALUE *argv, VALUE self) { VALUE out; if (argc == 0) { out = rb_stdout; } else { rb_scan_args(argc, argv, "01", &out); } rb_io_write(out, self); return Qnil; }
Produces a shallow copy of obj—the instance variables of
obj are copied, but not the objects they reference.
dup
copies the tainted state of obj.
This method may have class-specific behavior. If so, that behavior will be
documented under the #initialize_copy
method of the class.
on dup vs clone¶ ↑
In general, clone
and dup
may have different
semantics in descendant classes. While clone
is used to
duplicate an object, including its internal state, dup
typically uses the class of the descendant object to create the new
instance.
When using dup, any modules that the object has been extended with will not be copied.
class Klass attr_accessor :str end module Foo def foo; 'foo'; end end s1 = Klass.new #=> #<Klass:0x401b3a38> s1.extend(Foo) #=> #<Klass:0x401b3a38> s1.foo #=> "foo" s2 = s1.clone #=> #<Klass:0x401b3a38> s2.foo #=> "foo" s3 = s1.dup #=> #<Klass:0x401b3a38> s3.foo #=> NoMethodError: undefined method `foo' for #<Klass:0x401b3a38>
VALUE rb_obj_dup(VALUE obj) { VALUE dup; if (special_object_p(obj)) { return obj; } dup = rb_obj_alloc(rb_obj_class(obj)); init_copy(dup, obj); rb_funcall(dup, id_init_dup, 1, obj); return dup; }
Creates a new Enumerator which will enumerate
by calling method
on obj
, passing
args
if any.
If a block is given, it will be used to calculate the size of the enumerator without the need to iterate it (see Enumerator#size).
Examples¶ ↑
str = "xyz" enum = str.enum_for(:each_byte) enum.each { |b| puts b } # => 120 # => 121 # => 122 # protect an array from being modified by some_method a = [1, 2, 3] some_method(a.to_enum)
It is typical to call #to_enum when defining methods for a generic Enumerable, in case no block is passed.
Here is such an example, with parameter passing and a sizing block:
module Enumerable # a generic method to repeat the values of any enumerable def repeat(n) raise ArgumentError, "#{n} is negative!" if n < 0 unless block_given? return to_enum(__method__, n) do # __method__ is :repeat here sz = size # Call size and multiply by n... sz * n if sz # but return nil if size itself is nil end end each do |*val| n.times { yield *val } end end end %[hello world].repeat(2) { |w| puts w } # => Prints 'hello', 'hello', 'world', 'world' enum = (1..14).repeat(3) # => returns an Enumerator when called without a block enum.first(4) # => [1, 1, 1, 2] enum.size # => 42
static VALUE obj_to_enum(int argc, VALUE *argv, VALUE obj) { VALUE enumerator, meth = sym_each; if (argc > 0) { --argc; meth = *argv++; } enumerator = rb_enumeratorize_with_size(obj, meth, argc, argv, 0); if (rb_block_given_p()) { enumerator_ptr(enumerator)->size = rb_block_proc(); } return enumerator; }
Equality — At the Object
level, ==
returns
true
only if obj
and other
are the
same object. Typically, this method is overridden in descendant classes to
provide class-specific meaning.
Unlike ==
, the equal?
method should never be
overridden by subclasses as it is used to determine object identity (that
is, a.equal?(b)
if and only if a
is the same
object as b
):
obj = "a" other = obj.dup obj == other #=> true obj.equal? other #=> false obj.equal? obj #=> true
The eql?
method returns true
if obj
and other
refer to the same hash key. This is used by Hash to test members for equality. For objects of
class Object
, eql?
is synonymous with
==
. Subclasses normally continue this tradition by aliasing
eql?
to their overridden ==
method, but there are
exceptions. Numeric
types, for example, perform type
conversion across ==
, but not across eql?
, so:
1 == 1.0 #=> true 1.eql? 1.0 #=> false
VALUE rb_obj_equal(VALUE obj1, VALUE obj2) { if (obj1 == obj2) return Qtrue; return Qfalse; }
Adds to obj the instance methods from each module given as a parameter.
module Mod def hello "Hello from Mod.\n" end end class Klass def hello "Hello from Klass.\n" end end k = Klass.new k.hello #=> "Hello from Klass.\n" k.extend(Mod) #=> #<Klass:0x401b3bc8> k.hello #=> "Hello from Mod.\n"
static VALUE rb_obj_extend(int argc, VALUE *argv, VALUE obj) { int i; ID id_extend_object, id_extended; CONST_ID(id_extend_object, "extend_object"); CONST_ID(id_extended, "extended"); rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS); for (i = 0; i < argc; i++) Check_Type(argv[i], T_MODULE); while (argc--) { rb_funcall(argv[argc], id_extend_object, 1, obj); rb_funcall(argv[argc], id_extended, 1, obj); } return obj; }
Prevents further modifications to obj. A RuntimeError
will be raised if modification is attempted. There is no way to unfreeze a
frozen object. See also Object#frozen?
.
This method returns self.
a = [ "a", "b", "c" ] a.freeze a << "z"
produces:
prog.rb:3:in `<<': can't modify frozen Array (RuntimeError) from prog.rb:3
Objects of the following classes are always frozen: Integer, Float, Symbol.
VALUE rb_obj_freeze(VALUE obj) { if (!OBJ_FROZEN(obj)) { OBJ_FREEZE(obj); if (SPECIAL_CONST_P(obj)) { rb_bug("special consts should be frozen."); } } return obj; }
Returns the freeze status of obj.
a = [ "a", "b", "c" ] a.freeze #=> ["a", "b", "c"] a.frozen? #=> true
VALUE rb_obj_frozen_p(VALUE obj) { return OBJ_FROZEN(obj) ? Qtrue : Qfalse; }
Generates an Integer hash value for this object.
This function must have the property that a.eql?(b)
implies
a.hash == b.hash
.
The hash value is used along with eql? by the Hash class to determine if two objects reference the same hash key. Any hash value that exceeds the capacity of an Integer will be truncated before being used.
The hash value for an object may not be identical across invocations or implementations of Ruby. If you need a stable identifier across Ruby invocations and implementations you will need to generate one with a custom method.
VALUE rb_obj_hash(VALUE obj) { VALUE oid = rb_obj_id(obj); #if SIZEOF_LONG == SIZEOF_VOIDP st_index_t index = NUM2LONG(oid); #elif SIZEOF_LONG_LONG == SIZEOF_VOIDP st_index_t index = NUM2LL(oid); #else # error not supported #endif return LONG2FIX(rb_objid_hash(index)); }
Returns a string containing a human-readable representation of
obj. The default inspect
shows the object's class
name, an encoding of the object id, and a list of the instance variables
and their values (by calling inspect on each of them). User
defined classes should override this method to provide a better
representation of obj. When overriding this method, it should
return a string whose encoding is compatible with the default external
encoding.
[ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]" Time.new.inspect #=> "2008-03-08 19:43:39 +0900" class Foo end Foo.new.inspect #=> "#<Foo:0x0300c868>" class Bar def initialize @bar = 1 end end Bar.new.inspect #=> "#<Bar:0x0300c868 @bar=1>"
static VALUE rb_obj_inspect(VALUE obj) { if (rb_ivar_count(obj) > 0) { VALUE str; VALUE c = rb_class_name(CLASS_OF(obj)); str = rb_sprintf("-<%"PRIsVALUE":%p", c, (void*)obj); return rb_exec_recursive(inspect_obj, obj, str); } else { return rb_any_to_s(obj); } }
Returns true
if obj is an instance of the given
class. See also Object#kind_of?
.
class A; end class B < A; end class C < B; end b = B.new b.instance_of? A #=> false b.instance_of? B #=> true b.instance_of? C #=> false
VALUE rb_obj_is_instance_of(VALUE obj, VALUE c) { c = class_or_module_required(c); if (rb_obj_class(obj) == c) return Qtrue; return Qfalse; }
Returns true
if the given instance variable is defined in
obj. String arguments are converted to symbols.
class Fred def initialize(p1, p2) @a, @b = p1, p2 end end fred = Fred.new('cat', 99) fred.instance_variable_defined?(:@a) #=> true fred.instance_variable_defined?("@b") #=> true fred.instance_variable_defined?("@c") #=> false
static VALUE rb_obj_ivar_defined(VALUE obj, VALUE iv) { ID id = id_for_var(obj, iv, an, instance); if (!id) { return Qfalse; } return rb_ivar_defined(obj, id); }
Returns the value of the given instance variable, or nil if the instance
variable is not set. The @
part of the variable name should be
included for regular instance variables. Throws a NameError
exception if the supplied symbol is not valid as an instance variable name.
String arguments are converted to symbols.
class Fred def initialize(p1, p2) @a, @b = p1, p2 end end fred = Fred.new('cat', 99) fred.instance_variable_get(:@a) #=> "cat" fred.instance_variable_get("@b") #=> 99
static VALUE rb_obj_ivar_get(VALUE obj, VALUE iv) { ID id = id_for_var(obj, iv, an, instance); if (!id) { return Qnil; } return rb_ivar_get(obj, id); }
Sets the instance variable named by symbol to the given object, thereby frustrating the efforts of the class's author to attempt to provide proper encapsulation. The variable does not have to exist prior to this call. If the instance variable name is passed as a string, that string is converted to a symbol.
class Fred def initialize(p1, p2) @a, @b = p1, p2 end end fred = Fred.new('cat', 99) fred.instance_variable_set(:@a, 'dog') #=> "dog" fred.instance_variable_set(:@c, 'cat') #=> "cat" fred.inspect #=> "#<Fred:0x401b3da8 @a=\"dog\", @b=99, @c=\"cat\">"
static VALUE rb_obj_ivar_set(VALUE obj, VALUE iv, VALUE val) { ID id = id_for_var(obj, iv, an, instance); if (!id) id = rb_intern_str(iv); return rb_ivar_set(obj, id, val); }
Returns an array of instance variable names for the receiver. Note that simply defining an accessor does not create the corresponding instance variable.
class Fred attr_accessor :a1 def initialize @iv = 3 end end Fred.new.instance_variables #=> [:@iv]
VALUE rb_obj_instance_variables(VALUE obj) { VALUE ary; ary = rb_ary_new(); rb_ivar_foreach(obj, ivar_i, ary); return ary; }
Returns true
if class is the class of obj,
or if class is one of the superclasses of obj or modules
included in obj.
module M; end class A include M end class B < A; end class C < B; end b = B.new b.is_a? A #=> true b.is_a? B #=> true b.is_a? C #=> false b.is_a? M #=> true b.kind_of? A #=> true b.kind_of? B #=> true b.kind_of? C #=> false b.kind_of? M #=> true
VALUE rb_obj_is_kind_of(VALUE obj, VALUE c) { VALUE cl = CLASS_OF(obj); c = class_or_module_required(c); return class_search_ancestor(cl, RCLASS_ORIGIN(c)) ? Qtrue : Qfalse; }
Returns obj.
string = 'my string' #=> "my string" string.itself.object_id == string.object_id #=> true
static VALUE rb_obj_itself(VALUE obj) { return obj; }
Returns true
if class is the class of obj,
or if class is one of the superclasses of obj or modules
included in obj.
module M; end class A include M end class B < A; end class C < B; end b = B.new b.is_a? A #=> true b.is_a? B #=> true b.is_a? C #=> false b.is_a? M #=> true b.kind_of? A #=> true b.kind_of? B #=> true b.kind_of? C #=> false b.kind_of? M #=> true
VALUE rb_obj_is_kind_of(VALUE obj, VALUE c) { VALUE cl = CLASS_OF(obj); c = class_or_module_required(c); return class_search_ancestor(cl, RCLASS_ORIGIN(c)) ? Qtrue : Qfalse; }
Looks up the named method as a receiver in obj, returning a
Method
object (or raising NameError
). The
Method
object acts as a closure in obj's object
instance, so instance variables and the value of self
remain
available.
class Demo def initialize(n) @iv = n end def hello() "Hello, @iv = #{@iv}" end end k = Demo.new(99) m = k.method(:hello) m.call #=> "Hello, @iv = 99" l = Demo.new('Fred') m = l.method("hello") m.call #=> "Hello, @iv = Fred"
VALUE rb_obj_method(VALUE obj, VALUE vid) { return obj_method(obj, vid, FALSE); }
Returns a list of the names of public and protected methods of
obj. This will include all the methods accessible in
obj's ancestors. If the optional parameter is
false
, it returns an array of obj<i>'s public
and protected singleton methods, the array will not include methods in
modules included in <i>obj.
class Klass def klass_method() end end k = Klass.new k.methods[0..9] #=> [:klass_method, :nil?, :===, # :==~, :!, :eql? # :hash, :<=>, :class, :singleton_class] k.methods.length #=> 56 k.methods(false) #=> [] def k.singleton_method; end k.methods(false) #=> [:singleton_method] module M123; def m123; end end k.extend M123 k.methods(false) #=> [:singleton_method]
VALUE rb_obj_methods(int argc, const VALUE *argv, VALUE obj) { rb_check_arity(argc, 0, 1); if (argc > 0 && !RTEST(argv[0])) { return rb_obj_singleton_methods(argc, argv, obj); } return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_i); }
Only the object nil responds true
to
nil?
.
Object.new.nil? #=> false nil.nil? #=> true
static VALUE rb_false(VALUE obj) { return Qfalse; }
Returns an integer identifier for obj
.
The same number will be returned on all calls to object_id
for
a given object, and no two active objects will share an id.
Note: that some objects of builtin classes are reused for optimization. This is the case for immediate values and frozen string literals.
Immediate values are not passed by reference but are passed by value:
nil
, true
, false
, Fixnums, Symbols,
and some Floats.
Object.new.object_id == Object.new.object_id # => false (21 * 2).object_id == (21 * 2).object_id # => true "hello".object_id == "hello".object_id # => false "hi".freeze.object_id == "hi".freeze.object_id # => true
VALUE rb_obj_id(VALUE obj) { /* * 32-bit VALUE space * MSB ------------------------ LSB * false<PHONE_NUMBER>0000000000000000000000 * true<PHONE_NUMBER>0000000000000000000010 * nil<PHONE_NUMBER>0000000000000000000100 * undef<PHONE_NUMBER>0000000000000000000110 * symbol ssssssssssssssssssssssss00001110 * object oooooooooooooooooooooooooooooo00 = 0 (mod sizeof(RVALUE)) * fixnum fffffffffffffffffffffffffffffff1 * * object_id space * LSB * false<PHONE_NUMBER>0000000000000000000000 * true<PHONE_NUMBER>0000000000000000000010 * nil<PHONE_NUMBER>0000000000000000000100 * undef<PHONE_NUMBER>0000000000000000000110 * symbol 000SSSSSSSSSSSSSSSSSSSSSSSSSSS0 S...S % A = 4 (S...S = s...s * A + 4) * object oooooooooooooooooooooooooooooo0 o...o % A = 0 * fixnum fffffffffffffffffffffffffffffff1 bignum if required * * where A = sizeof(RVALUE)/4 * * sizeof(RVALUE) is * 20 if 32-bit, double is 4-byte aligned * 24 if 32-bit, double is 8-byte aligned * 40 if 64-bit */ if (STATIC_SYM_P(obj)) { return (SYM2ID(obj) * sizeof(RVALUE) + (4 << 2)) | FIXNUM_FLAG; } else if (FLONUM_P(obj)) { #if SIZEOF_LONG == SIZEOF_VOIDP return LONG2NUM((SIGNED_VALUE)obj); #else return LL2NUM((SIGNED_VALUE)obj); #endif } else if (SPECIAL_CONST_P(obj)) { return LONG2NUM((SIGNED_VALUE)obj); } return nonspecial_obj_id(obj); }
Returns the list of private methods accessible to obj. If the
all parameter is set to false
, only those methods in
the receiver will be listed.
VALUE rb_obj_private_methods(int argc, const VALUE *argv, VALUE obj) { return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_priv_i); }
Returns the list of protected methods accessible to obj. If the
all parameter is set to false
, only those methods in
the receiver will be listed.
VALUE rb_obj_protected_methods(int argc, const VALUE *argv, VALUE obj) { return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_prot_i); }
Convert an object to YAML. See Psych.dump for more information on the
available options
.
# File ext/psych/lib/psych/core_ext.rb, line 13 def psych_to_yaml options = {} Psych.dump self, options end
Similar to method, searches public method only.
VALUE rb_obj_public_method(VALUE obj, VALUE vid) { return obj_method(obj, vid, TRUE); }
Returns the list of public methods accessible to obj. If the
all parameter is set to false
, only those methods in
the receiver will be listed.
VALUE rb_obj_public_methods(int argc, const VALUE *argv, VALUE obj) { return class_instance_method_list(argc, argv, CLASS_OF(obj), 1, ins_methods_pub_i); }
Invokes the method identified by symbol, passing it any arguments specified. Unlike send, #public_send calls public methods only. When the method is identified by a string, the string is converted to a symbol.
1.public_send(:puts, "hello") # causes NoMethodError
VALUE rb_f_public_send(int argc, VALUE *argv, VALUE recv) { return send_internal(argc, argv, recv, CALL_PUBLIC); }
Removes the named instance variable from obj, returning that variable's value.
class Dummy attr_reader :var def initialize @var = 99 end def remove remove_instance_variable(:@var) end end d = Dummy.new d.var #=> 99 d.remove #=> 99 d.var #=> nil
VALUE rb_obj_remove_instance_variable(VALUE obj, VALUE name) { VALUE val = Qnil; const ID id = id_for_var(obj, name, an, instance); st_data_t n, v; struct st_table *iv_index_tbl; st_data_t index; rb_check_frozen(obj); if (!id) { goto not_defined; } switch (BUILTIN_TYPE(obj)) { case T_OBJECT: iv_index_tbl = ROBJECT_IV_INDEX_TBL(obj); if (!iv_index_tbl) break; if (!st_lookup(iv_index_tbl, (st_data_t)id, &index)) break; if (ROBJECT_NUMIV(obj) <= index) break; val = ROBJECT_IVPTR(obj)[index]; if (val != Qundef) { ROBJECT_IVPTR(obj)[index] = Qundef; return val; } break; case T_CLASS: case T_MODULE: n = id; if (RCLASS_IV_TBL(obj) && st_delete(RCLASS_IV_TBL(obj), &n, &v)) { return (VALUE)v; } break; default: if (FL_TEST(obj, FL_EXIVAR)) { if (generic_ivar_remove(obj, id, &val)) { return val; } } break; } not_defined: rb_name_err_raise("instance variable %1$s not defined", obj, name); UNREACHABLE; }
Returns true
if obj responds to the given method.
Private and protected methods are included in the search only if the
optional second parameter evaluates to true
.
If the method is not implemented, as Process.fork on Windows, File.lchmod on GNU/Linux, etc., false is returned.
If the method is not defined, respond_to_missing?
method is
called and the result is returned.
When the method name parameter is given as a string, the string is converted to a symbol.
static VALUE obj_respond_to(int argc, VALUE *argv, VALUE obj) { VALUE mid, priv; ID id; rb_thread_t *th = GET_THREAD(); rb_scan_args(argc, argv, "11", &mid, &priv); if (!(id = rb_check_id(&mid))) { VALUE ret = basic_obj_respond_to_missing(th, CLASS_OF(obj), obj, rb_to_symbol(mid), priv); if (ret == Qundef) ret = Qfalse; return ret; } if (basic_obj_respond_to(th, obj, id, !RTEST(priv))) return Qtrue; return Qfalse; }
DO NOT USE THIS DIRECTLY.
Hook method to return whether the obj can respond to id method or not.
When the method name parameter is given as a string, the string is converted to a symbol.
See respond_to?, and the example of BasicObject.
static VALUE obj_respond_to_missing(VALUE obj, VALUE mid, VALUE priv) { return Qfalse; }
Invokes the method identified by symbol, passing it any arguments
specified. You can use __send__
if the name send
clashes with an existing method in obj. When the method is
identified by a string, the string is converted to a symbol.
class Klass def hello(*args) "Hello " + args.join(' ') end end k = Klass.new k.send :hello, "gentle", "readers" #=> "Hello gentle readers"
VALUE rb_f_send(int argc, VALUE *argv, VALUE recv) { return send_internal(argc, argv, recv, CALL_FCALL); }
Returns the singleton class of obj. This method creates a new singleton class if obj does not have one.
If obj is nil
, true
, or
false
, it returns NilClass, TrueClass, or FalseClass, respectively. If obj is an
Integer, a Float or a
Symbol, it raises a TypeError.
Object.new.singleton_class #=> #<Class:#<Object:0xb7ce1e24>> String.singleton_class #=> #<Class:String> nil.singleton_class #=> NilClass
static VALUE rb_obj_singleton_class(VALUE obj) { return rb_singleton_class(obj); }
Similar to method, searches singleton method only.
class Demo def initialize(n) @iv = n end def hello() "Hello, @iv = #{@iv}" end end k = Demo.new(99) def k.hi "Hi, @iv = #{@iv}" end m = k.singleton_method(:hi) m.call #=> "Hi, @iv = 99" m = k.singleton_method(:hello) #=> NameError
VALUE rb_obj_singleton_method(VALUE obj, VALUE vid) { const rb_method_entry_t *me; VALUE klass; ID id = rb_check_id(&vid); if (!id) { if (!NIL_P(klass = rb_singleton_class_get(obj)) && respond_to_missing_p(klass, obj, vid, FALSE)) { id = rb_intern_str(vid); return mnew_missing(klass, obj, id, rb_cMethod); } undef: rb_name_err_raise("undefined singleton method `%1$s' for `%2$s'", obj, vid); } if (NIL_P(klass = rb_singleton_class_get(obj)) || UNDEFINED_METHOD_ENTRY_P(me = rb_method_entry_at(klass, id)) || UNDEFINED_REFINED_METHOD_P(me->def)) { vid = ID2SYM(id); goto undef; } return mnew_from_me(me, klass, obj, id, rb_cMethod, FALSE); }
Returns an array of the names of singleton methods for obj. If the optional all parameter is true, the list will include methods in modules included in obj. Only public and protected singleton methods are returned.
module Other def three() end end class Single def Single.four() end end a = Single.new def a.one() end class << a include Other def two() end end Single.singleton_methods #=> [:four] a.singleton_methods(false) #=> [:two, :one] a.singleton_methods #=> [:two, :one, :three]
VALUE rb_obj_singleton_methods(int argc, const VALUE *argv, VALUE obj) { VALUE recur, ary, klass, origin; struct method_entry_arg me_arg; struct rb_id_table *mtbl; if (argc == 0) { recur = Qtrue; } else { rb_scan_args(argc, argv, "01", &recur); } klass = CLASS_OF(obj); origin = RCLASS_ORIGIN(klass); me_arg.list = st_init_numtable(); me_arg.recur = RTEST(recur); if (klass && FL_TEST(klass, FL_SINGLETON)) { if ((mtbl = RCLASS_M_TBL(origin)) != 0) rb_id_table_foreach(mtbl, method_entry_i, &me_arg); klass = RCLASS_SUPER(klass); } if (RTEST(recur)) { while (klass && (FL_TEST(klass, FL_SINGLETON) || RB_TYPE_P(klass, T_ICLASS))) { if (klass != origin && (mtbl = RCLASS_M_TBL(klass)) != 0) rb_id_table_foreach(mtbl, method_entry_i, &me_arg); klass = RCLASS_SUPER(klass); } } ary = rb_ary_new(); st_foreach(me_arg.list, ins_methods_i, ary); st_free_table(me_arg.list); return ary; }
cgi_runner.rb – CGI launcher.
Author: IPR – Internet Programming with Ruby – writers Copyright © 2000 TAKAHASHI Masayoshi, GOTOU YUUZOU Copyright © 2002 Internet Programming with Ruby writers. All rights reserved.
$IPR: cgi_runner.rb,v 1.9 2002/09/25 11:33:15 gotoyuzo Exp $
# File lib/webrick/httpservlet/cgi_runner.rb, line 11 def sysread(io, size) buf = "" while size > 0 tmp = io.sysread(size) buf << tmp size -= tmp.bytesize end return buf end
Mark the object as tainted.
Objects that are marked as tainted will be restricted from various built-in methods. This is to prevent insecure data, such as command-line arguments or strings read from Kernel#gets, from inadvertently compromising the user's system.
To check whether an object is tainted, use tainted?.
You should only untaint a tainted object if your code has inspected it and determined that it is safe. To do so use untaint.
VALUE rb_obj_taint(VALUE obj) { if (!OBJ_TAINTED(obj) && OBJ_TAINTABLE(obj)) { rb_check_frozen(obj); OBJ_TAINT(obj); } return obj; }
Returns true if the object is tainted.
See taint for more information.
VALUE rb_obj_tainted(VALUE obj) { if (OBJ_TAINTED(obj)) return Qtrue; return Qfalse; }
Yields self to the block, and then returns self. The primary purpose of this method is to “tap into” a method chain, in order to perform operations on intermediate results within the chain.
(1..10) .tap {|x| puts "original: #{x.inspect}"} .to_a .tap {|x| puts "array: #{x.inspect}"} .select {|x| x%2==0} .tap {|x| puts "evens: #{x.inspect}"} .map {|x| x*x} .tap {|x| puts "squares: #{x.inspect}"}
VALUE rb_obj_tap(VALUE obj) { rb_yield(obj); return obj; }
# File lib/timeout.rb, line 119 def timeout(*args, &block) warn "#{caller_locations(1, 1)[0]}: Object##{__method__} is deprecated, use Timeout.timeout instead." Timeout.timeout(*args, &block) end
Creates a new Enumerator which will enumerate
by calling method
on obj
, passing
args
if any.
If a block is given, it will be used to calculate the size of the enumerator without the need to iterate it (see Enumerator#size).
Examples¶ ↑
str = "xyz" enum = str.enum_for(:each_byte) enum.each { |b| puts b } # => 120 # => 121 # => 122 # protect an array from being modified by some_method a = [1, 2, 3] some_method(a.to_enum)
It is typical to call #to_enum when defining methods for a generic Enumerable, in case no block is passed.
Here is such an example, with parameter passing and a sizing block:
module Enumerable # a generic method to repeat the values of any enumerable def repeat(n) raise ArgumentError, "#{n} is negative!" if n < 0 unless block_given? return to_enum(__method__, n) do # __method__ is :repeat here sz = size # Call size and multiply by n... sz * n if sz # but return nil if size itself is nil end end each do |*val| n.times { yield *val } end end end %[hello world].repeat(2) { |w| puts w } # => Prints 'hello', 'hello', 'world', 'world' enum = (1..14).repeat(3) # => returns an Enumerator when called without a block enum.first(4) # => [1, 1, 1, 2] enum.size # => 42
static VALUE obj_to_enum(int argc, VALUE *argv, VALUE obj) { VALUE enumerator, meth = sym_each; if (argc > 0) { --argc; meth = *argv++; } enumerator = rb_enumeratorize_with_size(obj, meth, argc, argv, 0); if (rb_block_given_p()) { enumerator_ptr(enumerator)->size = rb_block_proc(); } return enumerator; }
Returns a string representing obj. The default to_s
prints the object's class and an encoding of the object id. As a
special case, the top-level object that is the initial execution context of
Ruby programs returns “main''.
VALUE rb_any_to_s(VALUE obj) { VALUE str; VALUE cname = rb_class_name(CLASS_OF(obj)); str = rb_sprintf("#<%"PRIsVALUE":%p>", cname, (void*)obj); OBJ_INFECT(str, obj); return str; }
Deprecated method that is equivalent to untaint.
VALUE rb_obj_trust(VALUE obj) { rb_warning("trust is deprecated and its behavior is same as untaint"); return rb_obj_untaint(obj); }
mathn¶ ↑
mathn serves to make mathematical operations more precise in Ruby and to integrate other mathematical standard libraries.
Without mathn:
3 / 2 => 1 # Integer
With mathn:
3 / 2 => 3/2 # Rational
mathn keeps value in exact terms.
Without mathn:
20 / 9 * 3 * 14 / 7 * 3 / 2 # => 18
With mathn:
20 / 9 * 3 * 14 / 7 * 3 / 2 # => 20
When you require 'mathn', the libraries for Prime, CMath, Matrix and Vector are also loaded.
Copyright¶ ↑
Author: Keiju ISHITSUKA (SHL Japan Inc.)
# File lib/mathn.rb, line 40 warn('lib/mathn.rb is deprecated') if $VERBOSE
Removes the tainted mark from the object.
See taint for more information.
VALUE rb_obj_untaint(VALUE obj) { if (OBJ_TAINTED(obj)) { rb_check_frozen(obj); FL_UNSET(obj, FL_TAINT); } return obj; }
Deprecated method that is equivalent to taint.
VALUE rb_obj_untrust(VALUE obj) { rb_warning("untrust is deprecated and its behavior is same as taint"); return rb_obj_taint(obj); }
Deprecated method that is equivalent to tainted?.
VALUE rb_obj_untrusted(VALUE obj) { rb_warning("untrusted? is deprecated and its behavior is same as tainted?"); return rb_obj_tainted(obj); }
A convenience method that's only available when the you require the IRB::XMP standard library.
Creates a new XMP object, using the given
expressions as the exps
parameter, and optional binding as
bind
or uses the top-level binding. Then evaluates the given
expressions using the :XMP
prompt mode.
For example:
require 'irb/xmp' ctx = binding xmp 'foo = "bar"', ctx #=> foo = "bar" #==>"bar" ctx.eval 'foo' #=> "bar"
See XMP.new for more information.
# File lib/irb/xmp.rb, line 164 def xmp(exps, bind = nil) bind = IRB::Frame.top(1) unless bind xmp = XMP.new(bind) xmp.puts exps xmp end


Nehemiah 5:4
There were also that said, We have borrowed money for the king's tribute, and that upon our lands and vineyards.


| Name | Template | Description | Status | Created | Last Update | Cloud Items |
|---|
$def with () $var jsfiles: managePageCommon.js ecosystemManage.js $var cssfiles:
The Manage Ecosystems screen allows administrators to modify, add and delete Ecosystems.
Select one or more Ecosystems from the list, using the checkboxes. Select an action to modify or delete the Ecosystems you've selected.
Click here for a more detailed introduction to Ecosystems.
| Name | Template | Description | Status | Created | Last Update | Cloud Items |
|---|
| Name | |
| Description | |
| Serviced by Template |


The following programs are implemented in javascript / typescript, using WebGl2. Not all browsers support WebGl2. The latest versions of Google Chrome and Windows Edge can be used to view the results.
In the program load_gltf_waterbottle.ts we once again load the gltf model WaterBottle.gltf. We've done that before in Part 6. In the program load_environment.ts we create an environment from a cubemap. The theory can be found in Part 4, Chapter 27. And finally we have a program that combines the two, an environment + a gltf model (this time a two-cylindre engine).
The main idea behind this chapter is to restructure the code we used. We introduce a number of Draw_xxx classes that hold the information about the things we want to draw. Examples are DrawModel, DrawCubeMap and DrawObject. These classes are found in geometry/drawable.ts. A DrawObject has the vertex-data as welle as the material data.
The classes are converted into clases that hold the information to draw them in a OpenGL context, using the class glManager (found in file /gl/glDrawable.ts). In the same subdirectory /gl/ is also the code to create shaders. A material is of a type (a material has a field type). A Shader corresponding to the type is created by glManager using Shaders.getShader(type). If we call Shaders.getShader a second time with the same value for type Shaders will return the same shader. In our examples there are only two shader classes, a Env0Shader (for drawing an environment) and a Pbr0Shader (for drawing a gltf model).
Depending on what is found in the Gltf file a Pbr0Material is made. Depending on the textures found the field mapCode gets its value. This value is passed to the Pbr0Shader. A Pbr0Shader has the method setMaterial that gives the uniforms of the shader a value.
In the program we call Shaders.getShader first to get the shader and set the uniforms positions and colors. Pbr0Shader.setMaterial is called automatically by glManager.drawModelObjects(glDrawModel, model: mat4). We need to call setProjection and setView ourselves, as usual.
The class ImageLoader is introduced that accepts a list of uris and returns the promise of a set of images. We are using a set of images that make it easy to see what happens to them when using cubemap textures (the textures are mapped on the outside of the cube; what is meant by the right or the left relative to the front can be seen looking at the colors).
Use is made op Promise.all()


Follow these steps to open existing projects:
- Log in to the Algorithm Lab.
- In the left navigation bar, click Projects.
- On the Projects page, click Open Project.
- If the project is in a directory, click the directory files to navigate to the project file.
- Click the project file.
The web IDE displays the project.


Go to "Help" -> "Install New Software":
Setup the update site:
Location:
http://www.esrlabs.com/eclipse-plugins/com.esrlabs.eclipse.bake.updatesite/
Choose the bake Feature:
Accept the license after reading it:
Ignore the security warning - you can trust the software:
After successfull installation, restart Eclipse:


Profile
Matches
Press
About Us
Log a Trip
Messages
1
Malik
Malik
View Profile
Savings
$50
500kg CO2
45 minutes
Upcoming Trips
Trip 1
Trip 2
Trip 3
x
Say Hello!
Subject:
Malik Ismail
32
min
Sits: 595A
Contact:<PHONE_NUMBER>
Hover
In Person
Monday
Tuesday
Wednesday
Thursday
Friday
In Car Experience
Stations
1010 AM
99.1 FM
92.5 FM
93.5 FM
104.5 FM
Conversation
Temperature
About
Sits
509b
Works
Finance
Savings
Carpooling with Malik
Once a week -
2 times a week
3 times a week
4 times a week
5 times a week
could save:
Money: $45
Money: $45
Money: $45


Psalms 49:5
Wherefore should I fear in the days of evil, when the iniquity of my heels shall compass me about?


This documentation is for people who work on the Twisted codebase itself, rather than for people who want to use Twisted in their own projects.
This documentation is for people who work on the Twisted codebase itself, rather than for people who want to use Twisted in their own projects.


Lara Croft Tomb Raider (2001) Reviewed by Eugene Novikov http://www.ultimate-movie.com/ "You might try to kill me."  "I said you'd try."
Starring Angelina Jolie, Noah Taylor, Iain Glen, Daniel Craig, Chris Barrie, John Voight. Directed by Simon West. Rated PG-13.
The official title of this long-awaited video game adaptation is Lara Croft Tomb Raider. Just like that. No punctuation, not even a comma or a colon. It's a bad omen; fortunately, it's just about the only sloppiness you'll see in this sleek, almost embarassingly entertaining summer blockbuster. The critics ripped the movie apart, but it's a great time-waster, perfect for taking in casually on a Saturday afternoon and forgetting an hour later. And I'm a sucker for completely gratuitous shower scenes, especially if the showeree is the likes of Angelina Jolie. Sue me.
The plot is nonsense about a fight for 2 pieces of some mysterious talisman that, at the appropriate planetary alignment that only occurs every 5000 years or so, will give its possessor the power to change the fabric of space and time. Or something like that. Lara Croft, a famous Tomb Raider (the movie never defines exactly what a "Tomb Raider" is), is saddled with the task of stopping the Illuminati, a secret organization of shady old men, from obtaining the parts of the triangle. Her opponent: the suave, evil, Manfred Powell (Iain Glenn), who is committed to giving the Illuminati what they want. Working with Powell is Alex West (Daniel Craig), also a Tomb Raider and, apparently, Lara's former love interest.
This is silly, of course, but you can follow it -- which is much more than can be said for the inexplicably better-reviewed Swordfish -- and all that's left to do after that is watch Jolie fire multiple guns at a time at weird robot-like creatures. The subject matter here is mythical mumbo-jumbo, but director Simon West (Con Air) makes an interesting decision: instead of approaching it with the childlike awe of The Mummy, he treats it with a sort of ultra-hip indifference. Jolie has a constant smirk on her face and so, it seems, does the director; the movie doesn't make fun of the plot or acknowledge its prepostrousness, but it sort of dismisses its own story as just another day in the life of Lara Croft.
The action sequences are fluid and exciting, and the special effects don't call attention to themselves.  To risk overreaching, Jolie may be the best action heroine I've ever seen; she's confident and comfortable with the material, either overcoming or just plain ignoring the bombshell status placed on her. She doesn't have much dialogue and she doesn't need any; the movie avoids making an embarassment of itself by keeping it to a minimum.
There's a subplot involving Lara Croft's father (played by Jolie's real father, Jon Voight) that works to provide motivation for a crucial decision Croft makes in the climax. None of it is meant to be taken seriously, of course, and there's no pathos to speak of, but it's good to see the history of the character mentioned (Mummy's Rick O'Connell seems to have popped out of nowhere).
In a summer when a surprising amount of big-budget movies are just plain clunky, Tomb Raider is well-made, confident and entertaining through-and-through. People have harangued it for being pointless, but what's the point of such an argument against a movie like this?
Grade: B-
Up Next: Atlantis: The Lost Empire
©2001 Eugene Novikov
========== X-RAMR-ID: 28867 X-Language: en X-RT-ReviewID: 236492 X-RT-TitleID: 1105256 X-RT-SourceID: 610 X-RT-AuthorID: 1577 X-RT-RatingText: B-
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


I find that for me, one of my triggers when programming is coming across an error or problem that I don’t understand and don’t know where I should look or what I should be researching in order to solve it. I think some of this comes from the fact that I’m so new to programming and don’t really have any kind of method yet for solving problems I get stuck on (since in other areas of my life that I have much more background and skill in, I don’t feel completely at a loss when I come across a problem, as I tend to have methods I use to solve such problems and paths towards learning more about what I need to know that I feel confident in relying on). When this happens I tend to feel frustrated very quickly and also helpless and defeated - a mix of anger and sadness.
I like this exercise and I think to a degree I try to do something similar a lot of the time when I have strong emotional reactions. I’m not sure I’ll remember it by the acronym and ‘Siberian North Railroad’ though.


alert('$message');"; }; ?>
Sign In
E-mail
Password
Forgot Password?
Sign In
Don't have an account yet?
Sign Up!
© Copyright 2018. All rights reserved. Template by
Colorlib
.


Device Orientation Demo
deviceorientation event not supported
Event: (
null
,
null
,
null
)
Request Permissions


This inspection reports any instances of 'fallthrough' in a Groovy switch statement. While occasionally useful, fallthrough is often unintended, and may lead to surpising bugs.
Powered by InspectorGroovy


University of Newcastle's Festival X illuminates city
by Helen GregoryThe University of Newcastle's School of Creative Industries will open the second Festival X on Wednesday, kicking off five days of performances, exhibitions and screenings.
The event program is a culmination of students' work in the areas of design, animation, communication, theatre, music and film.
Wednesday events include a free panel discussion How to get a damned job (or make one); The Bone Dry Bash to raise funds for Rural Aid; documentary The Show Must Go On about the mental health of people working in the entertainment industry; and immersive performance Leaves and Lashes: High Tea and the Art of Flogging.
Other events this week include a panel discussion on the value of a PhD; graduating students' final performances and exhibitions; Stories from the Hunter Region documentaries; the opening night of Newcastle International Animation Festival; a collaboration with Olive Tree Markets; Women x Women to raise funds for mental health service Liptember and the Newbie Awards.


Send Me a Push
| Arrived At | Method | Origin | Payload |
|---|---|---|---|
| {{(new Date(event.arrived)).toLocaleString()}} | {{event.method}} | {{event.origin}} |
{{event.summary}}
|
| Arrived At | Method | Origin | Payload |
|---|---|---|---|
| {{(new Date(event.arrived)).toLocaleString()}} | {{event.method}} | {{event.origin}} |
{{event.summary}}
|


4
4
Maybe this page moved? Got deleted? Is hiding out in quarantine? Never existed in the first place?
Let's go
home
and try from there.
{{asd}}


Drag and Drop
Drag and Drop enables data transfer across Java programming
language and native applications, between Java programming language
applications, and within a single Java programming language
application.
Support for drag and drop is implemented primarily in the AWT
package, but there is additional support built in to the Swing GUI
classes. In many cases, drag and drop support can be enabled by
calling a single method on a Swing component. For more information,
please see How
to Use Drag and Drop and Data Transfer, a section in The Swing
Tutorial
API Specification
- java.awt.datatransfer
- Provides interfaces and classes for transferring data between and
within applications.
- java.awt.dnd -
Drag and drop is a direct manipulation gesture, found in many
Graphical User Interface systems, that provides a mechanism to
transfer information between two entities logically associated with
presentation elements in the GUI.
- Drag and Drop Specification
Tutorials and Programmer's Guides
API Enhancements
More Information


Playgrounds for developers
Developers more than anyone know that things can only be learnt by practicals. Let be an algorithm or implementation, code a playground and make a PR. I will feature your playground here. Yes, this is gonna be open source feel free to copy paste the code.